You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. /* ______________________________________
  2. ________| |_______
  3. \ | SmartAdmin WebApp | /
  4. \ | Copyright © 2016 MyOrange | /
  5. / |______________________________________| \
  6. /__________) (_________\
  7. * The above copyright notice and this permission notice shall be
  8. * included in all copies or substantial portions of the Software.
  9. * =======================================================================
  10. * SmartAdmin is FULLY owned and LICENSED by MYORANGE INC.
  11. * This script may NOT be RESOLD or REDISTRUBUTED under any
  12. * circumstances, and is only to be used with this purchased
  13. * copy of SmartAdmin Template.
  14. * =======================================================================
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  18. * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  19. * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. * =======================================================================
  22. * original filename: app.config.js
  23. * filesize: 12kb
  24. * author: Sunny (@bootstraphunt)
  25. * email: info@myorange.ca
  26. * =======================================================================
  27. *
  28. * GLOBAL ROOT (DO NOT CHANGE)
  29. */
  30. $.root_ = $('body');
  31. /*
  32. * APP CONFIGURATION (HTML/AJAX/PHP Versions ONLY)
  33. * Description: Enable / disable certain theme features here
  34. * GLOBAL: Your left nav in your app will no longer fire ajax calls, set
  35. * it to false for HTML version
  36. */
  37. $.navAsAjax = false;
  38. /*
  39. * GLOBAL: Sound Config (define sound path, enable or disable all sounds)
  40. */
  41. $.sound_path = "sound/";
  42. $.sound_on = true;
  43. /*
  44. * SAVE INSTANCE REFERENCE (DO NOT CHANGE)
  45. * Save a reference to the global object (window in the browser)
  46. */
  47. var root = this,
  48. /*
  49. * DEBUGGING MODE
  50. * debugState = true; will spit all debuging message inside browser console.
  51. * The colors are best displayed in chrome browser.
  52. */
  53. debugState = false,
  54. debugStyle = 'font-weight: bold; color: #00f;',
  55. debugStyle_green = 'font-weight: bold; font-style:italic; color: #46C246;',
  56. debugStyle_red = 'font-weight: bold; color: #ed1c24;',
  57. debugStyle_warning = 'background-color:yellow',
  58. debugStyle_success = 'background-color:green; font-weight:bold; color:#fff;',
  59. debugStyle_error = 'background-color:#ed1c24; font-weight:bold; color:#fff;',
  60. /*
  61. * Impacts the responce rate of some of the responsive elements (lower
  62. * value affects CPU but improves speed)
  63. */
  64. throttle_delay = 350,
  65. /*
  66. * The rate at which the menu expands revealing child elements on click
  67. */
  68. menu_speed = 235,
  69. /*
  70. * Collapse current menu item as other menu items are expanded
  71. * Careful when using this option, if you have a long menu it will
  72. * keep expanding and may distrupt the user experience This is best
  73. * used with fixed-menu class
  74. */
  75. menu_accordion = true,
  76. /*
  77. * Turn on JarvisWidget functionality
  78. * Global JarvisWidget Settings
  79. * For a greater control of the widgets, please check app.js file
  80. * found within COMMON_ASSETS/UNMINIFIED_JS folder and see from line 1355
  81. * dependency: js/jarviswidget/jarvis.widget.min.js
  82. */
  83. enableJarvisWidgets = true,
  84. /*
  85. * Use localstorage to save widget settings
  86. * turn this off if you prefer to use the onSave hook to save
  87. * these settings to your datatabse instead
  88. */
  89. localStorageJarvisWidgets = true,
  90. /*
  91. * Turn off sortable feature for JarvisWidgets
  92. */
  93. sortableJarvisWidgets = true,
  94. /*
  95. * Warning: Enabling mobile widgets could potentially crash your webApp
  96. * if you have too many widgets running at once
  97. * (must have enableJarvisWidgets = true)
  98. */
  99. enableMobileWidgets = false,
  100. /*
  101. * Turn on fast click for mobile devices
  102. * Enable this to activate fastclick plugin
  103. * dependency: js/plugin/fastclick/fastclick.js
  104. */
  105. fastClick = false,
  106. /*
  107. * SMARTCHAT PLUGIN ARRAYS & CONFIG
  108. * Dependency: js/plugin/moment/moment.min.js
  109. * js/plugin/cssemotions/jquery.cssemoticons.min.js
  110. * js/smart-chat-ui/smart.chat.ui.js
  111. * (DO NOT CHANGE BELOW)
  112. */
  113. boxList = [],
  114. showList = [],
  115. nameList = [],
  116. idList = [],
  117. /*
  118. * Width of the chat boxes, and the gap inbetween in pixel (minus padding)
  119. */
  120. chatbox_config = {
  121. width: 200,
  122. gap: 35
  123. },
  124. /*
  125. * These elements are ignored during DOM object deletion for ajax version
  126. * It will delete all objects during page load with these exceptions:
  127. */
  128. ignore_key_elms = ["#header, #left-panel, #right-panel, #main, div.page-footer, #shortcut, #divSmallBoxes, #divMiniIcons, #divbigBoxes, #voiceModal, script, .ui-chatbox"],
  129. /*
  130. * VOICE COMMAND CONFIG
  131. * dependency: js/speech/voicecommand.js
  132. */
  133. voice_command = true,
  134. /*
  135. * Turns on speech as soon as the page is loaded
  136. */
  137. voice_command_auto = false,
  138. /*
  139. * Sets the language to the default 'en-US'. (supports over 50 languages
  140. * by google)
  141. *
  142. * Afrikaans ['af-ZA']
  143. * Bahasa Indonesia ['id-ID']
  144. * Bahasa Melayu ['ms-MY']
  145. * Català ['ca-ES']
  146. * Čeština ['cs-CZ']
  147. * Deutsch ['de-DE']
  148. * English ['en-AU', 'Australia']
  149. * ['en-CA', 'Canada']
  150. * ['en-IN', 'India']
  151. * ['en-NZ', 'New Zealand']
  152. * ['en-ZA', 'South Africa']
  153. * ['en-GB', 'United Kingdom']
  154. * ['en-US', 'United States']
  155. * Español ['es-AR', 'Argentina']
  156. * ['es-BO', 'Bolivia']
  157. * ['es-CL', 'Chile']
  158. * ['es-CO', 'Colombia']
  159. * ['es-CR', 'Costa Rica']
  160. * ['es-EC', 'Ecuador']
  161. * ['es-SV', 'El Salvador']
  162. * ['es-ES', 'España']
  163. * ['es-US', 'Estados Unidos']
  164. * ['es-GT', 'Guatemala']
  165. * ['es-HN', 'Honduras']
  166. * ['es-MX', 'México']
  167. * ['es-NI', 'Nicaragua']
  168. * ['es-PA', 'Panamá']
  169. * ['es-PY', 'Paraguay']
  170. * ['es-PE', 'Perú']
  171. * ['es-PR', 'Puerto Rico']
  172. * ['es-DO', 'República Dominicana']
  173. * ['es-UY', 'Uruguay']
  174. * ['es-VE', 'Venezuela']
  175. * Euskara ['eu-ES']
  176. * Français ['fr-FR']
  177. * Galego ['gl-ES']
  178. * Hrvatski ['hr_HR']
  179. * IsiZulu ['zu-ZA']
  180. * Íslenska ['is-IS']
  181. * Italiano ['it-IT', 'Italia']
  182. * ['it-CH', 'Svizzera']
  183. * Magyar ['hu-HU']
  184. * Nederlands ['nl-NL']
  185. * Norsk bokmål ['nb-NO']
  186. * Polski ['pl-PL']
  187. * Português ['pt-BR', 'Brasil']
  188. * ['pt-PT', 'Portugal']
  189. * Română ['ro-RO']
  190. * Slovenčina ['sk-SK']
  191. * Suomi ['fi-FI']
  192. * Svenska ['sv-SE']
  193. * Türkçe ['tr-TR']
  194. * български ['bg-BG']
  195. * Pусский ['ru-RU']
  196. * Српски ['sr-RS']
  197. * 한국어 ['ko-KR']
  198. * 中文 ['cmn-Hans-CN', '普通话 (中国大陆)']
  199. * ['cmn-Hans-HK', '普通话 (香港)']
  200. * ['cmn-Hant-TW', '中文 (台灣)']
  201. * ['yue-Hant-HK', '粵語 (香港)']
  202. * 日本語 ['ja-JP']
  203. * Lingua latīna ['la']
  204. */
  205. voice_command_lang = 'en-US',
  206. /*
  207. * Use localstorage to remember on/off (best used with HTML Version
  208. * when going from one page to the next)
  209. */
  210. voice_localStorage = true;
  211. /*
  212. * Voice Commands
  213. * Defines voice command variables and functions
  214. */
  215. if (voice_command) {
  216. var commands = {
  217. 'show dashboard' : function() { $('nav a[href="dashboard.html"]').trigger("click"); },
  218. 'show inbox' : function() { $('nav a[href="inbox.html"]').trigger("click"); },
  219. 'show graphs' : function() { $('nav a[href="flot.html"]').trigger("click"); },
  220. 'show flotchart' : function() { $('nav a[href="flot.html"]').trigger("click"); },
  221. 'show morris chart' : function() { $('nav a[href="morris.html"]').trigger("click"); },
  222. 'show inline chart' : function() { $('nav a[href="inline-charts.html"]').trigger("click"); },
  223. 'show dygraphs' : function() { $('nav a[href="dygraphs.html"]').trigger("click"); },
  224. 'show tables' : function() { $('nav a[href="table.html"]').trigger("click"); },
  225. 'show data table' : function() { $('nav a[href="datatables.html"]').trigger("click"); },
  226. 'show jquery grid' : function() { $('nav a[href="jqgrid.html"]').trigger("click"); },
  227. 'show form' : function() { $('nav a[href="form-elements.html"]').trigger("click"); },
  228. 'show form layouts' : function() { $('nav a[href="form-templates.html"]').trigger("click"); },
  229. 'show form validation' : function() { $('nav a[href="validation.html"]').trigger("click"); },
  230. 'show form elements' : function() { $('nav a[href="bootstrap-forms.html"]').trigger("click"); },
  231. 'show form plugins' : function() { $('nav a[href="plugins.html"]').trigger("click"); },
  232. 'show form wizards' : function() { $('nav a[href="wizards.html"]').trigger("click"); },
  233. 'show bootstrap editor' : function() { $('nav a[href="other-editors.html"]').trigger("click"); },
  234. 'show dropzone' : function() { $('nav a[href="dropzone.html"]').trigger("click"); },
  235. 'show image cropping' : function() { $('nav a[href="image-editor.html"]').trigger("click"); },
  236. 'show general elements' : function() { $('nav a[href="general-elements.html"]').trigger("click"); },
  237. 'show buttons' : function() { $('nav a[href="buttons.html"]').trigger("click"); },
  238. 'show fontawesome' : function() { $('nav a[href="fa.html"]').trigger("click"); },
  239. 'show glyph icons' : function() { $('nav a[href="glyph.html"]').trigger("click"); },
  240. 'show flags' : function() { $('nav a[href="flags.html"]').trigger("click"); },
  241. 'show grid' : function() { $('nav a[href="grid.html"]').trigger("click"); },
  242. 'show tree view' : function() { $('nav a[href="treeview.html"]').trigger("click"); },
  243. 'show nestable lists' : function() { $('nav a[href="nestable-list.html"]').trigger("click"); },
  244. 'show jquery U I' : function() { $('nav a[href="jqui.html"]').trigger("click"); },
  245. 'show typography' : function() { $('nav a[href="typography.html"]').trigger("click"); },
  246. 'show calendar' : function() { $('nav a[href="calendar.html"]').trigger("click"); },
  247. 'show widgets' : function() { $('nav a[href="widgets.html"]').trigger("click"); },
  248. 'show gallery' : function() { $('nav a[href="gallery.html"]').trigger("click"); },
  249. 'show maps' : function() { $('nav a[href="gmap-xml.html"]').trigger("click"); },
  250. 'show pricing tables' : function() { $('nav a[href="pricing-table.html"]').trigger("click"); },
  251. 'show invoice' : function() { $('nav a[href="invoice.html"]').trigger("click"); },
  252. 'show search' : function() { $('nav a[href="search.html"]').trigger("click"); },
  253. 'go back' : function() { history.back(1); },
  254. 'scroll up' : function () { $('html, body').animate({ scrollTop: 0 }, 100); },
  255. 'scroll down' : function () { $('html, body').animate({ scrollTop: $(document).height() }, 100);},
  256. 'hide navigation' : function() {
  257. if ($.root_.hasClass("container") && !$.root_.hasClass("menu-on-top")){
  258. $('span.minifyme').trigger("click");
  259. } else {
  260. $('#hide-menu > span > a').trigger("click");
  261. }
  262. },
  263. 'show navigation' : function() {
  264. if ($.root_.hasClass("container") && !$.root_.hasClass("menu-on-top")){
  265. $('span.minifyme').trigger("click");
  266. } else {
  267. $('#hide-menu > span > a').trigger("click");
  268. }
  269. },
  270. 'mute' : function() {
  271. $.sound_on = false;
  272. $.smallBox({
  273. title : "MUTE",
  274. content : "All sounds have been muted!",
  275. color : "#a90329",
  276. timeout: 4000,
  277. icon : "fa fa-volume-off"
  278. });
  279. },
  280. 'sound on' : function() {
  281. $.sound_on = true;
  282. $.speechApp.playConfirmation();
  283. $.smallBox({
  284. title : "UNMUTE",
  285. content : "All sounds have been turned on!",
  286. color : "#40ac2b",
  287. sound_file: 'voice_alert',
  288. timeout: 5000,
  289. icon : "fa fa-volume-up"
  290. });
  291. },
  292. 'stop' : function() {
  293. smartSpeechRecognition.abort();
  294. $.root_.removeClass("voice-command-active");
  295. $.smallBox({
  296. title : "VOICE COMMAND OFF",
  297. 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.",
  298. color : "#40ac2b",
  299. sound_file: 'voice_off',
  300. timeout: 8000,
  301. icon : "fa fa-microphone-slash"
  302. });
  303. if ($('#speech-btn .popover').is(':visible')) {
  304. $('#speech-btn .popover').fadeOut(250);
  305. }
  306. },
  307. 'help' : function() {
  308. $('#voiceModal').removeData('modal').modal( { remote: "ajax/modal-content/modal-voicecommand.html", show: true } );
  309. if ($('#speech-btn .popover').is(':visible')) {
  310. $('#speech-btn .popover').fadeOut(250);
  311. }
  312. },
  313. 'got it' : function() {
  314. $('#voiceModal').modal('hide');
  315. },
  316. 'logout' : function() {
  317. $.speechApp.stop();
  318. window.location = $('#logout > span > a').attr("href");
  319. }
  320. };
  321. };
  322. /*
  323. * END APP.CONFIG
  324. */