add global hooks for autocomplete functions #3795

This commit is contained in:
Albert Yi
2018-08-03 16:02:09 -07:00
parent 477a5a8ac3
commit cffb08a4b6
3 changed files with 42 additions and 9 deletions

View File

@@ -138,6 +138,18 @@ Utility.sorttable = function(table) {
});
};
Utility.is_global_hook_defined = function(path) {
let objs = path.split(/\./g);
let obj = window;
objs.forEach(x => {
if (obj) {
obj = obj[x]
}
});
return typeof obj === 'function';
}
String.prototype.hash = function() {
var hash = 5381, i = this.length;