SettingMobile.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. MWF.xDesktop.requireApp("Setting", "Document", null, false);
  2. MWF.xApplication.Setting.MobileConnectDocument = new Class({
  3. Extends: MWF.xApplication.Setting.Document,
  4. load: function(){
  5. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  6. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  7. this.titleName.set("text", this.lp.mobile_connectSetting);
  8. var o2CloudConnected = false;
  9. this.actions.collectConnected(function(json){
  10. o2CloudConnected = json.data.value;
  11. }.bind(this), function(json){
  12. o2CloudConnected = false;
  13. }.bind(this), false);
  14. this.mobileO2CloudConnectInput = new MWF.xApplication.Setting.Document.Button(this.explorer, this.node, {
  15. "lp": {"title": this.lp.mobile_connectO2Cloud, "infor": this.mobile_connectO2Cloud_infor, "action": this.lp.mobile_connectO2Cloud_action},
  16. //"data": {"key": "proxyData", "valueKey": "ssos", "notEmpty": false },
  17. "value": o2CloudConnected ? this.lp.mobile_connectO2Cloud_success : this.lp.mobile_connectO2Cloud_error,
  18. "itemTitle": o2CloudConnected ? this.lp.mobile_connectO2Cloud_success : this.lp.mobile_connectO2Cloud_error,
  19. "icon": o2CloudConnected ? "cloud.png" : "cloud_error.png",
  20. "action": function(e){
  21. layout.desktop.openApplication(e, "Collect");
  22. }.bind(this)
  23. });
  24. this.mobileHttpProtocolInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  25. "lp": {"title": this.lp.mobile_httpProtocol, "infor": this.lp.mobile_httpProtocol_infor},
  26. "data": {"key": "proxyData", "valueKey": "httpProtocol"},
  27. "value": this.explorer.proxyData.httpProtocol,
  28. "options": [{"value": "http", "text": "http"}, {"value": "https", "text": "https"}]
  29. });
  30. this.mobileCenterInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  31. "lp": {"title": this.lp.mobile_center, "infor": this.lp.mobile_center_infor, "editAction": this.lp.mobile_center_action},
  32. "data": {"key": "proxyData", "valueKey": "center", "notEmpty": false},
  33. "value": this.explorer.proxyData.center,
  34. "itemTitle": "{proxyHost}:{proxyPort}",
  35. "icon": "center.png"
  36. });
  37. this.mobileWebInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  38. "lp": {"title": this.lp.mobile_web, "infor": this.lp.mobile_web_infor, "editAction": this.lp.mobile_web_action},
  39. "data": {"key": "proxyData", "valueKey": "web", "notEmpty": false},
  40. "value": this.explorer.proxyData.web,
  41. "itemTitle": "{proxyHost}:{proxyPort}",
  42. "icon": "webserver.png"
  43. });
  44. this.mobileApplicationInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  45. "lp": {"title": this.lp.mobile_application, "infor": this.lp.mobile_application_infor, "editAction": this.lp.mobile_application_action},
  46. "data": {"key": "proxyData", "valueKey": "applicationList", "notEmpty": false},
  47. "value": this.explorer.proxyData.applicationList,
  48. "itemTitle": "{proxyHost}:{proxyPort}",
  49. "readonly": ["node"],
  50. "icon": "server.png"
  51. });
  52. }
  53. });
  54. MWF.xApplication.Setting.MobileModuleDocument = new Class({
  55. Extends: MWF.xApplication.Setting.Document,
  56. load: function(){
  57. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  58. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  59. this.titleName.set("text", this.lp.mobile_moduleSetting);
  60. var options = [{"value": "", "text": this.lp.mobile_index_defalue}];
  61. if (this.explorer.portalData.portalList && this.explorer.portalData.portalList.length){
  62. this.explorer.portalData.portalList.each(function(portal){
  63. options.push({
  64. "value": portal.id,
  65. "text": portal.name
  66. });
  67. }.bind(this));
  68. }
  69. this.mobileIndexInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  70. "lp": {"title": this.lp.mobile_index, "infor": this.lp.mobile_index_infor},
  71. "data": {"key": "nativeData", "valueKey": "indexPortal"},
  72. "value": this.explorer.nativeData.indexPortal,
  73. "options": options
  74. });
  75. //移动端简易模式
  76. var simpleModeTitle = this.lp.mobile_module_simple_mode;
  77. var simpleModeInfor = this.lp.mobile_module_simple_mode_infor;
  78. new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  79. "lp": {"title": simpleModeTitle, "infor": simpleModeInfor},
  80. "data": {"key": "nativeData", "valueKey": "simpleMode", "notEmpty": false },
  81. "value": this.explorer.nativeData.simpleMode
  82. });
  83. this.explorer.nativeData.nativeAppList.each(function(app, i){
  84. var title = this.lp.mobile_module.replace("{name}", app.name);
  85. var infor = this.lp.mobile_module_infor.replace("{name}", app.name);
  86. new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  87. "lp": {"title": title, "infor": infor},
  88. "data": {"key": "nativeData", "valueKey": "nativeAppList."+i+".enable", "notEmpty": false },
  89. "value": app.enable
  90. });
  91. }.bind(this));
  92. }
  93. });
  94. MWF.xApplication.Setting.MobileStyleDocument = new Class({
  95. Extends: MWF.xApplication.Setting.Document,
  96. load: function(){
  97. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  98. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  99. this.titleName.set("text", this.lp.mobile_styleSetting);
  100. this.explorer.imagesData.images.each(function(img, i){
  101. var imgName = this.lp.mobile_style_imgs[img.name];
  102. var title = this.lp.mobile_style.replace("{name}", imgName);
  103. var infor = this.lp.mobile_style_infor.replace("{name}", imgName);
  104. new MWF.xApplication.Setting.Document.Image(this.explorer, this.node, {
  105. "lp": {"title": title, "infor": ""},
  106. "data": {"key": "imagesData", "valueKey": "applicationList", "notEmpty": false},
  107. "value": img,
  108. "itemTitle": infor,
  109. "iconData": img.value
  110. });
  111. }.bind(this));
  112. }
  113. });