Changeset 9974

Show
Ignore:
Timestamp:
11/18/08 21:29:29 (2 months ago)
Author:
afz
Message:

Update scriptaculous to 1.8.2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.8/jaws/html/libraries/prototype/scriptaculous.src.js

    r9135 r9974  
    2828    document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>'); 
    2929  }, 
    30   REQUIRED_PROTOTYPE: '1.6.0.2', 
     30  REQUIRED_PROTOTYPE: '1.6.0.3', 
    3131  load: function() { 
    3232    function convertVersionString(versionString) { 
     
    8383  node: function(elementName) { 
    8484    elementName = elementName.toUpperCase(); 
    85      
     85 
    8686    // try innerHTML approach 
    8787    var parentTag = this.NODEMAP[elementName] || 'div'; 
     
    9191    } catch(e) {} 
    9292    var element = parentElement.firstChild || null; 
    93        
     93 
    9494    // see if browser added wrapping tags 
    9595    if(element && (element.tagName.toUpperCase() != elementName)) 
    9696      element = element.getElementsByTagName(elementName)[0]; 
    97      
     97 
    9898    // fallback to createElement approach 
    9999    if(!element) element = document.createElement(elementName); 
    100      
     100 
    101101    // abort if nothing could be created 
    102102    if(!element) return; 
     
    119119            if(!element) { 
    120120              element = document.createElement(elementName); 
    121               for(attr in arguments[1])  
     121              for(attr in arguments[1]) 
    122122                element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; 
    123123            } 
     
    125125              element = parentElement.getElementsByTagName(elementName)[0]; 
    126126          } 
    127         }  
     127        } 
    128128 
    129129    // text, or array of children 
     
    131131      this._children(element, arguments[2]); 
    132132 
    133      return element
     133     return $(element)
    134134  }, 
    135135  _text: function(text) { 
     
    174174    return element.down(); 
    175175  }, 
    176   dump: function(scope) {  
    177     if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope  
    178    
     176  dump: function(scope) { 
     177    if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope 
     178 
    179179    var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + 
    180180      "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + 
     
    183183      "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ 
    184184      "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); 
    185    
    186     tags.each( function(tag){  
    187       scope[tag] = function() {  
    188         return Builder.node.apply(Builder, [tag].concat($A(arguments)));   
     185 
     186    tags.each( function(tag){ 
     187      scope[tag] = function() { 
     188        return Builder.node.apply(Builder, [tag].concat($A(arguments))); 
    189189      }; 
    190190    }); 
     
    204204// converts rgb() and #xxx to #xxxxxx format,   
    205205// returns self (or first argument) if not convertable   
    206 String.prototype.parseColor = function() {   
     206String.prototype.parseColor = function() { 
    207207  var color = '#'; 
    208   if (this.slice(0,4) == 'rgb(') {   
    209     var cols = this.slice(4,this.length-1).split(',');   
    210     var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);   
    211   } else {   
    212     if (this.slice(0,1) == '#') {   
    213       if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();   
    214       if (this.length==7) color = this.toLowerCase();   
    215     }   
    216   }   
    217   return (color.length==7 ? color : (arguments[0] || this));   
     208  if (this.slice(0,4) == 'rgb(') { 
     209    var cols = this.slice(4,this.length-1).split(','); 
     210    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); 
     211  } else { 
     212    if (this.slice(0,1) == '#') { 
     213      if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); 
     214      if (this.length==7) color = this.toLowerCase(); 
     215    } 
     216  } 
     217  return (color.length==7 ? color : (arguments[0] || this)); 
    218218}; 
    219219 
    220220/*--------------------------------------------------------------------------*/ 
    221221 
    222 Element.collectTextNodes = function(element) {   
     222Element.collectTextNodes = function(element) { 
    223223  return $A($(element).childNodes).collect( function(node) { 
    224     return (node.nodeType==3 ? node.nodeValue :  
     224    return (node.nodeType==3 ? node.nodeValue : 
    225225      (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); 
    226226  }).flatten().join(''); 
    227227}; 
    228228 
    229 Element.collectTextNodesIgnoreClass = function(element, className) {   
     229Element.collectTextNodesIgnoreClass = function(element, className) { 
    230230  return $A($(element).childNodes).collect( function(node) { 
    231     return (node.nodeType==3 ? node.nodeValue :  
    232       ((node.hasChildNodes() && !Element.hasClassName(node,className)) ?  
     231    return (node.nodeType==3 ? node.nodeValue : 
     232      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
    233233        Element.collectTextNodesIgnoreClass(node, className) : '')); 
    234234  }).flatten().join(''); 
     
    236236 
    237237Element.setContentZoom = function(element, percent) { 
    238   element = $(element);   
    239   element.setStyle({fontSize: (percent/100) + 'em'});    
     238  element = $(element); 
     239  element.setStyle({fontSize: (percent/100) + 'em'}); 
    240240  if (Prototype.Browser.WebKit) window.scrollBy(0,0); 
    241241  return element; 
     
    277277      return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5; 
    278278    }, 
    279     pulse: function(pos, pulses) {  
     279    pulse: function(pos, pulses) { 
    280280      return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5; 
    281281    }, 
    282     spring: function(pos) {  
     282    spring: function(pos) { 
    283283      return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); 
    284284    }, 
     
    302302    var tagifyStyle = 'position:relative'; 
    303303    if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; 
    304      
     304 
    305305    element = $(element); 
    306306    $A(element.childNodes).each( function(child) { 
     
    309309          element.insertBefore( 
    310310            new Element('span', {style: tagifyStyle}).update( 
    311               character == ' ' ? String.fromCharCode(160) : character),  
     311              character == ' ' ? String.fromCharCode(160) : character), 
    312312              child); 
    313313        }); 
     
    318318  multiple: function(element, effect) { 
    319319    var elements; 
    320     if (((typeof element == 'object') ||  
    321         Object.isFunction(element)) &&  
     320    if (((typeof element == 'object') || 
     321        Object.isFunction(element)) && 
    322322       (element.length)) 
    323323      elements = element; 
    324324    else 
    325325      elements = $(element).childNodes; 
    326        
     326 
    327327    var options = Object.extend({ 
    328328      speed: 0.1, 
     
    346346      queue: { position:'end', scope:(element.id || 'global'), limit: 1 } 
    347347    }, arguments[2] || { }); 
    348     Effect[element.visible() ?  
     348    Effect[element.visible() ? 
    349349      Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); 
    350350  } 
     
    358358  initialize: function() { 
    359359    this.effects  = []; 
    360     this.interval = null;     
     360    this.interval = null; 
    361361  }, 
    362362  _each: function(iterator) { 
     
    365365  add: function(effect) { 
    366366    var timestamp = new Date().getTime(); 
    367      
    368     var position = Object.isString(effect.options.queue) ?  
     367 
     368    var position = Object.isString(effect.options.queue) ? 
    369369      effect.options.queue : effect.options.queue.position; 
    370      
     370 
    371371    switch(position) { 
    372372      case 'front': 
    373         // move unstarted effects after this effect   
     373        // move unstarted effects after this effect 
    374374        this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { 
    375375            e.startOn  += effect.finishOn; 
     
    385385        break; 
    386386    } 
    387      
     387 
    388388    effect.startOn  += timestamp; 
    389389    effect.finishOn += timestamp; 
     
    391391    if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) 
    392392      this.effects.push(effect); 
    393      
     393 
    394394    if (!this.interval) 
    395395      this.interval = setInterval(this.loop.bind(this), 15); 
     
    404404  loop: function() { 
    405405    var timePos = new Date().getTime(); 
    406     for(var i=0, len=this.effects.length;i<len;i++)  
     406    for(var i=0, len=this.effects.length;i<len;i++) 
    407407      this.effects[i] && this.effects[i].loop(timePos); 
    408408  } 
     
    413413  get: function(queueName) { 
    414414    if (!Object.isString(queueName)) return queueName; 
    415      
     415 
    416416    return this.instances.get(queueName) || 
    417417      this.instances.set(queueName, new Effect.ScopedQueue()); 
     
    438438    this.totalTime    = this.finishOn-this.startOn; 
    439439    this.totalFrames  = this.options.fps*this.options.duration; 
    440      
     440 
    441441    this.render = (function() { 
    442442      function dispatch(effect, eventName) { 
     
    461461          dispatch(this, 'afterUpdate'); 
    462462        } 
    463       } 
     463      }; 
    464464    })(); 
    465      
     465 
    466466    this.event('beforeStart'); 
    467467    if (!this.options.sync) 
    468       Effect.Queues.get(Object.isString(this.options.queue) ?  
     468      Effect.Queues.get(Object.isString(this.options.queue) ? 
    469469        'global' : this.options.queue.scope).add(this); 
    470470  }, 
     
    475475        this.cancel(); 
    476476        this.event('beforeFinish'); 
    477         if (this.finish) this.finish();  
     477        if (this.finish) this.finish(); 
    478478        this.event('afterFinish'); 
    479         return;   
     479        return; 
    480480      } 
    481481      var pos   = (timePos - this.startOn) / this.totalTime, 
     
    489489  cancel: function() { 
    490490    if (!this.options.sync) 
    491       Effect.Queues.get(Object.isString(this.options.queue) ?  
     491      Effect.Queues.get(Object.isString(this.options.queue) ? 
    492492        'global' : this.options.queue.scope).remove(this); 
    493493    this.state = 'finished'; 
     
    527527  initialize: function(object, from, to) { 
    528528    object = Object.isString(object) ? $(object) : object; 
    529     var args = $A(arguments), method = args.last(),  
     529    var args = $A(arguments), method = args.last(), 
    530530      options = args.length == 5 ? args[3] : null; 
    531531    this.method = Object.isFunction(method) ? method.bind(object) : 
    532       Object.isFunction(object[method]) ? object[method].bind(object) :  
     532      Object.isFunction(object[method]) ? object[method].bind(object) : 
    533533      function(value) { object[method] = value }; 
    534534    this.start(Object.extend({ from: from, to: to }, options || { })); 
     
    594594// for backwards compatibility 
    595595Effect.MoveBy = function(element, toTop, toLeft) { 
    596   return new Effect.Move(element,  
     596  return new Effect.Move(element, 
    597597    Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); 
    598598}; 
     
    616616    this.restoreAfterFinish = this.options.restoreAfterFinish || false; 
    617617    this.elementPositioning = this.element.getStyle('position'); 
    618      
     618 
    619619    this.originalStyle = { }; 
    620620    ['top','left','width','height','fontSize'].each( function(k) { 
    621621      this.originalStyle[k] = this.element.style[k]; 
    622622    }.bind(this)); 
    623        
     623 
    624624    this.originalTop  = this.element.offsetTop; 
    625625    this.originalLeft = this.element.offsetLeft; 
    626      
     626 
    627627    var fontSize = this.element.getStyle('font-size') || '100%'; 
    628628    ['em','px','%','pt'].each( function(fontSizeType) { 
     
    632632      } 
    633633    }.bind(this)); 
    634      
     634 
    635635    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; 
    636      
     636 
    637637    this.dims = null; 
    638638    if (this.options.scaleMode=='box') 
     
    718718    elementOffsets[1], 
    719719    options, 
    720     function(p){ scrollTo(scrollOffsets.left, p.round())
     720    function(p){ scrollTo(scrollOffsets.left, p.round());
    721721  ); 
    722722}; 
     
    730730    from: element.getOpacity() || 1.0, 
    731731    to:   0.0, 
    732     afterFinishInternal: function(effect) {  
     732    afterFinishInternal: function(effect) { 
    733733      if (effect.options.to!=0) return; 
    734       effect.element.hide().setStyle({opacity: oldOpacity});  
     734      effect.element.hide().setStyle({opacity: oldOpacity}); 
    735735    } 
    736736  }, arguments[1] || { }); 
     
    748748  }, 
    749749  beforeSetup: function(effect) { 
    750     effect.element.setOpacity(effect.options.from).show();  
     750    effect.element.setOpacity(effect.options.from).show(); 
    751751  }}, arguments[1] || { }); 
    752752  return new Effect.Opacity(element,options); 
     
    755755Effect.Puff = function(element) { 
    756756  element = $(element); 
    757   var oldStyle = {  
    758     opacity: element.getInlineOpacity(),  
     757  var oldStyle = { 
     758    opacity: element.getInlineOpacity(), 
    759759    position: element.getStyle('position'), 
    760760    top:  element.style.top, 
     
    764764  }; 
    765765  return new Effect.Parallel( 
    766    [ new Effect.Scale(element, 200,  
    767       { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }),  
    768      new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],  
    769      Object.extend({ duration: 1.0,  
     766   [ new Effect.Scale(element, 200, 
     767      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), 
     768     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], 
     769     Object.extend({ duration: 1.0, 
    770770      beforeSetupInternal: function(effect) { 
    771         Position.absolutize(effect.effects[0].element) 
     771        Position.absolutize(effect.effects[0].element); 
    772772      }, 
    773773      afterFinishInternal: function(effect) { 
     
    781781  element.makeClipping(); 
    782782  return new Effect.Scale(element, 0, 
    783     Object.extend({ scaleContent: false,  
    784       scaleX: false,  
     783    Object.extend({ scaleContent: false, 
     784      scaleX: false, 
    785785      restoreAfterFinish: true, 
    786786      afterFinishInternal: function(effect) { 
    787787        effect.element.hide().undoClipping(); 
    788       }  
     788      } 
    789789    }, arguments[1] || { }) 
    790790  ); 
     
    794794  element = $(element); 
    795795  var elementDimensions = element.getDimensions(); 
    796   return new Effect.Scale(element, 100, Object.extend({  
    797     scaleContent: false,  
     796  return new Effect.Scale(element, 100, Object.extend({ 
     797    scaleContent: false, 
    798798    scaleX: false, 
    799799    scaleFrom: 0, 
     
    801801    restoreAfterFinish: true, 
    802802    afterSetup: function(effect) { 
    803       effect.element.makeClipping().setStyle({height: '0px'}).show();  
    804     },   
     803      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
     804    }, 
    805805    afterFinishInternal: function(effect) { 
    806806      effect.element.undoClipping(); 
     
    817817    transition: Effect.Transitions.flicker, 
    818818    afterFinishInternal: function(effect) { 
    819       new Effect.Scale(effect.element, 1, {  
     819      new Effect.Scale(effect.element, 1, { 
    820820        duration: 0.3, scaleFromCenter: true, 
    821821        scaleX: false, scaleContent: false, restoreAfterFinish: true, 
    822         beforeSetup: function(effect) {  
     822        beforeSetup: function(effect) { 
    823823          effect.element.makePositioned().makeClipping(); 
    824824        }, 
     
    826826          effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); 
    827827        } 
    828       }) 
     828      }); 
    829829    } 
    830830  }, arguments[1] || { })); 
     
    838838    opacity: element.getInlineOpacity() }; 
    839839  return new Effect.Parallel( 
    840     [ new Effect.Move(element, {x: 0, y: 100, sync: true }),  
     840    [ new Effect.Move(element, {x: 0, y: 100, sync: true }), 
    841841      new Effect.Opacity(element, { sync: true, to: 0.0 }) ], 
    842842    Object.extend( 
    843843      { duration: 0.5, 
    844844        beforeSetup: function(effect) { 
    845           effect.effects[0].element.makePositioned();  
     845          effect.effects[0].element.makePositioned(); 
    846846        }, 
    847847        afterFinishInternal: function(effect) { 
    848848          effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); 
    849         }  
     849        } 
    850850      }, arguments[1] || { })); 
    851851}; 
     
    875875      { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { 
    876876        effect.element.undoPositioned().setStyle(oldStyle); 
    877   }}) }}) }}) }}) }}) }}); 
     877  }}); }}); }}); }}); }}); }}); 
    878878}; 
    879879 
     
    883883  var oldInnerBottom = element.down().getStyle('bottom'); 
    884884  var elementDimensions = element.getDimensions(); 
    885   return new Effect.Scale(element, 100, Object.extend({  
    886     scaleContent: false,  
    887     scaleX: false,  
     885  return new Effect.Scale(element, 100, Object.extend({ 
     886    scaleContent: false, 
     887    scaleX: false, 
    888888    scaleFrom: window.opera ? 0 : 1, 
    889889    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, 
     
    893893      effect.element.down().makePositioned(); 
    894894      if (window.opera) effect.element.setStyle({top: ''}); 
    895       effect.element.makeClipping().setStyle({height: '0px'}).show();  
     895      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
    896896    }, 
    897897    afterUpdateInternal: function(effect) { 
    898898      effect.element.down().setStyle({bottom: 
    899         (effect.dims[0] - effect.element.clientHeight) + 'px' });  
     899        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
    900900    }, 
    901901    afterFinishInternal: function(effect) { 
     
    911911  var elementDimensions = element.getDimensions(); 
    912912  return new Effect.Scale(element, window.opera ? 0 : 1, 
    913    Object.extend({ scaleContent: false,  
    914     scaleX: false,  
     913   Object.extend({ scaleContent: false, 
     914    scaleX: false, 
    915915    scaleMode: 'box', 
    916916    scaleFrom: 100, 
     
    922922      if (window.opera) effect.element.setStyle({top: ''}); 
    923923      effect.element.makeClipping().show(); 
    924     },   
     924    }, 
    925925    afterUpdateInternal: function(effect) { 
    926926      effect.element.down().setStyle({bottom: 
     
    935935}; 
    936936 
    937 // Bug in opera makes the TD containing this element expand for a instance after finish  
     937// Bug in opera makes the TD containing this element expand for a instance after finish 
    938938Effect.Squish = function(element) { 
    939   return new Effect.Scale(element, window.opera ? 1 : 0, {  
     939  return new Effect.Scale(element, window.opera ? 1 : 0, { 
    940940    restoreAfterFinish: true, 
    941941    beforeSetup: function(effect) { 
    942       effect.element.makeClipping();  
    943     },   
     942      effect.element.makeClipping(); 
     943    }, 
    944944    afterFinishInternal: function(effect) { 
    945       effect.element.hide().undoClipping();  
     945      effect.element.hide().undoClipping(); 
    946946    } 
    947947  }); 
     
    963963    opacity: element.getInlineOpacity() }; 
    964964 
    965   var dims = element.getDimensions();     
     965  var dims = element.getDimensions(); 
    966966  var initialMoveX, initialMoveY; 
    967967  var moveX, moveY; 
    968    
     968 
    969969  switch (options.direction) { 
    970970    case 'top-left': 
    971       initialMoveX = initialMoveY = moveX = moveY = 0;  
     971      initialMoveX = initialMoveY = moveX = moveY = 0; 
    972972      break; 
    973973    case 'top-right': 
     
    994994      break; 
    995995  } 
    996    
     996 
    997997  return new Effect.Move(element, { 
    998998    x: initialMoveX, 
    999999    y: initialMoveY, 
    1000     duration: 0.01,  
     1000    duration: 0.01, 
    10011001    beforeSetup: function(effect) { 
    10021002      effect.element.hide().makeClipping().makePositioned(); 
     
    10071007          new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), 
    10081008          new Effect.Scale(effect.element, 100, { 
    1009             scaleMode: { originalHeight: dims.height, originalWidth: dims.width },  
     1009            scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, 
    10101010            sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) 
    10111011        ], Object.extend({ 
    10121012             beforeSetup: function(effect) { 
    1013                effect.effects[0].element.setStyle({height: '0px'}).show();  
     1013               effect.effects[0].element.setStyle({height: '0px'}).show(); 
    10141014             }, 
    10151015             afterFinishInternal: function(effect) { 
    1016                effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);  
     1016               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); 
    10171017             } 
    10181018           }, options) 
    1019       ) 
     1019      ); 
    10201020    } 
    10211021  }); 
     
    10391039  var dims = element.getDimensions(); 
    10401040  var moveX, moveY; 
    1041    
     1041 
    10421042  switch (options.direction) { 
    10431043    case 'top-left': 
     
    10561056      moveY = dims.height; 
    10571057      break; 
    1058     case 'center':   
     1058    case 'center': 
    10591059      moveX = dims.width / 2; 
    10601060      moveY = dims.height / 2; 
    10611061      break; 
    10621062  } 
    1063    
     1063 
    10641064  return new Effect.Parallel( 
    10651065    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), 
    10661066      new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), 
    10671067      new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) 
    1068     ], Object.extend({             
     1068    ], Object.extend({ 
    10691069         beforeStartInternal: function(effect) { 
    1070            effect.effects[0].element.makePositioned().makeClipping();  
     1070           effect.effects[0].element.makePositioned().makeClipping(); 
    10711071         }, 
    10721072         afterFinishInternal: function(effect) { 
     
    10811081    oldOpacity = element.getInlineOpacity(), 
    10821082    transition = options.transition || Effect.Transitions.linear, 
    1083     reverser   = function(pos){  
     1083    reverser   = function(pos){ 
    10841084      return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5); 
    10851085    }; 
    1086      
    1087   return new Effect.Opacity(element,  
     1086 
     1087  return new Effect.Opacity(element, 
    10881088    Object.extend(Object.extend({  duration: 2.0, from: 0, 
    10891089      afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } 
     
    10991099    height: element.style.height }; 
    11001100  element.makeClipping(); 
    1101   return new Effect.Scale(element, 5, Object.extend({    
     1101  return new Effect.Scale(element, 5, Object.extend({ 
    11021102    scaleContent: false, 
    11031103    scaleX: false, 
    11041104    afterFinishInternal: function(effect) { 
    1105     new Effect.Scale(element, 1, {  
    1106       scaleContent: false,  
     1105    new Effect.Scale(element, 1, { 
     1106      scaleContent: false, 
    11071107      scaleY: false, 
    11081108      afterFinishInternal: function(effect) { 
     
    11191119      style: { } 
    11201120    }, arguments[1] || { }); 
    1121      
     1121 
    11221122    if (!Object.isString(options.style)) this.style = $H(options.style); 
    11231123    else { 
     
    11421142    this.start(options); 
    11431143  }, 
    1144    
     1144 
    11451145  setup: function(){ 
    11461146    function parseColor(color){ 
     
    11481148      color = color.parseColor(); 
    11491149      return $R(0,2).map(function(i){ 
    1150         return parseInt( color.slice(i*2+1,i*2+3), 16 )  
     1150        return parseInt( color.slice(i*2+1,i*2+3), 16 ); 
    11511151      }); 
    11521152    } 
     
    11681168 
    11691169      var originalValue = this.element.getStyle(property); 
    1170       return {  
    1171         style: property.camelize(),  
    1172         originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),  
     1170      return { 
     1171        style: property.camelize(), 
     1172        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), 
    11731173        targetValue: unit=='color' ? parseColor(value) : value, 
    11741174        unit: unit 
     
    11811181          (isNaN(transform.originalValue) || isNaN(transform.targetValue)) 
    11821182        ) 
    1183       ) 
     1183      ); 
    11841184    }); 
    11851185  }, 
     
    11871187    var style = { }, transform, i = this.transforms.length; 
    11881188    while(i--) 
    1189       style[(transform = this.transforms[i]).style] =  
     1189      style[(transform = this.transforms[i]).style] = 
    11901190        transform.unit=='color' ? '#'+ 
    11911191          (Math.round(transform.originalValue[0]+ 
     
    11961196            (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : 
    11971197        (transform.originalValue + 
    1198           (transform.targetValue - transform.originalValue) * position).toFixed(3) +  
     1198          (transform.targetValue - transform.originalValue) * position).toFixed(3) + 
    11991199            (transform.unit === null ? '' : transform.unit); 
    12001200    this.element.setStyle(style, true); 
     
    12331233 
    12341234Element.CSS_PROPERTIES = $w( 
    1235   'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +  
     1235  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 
    12361236  'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + 
    12371237  'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + 
     
    12421242  'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + 
    12431243  'right textIndent top width wordSpacing zIndex'); 
    1244    
     1244 
    12451245Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; 
    12461246 
     
    12541254    style = String.__parseStyleElement.childNodes[0].style; 
    12551255  } 
    1256    
     1256 
    12571257  Element.CSS_PROPERTIES.each(function(property){ 
    1258     if (style[property]) styleRules.set(property, style[property]);  
     1258    if (style[property]) styleRules.set(property, style[property]); 
    12591259  }); 
    1260    
     1260 
    12611261  if (Prototype.Browser.IE && this.include('opacity')) 
    12621262    styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); 
     
    13071307$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ 
    13081308  'pulsate shake puff squish switchOff dropOut').each( 
    1309   function(effect) {  
     1309  function(effect) { 
    13101310    Effect.Methods[effect] = function(element, options){ 
    13111311      element = $(element); 
    13121312      Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); 
    13131313      return element; 
    1314     } 
     1314    }; 
    13151315  } 
    13161316); 
    13171317 
    1318 $w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(  
     1318$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( 
    13191319  function(f) { Effect.Methods[f] = Element[f]; } 
    13201320); 
     
    13571357      } 
    13581358    } 
    1359      
     1359 
    13601360    if(options.accept) options.accept = [options.accept].flatten(); 
    13611361 
     
    13651365    this.drops.push(options); 
    13661366  }, 
    1367    
     1367 
    13681368  findDeepestChild: function(drops) { 
    13691369    deepest = drops[0]; 
    1370        
     1370 
    13711371    for (i = 1; i < drops.length; ++i) 
    13721372      if (Element.isParent(drops[i].element, deepest.element)) 
    13731373        deepest = drops[i]; 
    1374      
     1374 
    13751375    return deepest; 
    13761376  }, 
     
    13791379    var containmentNode; 
    13801380    if(drop.tree) { 
    1381       containmentNode = element.treeNode;  
     1381      containmentNode = element.treeNode; 
    13821382    } else { 
    13831383      containmentNode = element.parentNode; 
     
    13851385    return drop._containers.detect(function(c) { return containmentNode == c }); 
    13861386  }, 
    1387    
     1387 
    13881388  isAffected: function(point, element, drop) { 
    13891389    return ( 
     
    13921392        this.isContained(element, drop)) && 
    13931393      ((!drop.accept) || 
    1394         (Element.classNames(element).detect(  
     1394        (Element.classNames(element).detect( 
    13951395          function(v) { return drop.accept.include(v) } ) )) && 
    13961396      Position.within(drop.element, point[0], point[1]) ); 
     
    14121412    if(!this.drops.length) return; 
    14131413    var drop, affected = []; 
    1414      
     1414 
    14151415    this.drops.each( function(drop) { 
    14161416      if(Droppables.isAffected(point, element, drop)) 
    14171417        affected.push(drop); 
    14181418    }); 
    1419          
     1419 
    14201420    if(affected.length>0) 
    14211421      drop = Droppables.findDeepestChild(affected); 
     
    14261426      if(drop.onHover) 
    14271427        drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); 
    1428        
     1428 
    14291429      if (drop != this.last_active) Droppables.activate(drop); 
    14301430    } 
     
    14371437    if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) 
    14381438      if (this.last_active.onDrop) { 
    1439         this.last_active.onDrop(element, this.last_active.element, event);  
    1440         return true;  
     1439        this.last_active.onDrop(element, this.last_active.element, event); 
     1440        return true; 
    14411441      } 
    14421442  }, 
     
    14511451  drags: [], 
    14521452  observers: [], 
    1453    
     1453 
    14541454  register: function(draggable) { 
    14551455    if(this.drags.length == 0) { 
     
    14571457      this.eventMouseMove = this.updateDrag.bindAsEventListener(this); 
    14581458      this.eventKeypress  = this.keyPress.bindAsEventListener(this); 
    1459        
     1459 
    14601460      Event.observe(document, "mouseup", this.eventMouseUp); 
    14611461      Event.observe(document, "mousemove", this.eventMouseMove); 
     
    14641464    this.drags.push(draggable); 
    14651465  }, 
    1466    
     1466 
    14671467  unregister: function(draggable) { 
    14681468    this.drags = this.drags.reject(function(d) { return d==draggable }); 
     
    14731473    } 
    14741474  }, 
    1475    
     1475 
    14761476  activate: function(draggable) { 
    1477     if(draggable.options.delay) {  
    1478       this._timeout = setTimeout(function() {  
    1479         Draggables._timeout = null;  
    1480         window.focus();  
    1481         Draggables.activeDraggable = draggable;  
    1482       }.bind(this), draggable.options.delay);  
     1477    if(draggable.options.delay) { 
     1478      this._timeout = setTimeout(function() { 
     1479        Draggables._timeout = null; 
     1480        window.focus(); 
     1481        Draggables.activeDraggable = draggable; 
     1482      }.bind(this), draggable.options.delay); 
    14831483    } else { 
    14841484      window.focus(); // allows keypress events if window isn't currently focused, fails for Safari 
     
    14861486    } 
    14871487  }, 
    1488    
     1488 
    14891489  deactivate: function() { 
    14901490    this.activeDraggable = null; 
    14911491  }, 
    1492    
     1492 
    14931493  updateDrag: function(event) { 
    14941494    if(!this.activeDraggable) return; 
     
    14981498    if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; 
    14991499    this._lastPointer = pointer; 
    1500      
     1500 
    15011501    this.activeDraggable.updateDrag(event, pointer); 
    15021502  }, 
    1503    
     1503 
    15041504  endDrag: function(event) { 
    1505     if(this._timeout) {  
    1506       clearTimeout(this._timeout);  
    1507       this._timeout = null;  
     1505    if(this._timeout) { 
     1506      clearTimeout(this._timeout); 
     1507      this._timeout = null; 
    15081508    } 
    15091509    if(!this.activeDraggable) return; 
     
    15121512    this.activeDraggable = null; 
    15131513  }, 
    1514    
     1514 
    15151515  keyPress: function(event) { 
    15161516    if(this.activeDraggable) 
    15171517      this.activeDraggable.keyPress(event); 
    15181518  }, 
    1519    
     1519 
    15201520  addObserver: function(observer) { 
    15211521    this.observers.push(observer); 
    15221522    this._cacheObserverCallbacks(); 
    15231523  }, 
    1524    
     1524 
    15251525  removeObserver: function(element) {  // element instead of observer fixes mem leaks 
    15261526    this.observers = this.observers.reject( function(o) { return o.element==element }); 
    15271527    this._cacheObserverCallbacks(); 
    15281528  }, 
    1529    
     1529 
    15301530  notify: function(eventName, draggable, event) {  // 'onStart', 'onEnd', 'onDrag' 
    15311531    if(this[eventName+'Count'] > 0) 
     
    15351535    if(draggable.options[eventName]) draggable.options[eventName](draggable, event); 
    15361536  }, 
    1537    
     1537 
    15381538  _cacheObserverCallbacks: function() { 
    15391539    ['onStart','onEnd','onDrag'].each( function(eventName) { 
     
    15591559      endeffect: function(element) { 
    15601560        var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; 
    1561         new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,  
     1561        new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, 
    15621562          queue: {scope:'_draggable', position:'end'}, 
    1563           afterFinish: function(){  
    1564             Draggable._dragging[element] = false  
     1563          afterFinish: function(){ 
     1564            Draggable._dragging[element] = false 
    15651565          } 
    1566         });  
     1566        }); 
    15671567      }, 
    15681568      zindex: 1000, 
     
    15751575      delay: 0 
    15761576    }; 
    1577      
     1577 
    15781578    if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) 
    15791579      Object.extend(defaults, { 
     
    15811581          element._opacity = Element.getOpacity(element); 
    15821582          Draggable._dragging[element] = true; 
    1583           new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});  
     1583          new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); 
    15841584        } 
    15851585      }); 
    1586      
     1586 
    15871587    var options = Object.extend(defaults, arguments[1] || { }); 
    15881588 
    15891589    this.element = $(element); 
    1590      
     1590 
    15911591    if(options.handle && Object.isString(options.handle)) 
    15921592      this.handle = this.element.down('.'+options.handle, 0); 
    1593      
     1593 
    15941594    if(!this.handle) this.handle = $(options.handle); 
    15951595    if(!this.handle) this.handle = this.element; 
    1596      
     1596 
    15971597    if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { 
    15981598      options.scroll = $(options.scroll); 
     
    16001600    } 
    16011601 
    1602     Element.makePositioned(this.element); // fix IE     
     1602    Element.makePositioned(this.element); // fix IE 
    16031603 
    16041604    this.options  = options; 
    1605     this.dragging = false;    
     1605    this.dragging = false; 
    16061606 
    16071607    this.eventMouseDown = this.initDrag.bindAsEventListener(this); 
    16081608    Event.observe(this.handle, "mousedown", this.eventMouseDown); 
    1609      
     1609 
    16101610    Draggables.register(this); 
    16111611  }, 
    1612    
     1612 
    16131613  destroy: function() { 
    16141614    Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); 
    16151615    Draggables.unregister(this); 
    16161616  }, 
    1617    
     1617 
    16181618  currentDelta: function() { 
    16191619    return([ 
     
    16211621      parseInt(Element.getStyle(this.element,'top') || '0')]); 
    16221622  }, 
    1623    
     1623 
    16241624  initDrag: function(event) { 
    16251625    if(!Object.isUndefined(Draggable._dragging[this.element]) && 
    16261626      Draggable._dragging[this.element]) return; 
    1627     if(Event.isLeftClick(event)) {     
     1627    if(Event.isLeftClick(event)) { 
    16281628      // abort on form elements, fixes a Firefox issue 
    16291629      var src = Event.element(event); 
     
    16341634        tag_name=='BUTTON' || 
    16351635        tag_name=='TEXTAREA')) return; 
    1636          </