/**
* [ONEMAP.M.update]
* @return {[object]}
*/
define([
'html!templates/update',
'css!styles/update'
], function (tplLayout) {
var modLocaSpace = {};
var statu = {};
function init(options) {
return;
setLayout();
subscribe();
bindEvents();
// if(options.act == 'showPop'){
// statu.act = true;
// $("#diBanBen").show();
// }
};
function setLayout() {
$(tplLayout).appendTo($("#header"));
// $(tplLayout).appendTo($("body"));
layoutResize();
$(window).resize(function () {
layoutResize();
});
//拖拽
// $("#diBanBen .popup-ct").dragmove($('#diBanBen'));
}
function layoutResize() {}
function bindEvents() {
$("#tiShiGengXin .closeTS").bind("click", function () {
$("#tiShiGengXin").hide();
})
$("#tiShiGengXin a").bind("click", function () {
$("#diBanBen").show();
})
//加载WEB三维控件
function DetectActiveX() {
try {
var comActiveX = new ActiveXObject("LocaSpacePlugin.LocaSpacePluginCtrl.1");
} catch (e) {
return false;
}
return true;
}
modLocaSpace.DetectActiveX = DetectActiveX;
$(function () {
var userAgent = navigator.userAgent;
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
var isIE10;
//判断系统为XP
if (navigator.userAgent.indexOf("Windows NT 5.1") > -1) {
if (navigator.userAgent.indexOf("MSIE") > -1) {
// downloadChromeUpdata();
modLocaSpace.xp = true;
$("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
$("#diBanBen li.xp").addClass("active");
$("#diBanBen .tab-right li.xp p").html("为获得更好的使用体验
请使用谷歌(chrome)浏览器");
$("#diBanBen .tab-right li.xp a,#diBanBen .tab-right li.xp div").show();
$("#diBanBen .tab-right li.win7 p").html("您的系统版本过低
请先升级到win7");
$("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").hide();
$("#diBanBen .tab-right li.sanw p").html("畅游三维世界
请先升级到win7");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
} else {
$("#tiShiGengXin,#diBanBen").hide();
}
} else {
modLocaSpace.xp = false;
$("#diBanBen .tab-right li.xp p").html("您的系统已升级至更高版本");
$("#diBanBen .tab-right li.xp a,#diBanBen .tab-right li.xp div").hide();
$("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
$("#diBanBen li.win7").addClass("active");
//判断IE浏览器版本是否为9以上
if (navigator.userAgent.indexOf("MSIE") > -1) {
if (navigator.userAgent.indexOf("MSIE 8.0") > -1) { //ie8
// alert(navigator.userAgent)
// downloadIEUpdata();
modLocaSpace.ie8 = true;
$("#diBanBen .tab-right li.win7 p").html("您的浏览器版本过低
更新到 IE 11 获得更多系统功能");
$("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").show();
$("#diBanBen .tab-right li.sanw p").html("请先更新到 IE 11 获得更多系统功能");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
} else if (navigator.userAgent.indexOf("MSIE 9.0") > -1) { //ie9
$("#diBanBen .popup-ct").dragmove($('#diBanBen'));
// alert("9"+navigator.userAgent)
modLocaSpace.ie8 = false;
$("#diBanBen .tab-right li.win7 p").html("更新到 IE 11 可获得更多系统功能");
$("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").show();
if (modLocaSpace.DetectActiveX() == false) {
// $("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
// $("#diBanBen li.sanw").addClass("active");
$("#diBanBen .tab-right li.sanw p").html("畅游三维世界
下载三维插件获得更强体验
安装后请关闭所有浏览器并重新打开");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").show();
} else {
$("#diBanBen .tab-right li.sanw p").html("您已安装三维插件");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
}
} else { //10 11
// alert("ie10 ie11"+navigator.userAgent)
$("#diBanBen .popup-ct").dragmove($('#diBanBen'));
isIE10 = true;
$("#diBanBen .tab-right li.win7 p").html("您已升级到高版本浏览器");
$("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").hide();
if (modLocaSpace.DetectActiveX() == false) {
$("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
$("#diBanBen li.sanw").addClass("active");
$("#diBanBen .tab-right li.sanw p").html("畅游三维世界
下载三维插件获得更强体验
安装后请关闭所有浏览器并重新打开");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").show();
} else {
$("#diBanBen .tab-right li.sanw p").html("您已安装三维插件");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
}
}
} else if (isIE11) {
// alert("new ie11")
$("#diBanBen .popup-ct").dragmove($('#diBanBen'));
$("#diBanBen .tab-right li.win7 p").html("您已升级到高版本浏览器");
$("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").hide();
if (modLocaSpace.DetectActiveX() == false) {
$("#diBanBen .tab-right li.sanw p").html("畅游三维世界
下载三维插件获得更强体验
安装后请关闭所有浏览器并重新打开");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").show();
} else {
$("#diBanBen .tab-right li.sanw p").html("您已安装三维插件");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
}
} else { //其他浏览器
$("#diBanBen .popup-ct").dragmove($('#diBanBen'));
$("#diBanBen .tab-right li.win7 p").html("为获得更好的使用体验
使用 IE 11 获得更多系统功能");
$("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").show();
$("#diBanBen .tab-right li.sanw p").html("请先更新到 IE 11 获得更多系统功能");
$("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
}
if (isIE11 || isIE10) {
$("#tiShiGengXin").hide();
} else {
$("#tiShiGengXin").show();
}
}
})
$("#diBanBen .tab-left li").bind("click", function () {
$("#diBanBen .tab-left li").removeClass("active");
$("#diBanBen .tab-right li").removeClass("active");
if ($(this).hasClass("xp")) {
$("#diBanBen li.xp").addClass("active");
} else if ($(this).hasClass("win7")) {
$("#diBanBen li.win7").addClass("active");
} else if ($(this).hasClass("sanw")) {
$("#diBanBen li.sanw").addClass("active");
}
})
$("#diBanBen .close").bind("click", function () {
$("#diBanBen").hide();
})
}
/**
* 注册订阅
* @type {Function}
* 推送:ONEMAP.C.publisher.publish(options,'moduleName::type');
* 订阅:ONEMAP.C.publisher.subscribe(layoutResize,'sideBarLayoutChange');
*/
function subscribe() {
// ONEMAP.C.publisher.subscribe(change23D,'change23D');
}
return ONEMAP.M.update = {
init: init
};
})