//----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);
});
});
}
}