diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-09-17 20:30:05 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-09-17 20:32:39 +0200 |
commit | 50dc8148259f6c36890c29d4b6f487a85ff7efa1 (patch) | |
tree | 3774c52cdfbdc2d2ee4217ad34c486a8610d4609 /ishtar_common/static | |
parent | 5f5c04ca650f1fab14f12e3c4ba0e5e73d07eeef (diff) | |
download | Ishtar-50dc8148259f6c36890c29d4b6f487a85ff7efa1.tar.bz2 Ishtar-50dc8148259f6c36890c29d4b6f487a85ff7efa1.zip |
Admin: force bootstrap load of ajax_select (removed in debian package)
Diffstat (limited to 'ishtar_common/static')
-rw-r--r-- | ishtar_common/static/ajax_select/js/bootstrap.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ishtar_common/static/ajax_select/js/bootstrap.js b/ishtar_common/static/ajax_select/js/bootstrap.js new file mode 100644 index 000000000..cb742eaa9 --- /dev/null +++ b/ishtar_common/static/ajax_select/js/bootstrap.js @@ -0,0 +1,30 @@ +(function(w) { + /** + * load jquery and jquery-ui if needed + */ + + function not(thing) { + return typeof thing === 'undefined'; + } + + function loadJS(src) { + document.write('<script type="text/javascript" src="' + src + '"><\/script>'); + } + + function loadCSS(href) { + var script = document.createElement('link'); + script.href = href; + script.type = 'text/css'; + script.rel = 'stylesheet'; + document.head.appendChild(script); + } + + if (not(w.jQuery)) { + loadJS('//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'); + } + + if (not(w.jQuery) || not(w.jQuery.ui) || not(w.jQuery.ui.autocomplete)) { + loadJS('//code.jquery.com/ui/1.10.3/jquery-ui.js'); + loadCSS('//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css'); + } +})(window); |