Commit eedfe57f authored by Ahoy's avatar Ahoy

loading

parent 78453e90
Pipeline #158332796 passed with stages
in 40 seconds
......@@ -440,6 +440,40 @@
<span class="attr-name">data-param_ustore=&quot;</span><span class="attr-value">one=1&two=2</span><span class="attr-name">&quot;</span>
<span class="comment"> - добавочные параметры к iframe</span>
</div>
<div class="code">
<span class="comment">
Параметр <span class="attr-name">data-loading</span>
</span>
<br>
<span class="attr-name">data-loading=&quot;</span><span class="attr-value">data:image/svg+xml;base64,PH...</span><span class="attr-name">&quot;</span>
<span class="comment"> - url/base64 анимации загрузки (loading.io)</span>
</div>
<div class="code">
<span class="comment">
Запрос на URL
</span>
<br>
<span class="attr-name">data-url=&quot;</span><span class="attr-value">https://ahoy.example.com</span><span class="attr-name">&quot;</span>
<span class="comment">
Результат запроса в формате JSON
</span>
<br>
&nbsp;&nbsp;<span class="tag">{</span>
<span class="attr-name">
<br>&nbsp;&nbsp;&nbsp;&nbsp;"Плеер 1": <span class="tag">{</span>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"iframe": "<span class="attr-value">https://player1.com/video</span>"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"translate": "<span class="attr-value">RU</span>"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"quality": "<span class="attr-value">HD</span>"
<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">}</span>,
<br>&nbsp;&nbsp;&nbsp;&nbsp;"Плеер 2": <span class="tag">{</span>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"iframe": "<span class="attr-value">https://player2.com/video</span>"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"translate": "<span class="attr-value">EN</span>"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"quality": "<span class="attr-value">HD</span>"
<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="tag">}</span>
</span>
<br>
&nbsp;&nbsp;<span class="tag">}</span>
</div>
<div class="code">
<span class="comment">
Отобразить качество и перевод на странице
......
......@@ -98,6 +98,16 @@ function yo(self) {
? options.bg.replace(/[^0-9a-z]/ig, '')
: '2A3440';
var options_url = options.url
? decodeURIComponent(options.url).trim() + (decodeURIComponent(options.url).indexOf('?')+1 ? '&' : '?') + 'cache' + Math.random().toString().substr(2, 3)
: 'https://ahoy.yohoho.' + tld + '?cache' + Math.random().toString().substr(2, 3);
options.url = null;
var options_loading = options.loading
? decodeURIComponent(options.loading).trim()
: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJ1aWwtc3BpcmFsIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgY2xhc3M9ImJrIiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTU0LjUgODkuOWMtOS42IDAtMTguNi0zLjktMjUuNC0xMSAtNi44LTcuMS0xMC41LTE2LjYtMTAuNS0yNi43IDAtOC45IDMuMy0xNy4yIDkuMi0yMy41UzQxLjcgMTkgNTAuMiAxOWM4LjQgMCAxNi40IDMuNCAyMi4zIDkuNyA2IDYuMyA5LjIgMTQuNiA5LjIgMjMuNSAwIDE1LjgtMTIuMiAyOC43LTI3LjMgMjguNyAtMTUgMC0yNy4zLTEyLjktMjcuMy0yOC43IDAtMTMuMyAxMC4zLTI0LjIgMjMtMjQuMnMyMyAxMC44IDIzIDI0LjJjMCAxMC44LTguNCAxOS42LTE4LjcgMTkuNiAtMTAuMyAwLTE4LjctOC44LTE4LjctMTkuNiAwLTguMyA2LjUtMTUuMSAxNC40LTE1LjEgNy45IDAgMTQuNCA2LjggMTQuNCAxNS4xIDAgNS44LTQuNSAxMC42LTEwLjEgMTAu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5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgZnJvbT0iMCA1MCA1MCIgdG89IjM2MCA1MCA1MCIgZHVyPSIxcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz48L3BhdGg+PC9zdmc+';
options.loading = null;
var language = (options.language && !/ru/i.test(options.language))
? {"trailer":"TRAILER","torrent":"DOWNLOAD","next":"NEXT","prev":"PREV"}
: {"trailer":"ТРЕЙЛЕР","torrent":"СКАЧАТЬ","next":"ВПЕРЕД","prev":"НАЗАД"};
......@@ -171,7 +181,7 @@ function yo(self) {
}
var head = document.head || document.getElementsByTagName('head')[0];
var css = '#yohoho-loading{z-index:9999;position:absolute;left:0;top:0;width:100%;height:100%;background:#' + bg + ' url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJ1aWwtc3BpcmFsIj48cmVjdCB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgY2xhc3M9ImJrIiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTU0LjUgODkuOWMtOS42IDAtMTguNi0zLjktMjUuNC0xMSAtNi44LTcuMS0xMC41LTE2LjYtMTAuNS0yNi43IDAtOC45IDMuMy0xNy4yIDkuMi0yMy41UzQxLjcgMTkgNTAuMiAxOWM4LjQgMCAxNi40IDMuNCAyMi4zIDkuNyA2IDYuMyA5LjIgMTQuNiA5LjIgMjMuNSAwIDE1LjgtMTIuMiAyOC43LTI3LjMgMjguNyAtMTUgMC0yNy4zLTEyLjktMjcuMy0yOC43IDAtMTMuMyAxMC4zLTI0LjIgMjMtMjQuMnMyMyAxMC44IDIzIDI0LjJjMCAxM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MC43IDAgMjAuOCA0LjQgMjguNCAxMi40IDcuNiA4IDExLjggMTguNiAxMS44IDI5LjkgMCAxMC4xLTMuNyAxOS41LTEwLjUgMjYuN0M3My4xIDg2IDY0LjEgODkuOSA1NC41IDg5Ljl6IiBmaWxsPSIjZmZmIj48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgZnJvbT0iMCA1MCA1MCIgdG89IjM2MCA1MCA1MCIgZHVyPSIxcyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiLz48L3BhdGg+PC9zdmc+) 50% 50% no-repeat}#yohoho-buttons{position:absolute;z-index:9999;right:0;top:50px;text-align:left}#yohoho-buttons:hover{right:0!important}#yohoho-buttons div{font-family:Verdana,sans-serif;font-weight:normal;text-shadow:none;line-height:normal;font-size:' + 12 * options.button_size + 'px;color:#fff;background:#' + bg + ';border-radius:5px 0 0 5px;padding:5px;margin:5px 0 5px 5px;opacity:.7;}#yohoho-buttons div:hover,#yohoho-buttons div.yohoho-active{color:#fff;background:#' + bg + ';cursor:pointer;opacity:1}';
var css = '#yohoho-loading{z-index:9999;position:absolute;left:0;top:0;width:100%;height:100%;background:#' + bg + ' url(' + options_loading + ') 50% 50% no-repeat}#yohoho-buttons{position:absolute;z-index:9999;right:0;top:50px;text-align:left}#yohoho-buttons:hover{right:0!important}#yohoho-buttons div{font-family:Verdana,sans-serif;font-weight:normal;text-shadow:none;line-height:normal;font-size:' + 12 * options.button_size + 'px;color:#fff;background:#' + bg + ';border-radius:5px 0 0 5px;padding:5px;margin:5px 0 5px 5px;opacity:.7;}#yohoho-buttons div:hover,#yohoho-buttons div.yohoho-active{color:#fff;background:#' + bg + ';cursor:pointer;opacity:1}';
s = document.createElement('style');
s.type = 'text/css';
if (s.styleSheet) {
......@@ -231,7 +241,7 @@ function yo(self) {
i.setAttribute('height', h);
yohoho.setAttribute('style', style);
yo_get('https://ahoy.yohoho.' + tld + '?cache' + Math.random().toString().substr(2, 3), p,
yo_get(options_url, p,
function (players) {
var first = true;
var buttons = document.createElement('div');
......
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