From eeb885d3d04a194069a293ec951eba8e77cd5b75 Mon Sep 17 00:00:00 2001 From: cajus Date: Sun, 14 Mar 2010 15:54:43 +0000 Subject: [PATCH] Removed image references git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16505 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/goto/addons/goto/deploy-list.tpl | 45 ++++++++++--------- gosa-plugins/goto/addons/goto/gotomasses.tpl | 19 +++++--- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/gosa-plugins/goto/addons/goto/deploy-list.tpl b/gosa-plugins/goto/addons/goto/deploy-list.tpl index c12f6bb80..5d6460f41 100644 --- a/gosa-plugins/goto/addons/goto/deploy-list.tpl +++ b/gosa-plugins/goto/addons/goto/deploy-list.tpl @@ -66,18 +66,17 @@ function loadContent() /* Create array of available progress images once */ if(!fai_status.length){ - for (var i = 0; i < document.images.length; i++) { - var img = document.images[i]; - var id = img.id; - if(id.match(/^progress_/)){ - var mac = id.replace(/^progress_/,''); - mac = mac.replace(/_/g,':'); - fai_status[c] = new Object(); - fai_status[c]['MAC'] = mac; - fai_status[c]['PROGRESS'] = -1; - c ++; - } - } + var progressBars= Form.getElements("mainform"); + progressBars.each(function(progressBar) { + if(progressBar.id.match(/^progress_/)){ + var mac = id.replace(/^progress_/,''); + mac = mac.replace(/_/g,':'); + fai_status[c] = new Object(); + fai_status[c]['MAC'] = mac; + fai_status[c]['PROGRESS'] = -1; + c ++; + } + } } /* Create string of macs used as parameter for getFAIstatus.php @@ -115,16 +114,13 @@ function handleContent() mac and progress value */ var found = false; - /* Create object id out of mac address - 12:34:56:12:34:56 => progress_12_34_56_12_34_56 - */ + /* Create object id out of mac address 12:34:56:12:34:56 => progress_12_34_56_12_34_56 */ var id = fai_status[e]["MAC"].replace(/:/g,"_"); id = "progress_" + id; - var img = document.getElementById(id); + var progressBar = document.getElementById(id); - /* Continue if there is no image object iwth this id - */ - if(!img){ + /* Continue if there is no image object iwth this id */ + if(!progressBar){ continue; } @@ -140,8 +136,15 @@ function handleContent() /* Check if progress has changed */ if(fai_status[e]["PROGRESS"] != progress){ - img.src = "progress.php?x=80&y=13&p=" + progress; - fai_status[e]["PROGRESS"] = progress; + var woffset= Math.floor(0.85 * (100-progress)); + + progressBar.setStyle({ + -moz-box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)", + -webkit-box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)", + box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)" + }); + fai_status[e]["PROGRESS"] = progress; + } break; } diff --git a/gosa-plugins/goto/addons/goto/gotomasses.tpl b/gosa-plugins/goto/addons/goto/gotomasses.tpl index b4476a444..df3c9a364 100644 --- a/gosa-plugins/goto/addons/goto/gotomasses.tpl +++ b/gosa-plugins/goto/addons/goto/gotomasses.tpl @@ -43,10 +43,9 @@ function loadContent() /* Create array of available progress images once */ if(!fai_status.length){ - for (var i = 0; i < document.images.length; i++) { - var img = document.images[i]; - var id = img.id; - if(id.match(/^progress_/)){ + var progressBars= Form.getElements("mainform"); + progressBars.each(function(progressBar) { + if(progressBar.id.match(/^progress_/)){ var mac = id.replace(/^progress_/,''); mac = mac.replace(/_/g,':'); fai_status[c] = new Object(); @@ -97,11 +96,11 @@ function handleContent() */ var id = fai_status[e]["MAC"].replace(/:/g,"_"); id = "progress_" + id; - var img = document.getElementById(id); + var progressBar = document.getElementById(id); /* Continue if there is no image object iwth this id */ - if(!img){ + if(!progressBar){ continue; } @@ -117,7 +116,13 @@ function handleContent() /* Check if progress has changed */ if(fai_status[e]["PROGRESS"] != progress){ - img.src = "progress.php?x=80&y=13&p=" + progress; + var woffset= Math.floor(0.85 * (100-progress)); + + progressBar.setStyle({ + -moz-box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)", + -webkit-box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)", + box-shadow: "0 0 2px rgba(255, 255, 255, 0.4) inset, 0 4px 6px rgba(255, 255, 255, 0.4) inset, 0 10px 0 -2px rgba(255, 255, 255, 0.2) inset, -" + woffset + "px 0 0 -2px rgba(255, 255, 255, 0.2) inset, -" + (woffset+1) + "px 0 0 -2px rgba(0, 0, 0, 0.6) inset, 0pt 11px 8px rgba(0, 0, 0, 0.3) inset, 0pt 1px 0px rgba(0, 0, 0, 0.2)" + }); fai_status[e]["PROGRESS"] = progress; } break; -- 2.30.2