//----JavaScript Document(是定義編輯、預覽、正常瀏覽模式下共同使用輸出)---- //----JavaScript Document(是定義可視化編輯器模式下輸出)---- ///處理詳細模塊的高度 $.PluginInfoViewHeight = function (o) { $(window).load(function () { o.c = $("#" + o.curr); o.t = $("#" + o.currtop); o.c.height = o.c.length ? o.c.outerHeight(true) : 0; o.t.h = o.t.length ? o.t.height() : 0; o.t.height(o.t.h < o.c.height ? o.c.height : o.t.h); o.cr = o.containerid.split(","); o.ar = o.areakey.split(","); o.d = o.c.height - o.t.h; o.cr.forEach(function (cri) { o.crt = $("#" + cri); if (o.crt.length > 0) { o.crt.height(o.d > 0 ? o.d + o.crt.height() : o.crt.height()); } if (cri.indexOf("_proot")<0) { o.crt.ms = o.crt.find("div[data-type]"); o.crt.ms.each(function () { if ($(this).offset().top - o.crt.offset().top > o.c.offset().top) { $(this).css("top", $(this).offset().top - o.crt.offset().top + o.d); } }); } }); o.ar.forEach(function (ari) { o.crt = $("#" + ari); if (o.crt.length > 0) { o.crt.height(o.d > 0 ? o.d + o.crt.height() : o.crt.height()); } }); }); } // 設置為主頁 $.SetHome=function(obj, vrl) { try { obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(vrl); } catch (e) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("此操作被瀏覽器拒絕!\n請在瀏覽器地址欄輸入“about:config”並回車\n然後將 [signed.applets.codebase_principal_support]的值設置為'true',雙擊即可。"); } var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch); prefs.setCharPref('browser.startup.homepage', vrl); } else { alert("您的瀏覽器不支持,請按照下麵步驟操作:1.打開瀏覽器設置。2.點擊設置網頁。3.輸入:" + vrl + "點擊確定。"); } } } // 加入收藏 兼容360和IE6 $.shoucang =function (sTitle, sURL) { try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, ""); } catch (e) { alert("加入收藏失敗,請使用Ctrl+D進行添加"); } } }///***異步加載點擊率 $.AjaxModelClick = function (modelId) { window.onload = function () { $._modelthis = $("div[data-id='" + modelId + "']"); $.ajaxArray = $._modelthis.find("*[ajaxviewid]"); $.ajaxArray.each(function (item) { $.post("/online_editsite/webjsonhtml_ashx/web_retuenCilckCount.ashx", { modelId: modelId, infoId: $($.ajaxArray[item]).attr("ajaxviewid") }, function (result) { $($.ajaxArray[item]).html(result); }); }); } }