Updated application sources
[apps/web/sample/FileManager.git] / project / js / main.js
index 360b951..2f53df2 100644 (file)
 var app = null;
 
 (function () { // strict mode wrapper
-       'use strict';
+    'use strict';
 
-       ({
-               /**
-                * Loader init - load the App constructor
-                */
-               init: function init() {
-                       var self = this;
-                       $.getScript('js/app.js')
-                               .done(function () {
-                                       // once the app is loaded, create the app object
-                                       // and load the libraries
-                                       app = new App();
-                                       self.loadLibs();
-                               })
-                               .fail(this.onGetScriptError);
-               },
+    ({
+        /**
+         * Loader init - load the App constructor
+         */
+        init: function init() {
+            var self = this;
+            $.getScript('js/app.js')
+                .done(function () {
+                    // once the app is loaded, create the app object
+                    // and load the libraries
+                    app = new App();
+                    self.loadLibs();
+                })
+                .fail(this.onGetScriptError);
+        },
 
-               /**
-                * Load dependencies
-                */
-               loadLibs: function loadLibs() {
-                       var loadedLibs = 0;
-                       if ($.isArray(app.requires)) {
-                               $.each(app.requires, function (index, filename) {
-                                       $.getScript(filename)
-                                               .done(function () {
-                                                       loadedLibs += 1;
-                                                       if (loadedLibs >= app.requires.length) {
-                                                               // All dependencies are loaded - initialise the app
-                                                               app.init();
-                                                       }
-                                               })
-                                               .fail(this.onGetScriptError);
-                               });
-                       }
-               },
+        /**
+         * Load dependencies
+         */
+        loadLibs: function loadLibs() {
+            var loadedLibs = 0;
+            if ($.isArray(app.requires)) {
+                $.each(app.requires, function (index, filename) {
+                    $.getScript(filename)
+                        .done(function () {
+                            loadedLibs += 1;
+                            if (loadedLibs >= app.requires.length) {
+                                // All dependencies are loaded
+                                // initialise the app
+                                app.init();
+                            }
+                        })
+                        .fail(this.onGetScriptError);
+                });
+            }
+        },
 
-               /**
-                * Handle ajax errors
-                */
-               onGetScriptError: function onGetScriptError(e, jqxhr, setting, exception) {
-                       app.ui.alertPopup('An error occurred: ' + e.message);
-               }
-       }).init(); // run the loader
+        /**
+         * Handle ajax errors
+         */
+        onGetScriptError: function onGetScriptError(
+            e,
+            jqxhr,
+            setting,
+            exception
+        ) {
+            app.ui.alertPopup('An error occurred: ' + e.message);
+        }
+    }).init(); // run the loader
 }());