$(document).ready(function() { $(".pick-a-color").spectrum( { type: "text", showAlpha: false } ); var doit = true; $("a[data-method]").on('click',function(){ if($(this).data('confirm')){ doit = confirm($(this).data('confirm')); if(!doit) return false; } }); $("button[data-method]").on('click',function(){ if($(this).data('confirm')){ doit = confirm($(this).data('confirm')); if(!doit) return false; } }); }); function ModalLoad(idmodal,title,path) { $("#"+idmodal+" .modal-header h4").text(title); $("#"+idmodal+" iframe").attr("src",path); $("#"+idmodal).modal("show"); } {% if wssuse %} function subscribe(channeltype,channelkey,userkey) { console.log("== SUBSCRIBE "+channeltype+"-"+channelkey+" with userkey "+userkey); conn.send(JSON.stringify({ command: "subscribe", log: "", channel: channeltype+"-"+channelkey, channeltype: channeltype, channelkey: channelkey, userkey: userkey })); } function sendMessage(msg) { json=JSON.stringify(msg); console.log("== SEND MSG = "+json); conn.send(json); } {% endif %}