summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2015-12-16 17:00:24 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2015-12-16 17:00:24 (GMT)
commitaf53fbda45a1d75344ded495cc56c7f37a3460d4 (patch)
tree8647c9591733e5af0936b3c61372b2faeb5840c8 /www/js
parentecb289de62a82a087df3fea11d4cbed47cb4bedb (diff)
add musicgrid tab
Diffstat (limited to 'www/js')
-rw-r--r--www/js/apps.js19
-rw-r--r--www/js/musicgrid.js35
-rw-r--r--www/js/musicpools.js2
-rw-r--r--www/js/rivendell.rh.js26
4 files changed, 82 insertions, 0 deletions
diff --git a/www/js/apps.js b/www/js/apps.js
index 32b5966..2b74edf 100644
--- a/www/js/apps.js
+++ b/www/js/apps.js
@@ -24,11 +24,27 @@ var apps_current;
function apps_select(app) {
switch(app) {
+ case "musicgrid":
+ $('#app-shows').hide();
+ $('#nav-btn-shows').removeClass('active');
+ $('#app-jingles').hide();
+ $('#nav-btn-jingles').removeClass('active');
+ $('#app-musicpools').hide();
+ $('#nav-btn-musicpools').removeClass('active');
+
+ $('#app-musicgrid').show();
+ $('#nav-btn-musicgrid').addClass('active');
+
+ apps_current = app;
+ musicgrid_init();
+ break;
case "musicpools":
$('#app-shows').hide();
$('#nav-btn-shows').removeClass('active');
$('#app-jingles').hide();
$('#nav-btn-jingles').removeClass('active');
+ $('#app-musicgrid').hide();
+ $('#nav-btn-musicgrid').removeClass('active');
$('#app-musicpools').show();
$('#nav-btn-musicpools').addClass('active');
@@ -41,6 +57,8 @@ function apps_select(app) {
$('#nav-btn-shows').removeClass('active');
$('#app-musicpools').hide();
$('#nav-btn-musicpools').removeClass('active');
+ $('#app-musicgrid').hide();
+ $('#nav-btn-musicgrid').removeClass('active');
$('#app-jingles').show();
$('#nav-btn-jingles').addClass('active');
@@ -83,6 +101,7 @@ function apps_cleanup() {
shows_cleanup();
jingles_cleanup();
musicpools_cleanup();
+ musicgrid_cleanup();
$(window).off('popstate');
diff --git a/www/js/musicgrid.js b/www/js/musicgrid.js
new file mode 100644
index 0000000..eca1de0
--- /dev/null
+++ b/www/js/musicgrid.js
@@ -0,0 +1,35 @@
+/*
+ * rhwebimport
+ *
+ * Copyright (C) 2014-2015 Christian Pointner <equinox@helsinki.at>
+ * Copyright (C) 2015 Peter Grassberger <petertheone@gmail.com>
+ *
+ * This file is part of rhwebimport.
+ *
+ * rhwebimport is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * rhwebimport is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with rhwebimport. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+'use strict';
+
+var rivendell = null;
+
+function musicgrid_init() {
+ rivendell = new Rivendell.Rivendell(auth_username, auth_token, '/rd-bin/rdxport.cgi');
+ rivendell.setMusicgridEndpoint('/rh-bin/musicgrid.cgi');
+ //rivendell.getMusicgrid();
+}
+
+function musicgrid_cleanup() {
+ rivendell = null;
+}
diff --git a/www/js/musicpools.js b/www/js/musicpools.js
index a3d9c65..1c968f9 100644
--- a/www/js/musicpools.js
+++ b/www/js/musicpools.js
@@ -20,6 +20,8 @@
* along with rhwebimport. If not, see <http://www.gnu.org/licenses/>.
*/
+'use strict';
+
function musicpools_init() {
}
diff --git a/www/js/rivendell.rh.js b/www/js/rivendell.rh.js
index 136440c..abec2d7 100644
--- a/www/js/rivendell.rh.js
+++ b/www/js/rivendell.rh.js
@@ -25,6 +25,9 @@
Rivendell.Rivendell.prototype.setListDropboxesEndpoint = function(listDropboxesEndpoint) {
this.listDropboxesEndpoint = listDropboxesEndpoint;
};
+Rivendell.Rivendell.prototype.setMusicgridEndpoint = function(musicgridEndpoint) {
+ this.musicgridEndpoint = musicgridEndpoint;
+};
Rivendell.Rivendell.prototype.listDropboxes = function(success) {
var command = {
@@ -44,3 +47,26 @@ Rivendell.Rivendell.prototype.addAndEditCut = function(cartNumber, options, succ
};
// todo: addAndEditCart
+
+// todo: get grid. musicgrid.cgi, username, pw, cmg(get,set), dow, hour, name
+/*Rivendell.Rivendell.prototype.getMusicgrid = function(success) {
+ var command = {
+ COMMAND: 'get',
+ LOGIN_NAME: this.username,
+ PASSWORD: this.token
+ };
+ return $.post(this.musicgridEndpoint, command, success, "xml");
+};*/
+
+// todo: set grid pool
+/*Rivendell.Rivendell.prototype.setMusicgrid = function(dow, hour, name, success) {
+ var command = {
+ COMMAND: 'set',
+ LOGIN_NAME: this.username,
+ PASSWORD: this.token,
+ DOW: dow,
+ HOUR: hour,
+ NAME: name
+ };
+ return $.post(this.musicgridEndpoint, command, success, "xml");
+};*/