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) => { |
||||
let digit = Math.trunc(value) + ''; |
||||
digit = digit[digit.length - 1]; |
||||
return (addValue ? value + ' ' : '') + |
||||
args[(+value > 10 && +value < 20) |
||||
? 2 |
||||
: (digit == '1' ? 0 : ('234'.search(digit) > -1 ? 1 : 2))]; |
||||
} |
||||
export const rupluralize = (value, args, addValue = true) => { |
||||
let digit = Math.trunc(value) + ''; |
||||
digit = digit[digit.length - 1]; |
||||
return (addValue ? value + ' ' : '') + |
||||
args[(+value > 10 && +value < 20) |
||||
? 2 |
||||
: (digit == '1' ? 0 : ('234'.search(digit) > -1 ? 1 : 2))]; |
||||
}; |
||||
|
||||
export const loadScript = (url, onload) => { |
||||
for(const script of document.getElementsByTagName('script')){ |
||||
if(script.url == url){ |
||||
onload && onload(); |
||||
return; |
||||
} |
||||
return new Promise(function (resolve, reject) { |
||||
for (const script of document.getElementsByTagName('script')) { |
||||
if (script.src == url) { |
||||
onload && onload(); |
||||
resolve(); |
||||
return; |
||||
} |
||||
} |
||||
const script = document.createElement('script'); |
||||
document.body.appendChild(script) |
||||
script.onload = onload; |
||||
script.url = url;; |
||||
} |
||||
script.async = true; |
||||
document.body.appendChild(script); |
||||
script.onload = function () { |
||||
onload && onload.apply(this, arguments); |
||||
resolve.apply(this, arguments); |
||||
} |
||||
script.src = url; |
||||
}); |
||||
}; |
||||
|
||||
Loading…
Reference in new issue