summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/models/File.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-08 17:37:43 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-08 17:37:44 +0200
commit2cf160d497e501bf254bd8be054c0f5880ab90ca (patch)
tree03a720b6142cc03fe7ef258fa8d17da92b30a462 /module/web/static/js/models/File.js
parentMerge pull request #151 from vuolter/invertedconf (diff)
downloadpyload-2cf160d497e501bf254bd8be054c0f5880ab90ca.tar.xz
restructured webui to single-page-app, removed jinja
Diffstat (limited to 'module/web/static/js/models/File.js')
-rw-r--r--module/web/static/js/models/File.js91
1 files changed, 0 insertions, 91 deletions
diff --git a/module/web/static/js/models/File.js b/module/web/static/js/models/File.js
deleted file mode 100644
index 524637cb4..000000000
--- a/module/web/static/js/models/File.js
+++ /dev/null
@@ -1,91 +0,0 @@
-define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes'], function($, Backbone, _, App, Api) {
-
- var Finished = [Api.DownloadStatus.Finished, Api.DownloadStatus.Skipped];
- var Failed = [Api.DownloadStatus.Failed, Api.DownloadStatus.Aborted, Api.DownloadStatus.TempOffline, Api.DownloadStatus.Offline];
- // Unfinished - Other
-
- return Backbone.Model.extend({
-
- idAttribute: 'fid',
-
- defaults: {
- fid: -1,
- name: null,
- package: -1,
- owner: -1,
- size: -1,
- status: -1,
- media: -1,
- added: -1,
- fileorder: -1,
- download: null,
-
- // UI attributes
- selected: false,
- visible: true,
- progress: 0,
- eta: 0
- },
-
- // Model Constructor
- initialize: function() {
-
- },
-
- fetch: function(options) {
- options = App.apiRequest(
- 'getFileInfo',
- {fid: this.get('fid')},
- options);
-
- return Backbone.Model.prototype.fetch.call(this, options);
- },
-
- destroy: function(options) {
- // also not working when using data
- options = App.apiRequest(
- 'deleteFiles/[' + this.get('fid') + ']',
- null, options);
- options.method = "post";
-
- return Backbone.Model.prototype.destroy.call(this, options);
- },
-
- // Does not send a request to the server
- destroyLocal: function(options) {
- this.trigger('destroy', this, this.collection, options);
- },
-
- restart: function(options) {
- options = App.apiRequest(
- 'restartFile',
- {fid: this.get('fid')},
- options);
-
- return $.ajax(options);
- },
-
- // Any time a model attribute is set, this method is called
- validate: function(attrs) {
-
- },
-
- isDownload: function() {
- return this.has('download');
- },
-
- isFinished: function() {
- return _.indexOf(Finished, this.get('download').status) > -1;
- },
-
- isUnfinished: function() {
- return _.indexOf(Finished, this.get('download').status) === -1 && _.indexOf(Failed, this.get('download').status) === -1;
- },
-
- isFailed: function() {
- return _.indexOf(Failed, this.get('download').status) > -1;
- }
-
- });
-
-}); \ No newline at end of file