remove useless stuff
This commit is contained in:
41
js/config.js
41
js/config.js
@@ -4,48 +4,9 @@
|
||||
if (typeof(window.MyApp) === 'undefined') {
|
||||
window.MyApp = {};
|
||||
}
|
||||
if (typeof(window.MyApp.config) === 'undefined') {
|
||||
window.MyApp.config = {};
|
||||
}
|
||||
|
||||
var config = {
|
||||
MyApp.config = {
|
||||
somePath: '/blabla/',
|
||||
someOtherGlobalConfig: 'https://...'
|
||||
};
|
||||
|
||||
Object.assign(MyApp.config, config);
|
||||
})();
|
||||
|
||||
|
||||
// for dev only
|
||||
jQuery.extend({
|
||||
getScript: function(url, callback) {
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var script = document.createElement('script');
|
||||
script.src = url;
|
||||
|
||||
// Handle Script loading
|
||||
{
|
||||
var done = false;
|
||||
|
||||
// Attach handlers for all browsers
|
||||
script.onload = script.onreadystatechange = function() {
|
||||
if (!done && (!this.readyState ||
|
||||
this.readyState == 'loaded' || this.readyState == 'complete')) {
|
||||
done = true;
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
|
||||
// Handle memory leak in IE
|
||||
script.onload = script.onreadystatechange = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
head.appendChild(script);
|
||||
|
||||
// We handle everything using the script element injection
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user