//バージョンチェッカー function verck(ver) { if(localStorage.getItem("ver")!=ver){ localStorage.setItem("ver", ver); console.log("Thank you for your update"); $(document).ready(function(){ $('#releasenote').modal('open'); verp=ver.replace( '(', ''); verp=verp.replace( '.', '-'); verp=verp.replace( '.', '-'); verp=verp.replace( '[', '-'); verp=verp.replace( ']', ''); verp=verp.replace( ')', ''); verp=verp.replace( ' ', '_'); console.log(verp); $("#release-"+verp).show(); }); } var l = 5; // 生成する文字列に含める文字セット var c = "abcdefghijklmnopqrstuvwxyz0123456789"; var cl = c.length; var r = ""; for(var i=0; iShow'; }else{ var toot=""; } if(obj.Ver!=""){ if(obj.Ver==ver){ show=true; }else{ show=false; } } if(obj.Domain!=""){ var multi = localStorage.getItem("multi"); if (multi) { show=false; var accts = JSON.parse(multi); Object.keys(accts).forEach(function(key) { var acct = accts[key]; if(acct.domain==obj.Domain){ show=true; } }); } } if(show){ Materialize.toast(obj.Text+toot+'(スライドして消去)', 86400); } } } } }); infows = new WebSocket("wss://thedesk.top/ws/"); infows.onopen = function(mess) { console.log(tlid + ":Connect Streaming Info:"); console.log(mess); } infows.onmessage = function(mess) { console.log(":Receive Streaming:"); console.log(JSON.parse(mess.data)); var obj=JSON.parse(mess.data); if(obj.type!="counter"){ if(obj.id*1<=localStorage.getItem("last-notice-id")){ }else{ localStorage.setItem("last-notice-id",obj.id) var show=true; if(obj.toot!=""){ var toot=''; }else{ var toot=""; } if(obj.ver!=""){ if(obj.ver==ver){ show=true; }else{ show=false; } } if(obj.domain!=""){ var multi = localStorage.getItem("multi"); if (multi) { show=false; var accts = JSON.parse(multi); Object.keys(accts).forEach(function(key) { var acct = accts[key]; if(acct.domain==obj.domain){ show=true; } }); } } if(show){ Materialize.toast(obj.text+toot+'(スライドして消去)', 86400); } } }else{ $("#persons").text(obj.text); } } infows.onerror = function(error) { console.error("Error closing:info"); console.error(error); return false; }; infows.onclose = function() { console.error("Closing:info"); }; }