Development

Changeset 3081

You must first sign up to be able to contribute.

Changeset 3081

Show
Ignore:
Timestamp:
12/19/06 07:01:59 (2 years ago)
Author:
fabien
Message:

updated scriptaculous to 1.7.0_beta2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r3078 r3081  
    2828* r2879: fixed glob() problem with PHP < 5.1 
    2929* r2875: added simple autoloader to ease unit tests (for model classes for example) 
    30 * updated script.aculo.us (1.7.0_beta1) and prototype (1.5.0_rc2) 
     30* updated script.aculo.us (1.7.0_beta2) and prototype (1.5.0_rc2) 
    3131 
    3232* fixed some bugs (see trac) 
    33 * added more unit tests (> 3000 now) 
     33* added more unit tests (> 3400 now) 
    3434 
    3535Version 1.0.0-beta1 
  • trunk/data/web/sf/prototype/js/builder.js

    r2877 r3081  
    1 // script.aculo.us builder.js v1.7.0_beta1, Tue Nov 21 10:25:25 CET 2006 
     1// script.aculo.us builder.js v1.7.0_beta2, Mon Dec 18 23:38:56 CET 2006 
    22 
    33// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
  • trunk/data/web/sf/prototype/js/controls.js

    r2877 r3081  
    1 // script.aculo.us controls.js v1.7.0_beta1, Tue Nov 21 10:25:25 CET 2006 
     1// script.aculo.us controls.js v1.7.0_beta2, Mon Dec 18 23:38:56 CET 2006 
    22 
    33// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
  • trunk/data/web/sf/prototype/js/dragdrop.js

    r2877 r3081  
    1 // script.aculo.us dragdrop.js v1.7.0_beta1, Tue Nov 21 10:25:25 CET 2006 
     1// script.aculo.us dragdrop.js v1.7.0_beta2, Mon Dec 18 23:38:56 CET 2006 
    22 
    33// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
  • trunk/data/web/sf/prototype/js/effects.js

    r2877 r3081  
    1 // script.aculo.us effects.js v1.7.0_beta1, Tue Nov 21 10:25:25 CET 2006 
     1// script.aculo.us effects.js v1.7.0_beta2, Mon Dec 18 23:38:56 CET 2006 
    22 
    33// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     
    5151 
    5252Element.getOpacity = function(element){ 
    53   element = $(element); 
    54   var opacity; 
    55   if (opacity = element.getStyle('opacity'))   
    56     return parseFloat(opacity);   
    57   if (opacity = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))   
    58     if(opacity[1]) return parseFloat(opacity[1]) / 100;   
    59   return 1.0;   
    60 
    61  
    62 Element.setOpacity = function(element, value){   
    63   element= $(element);   
    64   if (value == 1){ 
    65     element.setStyle({ opacity:  
    66       (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ?  
    67       0.999999 : 1.0 }); 
    68     if(/MSIE/.test(navigator.userAgent) && !window.opera)   
    69       element.setStyle({filter: Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')});   
    70   } else {   
    71     if(value < 0.00001) value = 0;   
    72     element.setStyle({opacity: value}); 
    73     if(/MSIE/.test(navigator.userAgent) && !window.opera)   
    74       element.setStyle( 
    75         { filter: element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') + 
    76             'alpha(opacity='+value*100+')' });   
    77   } 
    78   return element; 
     53  return $(element).getStyle('opacity'); 
     54
     55 
     56Element.setOpacity = function(element, value){ 
     57  return $(element).setStyle({opacity:value}); 
    7958 
    8059  
     
    236215     
    237216    if(!this.interval)  
    238       this.interval = setInterval(this.loop.bind(this), 40); 
     217      this.interval = setInterval(this.loop.bind(this), 15); 
    239218  }, 
    240219  remove: function(effect) { 
     
    267246  transition: Effect.Transitions.sinoidal, 
    268247  duration:   1.0,   // seconds 
    269   fps:        25.0,  // max. 25fps due to Effect.Queue implementation 
     248  fps:        60.0,  // max. 60fps due to Effect.Queue implementation 
    270249  sync:       false, // true for combining 
    271250  from:       0.0, 
     
    948927    if(!this.element) throw(Effect._elementDoesNotExistError); 
    949928    var options = Object.extend({ 
    950       style: '' 
     929      style: {} 
    951930    }, arguments[1] || {}); 
     931    if (typeof options.style == 'string') { 
     932      if(options.style.indexOf(':') == -1) { 
     933        var cssText = '', selector = '.' + options.style; 
     934        $A(document.styleSheets).reverse().each(function(styleSheet) { 
     935          if (styleSheet.cssRules) cssRules = styleSheet.cssRules; 
     936          else if (styleSheet.rules) cssRules = styleSheet.rules; 
     937          $A(cssRules).reverse().each(function(rule) { 
     938            if (selector == rule.selectorText) { 
     939              cssText = rule.style.cssText; 
     940              throw $break; 
     941            } 
     942          }); 
     943          if (cssText) throw $break; 
     944        }); 
     945        this.style = cssText.parseStyle(); 
     946        options.afterFinishInternal = function(effect){ 
     947          effect.element.addClassName(effect.options.style); 
     948          effect.transforms.each(function(transform) { 
     949            if(transform.style != 'opacity') 
     950              effect.element.style[transform.style.camelize()] = ''; 
     951          }); 
     952        } 
     953      } else this.style = options.style.parseStyle(); 
     954    } else this.style = $H(options.style) 
    952955    this.start(options); 
    953956  }, 
     
    960963      }); 
    961964    } 
    962     this.transforms = this.options.style.parseStyle().map(function(property){ 
    963       var originalValue = this.element.getStyle(property[0]); 
     965    this.transforms = this.style.map(function(pair){ 
     966      var property = pair[0].underscore().dasherize(), value = pair[1], unit = null; 
     967 
     968      if(value.parseColor('#zzzzzz') != '#zzzzzz') { 
     969        value = value.parseColor(); 
     970        unit  = 'color'; 
     971      } else if(property == 'opacity') { 
     972        value = parseFloat(value); 
     973        if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) 
     974          this.element.setStyle({zoom: 1}); 
     975      } else if(Element.CSS_LENGTH.test(value))  
     976        var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), 
     977          value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; 
     978 
     979      var originalValue = this.element.getStyle(property); 
    964980      return $H({  
    965         style: property[0],  
    966         originalValue: property[1].unit=='color' ?  
    967           parseColor(originalValue) : parseFloat(originalValue || 0),  
    968         targetValue: property[1].unit=='color' ?  
    969           parseColor(property[1].value) : property[1].value, 
    970         unit: property[1].unit 
     981        style: property,  
     982        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),  
     983        targetValue: unit=='color' ? parseColor(value) : value, 
     984        unit: unit 
    971985      }); 
    972986    }.bind(this)).reject(function(transform){ 
     
    10501064   
    10511065  Element.CSS_PROPERTIES.each(function(property){ 
    1052    if(style[property]) styleRules[property] = style[property];  
     1066    if(style[property]) styleRules[property] = style[property];  
    10531067  }); 
    1054    
    1055   var result = $H(); 
    1056    
    1057   styleRules.each(function(pair){ 
    1058     var property = pair[0], value = pair[1], unit = null; 
    1059      
    1060     if(value.parseColor('#zzzzzz') != '#zzzzzz') { 
    1061       value = value.parseColor(); 
    1062       unit  = 'color'; 
    1063     } else if(Element.CSS_LENGTH.test(value))  
    1064       var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), 
    1065           value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; 
    1066      
    1067     result[property.underscore().dasherize()] = $H({ value:value, unit:unit }); 
    1068   }.bind(this)); 
    1069    
    1070   return result; 
     1068  if(/MSIE/.test(navigator.userAgent) && !window.opera && this.indexOf('opacity') > -1) { 
     1069    styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]; 
     1070  } 
     1071  return styleRules; 
    10711072}; 
    10721073 
  • trunk/data/web/sf/prototype/js/prototype.js

    r2907 r3081  
    250250  toArray: function() { 
    251251    return this.split(''); 
     252  }, 
     253 
     254  succ: function() { 
     255    return this.slice(0, this.length - 1) + 
     256      String.fromCharCode(this.charCodeAt(this.length - 1) + 1); 
    252257  }, 
    253258 
     
    336341    while ((index += number) < array.length) 
    337342      slices.push(array.slice(index, index+number)); 
    338     return slices.collect(iterator || Prototype.K); 
     343    return slices.map(iterator); 
    339344  }, 
    340345 
     
    360365    var results = []; 
    361366    this.each(function(value, index) { 
    362       results.push(iterator(value, index)); 
     367      results.push((iterator || Prototype.K)(value, index)); 
    363368    }); 
    364369    return results; 
     
    407412 
    408413  inGroupsOf: function(number, fillWith) { 
    409     fillWith = fillWith || null; 
    410     var results = this.eachSlice(number); 
    411     if (results.length > 0) (number - results.last().length).times(function() { 
    412       results.last().push(fillWith) 
    413     }); 
    414     return results; 
     414    fillWith = fillWith === undefined ? null : fillWith; 
     415    return this.eachSlice(number, function(slice) { 
     416      while(slice.length < number) slice.push(fillWith); 
     417      return slice; 
     418    }); 
    415419  }, 
    416420 
     
    424428  invoke: function(method) { 
    425429    var args = $A(arguments).slice(1); 
    426     return this.collect(function(value) { 
     430    return this.map(function(value) { 
    427431      return value[method].apply(value, args); 
    428432    }); 
     
    476480 
    477481  sortBy: function(iterator) { 
    478     return this.collect(function(value, index) { 
     482    return this.map(function(value, index) { 
    479483      return {value: value, criteria: iterator(value, index)}; 
    480484    }).sort(function(left, right) { 
     
    485489 
    486490  toArray: function() { 
    487     return this.collect(Prototype.K); 
     491    return this.map(); 
    488492  }, 
    489493 
     
    497501      return iterator(collections.pluck(index)); 
    498502    }); 
     503  }, 
     504 
     505  size: function() { 
     506    return this.toArray().length; 
    499507  }, 
    500508 
     
    591599  }, 
    592600 
     601  size: function() { 
     602    return this.length; 
     603  }, 
     604 
    593605  inspect: function() { 
    594606    return '[' + this.map(Object.inspect).join(', ') + ']'; 
     
    597609 
    598610Array.prototype.toArray = Array.prototype.clone; 
     611 
     612function $w(string){ 
     613  string = string.strip(); 
     614  return string ? string.split(/\s+/) : []; 
     615} 
    599616 
    600617if(window.opera){ 
     
    808825 
    809826      this.transport.open(this.options.method.toUpperCase(), this.url, 
    810         this.options.asynchronous, this.options.username, 
    811         this.options.password); 
     827        this.options.asynchronous); 
    812828 
    813829      if (this.options.asynchronous) 
     
    11681184 
    11691185  descendants: function(element) { 
    1170     element = $(element); 
    1171     return $A(element.getElementsByTagName('*')); 
     1186    return $A($(element).getElementsByTagName('*')); 
    11721187  }, 
    11731188 
     
    11931208 
    11941209  match: function(element, selector) { 
    1195     element = $(element); 
    11961210    if (typeof selector == 'string') 
    11971211      selector = new Selector(selector); 
    1198     return selector.match(element); 
     1212    return selector.match($(element)); 
    11991213  }, 
    12001214 
     
    12211235 
    12221236  getElementsByClassName: function(element, className) { 
    1223     element = $(element); 
    12241237    return document.getElementsByClassName(className, element); 
    12251238  }, 
     
    12301243 
    12311244  getHeight: function(element) { 
    1232     element = $(element); 
    1233     return element.offsetHeight; 
     1245    return $(element).offsetHeight; 
    12341246  }, 
    12351247 
     
    12571269    if (!(element = $(element))) return; 
    12581270    Element.classNames(element).remove(className); 
     1271    return element; 
     1272  }, 
     1273 
     1274  toggleClassName: function(element, className) { 
     1275    if (!(element = $(element))) return; 
     1276    Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className); 
    12591277    return element; 
    12601278  }, 
     
    12961314  scrollTo: function(element) { 
    12971315    element = $(element); 
    1298     var x = element.x ? element.x : element.offsetLeft, 
    1299         y = element.y ? element.y : element.offsetTop; 
    1300     window.scrollTo(x, y); 
     1316    var pos = Position.cumulativeOffset(element); 
     1317    window.scrollTo(pos[0], pos[1]); 
    13011318    return element; 
    13021319  }, 
     
    17361753  matchElements: function(elements, expression) { 
    17371754    var selector = new Selector(expression); 
    1738     return elements.select(selector.match.bind(selector)).collect(Element.extend); 
     1755    return elements.select(selector.match.bind(selector)).map(Element.extend); 
    17391756  }, 
    17401757 
  • trunk/data/web/sf/prototype/js/scriptaculous.js

    r2877 r3081  
    1 // script.aculo.us scriptaculous.js v1.7.0_beta1, Tue Nov 21 10:25:25 CET 2006 
     1// script.aculo.us scriptaculous.js v1.7.0_beta2, Mon Dec 18 23:38:56 CET 2006 
    22 
    33// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     
    2525 
    2626var Scriptaculous = { 
    27   Version: '1.7.0_beta1', 
     27  Version: '1.7.0_beta2', 
    2828  require: function(libraryName) { 
    2929    // inserting via DOM fails in Safari 2.0, so brute force approach 
  • trunk/data/web/sf/prototype/js/slider.js

    r2877 r3081  
    1 // script.aculo.us slider.js v1.7.0_beta1, Tue Nov 21 10:25:25 CET 2006 
     1// script.aculo.us slider.js v1.7.0_beta2, Mon Dec 18 23:38:56 CET 2006 
    22 
    33// Copyright (c) 2005, 2006 Marty Haught, Thomas Fuchs