parent
16d1ddf293
commit
999f494a0c
9 changed files with 72 additions and 75 deletions
@ -1,6 +0,0 @@ |
|||||||
{% load static %} |
|
||||||
<div id="main-video-ended-popup" class="video-ended-popup js-popup-video-ended" data-manual-close="1"> |
|
||||||
<div class="video-ended__body"> |
|
||||||
Отправь другу реферальную ссылку, пригласи учиться вместе и получи лилики на свой бонусный счёт! |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 93 KiB |
@ -1,21 +1,28 @@ |
|||||||
export const rupluralize = (value, args, addValue=true) => { |
export const rupluralize = (value, args, addValue = true) => { |
||||||
let digit = Math.trunc(value) + ''; |
let digit = Math.trunc(value) + ''; |
||||||
digit = digit[digit.length - 1]; |
digit = digit[digit.length - 1]; |
||||||
return (addValue ? value + ' ' : '') + |
return (addValue ? value + ' ' : '') + |
||||||
args[(+value > 10 && +value < 20) |
args[(+value > 10 && +value < 20) |
||||||
? 2 |
? 2 |
||||||
: (digit == '1' ? 0 : ('234'.search(digit) > -1 ? 1 : 2))]; |
: (digit == '1' ? 0 : ('234'.search(digit) > -1 ? 1 : 2))]; |
||||||
} |
}; |
||||||
|
|
||||||
export const loadScript = (url, onload) => { |
export const loadScript = (url, onload) => { |
||||||
for(const script of document.getElementsByTagName('script')){ |
return new Promise(function (resolve, reject) { |
||||||
if(script.url == url){ |
for (const script of document.getElementsByTagName('script')) { |
||||||
onload && onload(); |
if (script.src == url) { |
||||||
return; |
onload && onload(); |
||||||
} |
resolve(); |
||||||
|
return; |
||||||
|
} |
||||||
} |
} |
||||||
const script = document.createElement('script'); |
const script = document.createElement('script'); |
||||||
document.body.appendChild(script) |
script.async = true; |
||||||
script.onload = onload; |
document.body.appendChild(script); |
||||||
script.url = url;; |
script.onload = function () { |
||||||
} |
onload && onload.apply(this, arguments); |
||||||
|
resolve.apply(this, arguments); |
||||||
|
} |
||||||
|
script.src = url; |
||||||
|
}); |
||||||
|
}; |
||||||
|
|||||||
Loading…
Reference in new issue