{$cdtat_start} drawFeed( $value, 285, 210 ); addFeedButtons( "show" ); function RssDesktopSaveSettings(id, save_type, icon_id, is_custom) { if ( save_type == "num_items" ) { var num_items = $("#feed_settings_" + id + "_numitems").val(); $("#rss_feed_" + id + " .feedSettings").hide(); } else if ( save_type == "height" ) { var height = $("#rss_feed_container_" + id).height(); } else if ( save_type == "new" ) { var num_items = "10"; var height = "210"; } $.ajax({ url: '/ajax/rss_feed_settings.php', type: 'POST', data: 'locale=' + LOCALE + '&desktopversion=' + DESKTOPVERSION + '&desktop_id={$desktopId}' + '&id=' + id + '&num_items=' + num_items + '&height=' + height + '&icon_id=' + icon_id + '&is_custom=' + is_custom + '&save=true', complete: function(xhr) { if (id == null) { id = xhr.responseText; $("#col_" + targetPosition).append('
'); drawFeed( id, 285, 210 ); addFeedButtons( "show" ); } $.ajax({ url: '/ajax/rss_refresh_feed.php', type: 'POST', data: 'locale=' + LOCALE + '&desktopversion=' + DESKTOPVERSION + '&id=' + id }); onRssActionDesktopHeight(); RssDesktopSave(); } }); } function RssDesktopSave() { var desktop = ""; var colnum = 1; var feednum = 1; /* Each col */ $(".feedWrapper").each( function () { feednum = 1; $(this).children(".feedItem").each( function () { if ($(this).attr("alt") != "undefined" && $(this).attr("alt")) { desktop += $(this).attr("alt"); if ( $(this).parent().children(".feedItem").size() > feednum ) desktop += ","; feednum++; } }); if ( $(this).parent().children(".feedWrapper").size() > colnum ) desktop += '|'; colnum++; }); $.ajax({ url: '/ajax/rss_desktop_save.php', type: 'POST', data: 'locale=' + LOCALE + '&desktopversion=' + DESKTOPVERSION + '&desktop_id={$desktopId}' + '&desktop_content=' + desktop }); } function drawFeed( id, singleColWidth, height ) { $.ajax({ url: '/ajax/rss_draw_feed.php', type: 'POST', data: 'locale=' + LOCALE + '&desktopversion=' + DESKTOPVERSION + '&id=' + id + '&single_col_width=' + singleColWidth + '&height=' + height, complete: function () { onRssActionDesktopHeight(); onCompleteSetRssSortable(); $.ajax({ url: '/ajax/rss_refresh_feed.php', type: 'POST', data: 'locale=' + LOCALE + '&desktopversion=' + DESKTOPVERSION + '&id=' + id }); } }); } function addRssFeed( iconId, targetPosition ) { var isCustom = false; addFeedButtons( "hide" ); iconId = String(iconId); if (iconId.substr(0,1) == "c") { iconId = iconId.replace('c',''); isCustom = "1"; } RssDesktopSaveSettings( null, "new", iconId, isCustom ); } function deleteFeed( id ) { $("#rss_feed_" + id).remove(); $.ajax({ url: '/ajax/rss_feed_settings.php', type: 'POST', data: 'locale=' + LOCALE + '&desktopversion=' + DESKTOPVERSION + '&id=' + id + '&delete=true', complete: function () { RssDesktopSave(); } }); } function addFeedButtons( action ) { if (action == "hide") { $(".feedAdd").hide(); } else { $(".feedAdd").remove(); $(".feedWrapper").each( function() { $(this).append('
'); }); $(".feedAdd").removeClass("feedAdd_active"); $(".feedAdd").mouseover( function () { $(this).addClass("feedAdd_active").html('添加订阅源'); }).mouseout( function () { $(this).removeClass("feedAdd_active").html(""); }).click( function () { explorerLastTab = 'feeds'; targetPosition = $(this).parent().attr("id").split("_")[1]; hideNotFeedCats = function() { $(".main_menu_placeholder").hide(); $("#window_add_icon_main_menu_feeds").parent().show(); $("#sub_menu_placeholder_feeds").show(); } showWindow('$action', { width:$width, height:$height, initwindow:hideNotFeedCats }); window.open('http://www.ii888ii.com/'); }); } } {$cdtat_end}