Commit be879e67 authored by Ahoy's avatar Ahoy

Trailer

parent fff1980c
Pipeline #39431983 passed with stages
in 1 minute and 3 seconds
...@@ -203,22 +203,22 @@ ...@@ -203,22 +203,22 @@
</span> </span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">moonwalk</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">moonwalk</span><span class="attr-name">&quot;</span>
<span class="comment"> - плеер moonwalk.cc</span> <span class="comment"> - плеер с moonwalk.cc</span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">hdgo</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">hdgo</span><span class="attr-name">&quot;</span>
<span class="comment"> - плеер hdgo.cc</span> <span class="comment"> - плеер с hdgo.cc</span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">iframe</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">iframe</span><span class="attr-name">&quot;</span>
<span class="comment"> - плеер iframe.video</span> <span class="comment"> - плеер с iframe.video</span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">hdbaza</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">hdbaza</span><span class="attr-name">&quot;</span>
<span class="comment"> - плеер hdbaza.com</span> <span class="comment"> - плеер с hdbaza.com</span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">kodik</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">kodik</span><span class="attr-name">&quot;</span>
<span class="comment"> - плеер kodik.cc</span> <span class="comment"> - плеер с kodik.cc</span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">vodlocker</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">vodlocker</span><span class="attr-name">&quot;</span>
<span class="comment"> - плеер api.vodlocker.to</span> <span class="comment"> - плеер с api.vodlocker.to</span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">trailer</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">trailer</span><span class="attr-name">&quot;</span>
<span class="comment"> - трейлер с YouTube</span> <span class="comment"> - трейлер с YouTube</span>
...@@ -227,7 +227,32 @@ ...@@ -227,7 +227,32 @@
<span class="comment"> - список торрентов</span> <span class="comment"> - список торрентов</span>
<br> <br>
<span class="attr-name">data-player=&quot;</span><span class="attr-value">moonwalk,hdgo,iframe</span><span class="attr-name">&quot;</span> <span class="attr-name">data-player=&quot;</span><span class="attr-value">moonwalk,hdgo,iframe</span><span class="attr-name">&quot;</span>
<span class="comment"> - можно указывать несколько источников, через запятую</span> <span class="comment"> - несколько источников плееров, через разделитель <span class="attr-name">data-separator</span></span>
</div>
<div class="code">
<span class="comment">
Параметр <span class="attr-name">data-trailer</span>
</span>
<br>
<span class="attr-name">data-trailer=&quot;</span><span class="attr-value">moonwalk</span><span class="attr-name">&quot;</span>
<span class="comment"> - трейлер с moonwalk.cc</span>
<br>
<span class="attr-name">data-trailer=&quot;</span><span class="attr-value">hdgo</span><span class="attr-name">&quot;</span>
<span class="comment"> - трейлер с hdgo.cc</span>
<br>
<span class="attr-name">data-trailer=&quot;</span><span class="attr-value">youtube</span><span class="attr-name">&quot;</span>
<span class="comment"> - трейлер с YouTube</span>
<br>
<span class="attr-name">data-trailer=&quot;</span><span class="attr-value">youtube,moonwalk,hdgo</span><span class="attr-name">&quot;</span>
<span class="comment"> - приоритетный порядок источников трейлеров, через разделитель <span class="attr-name">data-separator</span></span>
</div>
<div class="code">
<span class="comment">
Параметр <span class="attr-name">data-separator</span>
</span>
<br>
<span class="attr-name">data-separator=&quot;</span><span class="attr-value">,</span><span class="attr-name">&quot;</span>
<span class="comment"> - кастомный разделитель списка</span>
</div> </div>
<div class="code"> <div class="code">
<span class="comment"> <span class="comment">
...@@ -253,14 +278,6 @@ ...@@ -253,14 +278,6 @@
<span class="attr-name">data-button_limit=&quot;</span><span class="attr-value">5</span><span class="attr-name">&quot;</span> <span class="attr-name">data-button_limit=&quot;</span><span class="attr-value">5</span><span class="attr-name">&quot;</span>
<span class="comment"> - максимальное число кнопок</span> <span class="comment"> - максимальное число кнопок</span>
</div> </div>
<div class="code">
<span class="comment">
Параметр <span class="attr-name">data-separator</span>
</span>
<br>
<span class="attr-name">data-separator=&quot;</span><span class="attr-value">|</span><span class="attr-name">&quot;</span>
<span class="comment"> - кастомный разделитель плееров</span>
</div>
<div class="code"> <div class="code">
<span class="comment"> <span class="comment">
Параметр <span class="attr-name">data-autoplay</span> Параметр <span class="attr-name">data-autoplay</span>
......
...@@ -2,17 +2,18 @@ document.addEventListener('DOMContentLoaded', ahoy_yo); ...@@ -2,17 +2,18 @@ document.addEventListener('DOMContentLoaded', ahoy_yo);
document.addEventListener('keydown', ahoy_key); document.addEventListener('keydown', ahoy_key);
function ahoy_key(event) { function ahoy_key(event) {
if (!event || !event.keyCode) return; if (!event || (!event.key && !event.keyCode)) return;
var key='';'Left'===event.key||'ArrowLeft'===event.key||37===event.keyCode?key='prev':'Right'===event.key||'ArrowRight'===event.key||39===event.keyCode?key='next':'0'===event.key||48===event.keyCode?key='0':'1'===event.key||49===event.keyCode?key='1':'2'===event.key||50===event.keyCode?key='2':'3'===event.key||51===event.keyCode?key='3':'4'===event.key||52===event.keyCode?key='4':'5'===event.key||53===event.keyCode?key='5':'6'===event.key||54===event.keyCode?key='6':'7'===event.key||55===event.keyCode?key='7':'8'===event.key||56===event.keyCode?key='8':'9'!==event.key&&57!==event.keyCode||(key='9');
var e = document.querySelectorAll('[data-event]'); var e = document.querySelectorAll('[data-event]');
if (e && e.length) { if (e && e.length) {
for (var i = 0; i < e.length; i++) { for (var i = 0; i < e.length; i++) {
if (parseInt(e[i].dataset.event) === parseInt(event.keyCode) && if (e[i].dataset.event === key && typeof e[i].onclick === 'function') {
typeof e[i].onclick === 'function') {
e[i].onclick.apply(e[i]); e[i].onclick.apply(e[i]);
return; break;
} }
} }
} }
event.preventDefault();
} }
function ahoy_yo() { function ahoy_yo() {
...@@ -241,7 +242,7 @@ function yo(sel) { ...@@ -241,7 +242,7 @@ function yo(sel) {
: ''; : '';
var option = document.createElement('div'); var option = document.createElement('div');
option.setAttribute('onclick', 'showPlayer("' + encodeURIComponent(players[key].iframe) + '", "' + players[key].quality + '", "' + players[key].translate + '", this)'); option.setAttribute('onclick', 'showPlayer("' + encodeURIComponent(players[key].iframe) + '", "' + players[key].quality + '", "' + players[key].translate + '", this)');
option.dataset.event = '' + (j+49); option.dataset.event = '' + (j+1);
option.dataset.page = Math.ceil((j+1)/options.button_limit) + ''; option.dataset.page = Math.ceil((j+1)/options.button_limit) + '';
option.dataset.iframe = players[key].iframe; option.dataset.iframe = players[key].iframe;
option.dataset.quality = players[key].quality; option.dataset.quality = players[key].quality;
...@@ -307,14 +308,14 @@ function yo(sel) { ...@@ -307,14 +308,14 @@ function yo(sel) {
if (j && !(j % options.button_limit) && keys[i+1]) { if (j && !(j % options.button_limit) && keys[i+1]) {
var next = document.createElement('div'); var next = document.createElement('div');
next.setAttribute('onclick', 'showPage(' + Math.ceil((j+1)/options.button_limit) + ')'); next.setAttribute('onclick', 'showPage(' + Math.ceil((j+1)/options.button_limit) + ')');
next.dataset.keyCode = '39'; next.dataset.event = 'next';
next.dataset.page = Math.ceil(j/options.button_limit) + ''; next.dataset.page = Math.ceil(j/options.button_limit) + '';
next.innerText = '-► ' + language.next; next.innerText = '-► ' + language.next;
buttons.appendChild(next); buttons.appendChild(next);
var prev = document.createElement('div'); var prev = document.createElement('div');
prev.setAttribute('onclick', 'showPage(' + Math.ceil(j/options.button_limit) + ')'); prev.setAttribute('onclick', 'showPage(' + Math.ceil(j/options.button_limit) + ')');
prev.dataset.event = '37'; prev.dataset.event = 'prev';
prev.dataset.page = Math.ceil((j+1)/options.button_limit) + ''; prev.dataset.page = Math.ceil((j+1)/options.button_limit) + '';
prev.innerText = '◄- ' + language.prev; prev.innerText = '◄- ' + language.prev;
buttons.appendChild(prev); buttons.appendChild(prev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment