summaryrefslogtreecommitdiff
path: root/www/js/jingles.js
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2015-07-31 20:54:42 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2015-07-31 20:54:42 (GMT)
commite2034bcc39fd1d859626b3ea7512414dfccee499 (patch)
tree2b003fa6614a8f5584342ea14e048db3d717cb2d /www/js/jingles.js
parent032b6bcaf2b6811144325e504d6d7edfa248c508 (diff)
move main css to file, move clock to utils.js, load jingle groups
Diffstat (limited to 'www/js/jingles.js')
-rw-r--r--www/js/jingles.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/www/js/jingles.js b/www/js/jingles.js
index c8a5c60..3314572 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -19,8 +19,52 @@
* along with rhwebimport. If not, see <http://www.gnu.org/licenses/>.
*/
+jingle_groups_list = [];
+
+function jingle_groups_updateList(data, status, req) {
+ jingle_groups_list = [];
+ $('#show-selector').find('option').remove();
+ var dblist = $(data).find("dropboxList");
+ var dbs = dblist.children();
+ dbs.each(function() {
+ type = $(this).find('type').text();
+ if (type == 'jingle') {
+ var jingle_group = {
+ title: $(this).find('jingle-title').text(),
+ group: {
+ name: $(this).find('group').text(),
+ description: $(this).find('group-description').text(),
+ lowcart: $(this).find('group-low-cart').text(),
+ highcart: $(this).find('group-high-cart').text(),
+ },
+ normlevel: $(this).find('normalization-level').text(),
+ trimlevel: $(this).find('autotrim-level').text(),
+ };
+
+ var name = jingle_group.title;
+ $('#jingle-selector').append($('<option>').attr('value', jingle_group.id).text(name));
+
+ jingle_groups_list.push(jingle_group);
+ }
+ });
+ console.log(jingle_groups_list);
+ //$('#jingle-selector').val(jingles_currentid);
+ //shows_showSelected();
+}
+
function jingles_init() {
+ //jingles_currentid = sessionStorage.getItem("jingles_currentid");
+ jingle_groups_list = [];
+ data = { LOGIN_NAME: auth_username, PASSWORD: auth_token };
+ $.post("/rh-bin/listdropboxes.cgi", data, jingle_groups_updateList, "xml");
+ drawClock('Do, 1.1.1970', '00:00:00', 0);
+ clock_add_callback(drawClock);
}
function jingles_cleanup() {
+ sessionStorage.removeItem("jingles_currentid");
+ delete jingles_currentid;
+ jingle_groups_list = [];
+ //jingles_group_carts = {};
+ //jingles_log_carts = [];
}