Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6387

Show
Ignore:
Timestamp:
03/11/07 23:26:54 (1 year ago)
Author:
madrobby
Message:

script.aculo.us: prepare 1.7.1_beta1, update Prototype, test housekeeping

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/scriptaculous/CHANGELOG

    r6370 r6387  
    1 *SVN* 
    2  
    3 * Update to Prototype 1.5.1_rc0 
    4     See http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/CHANGELOG?rev=6369 for more information 
     1*V1.7.1 beta 1* (March 12, 2007) 
     2 
     3* Update to Prototype 1.5.1 r6386 
     4  - Fixes SlideUp/SlideDown on IE 
     5  - Fixes an opacity problem with IE 
     6  - Performance optimizations 
     7  - See http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/CHANGELOG?rev=6381 for more information 
     8     
     9* Make builder unit tests work on IE 
    510 
    611* Fix id assignment for sounds on Firefox/Windows, fixes #7709 [Robert Wallis] 
  • spinoffs/scriptaculous/lib/prototype.js

    r6370 r6387  
    1 /*  Prototype JavaScript framework, version 1.5.1_rc0 
     1/*  Prototype JavaScript framework, version 1.5.1_rc1 
    22 *  (c) 2005-2007 Sam Stephenson 
    33 * 
     
    88 
    99var Prototype = { 
    10   Version: '1.5.1_rc0', 
     10  Version: '1.5.1_rc1', 
    1111 
    1212  Browser: { 
     
    629629} 
    630630 
     631if (Prototype.Browser.WebKit) { 
     632  $A = Array.from = function(iterable) { 
     633    if (!iterable) return []; 
     634    if (!(typeof iterable == 'function' && iterable == '[object NodeList]') && 
     635      iterable.toArray) { 
     636      return iterable.toArray(); 
     637    } else { 
     638      var results = []; 
     639      for (var i = 0, length = iterable.length; i < length; i++) 
     640        results.push(iterable[i]); 
     641      return results; 
     642    } 
     643  } 
     644} 
     645 
    631646Object.extend(Array.prototype, Enumerable); 
    632647 
     
    12741289  } 
    12751290 
    1276   element._extended = true
     1291  element._extended = Prototype.emptyFunction
    12771292  return element; 
    12781293}; 
     
    13601375 
    13611376  descendants: function(element) { 
    1362     return $A($(element).getElementsByTagName('*'))
     1377    return $A($(element).getElementsByTagName('*')).each(Element.extend)
    13631378  }, 
    13641379 
     
    14251440    element = $(element); 
    14261441    if (Prototype.Browser.IE) { 
     1442      if (!element.attributes) return null; 
    14271443      var t = Element._attributeTranslations; 
    14281444      if (t.values[name]) return t.values[name](element, name); 
     
    22262242    unique: function(nodes) { 
    22272243      if (nodes.length == 0) return nodes; 
    2228       var results = [nodes[0]], n; 
    2229       nodes[0]._counted = true; 
    2230       for (var i = 0, l = nodes.length; i < l; i++) { 
    2231         n = nodes[i]; 
    2232         if (!n._counted) { 
     2244      var results = [], n; 
     2245      for (var i = 0, l = nodes.length; i < l; i++) 
     2246        if (!(n = nodes[i])._counted) { 
    22332247          n._counted = true; 
    22342248          results.push(Element.extend(n)); 
    22352249        } 
    2236       } 
    22372250      return Selector.handlers.unmark(results); 
    22382251    }, 
  • spinoffs/scriptaculous/MIT-LICENSE

    r5468 r6387  
    1 Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     1Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
    22 
    33Permission is hereby granted, free of charge, to any person obtaining 
  • spinoffs/scriptaculous/Rakefile

    r6295 r6387  
    66PKG_BUILD       = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : '' 
    77PKG_TIMESTAMP   = Time.new.to_s 
    8 PKG_VERSION     = '1.7.0' + PKG_BUILD 
     8PKG_VERSION     = '1.7.1_beta1' + PKG_BUILD 
    99PKG_FILE_NAME   = "#{PKG_NAME}-#{PKG_VERSION}" 
    1010PKG_DESTINATION = ENV["PKG_DESTINATION"] || "dist" 
     
    2727  'test/**/*.html', 
    2828  'test/**/*.css', 
    29   'test/**/*.png' 
     29  'test/**/*.png', 
     30  'test/**/*.mp3' 
    3031] 
    3132 
  • spinoffs/scriptaculous/src/builder.js

    r6135 r6387  
    1 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     1// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
    22// 
    33// script.aculo.us is freely distributable under the terms of an MIT-style license. 
  • spinoffs/scriptaculous/src/controls.js

    r6261 r6387  
    1 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
    2 //           (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan) 
    3 //           (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) 
     1// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     2//           (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan) 
     3//           (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) 
    44// Contributors: 
    55//  Richard Livsey 
  • spinoffs/scriptaculous/src/dragdrop.js

    r6258 r6387  
    1 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
    2 //           (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) 
     1// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     2//           (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) 
    33//  
    44// script.aculo.us is freely distributable under the terms of an MIT-style license. 
     
    246246      zindex: 1000, 
    247247      revert: false, 
     248      quiet: false, 
    248249      scroll: false, 
    249250      scrollSensitivity: 20, 
     
    354355  updateDrag: function(event, pointer) { 
    355356    if(!this.dragging) this.startDrag(event); 
    356     Position.prepare(); 
    357     Droppables.show(pointer, this.element); 
     357     
     358    if(!this.options.quiet){ 
     359      Position.prepare(); 
     360      Droppables.show(pointer, this.element); 
     361    } 
     362     
    358363    Draggables.notify('onDrag', this, event); 
    359364     
     
    390395  finishDrag: function(event, success) { 
    391396    this.dragging = false; 
     397     
     398    if(this.options.quiet){ 
     399      Position.prepare(); 
     400      var pointer = [Event.pointerX(event), Event.pointerY(event)]; 
     401      Droppables.show(pointer, this.element); 
     402    } 
    392403 
    393404    if(this.options.ghosting) { 
     
    621632      hoverclass:  null, 
    622633      ghosting:    false, 
     634      quiet:       false,  
    623635      scroll:      false, 
    624636      scrollSensitivity: 20, 
     
    635647    var options_for_draggable = { 
    636648      revert:      true, 
     649      quiet:       options.quiet, 
    637650      scroll:      options.scroll, 
    638651      scrollSpeed: options.scrollSpeed, 
  • spinoffs/scriptaculous/src/effects.js

    r6284 r6387  
    1 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     1// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
    22// Contributors: 
    33//  Justin Palmer (http://encytemedia.com/) 
  • spinoffs/scriptaculous/src/scriptaculous.js

    r6370 r6387  
    1 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     1// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
    22//  
    33// Permission is hereby granted, free of charge, to any person obtaining 
     
    2323 
    2424var Scriptaculous = { 
    25   Version: '1.7.0', 
     25  Version: '1.7.1_beta1', 
    2626  require: function(libraryName) { 
    2727    // inserting via DOM fails in Safari 2.0, so brute force approach 
  • spinoffs/scriptaculous/src/slider.js

    r6191 r6387  
    1 // Copyright (c) 2005, 2006 Marty Haught, Thomas Fuchs  
     1// Copyright (c) 2005-2007 Marty Haught, Thomas Fuchs  
    22// 
    33// script.aculo.us is freely distributable under the terms of an MIT-style license. 
  • spinoffs/scriptaculous/src/unittest.js

    r5528 r6387  
    1 // Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
    2 //           (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) 
    3 //           (c) 2005, 2006 Michael Schuerig (http://www.schuerig.de/michael/) 
     1// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) 
     2//           (c) 2005-2007 Jon Tirsen (http://www.tirsen.com) 
     3//           (c) 2005-2007 Michael Schuerig (http://www.schuerig.de/michael/) 
    44// 
    55// script.aculo.us is freely distributable under the terms of an MIT-style license. 
  • spinoffs/scriptaculous/test/functional/index.html

    r6295 r6387  
    1010  <link rel="stylesheet" href="../test.css" type="text/css" /> 
    1111</head> 
    12 <body
     12<body class="navigation"
    1313 
    14 <h1>script.aculo.us Functional Tests</h1> 
     14<h1>script.aculo.us<br/>Functional Tests</h1> 
    1515 
    1616<p id="version"></p> 
     
    2424<p><a href="http://wiki.script.aculo.us/scriptaculous/show/UnitTesting" target="test">Documentation</a></p> 
    2525 
    26 <ul> 
    27   <li><a href="position_clone_test.html" target="test">position_clone_test</a></li> 
    28 </ul> 
    29 <ul> 
    30   <li><a href="ajax_autocompleter_test.html" target="test">ajax_autocompleter_test</a></li> 
    31   <li><a href="ajax_autocompleter2_test.html" target="test">ajax_autocompleter2_test</a></li> 
    32 </ul> 
    33 <ul> 
    34   <li><a href="ajax_inplaceeditor_test.html" target="test">ajax_inplaceeditor_test</a></li> 
    35   <li><a href="ajax_inplacecollectioneditor_test.html" target="test">ajax_inplacecollectioneditor_test</a></li> 
    36 </ul> 
    37 <ul> 
    38   <li><a href="dragdrop_test.html" target="test">dragdrop_test</a></li> 
    39   <li><a href="dragdrop2_test.html" target="test">dragdrop2_test</a></li> 
    40   <li><a href="dragdrop3_test.html" target="test">dragdrop3_test</a></li> 
    41   <li><a href="dragdrop4_test.html" target="test">dragdrop4_test</a></li> 
    42   <li><a href="dragdrop5_test.html" target="test">dragdrop5_test</a></li> 
    43   <li><a href="dragdrop6_test.html" target="test">dragdrop6_test: snap option</a></li> 
    44   <li><a href="dragdrop7_test.html" target="test">dragdrop7_test</a></li> 
    45   <li><a href="dragdrop8_test.html" target="test">dragdrop8_test</a></li> 
    46   <li><a href="dragdrop9_test.html" target="test">Revert: failure</a></li> 
    47   <li><a href="dragdrop_delay_test.html" target="test">dragdrop delay test</a></li> 
    48 </ul> 
    49 <ul> 
    50   <li><a href="sortable_test.html" target="test">sortable_test</a></li> 
    51   <li><a href="sortable2_test.html" target="test">sortable2_test</a></li> 
    52   <li><a href="sortable3_test.html" target="test">sortable3_test</a></li> 
    53   <li><a href="sortable4_test.html" target="test">sortable4_test</a></li> 
    54   <li><a href="sortable5_test.html" target="test">sortable5_test</a></li> 
    55   <li><a href="sortable6_test.html" target="test">sortable5_test</a></li> 
    56 </ul> 
    57 <ul> 
    58   <li><a href="sortable_tree_test.html" target="test">Sortable trees</a></li> 
    59 </ul> 
    60 <ul> 
    61   <li><a href="slider_test.html" target="test">slider_test</a></li> 
    62 </ul> 
     26<h2>Effects</h2> 
    6327<ul> 
    6428  <li><b><a href="effects_random_demo.html" target="test">Random effects test</a></b></li> 
     
    7943  <li><a href="effects_float_appear_test.html" target="test">Test for Safari .Appear w/ floats</a></li> 
    8044  <li><a href="effects_highlight_bg_image.html" target="test">Effect.Highlight keepBackgroundImage option</a></li> 
    81 </ul> 
    82 <ul> 
    8345  <li><a href="texteffects_test.html" target="test">texteffects_test.html</a></li> 
    8446</ul> 
     47 
     48<h2>Controls</h2> 
     49<ul> 
     50  <li><a href="ajax_autocompleter_test.html" target="test">ajax_autocompleter_test</a></li> 
     51  <li><a href="ajax_autocompleter2_test.html" target="test">ajax_autocompleter2_test</a></li> 
     52  <li><a href="ajax_inplaceeditor_test.html" target="test">ajax_inplaceeditor_test</a></li> 
     53  <li><a href="ajax_inplacecollectioneditor_test.html" target="test">ajax_inplacecollectioneditor_test</a></li> 
     54  <li><a href="slider_test.html" target="test">slider_test</a></li> 
     55</ul> 
     56 
     57<h2>Drag &amp; Drop</h2> 
     58<ul> 
     59  <li><a href="dragdrop_test.html" target="test">dragdrop_test</a></li> 
     60  <li><a href="dragdrop2_test.html" target="test">dragdrop2_test</a></li> 
     61  <li><a href="dragdrop3_test.html" target="test">dragdrop3_test</a></li> 
     62  <li><a href="dragdrop4_test.html" target="test">dragdrop4_test</a></li> 
     63  <li><a href="dragdrop5_test.html" target="test">dragdrop5_test</a></li> 
     64  <li><a href="dragdrop6_test.html" target="test">dragdrop6_test: snap option</a></li> 
     65  <li><a href="dragdrop7_test.html" target="test">dragdrop7_test</a></li> 
     66  <li><a href="dragdrop8_test.html" target="test">dragdrop8_test</a></li> 
     67  <li><a href="dragdrop9_test.html" target="test">Revert: failure</a></li> 
     68  <li><a href="dragdrop_delay_test.html" target="test">dragdrop delay test</a></li> 
     69  <li><a href="sortable_test.html" target="test">sortable_test</a></li> 
     70  <li><a href="sortable2_test.html" target="test">sortable2_test</a></li> 
     71  <li><a href="sortable3_test.html" target="test">sortable3_test</a></li> 
     72  <li><a href="sortable4_test.html" target="test">sortable4_test</a></li> 
     73  <li><a href="sortable5_test.html" target="test">sortable5_test</a></li> 
     74  <li><a href="sortable6_test.html" target="test">sortable5_test</a></li> 
     75  <li><a href="sortable_tree_test.html" target="test">Sortable trees</a></li> 
     76</ul> 
     77 
     78<h2>Sound (experimental)</h2> 
    8579<ul> 
    8680  <li><a href="sound_test.html" target="test">sound_test.html</a></li> 
    8781</ul> 
    8882 
     83<h2>Miscellaneous</h2> 
     84<ul> 
     85  <li><a href="position_clone_test.html" target="test">position_clone_test</a></li> 
     86</ul> 
     87 
    8988</body> 
    9089</html> 
  • spinoffs/scriptaculous/test/test.css

    r5296 r6387  
    55body { 
    66  font-size:0.8em; 
     7} 
     8 
     9.navigation { 
     10  background: #9DC569; 
     11  color: #fff; 
     12} 
     13 
     14.navigation h1 { 
     15  font-size: 20px; 
     16} 
     17 
     18.navigation h2 { 
     19  font-size: 16px; 
     20  font-weight: normal; 
     21  margin: 0; 
     22  border: 1px solid #e8a400; 
     23  border-bottom: 0; 
     24  background: #ffc; 
     25  color: #E8A400; 
     26  padding: 8px; 
     27  padding-bottom: 0; 
     28} 
     29 
     30.navigation ul { 
     31  margin-top: 0; 
     32  border: 1px solid #E8A400; 
     33  border-top: none; 
     34  background: #ffc; 
     35  padding: 8px; 
     36  margin-left: 0; 
     37} 
     38 
     39.navigation ul li { 
     40  font-size: 12px; 
     41  list-style-type: none; 
     42  margin-top: 1px; 
     43  margin-bottom: 1px; 
     44} 
     45 
     46.navigation a { 
     47  color: #ffc; 
     48} 
     49 
     50.navigation ul li a { 
     51  color: #000; 
    752} 
    853 
  • spinoffs/scriptaculous/test/unit/ajax_autocompleter_test.html

    r4799 r6387  
    1616<h1>script.aculo.us Unit test file</h1> 
    1717<p> 
    18   Tests for the Ajax.Autocompleter
     18  Tests for Ajax.Autocompleter in controls.js
    1919</p> 
    2020 
  • spinoffs/scriptaculous/test/unit/ajax_inplaceeditor_test.html

    r2491 r6387  
    1313<h1>script.aculo.us Unit test file</h1> 
    1414<p> 
    15   Tests for the Ajax.InPlaceEditor. 
     15  Tests for Ajax.InPlaceEditor in controls.js 
    1616</p> 
    1717 
  • spinoffs/scriptaculous/test/unit/builder_test.html

    r6135 r6387  
    1111</head> 
    1212<body> 
    13 <h1>script.aculo.us Builder unit test file</h1> 
     13<h1>script.aculo.us Unit test file</h1> 
    1414<p> 
    15   Tests for Builder. 
     15  Tests for builder.js 
    1616</p> 
    1717 
     
    2424<script type="text/javascript" language="javascript" charset="utf-8"> 
    2525// <![CDATA[ 
     26 
     27  // Serializes a node and it's contents to plain old HTML 
     28  // IMPORTANT: style attributes can't be correctly serialized cross-browser wise, 
     29  // so the contents of style attributes must match what IE thinks is correct 
     30  function serializeNode(node){ 
     31    if(node.nodeType == 3) return node.nodeValue; 
     32    node = $(node); 
     33    var tag = node.tagName.toLowerCase(); 
     34    return '<' + ([tag].concat($A(node.attributes).map(function(attr){ 
     35      // Filter out stuff that we don't need 
     36      if(attr.nodeName == '_extended' || attr.nodeName == '_counted' ||  
     37        typeof attr.nodeValue == 'function' ||!Element.hasAttribute(node, attr.nodeName)) return; 
     38      // remove trailing ; in style attributes on Firefox 
     39      var value = node.readAttribute(attr.nodeName); 
     40      if(attr.nodeName == 'style' && value.endsWith(';')) 
     41        value = value.substr(0, value.length-1);  
     42      return attr.nodeName + '="' + value + '"' 
     43    }).compact().sort())).join(' ') + '>' + $A(node.childNodes).map(serializeNode).join('') +  
     44    '</' + tag + '>'; 
     45  } 
    2646 
    2747  new Test.Unit.Runner({ 
     
    81101       
    82102      var element = Builder.node('div', Builder.node('span')); 
    83       console.log(element); 
    84103      assertEqual(1, element.childNodes.length); 
    85104      assertEqual('SPAN', element.childNodes[0].tagName); 
     
    173192    testBuilderComplexExample: function() { with(this) {       
    174193      var element = Builder.node('div',{id:'ghosttrain'},[ 
    175         Builder.node('div',{style:'font-size: 11px; font-weight: bold;'},[ 
     194        Builder.node('div',{style:'font-weight: bold; font-size: 11px'},[ 
    176195          Builder.node('h1','Ghost Train'), 
    177196          "testtext", 2, 3, 4, 
     
    186205       
    187206      // browsers aren't sure about upper and lower case on elements 
    188       assertEqual('<div id="ghosttrain"><div style="font-size: 11px; font-weight: bold;"><h1>ghost train</h1>testtext234<ul><li onclick="alert(\'test\')">click me</li></ul></div></div>', $('result').innerHTML.toLowerCase()); 
     207      assertEqual( 
     208        '<div id="ghosttrain"><div style="font-weight: bold; font-size: 11px">' +  
     209        '<h1>Ghost Train</h1>testtext234<ul><li onclick="alert(\'test\')">click me</li></ul></div></div>', 
     210        serializeNode($('result').childNodes[0])); 
    189211    }}, 
    190212     
     
    199221       
    200222      var element = DIV({id:'ghosttrain'},[ 
    201          DIV({style:'font-size: 11px; font-weight: bold;'},[ 
     223         DIV({style:'font-weight: bold; font-size: 11px'},[ 
    202224           H1('Ghost Train'), 
    203225           "testtext", 2, 3, 4, 
     
    210232       
    211233      $('result').appendChild(element); 
    212       assertEqual('<div id="ghosttrain"><div style="font-size: 11px; font-weight: bold;"><h1>ghost train</h1>testtext234<ul><li onclick="alert(\'test\')">click me</li></ul></div></div>', $('result').innerHTML.toLowerCase());  
     234       
     235      assertEqual( 
     236        '<div id="ghosttrain"><div style="font-weight: bold; font-size: 11px">' + 
     237        '<h1>Ghost Train</h1>testtext234<ul><li onclick="alert(\'test\')">click me</li></ul></div></div>', 
     238        serializeNode($('result').childNodes[0])); 
    213239    }}, 
    214240     
     
    217243        function(html){ 
    218244          var node = Builder.build(html); 
    219           assertEqual('SPAN', node.tagName.toUpperCase()); 
    220           assertEqual('this is <b>neat!</b>', 
    221             node.innerHTML.toLowerCase()); 
     245          assertEqual('<span>this is <b>neat!</b></span>', serializeNode(node)); 
    222246        }); 
    223247    }} 
  • spinoffs/scriptaculous/test/unit/effects_test.html

    r6236 r6387  
    99  <script src="../../src/unittest.js" type="text/javascript"></script> 
    1010  <link rel="stylesheet" href="../test.css" type="text/css" /> 
     11  <style type="text/css" media="screen"> 
     12    #rotfl { 
     13      color: red; 
     14      font-family: serif; 
     15      font-style: italic; 
     16      font-size: 40px; 
     17      background: #fed; 
     18      padding: 1em; 
     19      width: 400px; 
     20    }  
     21    .final { 
     22      color: #fff; 
     23      font-style: italic; 
     24      font-size: 20px; 
     25      background: #000; 
     26      opacity: 0.5; 
     27    } 
     28  </style> 
    1129</head> 
    1230<body> 
    1331<h1>script.aculo.us Unit test file</h1> 
    1432<p> 
    15   Tests the effect
     33  Tests for effects.j
    1634</p> 
    1735 
     
    2139<!-- Log output --> 
    2240<div id="testlog"> </div> 
     41 
     42<div class="morphing blub" style="font-size:25px;color:#f00">Well</div> 
     43<div class="morphing">You know</div> 
     44<div id="blah" style="border:1px solid black;width:100px">Whoo-hoo!</div> 
     45 
     46<div id="error_message">ERROR MESSAGE</div> 
     47<div id="error_message_2">SECOND ERROR MESSAGE</div> 
     48<div id="error_message_3" style="border:1px solid red; width:100px; color: #f00">THIRD ERROR MESSAGE</div> 
     49 
     50<ul class="error-list" id="error_test_ul"> 
     51  <li>Lorem ipsum dolor sit amet, consectetur adipisicing elit,</li> 
     52  <li>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li> 
     53  <li>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris</li> 
     54  <li>nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in</li> 
     55  <li>reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</li> 
     56</ul> 
     57 
     58<div id="rotfl">ROTFL</div> 
    2359 
    2460<!-- Tests follow --> 
     
    3369     'SlideUp','SlideDown','Pulsate','Squish','Fold','Grow','Shrink']; 
    3470   
    35   var COMBINED_RJS_EFFECTS = $w(''+ 
    36     'fade appear blind_up blind_down puff switch_off drop_out shake '+ 
    37     'slide_up slide_down pulsate squish fold grow shrink' 
    38   ); 
     71  var COMBINED_RJS_EFFECTS = $w('fade appear blind_up blind_down puff switch_off '+ 
     72    'drop_out shake slide_up slide_down pulsate squish fold grow shrink'); 
    3973      
    4074  var tmp, tmp2; 
     
    132166    testInspect: function() { with(this) { 
    133167      var e1 = new Effect.Opacity('sandbox',{from:1.0,to:0.5,duration:0.5}); 
     168      info( e1.inspect() ); 
    134169      assertEqual(0, e1.inspect().indexOf('#<Effect:')); 
    135170      assert(e1.inspect().indexOf('idle')>0); 
     
    275310        $('sandbox').appendChild( 
    276311          Builder.node('div',{id:'test_element'}, 
    277             [Builder.node('span','test')])); //some effects require a child element 
     312            Builder.node('span','test'))); //some effects require a child element 
    278313             
    279314        // should work with new Effect.Blah syntax 
     
    338373        e.render(0.5); 
    339374      },1000, 'With afterUpdate event');       
     375    }}, 
     376     
     377    testElementMorph: function() { with(this) { 
     378      $('error_test_ul').morph('font-size:40px', {duration: 0.5}).setStyle({marginRight:'17px'}); 
     379      $('error_message_2').morph({ 
     380        fontSize:         '20px', 
     381        color:            '#f00', 
     382        backgroundColor:  '#ffffff' 
     383      }, 
     384      { 
     385        duration:0.5 
     386      }); 
     387      $('error_message_3').morph('final', {duration:0.5}); 
     388      wait(1000,function(){ 
     389        assertEqual('17px', $('error_test_ul').getStyle('margin-right')); 
     390        assertEqual('40px', $('error_test_ul').getStyle('font-size')); 
     391        assertEqual('#ffffff', $('error_message_2').getStyle('background-color').parseColor()); 
     392        assertEqual('20px', $('error_message_2').getStyle('font-size')); 
     393        assertEqual('italic', $('error_message_3').getStyle('font-style')); 
     394        assertEqual('20px', $('error_message_3').getStyle('font-size')); 
     395        assertEqual(.5, $('error_message_3').getStyle('opacity')); 
     396        assertEqual('', $('error_message_3').style.fontSize); 
     397      }); 
     398    }}, 
     399 
     400    testElementMorphChaining: function() { with(this) { 
     401      $('error_message').morph('font-size:17px').morph('opacity:0',{delay:3}); 
     402      wait(4100,function(){ // 3000ms delay + 1000ms default duration 
     403        assertEqual(0, $('error_message').getOpacity()); 
     404      }); 
     405    }}, 
     406 
     407    testTransformBySelector: function() { with(this) { 
     408      new Effect.Transform([ 
     409        { 'ul.error-list li': 'font-size:20px;text-indent:40pt' } 
     410      ],{ duration: 0.5 }).play(); 
     411 
     412      wait(700,function(){ 
     413        var idx = 0; 
     414        $A($('error_test_ul').cleanWhitespace().childNodes).each(function(node){ 
     415          assertEqual('20px', $(node).getStyle('font-size')); 
     416          assertEqual('40pt', $(node).getStyle('text-indent')); 
     417          idx++; 
     418        }); 
     419        assertEqual(5, idx); 
     420      }); 
     421    }}, 
     422 
     423    testTransformUsesCSSClassPresets: function() { with(this) { 
     424      assertEqual('40px', $('rotfl').getStyle('font-size')); 
     425 
     426      // Render the effect at half-way through, font-size should be 
     427      // exactly half-way between original and target 
     428      new Effect.Transform([ 
     429        { 'rotfl': 'font-size:20px;text-indent:40pt;background-color:#888' } 
     430      ],{ sync:true }).play().render(0.5); 
     431 
     432      wait(1100,function(){ 
     433        // shoould be 30px = 40px + (20px-40px)/2 
     434        assertEqual('30px', $('rotfl').getStyle('font-size')); 
     435      }); 
     436    }}, 
     437 
     438    testTransformMultiple: function() { with(this) { 
     439      var transformation = new Effect.Transform([ 
     440        { 'div.morphing': 'font-size:20px;padding-left:40em;opacity:0.5' }, 
     441        { 'blah'        :  
     442          'width:480px;border-width:10px;border-right-width:20px;' + 
     443          'margin:20px;margin-bottom:-20px;font-size:30px;' + 
     444          'background:#954' } 
     445      ],{ duration: 0.5 }); 
     446 
     447      var generatedEffect = transformation.play(); 
     448 
     449      assertEqual(3, generatedEffect.effects.length); 
     450 
     451      wait(700, function(){ 
     452        // have a look at the generated color transforms for the 3rd found element 
     453        // which is the "blah" div 
     454        assertEqual('blah', generatedEffect.effects[2].element.id); 
     455        assertEnumEqual([255,255,255],  
     456          generatedEffect.effects[2].transforms.detect( function(transform){ 
     457            return (transform.style == 'backgroundColor') 
     458          }).originalValue); 
     459        assertEnumEqual([153,85,68],  
     460          generatedEffect.effects[2].transforms.detect( function(transform){ 
     461            return (transform.style == 'backgroundColor') 
     462        }).targetValue); 
     463 
     464        assertEqual('20px', $$('div.morphing').first().getStyle('font-size')); 
     465        assertEqual('20px', $$('div.morphing').last().getStyle('font-size')); 
     466        assertEqual('30px', $('blah').getStyle('font-size')); 
     467 
     468        // border-width/border-right-width should be set independently 
     469        assertEqual('10px', $('blah').getStyle('border-top-width')); 
     470        assertEqual('10px', $('blah').getStyle('border-bottom-width')); 
     471        assertEqual('10px', $('blah').getStyle('border-left-width')); 
     472        assertEqual('20px', $('blah').getStyle('border-right-width')); 
     473 
     474        // colors should assume transition from  
     475        // #ffffff (white) if original was transparent 
     476        // we now should have arrived at the given color 
     477        assertEqual('#995544', $('blah').getStyle('background-color').parseColor()); 
     478 
     479        // play again = should have same values 
     480        transformation.play(); 
     481        wait(700, function(){ 
     482          assertEqual('20px', $$('div.morphing').first().getStyle('font-size')); 
     483          assertEqual('20px', $$('div.morphing').last().getStyle('font-size')); 
     484          assertEqual('30px', $('blah').getStyle('font-size')); 
     485 
     486          $('blah').setStyle({'font-size':'100px'}); 
     487          assertEqual('100px', $('blah').getStyle('font-size'));         
     488          transformation.play(); 
     489          wait(700, function(){ 
     490            assertEqual('30px', $('blah').getStyle('font-size')); 
     491 
     492            new Effect.Transform([ 
     493              { 'blah': 'color: #80d980; background: #208020' } 
     494            ],{ duration: 1.1 }).play(); 
     495            wait(1500, function(){ 
     496              assertEqual('#80d980', $('blah').getStyle('color').parseColor()); 
     497              assertEqual('#208020', $('blah').getStyle('background-color').parseColor()); 
     498            }); 
     499          }); 
     500        }); 
     501      }); 
    340502    }} 
    341503 
  • spinoffs/scriptaculous/test/unit/element_test.html

    r6284 r6387  
    1818<h1>script.aculo.us Unit test file</h1> 
    1919<p> 
    20   Test element extension
     20  Tests for Element extensions in effects.j
    2121</p> 
    2222 
  • spinoffs/scriptaculous/test/unit/index.html

    r5528 r6387  
    1010  <link rel="stylesheet" href="../test.css" type="text/css" /> 
    1111</head> 
    12 <body
     12<body class="navigation"
    1313 
    14 <h1>script.aculo.us Unit Tests</h1> 
     14<h1>script.aculo.us<br/>Unit Tests</h1> 
    1515 
    1616<p id="version"></p> 
     
    2424<p><a href="http://wiki.script.aculo.us/scriptaculous/show/UnitTesting" target="test">Documentation</a></p> 
    2525 
    26 <p> 
    27   Please note that some of these unit tests require Firefox <= 1.0.4 (due to a Firefox bug, 
    28   1.0.5 and later won't work [until fixed]). 
    29 </p> 
    30  
    3126<h2>scriptaculous.js</h2> 
    3227<ul> 
    3328  <li><a href="loading_test.html" target="test">Dynamic loading test</a></li> 
     29</ul> 
     30 
     31<h2>effects.js</h2> 
     32<ul> 
     33   <li><a href="effects_test.html" target="test">Effects test</a></li> 
     34   <li><a href="string_test.html" target="test">String test</a></li> 
     35   <li><a href="element_test.html" target="test">Element extensions test</a></li> 
     36   <li><a href="position_clone_test.html" target="test">Position.clone test</a></li> 
     37</ul> 
     38 
     39<h2>dragdrop.js</h2> 
     40<ul> 
     41  <li><a href="dragdrop_test.html" target="test">Drag &amp; Drop test</a></li> 
     42  <li><a href="sortable_test.html" target="test">Sortable test</a></li> 
     43</ul> 
     44 
     45<h2>builder.js</h2> 
     46<ul> 
     47  <li><a href="builder_test.html" target="test">Builder test</a></li> 
    3448</ul> 
    3549 
     
    4559</ul> 
    4660 
    47 <h2>util.js</h2> 
    48 <ul> 
    49   <li><a href="builder_test.html" target="test">Builder test</a></li> 
    50   <li><a href="string_test.html" target="test">String test</a></li> 
    51   <li><a href="element_test.html" target="test">Element extensions test</a></li> 
    52   <li><a href="position_clone_test.html" target="test">Position.clone test</a></li> 
    53 </ul> 
    54  
    55 <h2>dragdrop.js</h2> 
    56 <ul> 
    57   <li><a href="dragdrop_test.html" target="test">Drag &amp; Drop test</a></li> 
    58   <li><a href="sortable_test.html" target="test">Sortable test</a></li> 
    59 </ul> 
    60  
    61 <h2>effects.js</h2> 
    62 <ul> 
    63    <li><a href="effects_test.html" target="test">Effects test</a></li> 
    64    <li><a href="transform_test.html" target="test">Transform test</a></li> 
    65 </ul> 
    6661 
    6762<h2>unittest.js</h2> 
  • spinoffs/scriptaculous/test/unit/loading_test.html

    r3312 r6387  
    1313<h1>script.aculo.us Unit test file</h1> 
    1414<p> 
    15   Test dynamic loading 
     15  Test dynamic loading in scriptaculous.js 
    1616</p> 
    1717 
  • spinoffs/scriptaculous/test/unit/position_clone_test.html

    r2069 r6387  
    1313<h1>script.aculo.us Unit test file</h1> 
    1414<p> 
    15   Tests for String.prototype extensions 
     15  Tests for Postion.clone (to be moved to Prototype) 
    1616</p> 
    1717 
  • spinoffs/scriptaculous/test/unit/slider_test.html

    r6191 r6387  
    1313<h1>script.aculo.us Unit test file</h1> 
    1414<p> 
    15   Test of slider.js 
     15  Tests for slider.js 
    1616</p> 
    1717 
  • spinoffs/scriptaculous/test/unit/string_test.html

    r5742 r6387  
    1313<h1>script.aculo.us Unit test file</h1> 
    1414<p> 
    15   Tests for String.prototype extensions 
     15  Tests for String.prototype extensions in effects.js 
    1616</p> 
    1717