head 1.11; access; symbols; locks; strict; comment @# @; 1.11 date 2007.06.21.08.41.52; author openpkg; state Exp; branches; next 1.10; commitid E3ALEgDFkYfc0Lms; 1.10 date 2007.02.08.12.26.58; author rse; state Exp; branches; next 1.9; commitid 7mfQ3FGzxJAtwG5s; 1.9 date 2006.07.28.19.54.44; author rse; state Exp; branches; next 1.8; commitid HcILPZ52n6xHgFGr; 1.8 date 2006.03.28.09.03.58; author rse; state Exp; branches; next 1.7; commitid tzOqPtXzOj1zAVqr; 1.7 date 2006.03.27.13.46.28; author rse; state Exp; branches; next 1.6; commitid yuqV4XRtUwEtbPqr; 1.6 date 2006.03.16.20.00.40; author rse; state Exp; branches; next 1.5; commitid zlZKilSheCOMBrpr; 1.5 date 2006.03.12.19.16.35; author rse; state Exp; branches; next 1.4; commitid B23qzzqu5d3CuVor; 1.4 date 2006.03.11.16.32.59; author rse; state Exp; branches; next 1.3; commitid Sc38vyOyirIuCMor; 1.3 date 2006.03.09.20.50.31; author rse; state Exp; branches; next 1.2; commitid 8L9IHCZX0aMP6yor; 1.2 date 2006.03.09.20.16.24; author rse; state Exp; branches; next 1.1; commitid Oma681yrx5O7Vxor; 1.1 date 2006.03.09.19.12.10; author rse; state Exp; branches; next ; commitid epriXSkS92w5zxor; desc @@ 1.11 log @flush and save current state of CVS controlled data @ text @ /* create own convenience DOM JavaScript object */ DOM = { getNode: function (str, obj) { return cssQuery(str, obj); }, getPosition: function (obj) { var pos = YAHOO.util.Dom.getXY(obj); return { x: pos[0], y: pos[1] }; }, setPosition: function (obj, pos) { YAHOO.util.Dom.setXY(obj, [ pos.x, pos.y ], true); }, getStyle: function (obj, name) { return YAHOO.util.Dom.getStyle(obj, name); }, setStyle: function (obj, name, value) { YAHOO.util.Dom.setStyle(obj, name, value); }, getViewport: function () { return { x: YAHOO.util.Dom.getClientWidth(), y: YAHOO.util.Dom.getClientHeight() }; }, setEvent: function (obj, name, cb, ctx, override) { YAHOO.util.Event.addListener(obj, name, cb, ctx, override); } }; /* smart deferred execution */ var defer_scheduled = Array(); var defer_handle = Array(); function defer_schedule (id, cmd, delay) { if (defer_scheduled[id]) clearTimeout(defer_handle[id]); defer_scheduled[id] = 1; defer_handle[id] = setTimeout("defer_scheduled[\""+id+"\"] = 0; " + cmd, delay); return; } function defer_cancel (id) { if (defer_scheduled[id]) clearTimeout(defer_handle[id]); defer_scheduled[id] = 0; return; } /* *
content switching */ /* INTERNAL: the switchdiv run-time information */ var switchdiv = new Array(); /* INTERNAL: on mouse over events */ function switchdiv_over(event) { var id = this; switchdiv[id]["suspend"] = 1; return; } /* INTERNAL: on mouse out events */ function switchdiv_out(event) { var id = this; switchdiv[id]["suspend"] = 0; return; } /* INTERNAL: update the switchdiv effect on a DOM node */ function switchdiv_update (id) { /* check for suspend mode first */ if (switchdiv[id]["suspend"] == 1) { /* reschedule after 1s */ defer_schedule("switchdiv_update_"+id, "switchdiv_update('"+id+"')", 1000); return; } /* determine message nodes */ var divs = switchdiv[id]["divs"]; var div = divs[switchdiv[id]["current"]]; /* switching to next message */ div.style.display = "none"; switchdiv[id]["current"] = ((switchdiv[id]["current"] + 1) % divs.length); div = divs[switchdiv[id]["current"]]; div.style.display = "block"; t = switchdiv[id]["keep"]; /* re-schedule switchdiv rendering */ defer_schedule("switchdiv_update_"+id, "switchdiv_update('"+id+"')", t); return; } /* EXTERNAL: apply a switchdiv effect to a DOM node */ function switchdiv_apply (id, root_select, div_select, keep) { /* determine DOM root node */ var root = DOM.getNode(root_select); /* initially do not display any message */ var divs = DOM.getNode(div_select, root); if (divs.length < 2) { alert("switchdiv
'"+id+"' does not contain at least 2 message
elements!"); return; } for (var i = 0; i < divs.length; i++) divs[i].style.display = "none"; /* remember switchdiv run-time information */ switchdiv[id] = new Array(); switchdiv[id]["divs"] = divs; switchdiv[id]["current"] = divs.length-1; switchdiv[id]["keep"] = keep; switchdiv[id]["suspend"] = 0; /* grab mouse over/out events */ DOM.setEvent(root, "mouseover", switchdiv_over, id, true); DOM.setEvent(root, "mouseout", switchdiv_out, id, true); /* schedule switchdiv rendering */ defer_schedule("switchdiv_update_"+id, "switchdiv_update('"+id+"')", 1000); return; } /* INTERNAL: toggle classes */ function toggleclass_update (id, nodes_selector, class1, class2, delay) { var nodes = DOM.getNode(nodes_selector); for (var i = 0; i < nodes.length; i++) { if (nodes[i].className == class1) nodes[i].className = class2; else if (nodes[i].className == class2) nodes[i].className = class1; } defer_schedule("toggleclass_update_"+id, "toggleclass_update('"+id+"', '"+nodes_selector+"', '"+class1+"', '"+class2+"', '"+delay+"')", delay); return; } /* EXTERNAL: apply a class toggling effect to DOM nodes */ function toggleclass_apply (id, nodes_selector, class1, class2, delay) { var nodes = DOM.getNode(nodes_selector); if (nodes.length < 1) { alert("no elements found via '"+nodes_selector+"' for class toggling!"); return; } defer_schedule("toggleclass_update_"+id, "toggleclass_update('"+id+"', '"+nodes_selector+"', '"+class1+"', '"+class2+"', '"+delay+"')", delay); return; } @ 1.10 log @flush all pending changes to meta.openpkg.org @ text @d32 6 @ 1.9 log @upgrade to the latest Yahoo widget library world order now that openpkg.org runs OpenPKG 2.20060622 @ text @d34 4 a37 3 d50 4 d78 1 a78 1 return [ YAHOO.util.Dom.getClientWidth(), YAHOO.util.Dom.getClientHeight() ]; d183 24 @ 1.8 log @fix special case of initial start: make sure we start with first message @ text @d34 3 a36 3 @ 1.7 log @establish news ticker and feeds @ text @d164 1 a164 1 switchdiv[id]["current"] = 0; @ 1.6 log @the new title page @ text @d130 3 a132 6 /* determine DOM node */ var node = switchdiv[id]["node"]; /* determine message node */ var divs = node.getElementsByTagName("div"); var div = divs[switchdiv[id]["div"]]; d136 2 a137 2 switchdiv[id]["div"] = ((switchdiv[id]["div"] + 1) % divs.length); div = divs[switchdiv[id]["div"]]; d148 3 a150 3 function switchdiv_apply (id, keep) { /* determine DOM node */ var node = document.getElementById(id); d153 1 a153 1 var divs = node.getElementsByTagName("div"); d163 2 a164 2 switchdiv[id]["node"] = node; switchdiv[id]["div"] = 0; d169 2 a170 2 DOM.setEvent(node, "mouseover", switchdiv_over, id, true); DOM.setEvent(node, "mouseout", switchdiv_out, id, true); @ 1.5 log @code cosmetics @ text @d89 1 a89 1 defer_handle[id] = setTimeout("defer_scheduled["+id+"] = 0; " + cmd, delay); d100 81 @ 1.4 log @switch to global configuration array variables instead of a dozend individual variables @ text @d24 1 a24 1 ## canvas-js.php: javascript reuseable components d38 1 a38 1 d42 13 a54 2 d80 19 a98 6 @ 1.3 log @reference dhtml stuff via a local symlink so the consumer fetches it via meta and not locally @ text @d34 3 a36 3 d40 1 a40 1 d74 1 a74 1 @ 1.2 log @use remaining parts from dhtml package, too @ text @d34 3 a36 3 d40 1 a40 1 d74 1 a74 1 @ 1.1 log @flush all other pending changes to improve the website layout @ text @d40 1 a40 1 canvas-js.d/cssquery.js" type="text/javascript"> d74 1 a74 1 canvas-js.d/ie7.js" type="text/javascript"> @