ninegitea/templates/Include/javascript.js.twig

56 lines
1.4 KiB
Twig
Raw Normal View History

2021-07-20 13:04:47 +02:00
$(document).ready(function() {
$(".pick-a-color").spectrum(
{
type: "text",
showAlpha: false
}
);
$(".pick-a-color").attr("autocomplete","off");
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 %}
2024-03-15 15:44:29 +01:00
console.log("pouet");
2021-07-20 13:04:47 +02:00
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 %}