|
|
|
@ -9,13 +9,6 @@ export const rupluralize = (value, args, addValue = true) => { |
|
|
|
|
|
|
|
|
|
|
|
export const loadScript = (url, onload) => { |
|
|
|
export const loadScript = (url, onload) => { |
|
|
|
return new Promise(resolve => { |
|
|
|
return new Promise(resolve => { |
|
|
|
for (let script of document.getElementsByTagName('script')) { |
|
|
|
|
|
|
|
if (script.src == url) { |
|
|
|
|
|
|
|
onload && onload(); |
|
|
|
|
|
|
|
resolve(); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const script = document.createElement('script'); |
|
|
|
const script = document.createElement('script'); |
|
|
|
script.async = true; |
|
|
|
script.async = true; |
|
|
|
document.body.appendChild(script); |
|
|
|
document.body.appendChild(script); |
|
|
|
|