diff options
| author | RblSb <msrblsb@gmail.com> | 2020-04-06 21:47:29 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-04-06 21:47:29 +0300 |
| commit | 4c955af4c4be0d3c1d002a867c89166811373a9f (patch) | |
| tree | 06f7e23824b976f5c7b5907fa64e06321f1810d0 /res | |
| parent | bda198c729ba65905bc34d15b44eb51f8336a8ff (diff) | |
Skip item confirmation for touch
Diffstat (limited to 'res')
| -rw-r--r-- | res/client.js | 11 | ||||
| -rw-r--r-- | res/langs/en.json | 1 | ||||
| -rw-r--r-- | res/langs/ru.json | 1 |
3 files changed, 10 insertions, 3 deletions
diff --git a/res/client.js b/res/client.js index 32eb424..68064e2 100644 --- a/res/client.js +++ b/res/client.js @@ -648,8 +648,7 @@ client_Buttons.onVideoResize = function() { window.document.querySelector("#userlist").style.height = "" + height + "px"; }; client_Buttons.onClick = function(el,func) { - var isTouch = 'ontouchstart' in window; - if(!isTouch) { + if(!client_Utils.isTouch()) { el.onclick = func; } else { el.ontouchend = func; @@ -907,6 +906,9 @@ client_Main.prototype = { return; }; window.document.querySelector("#voteskip").onclick = function(e1) { + if(client_Utils.isTouch() && !window.confirm(Lang.get("skipItemConfirm"))) { + return; + } if(_gthis.player.isListEmpty()) { return; } @@ -1070,7 +1072,7 @@ client_Main.prototype = { var data = JSON.parse(e.data); var t = data.type; var t1 = t.charAt(0).toLowerCase() + HxOverrides.substr(t,1,null); - haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 299, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]}); + haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 300, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]}); switch(data.type) { case "AddVideo": this.player.addVideoItem(data.addVideo.item,data.addVideo.atEnd); @@ -1931,6 +1933,9 @@ client_Settings.write = function(data) { }; var client_Utils = function() { }; client_Utils.__name__ = true; +client_Utils.isTouch = function() { + return 'ontouchstart' in window; +}; client_Utils.prepend = function(parent,child) { if(parent.firstChild == null) { parent.appendChild(child); diff --git a/res/langs/en.json b/res/langs/en.json index 955d0c2..3524b15 100644 --- a/res/langs/en.json +++ b/res/langs/en.json @@ -67,6 +67,7 @@ "acceptableEmbedCodesAre": "Acceptable embed codes are", "customEmbedsCannotBeSynchronized": "CUSTOM EMBEDS CANNOT BE SYNCHRONIZED", "save": "Save", + "skipItemConfirm": "Are you sure you want to skip current video?", "clearPlaylistConfirm": "Are you sure you want to clear the playlist?", "shufflePlaylistConfirm": "Are you sure you want to shuffle the playlist?", diff --git a/res/langs/ru.json b/res/langs/ru.json index 6e6b15e..8297c36 100644 --- a/res/langs/ru.json +++ b/res/langs/ru.json @@ -67,6 +67,7 @@ "acceptableEmbedCodesAre": "Можно добавить видео с тегами", "customEmbedsCannotBeSynchronized": "СИНХРОНИЗАЦИЯ БУДЕТ НЕДОСТУПНА", "save": "Сохранить", + "skipItemConfirm": "Вы уверены что хотите пропустить текущее видео?", "clearPlaylistConfirm": "Вы уверены что хотите очистить плейлист?", "shufflePlaylistConfirm": "Вы уверены что хотите перемешать плейлист?", |
