diff options
Diffstat (limited to 'www/js/jingles.js')
-rw-r--r-- | www/js/jingles.js | 44 |
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 = []; } |