x.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * Created by TOMMY on 2015/11/14.
  3. */
  4. layout = (window["layout"]) ? window["layout"] : {};
  5. var locate = window.location;
  6. layout.protocol = locate.protocol;
  7. layout.session = layout.session || {};
  8. layout["debugger"] = o2.session.isDebugger;
  9. o2.addReady(function(){
  10. o2.loadLP(o2.language);
  11. $("browser_loading_area_text").set("text", o2.LP.desktop.loadding);
  12. $("browser_error_area_text").set("text", o2.LP.desktop.lowBrowser);
  13. $("browser_error_area_up_text").set("text", o2.LP.desktop.upgradeBrowser);
  14. var loadingNode = $("browser_loadding");
  15. var errorNode = $("browser_error");
  16. if (Browser.name==="ie" && Browser.version<9){
  17. if (loadingNode) loadingNode.setStyle("display", "none");
  18. if (errorNode) errorNode.setStyle("display", "block");
  19. return false;
  20. }else{
  21. if (Browser.name==="ie" && Browser.version<10){
  22. layout["debugger"] = true;
  23. o2.session.isDebugger = true;
  24. }
  25. }
  26. if (errorNode) errorNode.destroy();
  27. errorNode = null;
  28. //COMMON.setContentPath("/x_desktop");
  29. //COMMON.AjaxModule.load("ie_adapter", function(){
  30. o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], {"sequence": true}, function(){
  31. //o2.load("../o2_lib/mootools/plugin/mBox.Tooltip.js", function(){
  32. //o2.load("mwf", function(){
  33. o2.JSON.get("res/config/config.json", function(config){
  34. layout.config = config;
  35. if (layout.config.app_protocol==="auto"){
  36. layout.config.app_protocol = window.location.protocol;
  37. }
  38. layout.config.systemName = layout.config.systemName || layout.config.footer;
  39. layout.config.systemTitle = layout.config.systemTitle || layout.config.title;
  40. document.title = layout.config.title || layout.config.systemTitle || layout.config.footer || layout.config.systemName;
  41. MWF.require("MWF.xDesktop.Layout", function(){
  42. layout.desktop = new MWF.xDesktop.Layout("layout", {
  43. //"style": "newyear",
  44. "onLoad": function(){
  45. if (loadingNode){
  46. new Fx.Tween(loadingNode).start("opacity", 0).chain(function(){
  47. loadingNode.destroy();
  48. loadingNode = null;
  49. });
  50. }
  51. },
  52. "onLogin": function(){
  53. if (loadingNode){
  54. new Fx.Tween(loadingNode).start("opacity", 0).chain(function(){
  55. loadingNode.destroy();
  56. });
  57. }
  58. }
  59. });
  60. });
  61. }, false);
  62. //});
  63. //});
  64. });
  65. //});
  66. });