diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-20 14:46:11 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-08-20 14:46:11 +0000 |
commit | 469d17e7d448ec1833abb72add88d1d1f61c4a06 (patch) | |
tree | 4a21e42405a82385c87981d5f2199e388a964272 /frontends/php/js/json.js | |
parent | 155fa1457186f7ffa453ba7bf68ae0c22387746b (diff) | |
download | zabbix-master.tar.gz zabbix-master.tar.xz zabbix-master.zip |
- [DEV-137] many small fixes (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5932 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/js/json.js')
-rw-r--r-- | frontends/php/js/json.js | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/frontends/php/js/json.js b/frontends/php/js/json.js deleted file mode 100644 index 162b959b..00000000 --- a/frontends/php/js/json.js +++ /dev/null @@ -1,105 +0,0 @@ -// JavaScript Document -function callJSON(){ -// json.clean(); - json.createScript('dashboard.php?output=json'); - json.buildAll(); - json.addAll(); -} - -var json = { -scripts: new Array(), // array of existing scripts id's -nextId: 1, // id of next script tag - -head: '', // DOM Head obj - -initialize: function(){ - this.head = document.getElementsByTagName("head").item(0); -}, - -callBack: function(){ - if(this.callBack.arguments.length > 0) - alert(this.callBack.arguments[0]) - else - alert('callBack!'); -}, - -onetime: function(url){ - var onetimeid; - onetimeid = this.createScript(url); - this.buildScript(onetimeid); - this.addScript(onetimeid); -}, - -createScript: function(url){ - this.scripts[this.nextId] = { - 'id': this.nextId, - 'fullurl': url+'&jsscriptid='+this.nextId, - 'noCacheIE': '&noCacheIE=' + (new Date()).getTime(), - 'scriptId': 'JscriptId' + this.nextId, - 'status': 1 - }; -//SDI('create:' + this.nextId); - this.nextId++; -return (this.nextId-1); -}, - -buildScript: function(id){ - if((typeof(id) != 'undefined')){ - if((typeof(this.scripts[id]) != 'undefined') && !empty(this.scripts[id]) && (this.scripts[id].status == 1)){ - var scriptObj = document.createElement("script"); - - // Add script object attributes - scriptObj.setAttribute("type", "text/javascript"); - scriptObj.setAttribute("charset", "utf-8"); - - scriptObj.setAttribute("src", this.scripts[id].fullurl+this.scripts[id].noCacheIE); - - scriptObj.setAttribute("id", this.scripts[id].scriptId); - - this.scripts[id].scriptObj = scriptObj; - this.scripts[id].status = 2; - } - } -}, - -buildAll: function() { - for(var i=1; i < this.nextId; i++){ - this.buildScript(i); - } -}, - -addScript: function(id){ - if((typeof(id) != 'undefined')){ - if((typeof(this.scripts[id]) != 'undefined') && !empty(this.scripts[id]) && (this.scripts[id].status == 2)){ - this.head.appendChild(this.scripts[id].scriptObj); - this.scripts[id].status = 3; - } - } -}, - -addAll: function(){ - for(var i=1; i < this.nextId; i++){ - this.addScript(i); - } -}, - -removeScript: function(id){ - if((typeof(id) != 'undefined')){ - if((typeof(this.scripts[id]) != 'undefined') && !empty(this.scripts[id]) && (this.scripts[id].status == 3)){ -//SDI('remove:'+this.scripts[id].scriptId); - this.head.removeChild(this.scripts[id].scriptObj); - this.scripts[id] = null; - } - } -}, - -clean: function(){ - for(var i=1; i < this.nextId; i++){ - this.removeScript(i); - } - this.scripts = new Array(); - this.nextId = 1; -} -} - -json.initialize();
\ No newline at end of file |