[原]需要的是提供给别人服务调用,而非每次都要写函数实现

function Frame(){

var _me=this,_jqInfoToggle, _jqInfoImg, _jqDate,

_tabs, _skyline, _isInfoShow, _imgWay, 

_selectOptionHelper=[], _children = [];

/*//初始隐藏弹出缩进按钮 

_hideInfo = function(){

if(_isInfoShow){

_jqInfoToggle.hide();

}

},*/

/**

* 功能描述:

* 参数描述:无

* 返回值:无

*/

_onImgClick = function(){

switch(_imgWay){

case -1:

// 向上

_jqInfoImg.attr("src","images/toolbar/open.png"); 

_jqInfoImg.attr("alt","打开"); 

   innerinnerLayout.close('south');

break;

case 1:

// 向下

_jqInfoImg.attr("src","images/toolbar/close.png"); 

_jqInfoImg.attr("alt","关闭"); 

   innerinnerLayout.open('south');

break;

}

_imgWay = 0 - _imgWay;

}

/**

* 功能描述:获取当前日期

* 参数描述:无

* 返回值:无

*/

,_getCurrentDate = function(){

var myDate=new Date();

var sDate=myDate.toLocaleDateString();

return sDate;

}

/**

* 功能描述:设置页面右上角日期

* 参数描述:无

* 返回值:无

*/

,_setDate = function(){

var sCurrentDate=_getCurrentDate();

_jqDate.eq(0).html(sCurrentDate);

};

/*

// 获取

this.getSkyline = function(){

return _skyline;

}*/

/**

* 功能描述:加载信息并弹出信息框

* 参数描述:

* url:需要加载的信息地址

* 返回值:无

*/

this.setUrlOpen = function(url){

_isInfoShow = true;

_imgWay = -1;

_jqInfoToggle.show();

_jqInfoImg.attr("src","images/toolbar/close.png"); 

_jqInfoImg.attr("alt","关闭"); 

innerinnerLayout.open('south');

parent.document.popupFrame.location.href = url;

};

/**

* 功能描述:加载信息但关闭信息框

* 参数描述:

* url:需要加载的信息地址

* 返回值:无

*/

this.setUrlClose = function(url){

_isInfoShow = true;

_imgWay = 1;

_jqInfoToggle.show();

_jqInfoImg.attr("src","images/toolbar/open.png"); 

_jqInfoImg.attr("alt","打开"); 

innerinnerLayout.close('south');

parent.document.popupFrame.location.href = url;

};

/**

* 功能描述:依据信息是否弹出隐藏

* 参数描述:

* 返回值:无

*/

this.hideInfo = function(){

if(_isInfoShow){

_jqInfoToggle.hide();

innerinnerLayout.close('south');

}

};

/**

* 功能描述:返回级联对象

* 参数描述:

* moduleType:业务类型值(雷电,覆冰,生产管理,交叉跨越)

* 返回值:级联对象

*/

this.getSelectOption = function(moduleType){

return _selectOptionHelper[moduleType];

};

/**

* 功能描述:返回服务端地址

* 参数描述:

* 返回值:无

*/

this.getServerPath = function(){

return window.location.href.substring(0, window.location.href.indexOf("/Redbud/") + 8);

};

/**

* 功能描述:返回Skyline对象

* 参数描述:

* 返回值:Skyline对象

*/

this.getSkyline = function(){

return _skyline;

};

(function(){

_jqDate = $("#logout p");

_jqInfoToggle = $("#toggleFB");

_jqInfoImg = $("#toggleFB a img");

_jqInfoImg.click(_onImgClick);

jQuery.extend(jQuery.validator.messages, cnmsg);

jQuery("#ajaxloader").hide();

//初始化生产管理级联菜单对象

_selectOptionHelper[SelectOptionHelper.ModuleType.ProductControl] = new SelectOptionHelper(SelectOptionHelper.ModuleType.ProductControl);

//初始化雷电,覆冰,交叉跨越级联菜单对象

_selectOptionHelper[SelectOptionHelper.ModuleType.CovericeThunderCrossing] = new SelectOptionHelper(SelectOptionHelper.ModuleType.CovericeThunderCrossing);

_me._hideInfo;

_skyline = new Skyline("myWorld");

_skyline.load("http://www.skylineglobe.com/SkylineGlobe/WebClient/PresentationLayer/WebClient/SkyglobeLB.fly");

 };

var page;

$(document).ready(function(){

page = new Frame();

})

作者:mhfcr 发表于2014/1/22 15:07:05 原文链接
阅读:52 评论:0 查看评论
原文地址:https://www.cnblogs.com/crmhf/p/3823250.html