Changeset 6576 for branches/2.1/themes/default
- Timestamp:
- Jun 22, 2010, 9:39:12 PM (14 years ago)
- Location:
- branches/2.1/themes/default/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/themes/default/js/rating.js
r5123 r6576 36 36 rateButton.parentNode.removeChild(rateButton.previousSibling); 37 37 38 if(window.addEventListener){ // Mozilla, Netscape, Firefox 39 rateButton.addEventListener("click", updateRating, false ); 40 rateButton.addEventListener("mouseout", resetRatingStarDisplay, false ); 41 rateButton.addEventListener("mouseover", updateRatingStarDisplayEvt, false ); 42 } 43 else if(window.attachEvent) { // IE 44 rateButton.attachEvent("onclick", updateRating); 45 rateButton.attachEvent("onmouseout", resetRatingStarDisplay); 46 rateButton.attachEvent("onmouseover", updateRatingStarDisplayEvt); 47 } 38 pwgAddEventListener(rateButton, "click", updateRating); 39 pwgAddEventListener(rateButton, "mouseout", resetRatingStarDisplay); 40 pwgAddEventListener(rateButton, "mouseover", updateRatingStarDisplayEvt); 48 41 } 49 42 resetRatingStarDisplay(); … … 89 82 { 90 83 var t = gRatingOptions.ratingSummaryText; 91 var args =[result.average, result.count , result.stdev], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ );92 _xxx = t.match( rexp );84 var args =[result.average, result.count], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ ); 85 //_xxx = t.match( rexp ); 93 86 while (idx<args.length) t=t.replace(rexp, args[idx++]); 94 87 gRatingOptions.ratingSummaryElement.innerHTML = t; -
branches/2.1/themes/default/js/scripts.js
r5123 r6576 1 1 function SelectAll( formulaire ) 2 2 { 3 var len = formulaire.elements.length; 4 var i=0; 5 for( i = 0; i < len; i++) 3 var elts = formulaire.elements; 4 for(var i=0; i <elts.length; i++) 6 5 { 7 if ( formulaire.elements[i].type=='checkbox' 8 && formulaire.elements[i].name != 'copie') 9 { 10 formulaire.elements[i].checked = true; 11 } 6 if (elts[i].type=='checkbox') 7 elts[i].checked = true; 12 8 } 13 9 } … … 15 11 function DeselectAll( formulaire ) 16 12 { 17 var len = formulaire.elements.length; 18 var i=0; 19 for( i = 0; i < len; i++) 13 var elts = formulaire.elements; 14 for(var i=0; i <elts.length; i++) 20 15 { 21 if ( formulaire.elements[i].type=='checkbox' 22 && formulaire.elements[i].name != 'copie') 23 { 24 formulaire.elements[i].checked = false; 25 } 16 if (elts[i].type=='checkbox') 17 elts[i].checked = false; 26 18 } 27 19 } … … 29 21 function Inverser( formulaire ) 30 22 { 31 var len = formulaire.elements.length; 32 var i=0; 33 for( i=0; i<len; i++) 23 var elts = formulaire.elements; 24 for(var i=0; i <elts.length; i++) 34 25 { 35 if ( formulaire.elements[i].type=='checkbox' 36 && formulaire.elements[i].name != 'copie') 37 { 38 formulaire.elements[i].checked = !formulaire.elements[i].checked; 39 } 26 if (elts[i].type=='checkbox') 27 elts[i].checked = !elts[i].checked; 40 28 } 41 29 } … … 47 35 if (img.complete) 48 36 { 49 var width=img.width +40; 50 var height=img.height +40; 37 var width=img.width+40, height=img.height+40; 51 38 } 52 39 else 53 40 { 54 var width=640; 55 var height=480; 56 img.onload = resizeWindowToFit; 41 var width=640, height=480; 42 img.onload = function () { newWin.resizeTo( img.width+50, img.height+100); }; 57 43 } 58 44 newWin = window.open(theURL,winName,features+',left=2,top=1,width=' + width + ',height=' + height); 59 }60 61 function resizeWindowToFit()62 {63 newWin.resizeTo( img.width+50, img.height+100);64 45 } 65 46 … … 71 52 } 72 53 73 74 75 54 Function.prototype.pwgBind = function() { 76 var __method = this, object = arguments[0], args = new Array();77 for (var i=1; i<arguments.length; i++)78 args[i-1] = arguments[i];79 return function() { return __method.apply(object, args);}55 var __method = this, object = arguments[0], args = Array.prototype.slice.call(arguments,1); 56 return function() { 57 return __method.apply(object, args.concat(arguments) ); 58 } 80 59 } 81 82 60 function PwgWS(urlRoot) 83 61 { … … 145 123 onStateChange: function() { 146 124 var readyState = this.transport.readyState; 147 if (readyState ==4)148 this.respondToReadyState( this.transport.readyState);125 if (readyState==4) 126 this.respondToReadyState(readyState); 149 127 }, 150 128 … … 187 165 options: {} 188 166 } 167 168 function pwgAddEventListener(elem, evt, fn) 169 { 170 if (window.attachEvent) 171 elem.attachEvent('on'+evt, fn); 172 else 173 elem.addEventListener(evt, fn, false); 174 }
Note: See TracChangeset
for help on using the changeset viewer.