'+components[idx].title+'
'; $('#componentsbutton').append(d); } else // already create, update state { setClassByBool( $('#'+comp_btn_id) , components[idx].enabled, "btn-danger", "btn-success" ); setClassByBool( $('#'+comp_btn_id+"_icon"), components[idx].enabled, "fa-stop" , "fa-play" ); $('#'+comp_btn_id).attr("onclick",'requestSetComponentState(\''+comp_name+'\','+(!components[idx].enabled)+')'); } } } } $(document).ready(function() { // color $(function() { $('#cp2').colorpicker({ format: 'rgb', colorSelectors: { 'default': '#777777', 'primary': '#337ab7', 'success': '#5cb85c', 'info' : '#5bc0de', 'warning': '#f0ad4e', 'danger' : '#d9534f' }, customClass: 'colorpicker-2x', sliders: { saturation: { maxLeft: 200, maxTop: 200 }, hue: { maxTop: 200 }, alpha: { maxTop: 200 }, } }); $('#cp2').colorpicker().on('changeColor', function(e) { color = e.color.toRGB(); requestSetColor(color.r, color.g, color.b); }); }); $("#reset_color").off().on("click", requestPriorityClear); $("#effect_select").off().on("change", function(event) { efx = $(this).val(); if(efx != "__none__") { requestPlayEffect(efx); } }); // effects effects_html = ''; for(i = 0; i < parsedServerInfoJSON.info.effects.length; i++) { //console.log(parsedServerInfoJSON.info.effects[i].name); effectName = parsedServerInfoJSON.info.effects[i].name; effects_html += ''; } $('#effect_select').html(effects_html); // components $(hyperion).on("cmd-serverinfo",updateComponents); });