app.config.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. 'use strict';
  2. var appConfig = window.appConfig || {};
  3. appConfig.menu_speed = 200;
  4. appConfig.smartSkin = "smart-style-0";
  5. appConfig.skins = [
  6. {name: "smart-style-0",
  7. logo: "styles/img/logo.png",
  8. class: "btn btn-block btn-xs txt-color-white margin-right-5",
  9. style: "background-color:#4E463F;",
  10. label: "Smart Default"},
  11. {name: "smart-style-1",
  12. logo: "styles/img/logo-white.png",
  13. class: "btn btn-block btn-xs txt-color-white",
  14. style: "background:#3A4558;",
  15. label: "Dark Elegance"},
  16. {name: "smart-style-2",
  17. logo: "styles/img/logo-blue.png",
  18. class: "btn btn-xs btn-block txt-color-darken margin-top-5",
  19. style: "background:#fff;",
  20. label: "Ultra Light"},
  21. {name: "smart-style-3",
  22. logo: "styles/img/logo-pale.png",
  23. class: "btn btn-xs btn-block txt-color-white margin-top-5",
  24. style: "background:#f78c40",
  25. label: "Google Skin"},
  26. {name: "smart-style-4",
  27. logo: "styles/img/logo-pale.png",
  28. class: "btn btn-xs btn-block txt-color-white margin-top-5",
  29. style: "background: #bbc0cf; border: 1px solid #59779E; color: #17273D !important;",
  30. label: "PixelSmash"},
  31. {name: "smart-style-5",
  32. logo: "styles/img/logo-pale.png",
  33. class: "btn btn-xs btn-block txt-color-white margin-top-5",
  34. style: "background: rgba(153, 179, 204, 0.2); border: 1px solid rgba(121, 161, 221, 0.8); color: #17273D !important;",
  35. label: "Glass"},
  36. {name: "smart-style-6",
  37. logo: "styles/img/logo-pale.png",
  38. class: "btn btn-xs btn-block txt-color-white margin-top-5",
  39. style: "background: #2196F3; border: 1px solid rgba(121, 161, 221, 0.8); color: #FFF !important;",
  40. beta: true,
  41. label: "MaterialDesign"
  42. }
  43. ];
  44. appConfig.sound_path = "sound/";
  45. appConfig.sound_on = true;
  46. /*
  47. * DEBUGGING MODE
  48. * debugState = true; will spit all debuging message inside browser console.
  49. * The colors are best displayed in chrome browser.
  50. */
  51. appConfig.debugState = false;
  52. appConfig.debugStyle = 'font-weight: bold; color: #00f;';
  53. appConfig.debugStyle_green = 'font-weight: bold; font-style:italic; color: #46C246;';
  54. appConfig.debugStyle_red = 'font-weight: bold; color: #ed1c24;';
  55. appConfig.debugStyle_warning = 'background-color:yellow';
  56. appConfig.debugStyle_success = 'background-color:green; font-weight:bold; color:#fff;';
  57. appConfig.debugStyle_error = 'background-color:#ed1c24; font-weight:bold; color:#fff;';
  58. appConfig.voice_command = true;
  59. appConfig.voice_command_auto = false;
  60. /*
  61. * Sets the language to the default 'en-US'. (supports over 50 languages
  62. * by google)
  63. *
  64. * Afrikaans ['af-ZA']
  65. * Bahasa Indonesia ['id-ID']
  66. * Bahasa Melayu ['ms-MY']
  67. * CatalГ ['ca-ES']
  68. * ДЊeЕЎtina ['cs-CZ']
  69. * Deutsch ['de-DE']
  70. * English ['en-AU', 'Australia']
  71. * ['en-CA', 'Canada']
  72. * ['en-IN', 'India']
  73. * ['en-NZ', 'New Zealand']
  74. * ['en-ZA', 'South Africa']
  75. * ['en-GB', 'United Kingdom']
  76. * ['en-US', 'United States']
  77. * EspaГ±ol ['es-AR', 'Argentina']
  78. * ['es-BO', 'Bolivia']
  79. * ['es-CL', 'Chile']
  80. * ['es-CO', 'Colombia']
  81. * ['es-CR', 'Costa Rica']
  82. * ['es-EC', 'Ecuador']
  83. * ['es-SV', 'El Salvador']
  84. * ['es-ES', 'EspaГ±a']
  85. * ['es-US', 'Estados Unidos']
  86. * ['es-GT', 'Guatemala']
  87. * ['es-HN', 'Honduras']
  88. * ['es-MX', 'MГ©xico']
  89. * ['es-NI', 'Nicaragua']
  90. * ['es-PA', 'PanamГЎ']
  91. * ['es-PY', 'Paraguay']
  92. * ['es-PE', 'PerГє']
  93. * ['es-PR', 'Puerto Rico']
  94. * ['es-DO', 'RepГєblica Dominicana']
  95. * ['es-UY', 'Uruguay']
  96. * ['es-VE', 'Venezuela']
  97. * Euskara ['eu-ES']
  98. * FranГ§ais ['fr-FR']
  99. * Galego ['gl-ES']
  100. * Hrvatski ['hr_HR']
  101. * IsiZulu ['zu-ZA']
  102. * ГЌslenska ['is-IS']
  103. * Italiano ['it-IT', 'Italia']
  104. * ['it-CH', 'Svizzera']
  105. * Magyar ['hu-HU']
  106. * Nederlands ['nl-NL']
  107. * Norsk bokmГҐl ['nb-NO']
  108. * Polski ['pl-PL']
  109. * PortuguГЄs ['pt-BR', 'Brasil']
  110. * ['pt-PT', 'Portugal']
  111. * RomГўnДѓ ['ro-RO']
  112. * SlovenДЌina ['sk-SK']
  113. * Suomi ['fi-FI']
  114. * Svenska ['sv-SE']
  115. * TГјrkГ§e ['tr-TR']
  116. * български['bg-BG']
  117. * PСѓСЃСЃРєРёР№ ['ru-RU']
  118. * РЎСЂРїСЃРєРё ['sr-RS']
  119. * н•њкµ­м–ґ ['ko-KR']
  120. * 中文 ['cmn-Hans-CN', '普通话 (中国大陆)']
  121. * ['cmn-Hans-HK', '普通话 (香港)']
  122. * ['cmn-Hant-TW', 'дё­ж–‡ (еЏ°зЃЈ)']
  123. * ['yue-Hant-HK', '粵語 (香港)']
  124. * ж—Ґжњ¬иЄћ ['ja-JP']
  125. * Lingua latД«na ['la']
  126. */
  127. appConfig.voice_command_lang = 'en-US';
  128. /*
  129. * Use localstorage to remember on/off (best used with HTML Version)
  130. */
  131. appConfig.voice_localStorage = false;
  132. /*
  133. * Voice Commands
  134. * Defines all voice command variables and functions
  135. */
  136. if (appConfig.voice_command) {
  137. appConfig.commands = {
  138. 'show dashboard' : function() { window.location.hash = "dashboard" },
  139. 'show inbox' : function() { window.location.hash = "inbox/" },
  140. 'show graphs' : function() { window.location.hash = "graphs/flot" },
  141. 'show flotchart' : function() { window.location.hash = "graphs/flot" },
  142. 'show morris chart' : function() { window.location.hash = "graphs/morris" },
  143. 'show inline chart' : function() { window.location.hash = "graphs/inline-charts" },
  144. 'show dygraphs' : function() { window.location.hash = "graphs/dygraphs" },
  145. 'show tables' : function() { window.location.hash = "tables/table" },
  146. 'show data table' : function() { window.location.hash = "tables/datatable" },
  147. 'show jquery grid' : function() { window.location.hash = "tables/jqgrid" },
  148. 'show form' : function() { window.location.hash = "forms/form-elements" },
  149. 'show form layouts' : function() { window.location.hash = "forms/form-templates" },
  150. 'show form validation' : function() { window.location.hash = "forms/validation" },
  151. 'show form elements' : function() { window.location.hash = "forms/bootstrap-forms" },
  152. 'show form plugins' : function() { window.location.hash = "forms/plugins" },
  153. 'show form wizards' : function() { window.location.hash = "forms/wizards" },
  154. 'show bootstrap editor' : function() { window.location.hash = "forms/other-editors" },
  155. 'show dropzone' : function() { window.location.hash = "forms/dropzone" },
  156. 'show image cropping' : function() { window.location.hash = "forms/image-editor" },
  157. 'show general elements' : function() { window.location.hash = "ui/general-elements" },
  158. 'show buttons' : function() { window.location.hash = "ui/buttons" },
  159. 'show fontawesome' : function() { window.location.hash = "ui/icons/fa" },
  160. 'show glyph icons' : function() { window.location.hash = "ui/icons/glyph" },
  161. 'show flags' : function() { window.location.hash = "ui/icons/flags" },
  162. 'show grid' : function() { window.location.hash = "ui/grid" },
  163. 'show tree view' : function() { window.location.hash = "ui/treeview" },
  164. 'show nestable lists' : function() { window.location.hash = "ui/nestable-list" },
  165. 'show jquery U I' : function() { window.location.hash = "ui/jqui" },
  166. 'show typography' : function() { window.location.hash = "ui/typography" },
  167. 'show calendar' : function() { window.location.hash = "calendar" },
  168. 'show widgets' : function() { window.location.hash = "widgets" },
  169. 'show gallery' : function() { window.location.hash = "gallery" },
  170. 'show maps' : function() { window.location.hash = "gmap-xml" },
  171. 'go back' : function() { history.back(1); },
  172. 'scroll up' : function () { $('html, body').animate({ scrollTop: 0 }, 100); },
  173. 'scroll down' : function () { $('html, body').animate({ scrollTop: $(document).height() }, 100);},
  174. 'hide navigation' : function() {
  175. if ($( ":root" ).hasClass("container") && !$( ":root" ).hasClass("menu-on-top")){
  176. $('span.minifyme').trigger("click");
  177. } else {
  178. $('#hide-menu > span > a').trigger("click");
  179. }
  180. },
  181. 'show navigation' : function() {
  182. if ($( ":root" ).hasClass("container") && !$( ":root" ).hasClass("menu-on-top")){
  183. $('span.minifyme').trigger("click");
  184. } else {
  185. $('#hide-menu > span > a').trigger("click");
  186. }
  187. },
  188. 'mute' : function() {
  189. appConfig.sound_on = false;
  190. $.smallBox({
  191. title : "MUTE",
  192. content : "All sounds have been muted!",
  193. color : "#a90329",
  194. timeout: 4000,
  195. icon : "fa fa-volume-off"
  196. });
  197. },
  198. 'sound on' : function() {
  199. appConfig.sound_on = true;
  200. $.speechApp.playConfirmation();
  201. $.smallBox({
  202. title : "UNMUTE",
  203. content : "All sounds have been turned on!",
  204. color : "#40ac2b",
  205. sound_file: 'voice_alert',
  206. timeout: 5000,
  207. icon : "fa fa-volume-up"
  208. });
  209. },
  210. 'stop' : function() {
  211. smartSpeechRecognition.abort();
  212. $( ":root" ).removeClass("voice-command-active");
  213. $.smallBox({
  214. title : "VOICE COMMAND OFF",
  215. content : "Your voice commands has been successfully turned off. Click on the <i class='fa fa-microphone fa-lg fa-fw'></i> icon to turn it back on.",
  216. color : "#40ac2b",
  217. sound_file: 'voice_off',
  218. timeout: 8000,
  219. icon : "fa fa-microphone-slash"
  220. });
  221. if ($('#speech-btn .popover').is(':visible')) {
  222. $('#speech-btn .popover').fadeOut(250);
  223. }
  224. },
  225. 'help' : function() {
  226. $('#voiceModal').removeData('modal').modal( { remote: "app/layout/partials/voice-commands.tpl.html", show: true } );
  227. if ($('#speech-btn .popover').is(':visible')) {
  228. $('#speech-btn .popover').fadeOut(250);
  229. }
  230. },
  231. 'got it' : function() {
  232. $('#voiceModal').modal('hide');
  233. },
  234. 'logout' : function() {
  235. $.speechApp.stop();
  236. window.location = $('#logout > span > a').attr("href");
  237. }
  238. };
  239. }
  240. //服务器上面
  241. appConfig.apiRootUrl = 'api';
  242. appConfig.baseUrl = 'http://localhost:9025';
  243. appConfig.safeProduceUrl = location.protocol+"//"+location.host+'/depot-safe-produce';
  244. appConfig.numberManageUrl = location.protocol+"//"+location.host+'/depot-number-manage';
  245. appConfig.drugManageUrl = location.protocol+"//"+location.host+'/depot-drug-manage';
  246. appConfig.systemUrl = location.protocol+"//"+location.host+'/depot-system';
  247. appConfig.basicUrl = location.protocol+"//"+location.host+'/depot-basic';
  248. appConfig.keeperHouseUrl = location.protocol+"//"+location.host+'/depot-keeper-account';
  249. appConfig.paymentUrl = location.protocol+"//"+location.host+'/depot-payment';
  250. appConfig.grainInspectionUrl = location.protocol+"//"+location.host+'/depot-grain-inspection';
  251. appConfig.grainAnalysis = location.protocol+"//"+location.host+'/depot-grain-analysis';
  252. appConfig.houseKeeperRepairUrl = location.protocol+"//"+location.host+'/depot-keeper-house';
  253. appConfig.taskUrl = location.protocol+"//"+location.host+'/depot-task';
  254. appConfig.qualitycheckUrl = location.protocol+"//"+location.host+'/depot-qualitycheck';
  255. appConfig.monitorUrl = location.protocol+"//"+location.host+'/depot-monitor';
  256. appConfig.superviseUrl = location.protocol+"//"+location.host+'/depot-supervise';
  257. appConfig.agileUrl = location.protocol+"//"+location.host+'/depot-agile';
  258. appConfig.businessUrl = location.protocol+"//"+location.host+'/depot-business';
  259. appConfig.deviceUrl = location.protocol+"//"+location.host+'/depot-device';
  260. appConfig.customerUrl = location.protocol+"//"+location.host+'/depot-customer';
  261. appConfig.agentUrl = location.protocol+"//"+location.host+'/depot-agent';
  262. appConfig.intelligentUrl = location.protocol+"//"+location.host+'/depot-intelligent';
  263. window.appConfig = appConfig;
  264. /*
  265. * END APP.appConfig
  266. */