| 1 |
let __tagembedLoaderImageCustomPath = "https://cdn.tagembed.com/libraries/loader/images/loader.gif"; |
| 2 |
if (typeof TAGEMBED_PLUGIN_URL_JS != "undefined") { |
| 3 |
__tagembedLoaderImageCustomPath = TAGEMBED_PLUGIN_URL_JS + 'assets/images/loader.gif'; |
| 4 |
} |
| 5 |
function __tagembed__open_loader(text = '', loaderImage = '') { |
| 6 |
text = (text) ? text : 'Please Wait...'; |
| 7 |
loaderImage = (loaderImage) ? loaderImage : __tagembedLoaderImageCustomPath; |
| 8 |
document.body.style.cursor = "wait"; |
| 9 |
let elem = document.createElement('div'); |
| 10 |
elem.innerHTML = '<div id="__tagembed__loader" class="__tagembed__loader-overlay"><div class="__tagembed__loader"><img src="' + loaderImage + '"/><br/>' + text + '</div></div>'; |
| 11 |
document.body.appendChild(elem.firstChild); |
| 12 |
} |
| 13 |
function __tagembed__close_loader() { |
| 14 |
document.body.style.cursor = "auto"; |
| 15 |
let elem = document.querySelector('#__tagembed__loader'); |
| 16 |
elem.remove(); |
| 17 |
} |