update.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /**
  2. * [ONEMAP.M.update]
  3. * @return {[object]}
  4. */
  5. define([
  6. 'html!templates/update',
  7. 'css!styles/update'
  8. ], function (tplLayout) {
  9. var modLocaSpace = {};
  10. var statu = {};
  11. function init(options) {
  12. return;
  13. setLayout();
  14. subscribe();
  15. bindEvents();
  16. // if(options.act == 'showPop'){
  17. // statu.act = true;
  18. // $("#diBanBen").show();
  19. // }
  20. };
  21. function setLayout() {
  22. $(tplLayout).appendTo($("#header"));
  23. // $(tplLayout).appendTo($("body"));
  24. layoutResize();
  25. $(window).resize(function () {
  26. layoutResize();
  27. });
  28. //拖拽
  29. // $("#diBanBen .popup-ct").dragmove($('#diBanBen'));
  30. }
  31. function layoutResize() {}
  32. function bindEvents() {
  33. $("#tiShiGengXin .closeTS").bind("click", function () {
  34. $("#tiShiGengXin").hide();
  35. })
  36. $("#tiShiGengXin a").bind("click", function () {
  37. $("#diBanBen").show();
  38. })
  39. //加载WEB三维控件
  40. function DetectActiveX() {
  41. try {
  42. var comActiveX = new ActiveXObject("LocaSpacePlugin.LocaSpacePluginCtrl.1");
  43. } catch (e) {
  44. return false;
  45. }
  46. return true;
  47. }
  48. modLocaSpace.DetectActiveX = DetectActiveX;
  49. $(function () {
  50. var userAgent = navigator.userAgent;
  51. var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf('rv:11.0') > -1;
  52. var isIE10;
  53. //判断系统为XP
  54. if (navigator.userAgent.indexOf("Windows NT 5.1") > -1) {
  55. if (navigator.userAgent.indexOf("MSIE") > -1) {
  56. // downloadChromeUpdata();
  57. modLocaSpace.xp = true;
  58. $("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
  59. $("#diBanBen li.xp").addClass("active");
  60. $("#diBanBen .tab-right li.xp p").html("为获得更好的使用体验 <br>请使用谷歌(chrome)浏览器");
  61. $("#diBanBen .tab-right li.xp a,#diBanBen .tab-right li.xp div").show();
  62. $("#diBanBen .tab-right li.win7 p").html("您的系统版本过低 <br>请先升级到win7");
  63. $("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").hide();
  64. $("#diBanBen .tab-right li.sanw p").html("畅游三维世界 <br>请先升级到win7");
  65. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
  66. } else {
  67. $("#tiShiGengXin,#diBanBen").hide();
  68. }
  69. } else {
  70. modLocaSpace.xp = false;
  71. $("#diBanBen .tab-right li.xp p").html("您的系统已升级至更高版本");
  72. $("#diBanBen .tab-right li.xp a,#diBanBen .tab-right li.xp div").hide();
  73. $("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
  74. $("#diBanBen li.win7").addClass("active");
  75. //判断IE浏览器版本是否为9以上
  76. if (navigator.userAgent.indexOf("MSIE") > -1) {
  77. if (navigator.userAgent.indexOf("MSIE 8.0") > -1) { //ie8
  78. // alert(navigator.userAgent)
  79. // downloadIEUpdata();
  80. modLocaSpace.ie8 = true;
  81. $("#diBanBen .tab-right li.win7 p").html("您的浏览器版本过低 <br>更新到 IE 11 获得更多系统功能");
  82. $("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").show();
  83. $("#diBanBen .tab-right li.sanw p").html("请先更新到 IE 11 获得更多系统功能");
  84. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
  85. } else if (navigator.userAgent.indexOf("MSIE 9.0") > -1) { //ie9
  86. $("#diBanBen .popup-ct").dragmove($('#diBanBen'));
  87. // alert("9"+navigator.userAgent)
  88. modLocaSpace.ie8 = false;
  89. $("#diBanBen .tab-right li.win7 p").html("更新到 IE 11 可获得更多系统功能");
  90. $("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").show();
  91. if (modLocaSpace.DetectActiveX() == false) {
  92. // $("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
  93. // $("#diBanBen li.sanw").addClass("active");
  94. $("#diBanBen .tab-right li.sanw p").html("畅游三维世界 <br>下载三维插件获得更强体验 <br>安装后请关闭所有浏览器并重新打开");
  95. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").show();
  96. } else {
  97. $("#diBanBen .tab-right li.sanw p").html("您已安装三维插件");
  98. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
  99. }
  100. } else { //10 11
  101. // alert("ie10 ie11"+navigator.userAgent)
  102. $("#diBanBen .popup-ct").dragmove($('#diBanBen'));
  103. isIE10 = true;
  104. $("#diBanBen .tab-right li.win7 p").html("您已升级到高版本浏览器");
  105. $("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").hide();
  106. if (modLocaSpace.DetectActiveX() == false) {
  107. $("#diBanBen .tab-left li,#diBanBen .tab-right li").removeClass("active");
  108. $("#diBanBen li.sanw").addClass("active");
  109. $("#diBanBen .tab-right li.sanw p").html("畅游三维世界 <br>下载三维插件获得更强体验 <br>安装后请关闭所有浏览器并重新打开");
  110. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").show();
  111. } else {
  112. $("#diBanBen .tab-right li.sanw p").html("您已安装三维插件");
  113. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
  114. }
  115. }
  116. } else if (isIE11) {
  117. // alert("new ie11")
  118. $("#diBanBen .popup-ct").dragmove($('#diBanBen'));
  119. $("#diBanBen .tab-right li.win7 p").html("您已升级到高版本浏览器");
  120. $("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").hide();
  121. if (modLocaSpace.DetectActiveX() == false) {
  122. $("#diBanBen .tab-right li.sanw p").html("畅游三维世界 <br>下载三维插件获得更强体验 <br>安装后请关闭所有浏览器并重新打开");
  123. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").show();
  124. } else {
  125. $("#diBanBen .tab-right li.sanw p").html("您已安装三维插件");
  126. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
  127. }
  128. } else { //其他浏览器
  129. $("#diBanBen .popup-ct").dragmove($('#diBanBen'));
  130. $("#diBanBen .tab-right li.win7 p").html("为获得更好的使用体验 <br>使用 IE 11 获得更多系统功能");
  131. $("#diBanBen .tab-right li.win7 a,#diBanBen .tab-right li.win7 div").show();
  132. $("#diBanBen .tab-right li.sanw p").html("请先更新到 IE 11 获得更多系统功能");
  133. $("#diBanBen .tab-right li.sanw a,#diBanBen .tab-right li.sanw div").hide();
  134. }
  135. if (isIE11 || isIE10) {
  136. $("#tiShiGengXin").hide();
  137. } else {
  138. $("#tiShiGengXin").show();
  139. }
  140. }
  141. })
  142. $("#diBanBen .tab-left li").bind("click", function () {
  143. $("#diBanBen .tab-left li").removeClass("active");
  144. $("#diBanBen .tab-right li").removeClass("active");
  145. if ($(this).hasClass("xp")) {
  146. $("#diBanBen li.xp").addClass("active");
  147. } else if ($(this).hasClass("win7")) {
  148. $("#diBanBen li.win7").addClass("active");
  149. } else if ($(this).hasClass("sanw")) {
  150. $("#diBanBen li.sanw").addClass("active");
  151. }
  152. })
  153. $("#diBanBen .close").bind("click", function () {
  154. $("#diBanBen").hide();
  155. })
  156. }
  157. /**
  158. * 注册订阅
  159. * @type {Function}
  160. * 推送:ONEMAP.C.publisher.publish(options,'moduleName::type');
  161. * 订阅:ONEMAP.C.publisher.subscribe(layoutResize,'sideBarLayoutChange');
  162. */
  163. function subscribe() {
  164. // ONEMAP.C.publisher.subscribe(change23D,'change23D');
  165. }
  166. return ONEMAP.M.update = {
  167. init: init
  168. };
  169. })