diff options
author | 2013-06-08 17:37:43 +0200 | |
---|---|---|
committer | 2013-06-08 17:37:44 +0200 | |
commit | 2cf160d497e501bf254bd8be054c0f5880ab90ca (patch) | |
tree | 03a720b6142cc03fe7ef258fa8d17da92b30a462 /module/web/static/js/app.js | |
parent | Merge pull request #151 from vuolter/invertedconf (diff) | |
download | pyload-2cf160d497e501bf254bd8be054c0f5880ab90ca.tar.xz |
restructured webui to single-page-app, removed jinja
Diffstat (limited to 'module/web/static/js/app.js')
-rw-r--r-- | module/web/static/js/app.js | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/module/web/static/js/app.js b/module/web/static/js/app.js deleted file mode 100644 index 53af4b797..000000000 --- a/module/web/static/js/app.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Global Application Object - * Contains all necessary logic shared across views - */ -/*jslint browser: true*/ -define([ - - // Libraries. - 'jquery', - 'underscore', - 'backbone', - 'utils/initHB', - 'utils/animations', - 'utils/lazyRequire', - 'utils/dialogs', - 'wreqr', - 'bootstrap', - 'animate' - -], function($, _, Backbone, Handlebars) { - 'use strict'; - - var Application = function(options){ - this.vent = new Backbone.Wreqr.EventAggregator(); - _.extend(this, options); - }; - - // Add Global Helper functions - _.extend(Application.prototype, Backbone.Events, { - - // Generates options dict that can be used for xhr requests - apiRequest: function(method, data, options) { - options || (options = {}); - options.url = window.pathPrefix + "/api/" + method; - options.dataType = "json"; - if (data) { - options.type = "POST"; - options.data = {}; - // Convert arguments to json - _.keys(data).map(function(key) { - options.data[key] = JSON.stringify(data[key]); - }); - } - - return options; - }, - - openWebSocket: function(path) { - return new WebSocket(window.wsAddress.replace('%s', window.location.hostname) + path); - } - }); - - - // Returns the app object to be available to other modules through require.js. - return new Application(); -});
\ No newline at end of file |