mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Bind subscriberManager object to task manager application
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="admintable">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@@ -62,7 +62,7 @@
|
||||
|
||||
{% if app['acl'].get(app['authentication'].getUser()).has_right('taskmanager') %}
|
||||
<li class="{% if feature == 'taskmanager' %}selected{% endif %}">
|
||||
<a target="right" href="{{ path('admin_tasks_list') }}" class="ajax">
|
||||
<a target="right" href="{{ path('admin_tasks_list') }}" class="ajax" data-ws-topic="http://phraseanet.com/topics/admin/task-manager">
|
||||
<img src="/skins/admin/TaskManager.png" />
|
||||
<span>{{ 'admin::utilisateurs: gestionnaire de taches' | trans }}</span>
|
||||
</a>
|
||||
|
@@ -13,21 +13,20 @@ define([
|
||||
"backbone",
|
||||
"models/scheduler",
|
||||
"common/websockets/connection",
|
||||
"common/websockets/subscriberManager",
|
||||
"apps/admin/tasks-manager/views/scheduler",
|
||||
"apps/admin/tasks-manager/views/tasks",
|
||||
"apps/admin/tasks-manager/views/ping",
|
||||
"apps/admin/tasks-manager/views/refresh",
|
||||
"apps/admin/tasks-manager/collections/tasks"
|
||||
], function ($, _, Backbone, Scheduler, WSConnection, SchedulerView, TasksView, PingView, RefreshView, TasksCollection) {
|
||||
], function ($, _, Backbone, Scheduler, WSConnection, SubscriberManager, SchedulerView, TasksView, PingView, RefreshView, TasksCollection) {
|
||||
var create = function() {
|
||||
window.TaskManagerApp = {
|
||||
$scope: $("#task-manager-app"),
|
||||
$tasksListView : $(".tasks-list-view", this.$scope),
|
||||
$schedulerView : $(".scheduler-view", this.$scope),
|
||||
$pingView : $(".ping-view", this.$scope),
|
||||
$refreshView : $(".refresh-view", this.$scope),
|
||||
eventAggregator: _.extend({}, Backbone.Events),
|
||||
wstopic: "http://phraseanet.com/topics/admin/task-manager"
|
||||
$refreshView : $(".refresh-view", this.$scope)
|
||||
};
|
||||
|
||||
TaskManagerApp.tasksCollection = new TasksCollection();
|
||||
@@ -56,7 +55,7 @@ define([
|
||||
TaskManagerApp.tasksView.render();
|
||||
TaskManagerApp.schedulerView.render();
|
||||
|
||||
WSConnection.subscribe(TaskManagerApp.wstopic, function(topic, msg) {
|
||||
SubscriberManager.pushCallback(function(topic, msg) {
|
||||
// double encoded string
|
||||
var msg = JSON.parse(JSON.parse(msg));
|
||||
WSConnection.trigger("ws:"+msg.event, msg);
|
||||
|
@@ -7,16 +7,6 @@
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
// configure AMD loading
|
||||
require.config({
|
||||
baseUrl: "/scripts",
|
||||
paths: {
|
||||
jquery: "../assets/jquery/jquery",
|
||||
underscore: "../assets/underscore-amd/underscore",
|
||||
backbone: "../assets/backbone-amd/backbone"
|
||||
}
|
||||
});
|
||||
|
||||
// launch application
|
||||
require(["apps/admin/tasks-manager/app"], function (App) {
|
||||
App.initialize();
|
||||
|
@@ -9,12 +9,10 @@
|
||||
|
||||
define([
|
||||
"jquery",
|
||||
"jqueryui",
|
||||
"underscore",
|
||||
"backbone",
|
||||
"i18n",
|
||||
"apps/admin/tasks-manager/views/task"
|
||||
], function ($, jqueryui, _, Backbone, i18n, TaskView) {
|
||||
], function ($, _, Backbone, TaskView) {
|
||||
var TasksView = Backbone.View.extend({
|
||||
initialize: function() {
|
||||
this._taskViews = [];
|
||||
|
Reference in New Issue
Block a user