summaryrefslogtreecommitdiffstats
path: root/htdocs
diff options
context:
space:
mode:
authorTobi Oetiker <tobi@oetiker.ch>2007-08-20 07:59:44 +0200
committerTobi Oetiker <tobi@oetiker.ch>2007-08-20 07:59:44 +0200
commit80e63dbd61a1d431e4a338316a14a099cdea434b (patch)
tree42f68c642a5f42791f21985e961e4ecd5fd14264 /htdocs
parent3999a99132f2bc44c5e532dae3a89225944ca746 (diff)
downloadsmokeping-80e63dbd61a1d431e4a338316a14a099cdea434b.tar.gz
smokeping-80e63dbd61a1d431e4a338316a14a099cdea434b.tar.xz
finally working code on ie (although it looks quite bad) and firefox
Diffstat (limited to 'htdocs')
-rw-r--r--htdocs/js/jquery.dimensions.js12
-rw-r--r--htdocs/js/smokeping_zoom.js70
2 files changed, 48 insertions, 34 deletions
diff --git a/htdocs/js/jquery.dimensions.js b/htdocs/js/jquery.dimensions.js
new file mode 100644
index 0000000..967049a
--- /dev/null
+++ b/htdocs/js/jquery.dimensions.js
@@ -0,0 +1,12 @@
+/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ *
+ * $LastChangedDate: 2007-08-17 13:14:11 -0500 (Fri, 17 Aug 2007) $
+ * $Rev: 2759 $
+ *
+ * Version: 1.1.2
+ *
+ * Requires: jQuery 1.1.3+
+ */
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(9($){l e=$.1q.C,r=$.1q.r;$.1q.M({C:9(){3(!1[0])f();3(1[0]==p)3($.7.O||($.7.E&&U($.7.13)>11))6 n.19-(($(5).C()>n.19)?i():0);k 3($.7.E)6 n.19;k 6 $.I&&5.P.1E||5.o.1E;3(1[0]==5)6 1C.1y(($.I&&5.P.1w||5.o.1w),5.o.1u);6 e.1T(1,1P)},r:9(){3(!1[0])f();3(1[0]==p)3($.7.O||($.7.E&&U($.7.13)>11))6 n.1b-(($(5).r()>n.1b)?i():0);k 3($.7.E)6 n.1b;k 6 $.I&&5.P.1N||5.o.1N;3(1[0]==5)3($.7.1M){l a=n.1p;n.1a(27,n.1o);l b=n.1p;n.1a(a,n.1o);6 5.o.1c+b}k 6 1C.1y((($.I&&!$.7.E)&&5.P.1L||5.o.1L),5.o.1c);6 r.1T(1,1P)},19:9(){3(!1[0])f();6 1[0]==p||1[0]==5?1.C():1.14(\':N\')?1[0].1u-h(1,\'q\')-h(1,\'1I\'):1.C()+h(1,\'1h\')+h(1,\'1H\')},1b:9(){3(!1[0])f();6 1[0]==p||1[0]==5?1.r():1.14(\':N\')?1[0].1c-h(1,\'s\')-h(1,\'1F\'):1.r()+h(1,\'1v\')+h(1,\'1D\')},21:9(a){3(!1[0])f();a=$.M({A:w},a||{});6 1[0]==p||1[0]==5?1.C():1.14(\':N\')?1[0].1u+(a.A?(h(1,\'L\')+h(1,\'1x\')):0):1.C()+h(1,\'q\')+h(1,\'1I\')+h(1,\'1h\')+h(1,\'1H\')+(a.A?(h(1,\'L\')+h(1,\'1x\')):0)},1Y:9(a){3(!1[0])f();a=$.M({A:w},a||{});6 1[0]==p||1[0]==5?1.r():1.14(\':N\')?1[0].1c+(a.A?(h(1,\'K\')+h(1,\'1U\')):0):1.r()+h(1,\'s\')+h(1,\'1F\')+h(1,\'1v\')+h(1,\'1D\')+(a.A?(h(1,\'K\')+h(1,\'1U\')):0)},m:9(a){3(!1[0])f();3(a!=1S)6 1.1Q(9(){3(1==p||1==5)p.1a(a,$(p).u());k 1.m=a});3(1[0]==p||1[0]==5)6 n.1p||$.I&&5.P.m||5.o.m;6 1[0].m},u:9(a){3(!1[0])f();3(a!=1S)6 1.1Q(9(){3(1==p||1==5)p.1a($(p).m(),a);k 1.u=a});3(1[0]==p||1[0]==5)6 n.1o||$.I&&5.P.u||5.o.u;6 1[0].u},12:9(a){6 1.1O({A:w,J:w,v:1.z()},a)},1O:9(b,c){3(!1[0])f();l x=0,y=0,H=0,G=0,8=1[0],4=1[0],T,10,Z=$.D(8,\'12\'),F=$.7.1M,S=$.7.26,18=$.7.O,1n=$.7.E,R=$.7.E&&U($.7.13)>11,1m=w,1l=w,b=$.M({A:Q,15:w,1k:w,J:Q,1K:w,v:5.o},b||{});3(b.1K)6 1.1J(b,c);3(b.v.1j)b.v=b.v[0];3(8.B==\'Y\'){x=8.V;y=8.X;3(F){x+=h(8,\'K\')+(h(8,\'s\')*2);y+=h(8,\'L\')+(h(8,\'q\')*2)}k 3(18){x+=h(8,\'K\');y+=h(8,\'L\')}k 3((S&&1g.I)){x+=h(8,\'s\');y+=h(8,\'q\')}k 3(R){x+=h(8,\'K\')+h(8,\'s\');y+=h(8,\'L\')+h(8,\'q\')}}k{17{10=$.D(4,\'12\');x+=4.V;y+=4.X;3((F&&!4.B.1G(/^t[d|h]$/i))||S||R){x+=h(4,\'s\');y+=h(4,\'q\');3(F&&10==\'1i\')1m=Q;3(S&&10==\'25\')1l=Q}T=4.z||5.o;3(b.J||F){17{3(b.J){H+=4.m;G+=4.u}3(18&&($.D(4,\'24\')||\'\').1G(/23-22|20/)){H=H-((4.m==4.V)?4.m:0);G=G-((4.u==4.X)?4.u:0)}3(F&&4!=8&&$.D(4,\'1e\')!=\'N\'){x+=h(4,\'s\');y+=h(4,\'q\')}4=4.1B}W(4!=T)}4=T;3(4==b.v&&!(4.B==\'Y\'||4.B==\'1d\')){3(F&&4!=8&&$.D(4,\'1e\')!=\'N\'){x+=h(4,\'s\');y+=h(4,\'q\')}3(((1n&&!R)||18)&&10!=\'1r\'){x-=h(T,\'s\');y-=h(T,\'q\')}1A}3(4.B==\'Y\'||4.B==\'1d\'){3(((1n&&!R)||(S&&$.I))&&Z!=\'1i\'&&Z!=\'1z\'){x+=h(4,\'K\');y+=h(4,\'L\')}3(R||(F&&!1m&&Z!=\'1z\')||(S&&Z==\'1r\'&&!1l)){x+=h(4,\'s\');y+=h(4,\'q\')}1A}}W(4)}l a=j(8,b,x,y,H,G);3(c){$.M(c,a);6 1}k{6 a}},1J:9(b,c){3(!1[0])f();l x=0,y=0,H=0,G=0,4=1[0],z,b=$.M({A:Q,15:w,1k:w,J:Q,v:5.o},b||{});3(b.v.1j)b.v=b.v[0];17{x+=4.V;y+=4.X;z=4.z||5.o;3(b.J){17{H+=4.m;G+=4.u;4=4.1B}W(4!=z)}4=z}W(4&&4.B!=\'Y\'&&4.B!=\'1d\'&&4!=b.v);l a=j(1[0],b,x,y,H,G);3(c){$.M(c,a);6 1}k{6 a}},z:9(){3(!1[0])f();l a=1[0].z;W(a&&(a.B!=\'Y\'&&$.D(a,\'12\')==\'1r\'))a=a.z;6 $(a)}});l f=9(){1Z"1X: 1g 1W 14 1V";};l h=9(a,b){6 U($.D(a.1j?a[0]:a,b))||0};l j=9(a,b,x,y,d,c){3(!b.A){x-=h(a,\'K\');y-=h(a,\'L\')}3(b.15&&(($.7.E&&U($.7.13)<11)||$.7.O)){x+=h(a,\'s\');y+=h(a,\'q\')}k 3(!b.15&&!(($.7.E&&U($.7.13)<11)||$.7.O)){x-=h(a,\'s\');y-=h(a,\'q\')}3(b.1k){x+=h(a,\'1v\');y+=h(a,\'1h\')}3(b.J&&(!$.7.O||a.V!=a.m&&a.X!=a.m)){d-=a.m;c-=a.u}6 b.J?{1f:y-c,1t:x-d,u:c,m:d}:{1f:y,1t:x}};l g=0;l i=9(){3(!g){l a=$(\'<1s>\').D({r:16,C:16,1e:\'2d\',12:\'1i\',1f:-1R,1t:-1R}).2c(\'o\');g=16-a.2b(\'<1s>\').2a(\'1s\').D({r:\'16%\',C:29}).r();a.28()}6 g}})(1g);',62,138,'|this||if|parent|document|return|browser|elem|function|||||||||||else|var|scrollLeft|self|body|window|borderTopWidth|width|borderLeftWidth||scrollTop|relativeTo|false|||offsetParent|margin|tagName|height|css|safari|mo|st|sl|boxModel|scroll|marginLeft|marginTop|extend|visible|opera|documentElement|true|sf3|ie|op|parseInt|offsetLeft|while|offsetTop|BODY|elemPos|parPos|520|position|version|is|border|100|do|oa|innerHeight|scrollTo|innerWidth|offsetWidth|HTML|overflow|top|jQuery|paddingTop|absolute|jquery|padding|relparent|absparent|sf|pageYOffset|pageXOffset|fn|static|div|left|offsetHeight|paddingLeft|scrollHeight|marginBottom|max|fixed|break|parentNode|Math|paddingRight|clientHeight|borderRightWidth|match|paddingBottom|borderBottomWidth|offsetLite|lite|scrollWidth|mozilla|clientWidth|offset|arguments|each|1000|undefined|apply|marginRight|empty|collection|Dimensions|outerWidth|throw|inline|outerHeight|row|table|display|relative|msie|99999999|remove|200|find|append|appendTo|auto'.split('|'),0,{})) \ No newline at end of file
diff --git a/htdocs/js/smokeping_zoom.js b/htdocs/js/smokeping_zoom.js
index b9526d1..47ce067 100644
--- a/htdocs/js/smokeping_zoom.js
+++ b/htdocs/js/smokeping_zoom.js
@@ -78,55 +78,57 @@ function JSToISODate(mydate) {
isodate = isodate + mydate.getMinutes();
return encodeURI(isodate);
}
+
+var mySelectTop = 0;
+var mySelectLeft = 0;
+var mySelectRight = 0;
+var mySelectBottom = 0;
$(document).ready(function() {
- mySelectTop = 0;
- mySelectLeft = 0;
- mySelectRight = 0;
- mySelectBottom = 0;
- myImgTop = 0;
- myImgLeft = 0;
- myImgRight = 0;
- myImgBottom = 0;
+ var rrdimg = jQuery("img#zoom");
+ var myImgTop = rrdimg.get(0).y;
+ var myImgLeft = rrdimg.get(0).x;
+ var myImgRight = myImgLeft + rrdimg.get(0).width;
+ var myImgBottom = myImgTop + rrdimg.get(0).height;
- RRDLeftDiff = 68; // difference between left border of RRD image and content
- RRDRightDiff = 33; // difference between right border of RRD image and content
- RRDImgWidth = 697; // Width of the Smokeping RRD Graphik
- RRDImgUsable = 596; // 598 = 697 - 68 - 33;
-
- mySelectTop = 0;
- mySelectLeft = 0;
- mySelectRight = 0;
- mySelectBottom = 0;
-
StartDateString = 0;
EndDateString = 0;
-
- $("div.zoom").mousedown(function() {
-
- var rrdimg = $("div.zoom").children("img");
- myImgTop = rrdimg.get(0).y;
- myImgLeft = rrdimg.get(0).x;
- myImgRight = myImgLeft + rrdimg.get(0).width;
- myImgBottom = myImgTop + rrdimg.get(0).height;
-
- });
+ jQuery('body',document).append('<div id="selector"></div>')
+ var selector = jQuery("div#selector");
- $("div.zoom").Selectable({
- accept : 'selectableitem',
- opacity : 0.2,
- selectedclass : 'selecteditem',
- helperclass : 'selecthelper'
+ selector.Selectable({
+ opacity : 1,
+ helperclass : 'selecthelper'
});
+
+ selector.css({
+ cursor: 'crosshair',
+ top : rrdimg.offset().top+30,
+ width : rrdimg.width()-95,
+ left : rrdimg.offset().left+68,
+ height : rrdimg.height()-110,
+ position: 'absolute',
+ background: '#fefefe',
+ opacity: 0.1,
+ margin: 0,
+ padding: 0,
+ 'z-index': 1000
+ });
+
});
// will be started by modified iSelect (StopApply Function)
function changeRRDImage(){
- var oldimg = $("div.zoom").children("img");
+ var RRDLeftDiff = 0; // difference between left border of RRD image and content
+ var RRDRightDiff = 0; // difference between right border of RRD image and content
+ var RRDImgWidth = 697; // Width of the Smokeping RRD Graphik
+ var RRDImgUsable = 596; // 598 = 697 - 68 - 33;
+
+ var oldimg = $("img#zoom");
myURLObj = new urlObj(document.URL);