summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/headerView.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-12 12:49:42 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-12 12:49:42 +0100
commit6232db5a1d3b8b5e4412af67d5bc7ca65f94333c (patch)
tree02a95e1216ace355d84a9704fb9070bd744b17c2 /module/web/static/js/views/headerView.js
parentadded missing file (diff)
downloadpyload-6232db5a1d3b8b5e4412af67d5bc7ca65f94333c.tar.xz
renamed most events, push events to webui
Diffstat (limited to 'module/web/static/js/views/headerView.js')
-rw-r--r--module/web/static/js/views/headerView.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/module/web/static/js/views/headerView.js b/module/web/static/js/views/headerView.js
index c22f173c4..35df06003 100644
--- a/module/web/static/js/views/headerView.js
+++ b/module/web/static/js/views/headerView.js
@@ -12,6 +12,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', 'flot'
},
templateStatus: _.compile($('#template-header-status').html()),
+ templateProgress: _.compile($('#template-header-progress').html()),
// Will hold the link grabber
grabber: null,
@@ -100,11 +101,15 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', 'flot'
},
render: function() {
-// console.log('Render header');
+ // TODO: what should be displayed in the header
+ // queue/processing size?
this.$('.status-block').html(
this.templateStatus(this.status.toJSON())
);
+
+ // TODO: render progress
+ this.$('.progress-list');
},
toggle_taskList: function() {
@@ -132,10 +137,10 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', 'flot'
if (data['@class'] === "ServerStatus") {
this.status.set(data);
}
- else if (data['@class'] === 'progress')
+ else if (_.isArray(data))
this.onProgressUpdate(data);
- else if (data['@class'] === 'event')
- this.onEvent(data);
+ else if (data['@class'] === 'EventInfo')
+ this.onEvent(data.eventname, data.event_args);
else
console.log('Unknown Async input');
@@ -145,8 +150,10 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ServerStatus', 'flot'
},
- onEvent: function(event) {
-
+ onEvent: function(event, args) {
+ args.unshift(event);
+ console.log('Core send event', args);
+ App.vent.trigger.apply(App.vent, args);
}
});