scriptaculous-1.9.0/0000755000175000017500000000000011504742473015414 5ustar fhabermannfhabermannscriptaculous-1.9.0/src/0000755000175000017500000000000011504742473016203 5ustar fhabermannfhabermannscriptaculous-1.9.0/src/scriptaculous.js0000644000175000017500000000556311504742473021452 0ustar fhabermannfhabermann// script.aculo.us scriptaculous.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010 // Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // For details, see the script.aculo.us web site: http://script.aculo.us/ var Scriptaculous = { Version: '1.9.0', require: function(libraryName) { try{ // inserting via DOM fails in Safari 2.0, so brute force approach document.write('

script.aculo.us Unit test file

initial
scriptaculous-1.9.0/test/unit/slider_test.html0000644000175000017500000004105511504742473022566 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for slider.js

1 2 3
1 2 3
1
2
3
1
2
3
1
2
3
scriptaculous-1.9.0/test/unit/index.html0000644000175000017500000000455111504742473021354 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us
Unit Tests

Documentation

scriptaculous.js

effects.js

dragdrop.js

builder.js

controls.js

slider.js

unittest.js

scriptaculous-1.9.0/test/unit/_ajax_inplaceeditor_result.html0000644000175000017500000000003511504742473025620 0ustar fhabermannfhabermannServer received: To be editedscriptaculous-1.9.0/test/unit/position_clone_test.html0000644000175000017500000003265211504742473024333 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for Postion.clone (to be moved to Prototype)

scriptaculous-1.9.0/test/unit/_ajax_inplaceeditor_tagged.html0000644000175000017500000000004711504742473025540 0ustar fhabermannfhabermannNew to be edited - edited scriptaculous-1.9.0/test/unit/icon.png0000644000175000017500000000043111504742473021006 0ustar fhabermannfhabermann‰PNG  IHDR exgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe<9PLTEµBBΔ”΄„œ!!­!!Îssœ½RRïÖÖµcc¥µçÆÆçµµœŒÿÿÿ{­ì­ƒcfIDATxÚl‰ Â@C³ÛZ!@ïX¡Ug¶ÓÀBðÞ‡Â>êÎóK 0'«Ïœû£ë¼-ºÔ„—žIgåt‡&p! f®¶&µååÏ´žy¹L.°–„¶h/„EõĨ«ÿ0‘ Ý«ñIEND®B`‚scriptaculous-1.9.0/test/unit/_autocomplete_result.html0000644000175000017500000000047511504742473024504 0ustar fhabermannfhabermannscriptaculous-1.9.0/test/unit/_ajax_inplaceeditor_result2.html0000644000175000017500000000003211504742473025677 0ustar fhabermannfhabermannNew to be edited - edited scriptaculous-1.9.0/test/unit/dragdrop_test.html0000644000175000017500000001173011504742473023103 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Test of drag & drop functions in dragdrop.js

p_test

p_test2

p_test3

img_text
droppable_test
div_test
div_absolute_test
div_absolute_inline_test
droppable_test
droppable_test
droppable_test
scriptaculous-1.9.0/test/unit/_ajax_inplaceeditor_ipce_alt_text.html0000644000175000017500000000000511504742473027123 0ustar fhabermannfhabermannntbe scriptaculous-1.9.0/test/unit/unittest_test.html0000644000175000017500000001225611504742473023164 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

This is a preliminary version mostly for testing the unittest library.

XXXX
testcss1
testcss1
scriptaculous-1.9.0/test/unit/element_test.html0000644000175000017500000001206711504742473022736 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for Element extensions in effects.js

blah
op2 op2 op3 op3
First class Second class First and Second class Third class Nested First class
123
scriptaculous-1.9.0/test/unit/ajax_autocompleter_test.html0000644000175000017500000002423511504742473025173 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for Ajax.Autocompleter in controls.js.

scriptaculous-1.9.0/test/unit/sortable_test.html0000644000175000017500000001640111504742473023114 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Test of sortable functions in dragdrop.js

item 4
item 5
img
scriptaculous-1.9.0/test/unit/_autocomplete_result_nobr.html0000644000175000017500000000044711504742473025523 0ustar fhabermannfhabermannscriptaculous-1.9.0/test/unit/loading_test.html0000644000175000017500000000233611504742473022720 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Test dynamic loading in scriptaculous.js

scriptaculous-1.9.0/test/unit/effects_test.html0000644000175000017500000005151111504742473022721 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for effects.js

Well
You know
Whoo-hoo!
ERROR MESSAGE
SECOND ERROR MESSAGE
THIRD ERROR MESSAGE
ROTFL
foo!
scriptaculous-1.9.0/test/unit/ajax_inplaceeditor_test.html0000644000175000017500000012140311504742473025125 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for Ajax.InPlaceEditor and Ajax.InPlaceCollectionEditor in controls.js

To be edited

edit

New to be edited

External control for it

Me & Myself

First line
Second line
Third line
scriptaculous-1.9.0/test/unit/string_test.html0000644000175000017500000000522411504742473022610 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for String.prototype extensions in effects.js

scriptaculous-1.9.0/test/unit/_ajax_inplaceeditor_text.html0000644000175000017500000000002011504742473025260 0ustar fhabermannfhabermannText from serverscriptaculous-1.9.0/test/unit/_ajax_updater_result.html0000644000175000017500000000046711504742473024453 0ustar fhabermannfhabermannTest text more test text even more test text some other test text scriptaculous-1.9.0/test/unit/builder_test.html0000644000175000017500000002463511504742473022737 0ustar fhabermannfhabermann script.aculo.us Unit test file

script.aculo.us Unit test file

Tests for builder.js

scriptaculous-1.9.0/test/test.css0000644000175000017500000000241311504742473020064 0ustar fhabermannfhabermannbody, div, p, h1, h2, h3, ul, ol, span, a, table, td, form, img, li { font-family: sans-serif; } body { font-size:0.8em; } .navigation { background: #9DC569; color: #fff; } .navigation h1 { font-size: 20px; } .navigation h2 { font-size: 16px; font-weight: normal; margin: 0; border: 1px solid #e8a400; border-bottom: 0; background: #ffc; color: #E8A400; padding: 8px; padding-bottom: 0; } .navigation ul { margin-top: 0; border: 1px solid #E8A400; border-top: none; background: #ffc; padding: 8px; margin-left: 0; } .navigation ul li { font-size: 12px; list-style-type: none; margin-top: 1px; margin-bottom: 1px; color: #555; } .navigation a { color: #ffc; } .navigation ul li a { color: #000; } #log { padding-bottom: 1em; border-bottom: 2px solid #000; margin-bottom: 2em; } #logsummary { margin-bottom: 1em; padding: 1ex; border: 1px solid #000; font-weight: bold; } #logtable { width:100%; border-collapse: collapse; border: 1px dotted #666; } #logtable td, #logtable th { text-align: left; padding: 3px 8px; border: 1px dotted #666; } #logtable .passed { background-color: #cfc; } #logtable .failed, #logtable .error { background-color: #fcc; } #logtable .nameCell { cursor: pointer; }scriptaculous-1.9.0/test/functional/0000755000175000017500000000000011504742473020535 5ustar fhabermannfhabermannscriptaculous-1.9.0/test/functional/dragdrop5_test.html0000644000175000017500000000261411504742473024354 0ustar fhabermannfhabermann script.aculo.us Drag and drop functional test file

script.aculo.us Drag and drop functional test file

w/o hoverclass

### DROP HERE ###

Product2 <-- drag this!

w/ hoverclass

### DROP HERE ###
scriptaculous-1.9.0/test/functional/slider_test.html0000644000175000017500000001424311504742473023750 0ustar fhabermannfhabermann Text effects tests

Sliders

Standard horizontal slider

Vertical slider

Slider with predefined values [2,4,6,8] and a non-default range [2,15]

Slider with multiple handles

Slider with multiple handles and predefined values

Slider with multiple handles, external controls, handles are restricted (can't be moved prior/after adjacent handles)



<-- -->

Fun with spans

1
2
3




Slider with span and [1,10] range (test for #3731)

!
!
scriptaculous-1.9.0/test/functional/index.html0000644000175000017500000001121211504742473022527 0ustar fhabermannfhabermann script.aculo.us functional tests

script.aculo.us
Functional Tests

Documentation

Effects

Controls

Drag & Drop

Sound (experimental)

Miscellaneous

scriptaculous-1.9.0/test/functional/ajax_autocompleter2_test.html0000644000175000017500000000663611504742473026445 0ustar fhabermannfhabermann script.aculo.us Autocompleter functional test file

script.aculo.us Autocompleter functional test file

This is an incremental Ajax autocompleter. Type something, then type a comma, than type more. This autocompleter features an indicator.
Autocompleter ac1:

Non-incremental Ajax autocompleter.
Autocompleter ac2:

Non-incremental Ajax autocompleter.
Autocompleter ac3:

Local incremental array autocompleter ac4
with full-search. Type 'Jac', hit enter a few
times, type 'gne'.


Local incremental array autocompleter ac5
with fixed height and scrollbar. Type 'Jac', hit enter a few
times, type 'gne'.






scriptaculous-1.9.0/test/functional/effects_random_demo.html0000644000175000017500000000423411504742473025411 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

Random effects demo

Start... | Show/hide log
DIV1
DIV2
DIV3
DIV4
DIV5
DIV6
DIV7
DIV8
DIV9
scriptaculous-1.9.0/test/functional/_ajax_inplaceeditor_result.html0000644000175000017500000000003511504742473027003 0ustar fhabermannfhabermannServer received: To be editedscriptaculous-1.9.0/test/functional/sortable5_test.html0000644000175000017500000000263311504742473024366 0ustar fhabermannfhabermann script.aculo.us sortable functional test file
scriptaculous-1.9.0/test/functional/effects_queue_limit_test.html0000644000175000017500000000271611504742473026511 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Effect.Queue limit

up down
Do a bit sliding in parallel, with a scoped queue, but I am limited to one : ) so don't try over and over again...
scriptaculous-1.9.0/test/functional/dragdrop_delay_test.html0000644000175000017500000000411111504742473025437 0ustar fhabermannfhabermann script.aculo.us functional test

No delay sortable

Delayed sortable (500 ms)

No delay draggable

Lorem ipsum

Delayed draggable (1000 ms)

Lorem ipsum
scriptaculous-1.9.0/test/functional/position_clone_test.html0000644000175000017500000001170211504742473025507 0ustar fhabermannfhabermann prototype.js Position.clone functional test
abs
rel
static
abs-body child

unpositioned p

Toggle page scrolling | Page margings: on | off

Absolute marker in position:relative container DIV:
Mark abs | Mark rel | Mark static | Mark abs-body child | Mark p

Hidden marker (display:none), in position:relative container DIV switched on when clone is finished:
Mark abs | Mark rel | Mark static | Mark abs-body child | Mark p

Absolute marker, child of BODY:
Mark abs | Mark rel | Mark static | Mark abs-body child | Mark p

Fixed marker, child of BODY:
Mark abs | Mark rel | Mark static | Mark abs-body child | Mark p |
!
!
!
scriptaculous-1.9.0/test/functional/effects5b_test.html0000644000175000017500000000215711504742473024335 0ustar fhabermannfhabermann script.aculo.us Effects functional test file
 

script.aculo.us ScrollTo effect (with floats) functional test

(this test only applies to Firefox)

top of float

scroll to bottom!
 

Bottom of Float

w00t
scriptaculous-1.9.0/test/functional/effects6_test.html0000644000175000017500000000513611504742473024174 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Fade/Appear effect functional test

Note: these tests use the browser default CSS style rules.

DIV

TEST
Effect.Fade | Effect.Appear

SPAN

TEST
Effect.Fade | Effect.Appear

P

TEST


Effect.Fade | Effect.Appear

IMG

test image
Effect.Fade | Effect.Appear

The following elements are not supported with Fade/Appear on all browsers!

TABLE

TEST
Effect.Fade | Effect.Appear

TBODY

TEST
Effect.Fade | Effect.Appear

TR

TEST
Effect.Fade | Effect.Appear

TD

TEST
Effect.Fade | Effect.Appear scriptaculous-1.9.0/test/functional/icon.png0000644000175000017500000000043111504742473022171 0ustar fhabermannfhabermann‰PNG  IHDR exgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe<9PLTEµBBΔ”΄„œ!!­!!Îssœ½RRïÖÖµcc¥µçÆÆçµµœŒÿÿÿ{­ì­ƒcfIDATxÚl‰ Â@C³ÛZ!@ïX¡Ug¶ÓÀBðÞ‡Â>êÎóK 0'«Ïœû£ë¼-ºÔ„—žIgåt‡&p! f®¶&µååÏ´žy¹L.°–„¶h/„EõĨ«ÿ0‘ Ý«ñIEND®B`‚scriptaculous-1.9.0/test/functional/effect_direct_test.html0000644000175000017500000000607711504742473025262 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Highlight | BlindUp | BlindDown | SlideUp | SlideDown
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
scriptaculous-1.9.0/test/functional/_autocomplete_result.html0000644000175000017500000000076711504742473025673 0ustar fhabermannfhabermannscriptaculous-1.9.0/test/functional/ajax_inplacecollectioneditor_test.html0000644000175000017500000000367411504742473030375 0ustar fhabermannfhabermann script.aculo.us Demo

script.aculo.us Demo

Demo of the Ajax.InPlaceCollectionEditor.

three

(should autoselect "three")

two

(should autoselect "two")

three

(should manually select "one")

one

(should manually select "two") scriptaculous-1.9.0/test/functional/dragdrop_test.html0000644000175000017500000000674511504742473024300 0ustar fhabermannfhabermann script.aculo.us Drag and drop functional test file

script.aculo.us Drag and drop functional test file

Draggables/Droppables

inspect sortables
drag here (but not here)
Revert?
drag here
Revert?
testtest
scriptaculous-1.9.0/test/functional/effect_scale_test.html0000644000175000017500000000365711504742473025100 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Scale X only | Scale Y only | Scale X and Y
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
scriptaculous-1.9.0/test/functional/sortable2_test.html0000644000175000017500000001271711504742473024367 0ustar fhabermannfhabermann script.aculo.us Sortable ghosting functional test file

script.aculo.us Sortable ghosting functional test file

Ghosting

(waiting for onChange)

No ghosting

(waiting for onChange)

Ghosting (inside position:relative container)

(waiting for onChange)

Ghosting (inside position:relative container)

(waiting for onChange)

scriptaculous-1.9.0/test/functional/effects4_test.html0000644000175000017500000000404611504742473024171 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Highlight | BlindUp | BlindDown | SlideUp | SlideDown
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas enim. Nulla facilisi. Vestibulum accumsan augue vulputate justo. Fusce faucibus. Sed blandit, neque sed lacinia nonummy, diam quam imperdiet justo, at dictum augue nunc a neque. Sed urna lacus, tincidunt at, aliquam id, fringilla id, felis. Vivamus feugiat molestie quam. Sed id dolor. Sed ac purus id sapien sollicitudin ultricies. Aliquam hendrerit orci et odio. Suspendisse volutpat wisi at sem. Integer eget nulla. Duis eu diam a nunc condimentum tempus. Praesent gravida metus vitae massa. Aliquam neque magna, fringilla eu, porta id, interdum sit amet, dui. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin lorem est, ultrices sit amet, condimentum vitae, vehicula a, massa.
scriptaculous-1.9.0/test/functional/dragdrop2_test.html0000644000175000017500000000620311504742473024347 0ustar fhabermannfhabermann script.aculo.us Drag and drop functional test file

script.aculo.us Drag and drop functional test file

Draggables/Droppables

drag here
Revert?
drag here
Revert? I've onStart, onDrag and onEnd events!
This box overrides the default endeffect
This box overrides the default starteffect
This box overrides the default end- and starteffects
accepts first box
accepts second box
scriptaculous-1.9.0/test/functional/sortable4_test.html0000644000175000017500000000534511504742473024370 0ustar fhabermannfhabermann script.aculo.us sortable functional test file

script.aculo.us: Two floating sortables with containment and dropOnEmpty

This is the first list

And now the second list





 
 
 
 scriptaculous-1.9.0/test/functional/effect_shake.html0000644000175000017500000000375411504742473024043 0ustar  fhabermannfhabermann


  script.aculo.us Effects functional test file
  
  
  
  

script.aculo.us Effect.shake functional test file

Effect.Shake

shake
shake 2
shake 30
shake 60
shake these
shake 10
shake 20
shake 30
shake slow
shake fast
shake 2 slow
shake 60 fast
scriptaculous-1.9.0/test/functional/effects_toggle_test.html0000644000175000017500000000463411504742473025451 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effect.toggle functional test file

Toggle slide Toggle blind Toggle appear scriptaculous-1.9.0/test/functional/sound_test.html0000644000175000017500000000155711504742473023622 0ustar fhabermannfhabermann script.aculo.us Sound functional test file

script.aculo.us Sound test file

play sound (parallel) play sound (overwrite) Mute Enable sounds scriptaculous-1.9.0/test/functional/sortable_tree_test.html0000644000175000017500000001374511504742473025326 0ustar fhabermannfhabermann Sortable tree test serialize 1 scriptaculous-1.9.0/test/functional/sortable_nested_test.html0000644000175000017500000000224211504742473025637 0ustar fhabermannfhabermann Nested Sortable element bug scriptaculous-1.9.0/test/functional/effects_blind_test.html0000644000175000017500000000325111504742473025252 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Effect.BlindUp/Effect.BlindDown

Lorem ipsum dolor sit amet test! test! test! test! test! test! test! test! test! test! Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet

BlindDown()

BlindUp()

scriptaculous-1.9.0/test/functional/sortable6_test.html0000644000175000017500000000565611504742473024377 0ustar fhabermannfhabermann script.aculo.us Drag and drop functional test file

script.aculo.us Drag and drop functional test file

Scroll window down to test autoscrolling inside scrollable elements when window is scrolled

Draggables/Droppables

Some space in between





scriptaculous-1.9.0/test/functional/effects_grow_strink_test.html0000644000175000017500000000213311504742473026530 0ustar  fhabermannfhabermann


  script.aculo.us Effects functional test file
  
  
  
  
  
  


script.aculo.us Effects functional test file

Effect.Grow/Effect.Shrink

Lorem ipsum dolor sit amet

Grow: Grow()

Shrink: Shrink()

scriptaculous-1.9.0/test/functional/ajax_autocompleter_test.html0000644000175000017500000000501711504742473026353 0ustar fhabermannfhabermann script.aculo.us Autocompleter functional test file

script.aculo.us Autocompleter functional test file

Autocompleter ac1 (updated panel is relative, so no overlapping should occur):
Autocompleter ac2 w/ parameters:
Autocompleter ac3 (nested in postion:relative div, selects "selectme" class):



Autocompleter ac4 (autoselects option if single single option is returned):
scriptaculous-1.9.0/test/functional/sortable3_test.html0000644000175000017500000000277211504742473024370 0ustar fhabermannfhabermann script.aculo.us sortable functional test file

script.aculo.us Sortable two-lists w/ dropOnEmpty functional test file

Serialize sortable1 Serialize sortable2
scriptaculous-1.9.0/test/functional/dragdrop4_test.html0000644000175000017500000000310711504742473024351 0ustar fhabermannfhabermann script.aculo.us Drag and drop functional test file
(inside position:relative container)

script.aculo.us Drag and drop functional test file

Draggables/Droppables

Ghosting effect
test!

alert contents of test div
Ghost effect
scriptaculous-1.9.0/test/functional/sortable_test.html0000644000175000017500000002262311504742473024302 0ustar fhabermannfhabermann script.aculo.us sortable functional test file Create sortable | Destroy sortable | Serialize sortable Create sortable | Destroy sortable | Serialize sortable

no calls to onUpdate

20 times: Init with Preselection | Init normally scriptaculous-1.9.0/test/functional/effects_float_appear_test.html0000644000175000017500000000343111504742473026617 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us functional test file

See if workaround for Safari and floating elements with Effect.Appear works.

float:left | float:right | float:right (setOpacity 1) | image (non-floating) | image (floating) | image (setOpacity 1)
Lorem ipsum dolor sit amet,
consectetur adipisicing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
scriptaculous-1.9.0/test/functional/effects5_test.html0000644000175000017500000001626511504742473024200 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us ScrollTo effect functional test

scroll (slow-mo) down-below..., scroll last-heading

first-headingHeading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

DOWN BELOWHeading 2

scroll...

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

Heading 2

scriptaculous-1.9.0/test/functional/dragdrop8_test.html0000644000175000017500000000711111504742473024354 0ustar fhabermannfhabermann Drag & Drop

Drag from this table:

one1uno
two2dos
three3tres
four4quatro
five5cinco
six6seis
seven7siete
eight8ocho
nine9nueve
ten10diez

Drop on this table:

eleven11once
twelve12doce
thirteen13trece
fourteen14catorce
fifteen15quince
sixteen16dieciseis
seventeen17diecisiete
eightteen18dieciocho
nineteen19diecinueve
twenty20veinte

scriptaculous-1.9.0/test/functional/effects_queue_test.html0000644000175000017500000000435511504742473025314 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Effect.Queue

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet

Start queued effects (in 'global' queue)
Do a bit sliding in parallel, with a scoped queue
scriptaculous-1.9.0/test/functional/dropmarker.png0000644000175000017500000000032511504742473023411 0ustar fhabermannfhabermann‰PNG  IHDRô%œgAMAÖØÔOX2tEXtSoftwareAdobe ImageReadyqÉe<PLTE???ÎÎ΀€€ÿÿÿ÷v;ôtRNSÿÿÿÿÿ³¿¤¿7IDATxÚìÖ 0APºÿÊuþFð¢F¶æ¡ˆ”#QÝÙƒ"DoŒÎ¼Î;\Ÿ/À¼È6UUûÁIEND®B`‚scriptaculous-1.9.0/test/functional/effects_test.html0000644000175000017500000000514311504742473024104 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Effect.Highlight

asdasd
(highlight to red)
(highlight to greenish)
(bottom-right-grow)
click to test shake
click to test puff

update callbacks: (waiting) -- (waiting)

show puff div again test appear test grow test pulsate default times (5) test pulsate 2 times
pulsate
scriptaculous-1.9.0/test/functional/ajax_inplaceeditor_test.html0000644000175000017500000001013611504742473026310 0ustar fhabermannfhabermann script.aculo.us Demo

script.aculo.us Demo

Demo of the Ajax.InPlaceEditor.

To be edited

To be edited w/ blur

To be edited w/ okLink and cancelButton

To be edited w/ okLink only

With external edit control and custom parameter name   edit
test edit

Multi row editor: Lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum lorum ipsum

Loads text from server





























































Editor very far down to test scrolling bug

scriptaculous-1.9.0/test/functional/texteffects_test.html0000644000175000017500000000656411504742473025021 0ustar fhabermannfhabermann Text effects tests

Maybe this is useful? blah Dunno...

Appear | Fade | DropOut | show H1 innerHTML

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

THIS IS A WARNING!

Appear | Fade | DropOut

1234567890ABCDEFG
Appear | Fade | DropOut | Highlight | BlindDown

Fade all spans on page

scriptaculous-1.9.0/test/functional/_autocomplete_result_single.html0000644000175000017500000000010211504742473027213 0ustar fhabermannfhabermann

scriptaculous-1.9.0/test/functional/dragdrop3_test.html0000644000175000017500000000405311504742473024351 0ustar fhabermannfhabermann script.aculo.us Drag and drop functional test file

script.aculo.us Drag and drop functional test file

Draggables/Droppables






scriptaculous-1.9.0/test/functional/dragdrop9_test.html0000644000175000017500000000261111504742473024355 0ustar  fhabermannfhabermann

  
    
    
    
    
  
  
    
Draggable

Good Target

scriptaculous-1.9.0/test/functional/_ajax_inplaceeditor_text.html0000644000175000017500000000002011504742473026443 0ustar fhabermannfhabermannText from serverscriptaculous-1.9.0/test/functional/dragdrop7_test.html0000644000175000017500000001211211504742473024350 0ustar fhabermannfhabermann

Shrink your window until the right-hand pane is scrollable.

Drag from the list on left to groups on the right, force the right-hand pane to scroll.

Group 1

Group 2

Group 3

Group 4

Group 5

Group 6

Group 7

Group 8

Group 9

scriptaculous-1.9.0/test/functional/effects3_test.html0000644000175000017500000000431711504742473024171 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Effect.SlideDown/Effect.SlideUp

Start slide down | Start slide up | cancel() | inspect() | add content scriptaculous-1.9.0/test/functional/effect_puff_test.html0000644000175000017500000000473711504742473024751 0ustar fhabermannfhabermann script.aculo.us Effects functional test file

script.aculo.us Effects functional test file

Effect.Puff

click to test puff, no position set
click to test puff, floats
click to test puff, absolute position set

Floating inside a container

click to puff
click to puff
click to puff
click to puff
click to puff
click to puff
click to puff
click to puff
click to puff
scriptaculous-1.9.0/test/functional/effects_highlight_bg_image.html0000644000175000017500000000332111504742473026702 0ustar fhabermannfhabermann

Test of keepBackgroundImage parameter for Effect.Highlight. Click items to show effect.

With the keepBackgroundImage parameter.

Without the parameter.

scriptaculous-1.9.0/test/functional/dragdrop6_test.html0000644000175000017500000000447611504742473024365 0ustar fhabermannfhabermann script.aculo.us Drag and drop functional test file

script.aculo.us Drag and drop functional test file

Draggables/Droppables

Normal box
snap: 25
snap: [5,25]
snap: procedural (e.g. constrain to box)
snap: procedural (e.g. constrain to parent element)
scriptaculous-1.9.0/test/functional/effects2_test.html0000644000175000017500000000360011504742473024162 0ustar fhabermannfhabermann Untitled Document scriptaculous-1.9.0/test/functional/sword.mp30000644000175000017500000004253711504742473022327 0ustar fhabermannfhabermannÿû’d›8†@9Ò ÀŽAU8#€öH*ƒ ðÀ ðœ]âÐwÿñZ¯øYX‡Œ€Íÿãx`µŸÿsœFªÀµ€`þ`qé‹Û$?ÿþ\(Ø#pnt‡`å?ÿÿAs›$F‹ŒTÅfnaÿÿÿù¢j4tt&äÁ§ÿÿÿÿÿÿÿÿÿÿÿoÎíÿÿ1CãÅ?üï?ÿg" §ÿþ8x ©€€ áÏÿÿÅÞ®äÿÿÿÿÿÝØÿÿÿÿÿÿÿÿÿÿÿäyàa†a†NÄÎEØgClyQÁÃü °™ç†Ðö<òn7RƒCÇL56y3 ˜â±Qâ…‰B±ÃQŒW?c¢ò"Z%9&Z“Ðà —Á² ÌSÊœIŒ1Ng{øÝ\óOCgÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüÜÿÿ“?ïK_æ bgDþ¤K9ÊOó¹.í03ÿóçuZ«YQ§ÿçTWÿ­¿ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ›Z„€²8—ö‘ž<yAÓ‡Ðÿû’d €ÚV^ àGr ÀÁ ÁYÜô€ ž*û” °ÈéGa0?1†„ . NkT|\'“°Ün@±Ãc½‘£®aƒÁD:i§$äUÆš¤&ë8\#=J”=ófCL&r;Ÿ›.ßsRËöCÔ_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÖÿÿè”Z¯Y3FS1ldU1ÔlFBÝ5ÚªŠUd´„ªYPÈ館Yê©«^¿úÿ%ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿü½[:!Ž.Œë´¥’uÆâýïï7W ¸‚DUNnFFÉEkA2û²_`S6ÒA5Wš‡Ì#m³cé®·l¸¬0fq3ÄGA†a œî­Œ”©?U÷6Nm›\Ý Ôd‚ñáÕ X>ŸÔ%åÌ€Ìäìø.yÝ}*~nG}Þ—e·¢»­ZU%U©Ð½ÑC»««#/U{¡,ÿÝ,.Ûœû]Öjû–šw1,fÜñ:8P ¨¾4Ëçþu“Šú… B+sSÿû’d‚3QFÖñéBâ@èªîý».Ž¿"Qw“½KR*çWúk3"YeèûÑÑô³o°¡L!ŽTw¾¬î=ä‡yCAn¡õ0Ìh=Fë;ÏAýθæARø„/ºrišï¢¤±ûÍ]×È 0@€(¹+€Ü-d ŸG  Ÿ“j•lý潜|öYe¿ Ô•­©Äž;Ú…ls›³{„ó¬—šòÕçž¿ôêžÍöZ²HCw3Ôn°DåÔöµ"~¢ÀSáF§wÿÿü @꼦d?šðEՔч‰c׿ß7šÖúà@†³Î<¿m܆ Özû]ç›lüã.ôÇÈo¹k\bÊ¥‚©Êôw1 kYÌ®Î'pùÆSI_*ÝZŒ0>aC«ªëþ„)ÿÿÿÿ9Ɖ2Š¢ÿþÿû’d8ãp_Øyì+rA¨ýE\ ¹scç¤MÈó.kÌq ¹@v0\ qŒÛÿÍêgOù»õ31š¤JRÈÌߺÍõšœ·Fò3)­e›Ý;ºÔÁÔ¬D£üïÿõ…À€®Uô8Ù xŽÃÝ<‹Ö})\\ÿʨ£ÛäÖ¨¼&í†Îúh —‰‚¤$Í´Î6å˜ðlX¹AÔ #¬D6álµ#•˜ÈW:%îZÆ™ebŽ{¬éÿB[ÿÿÿþ§P4@Ô€"PÖŸùz*µßž¨ÏJÕBó%Ðõ3¯vw{-«ëdÑõFKŸß™ËÈÔ*²Ößü„3ÿÿÿÿç`yÉ«uQHñ.'ZúuÓ~=ojzÿÈî—¢aH§'Å’'œWYä7H€jjÉ3dLìlÉtlq½9 qP¦v£v39B” ’³šÔ+áÊga@ß]øå7ÿÿÿüèPÂÛm°’ „¯OÿȃÏ]Zò‹I4µ âÆ-¤¬û+Ȉƣ§zmcDÿû’dM‚n]WùérB šíBnMIo_ì$íÉ-ì|°‰¹s²nb ôïô¾¶²ÿÿ“ÿÿÿþ¨ÂŸ&­m9·¤;òÆXÿRÒë íåڿ䡨[à–0¾m¸~Õ”v%…˜3qœahÖD”&~–Îd†Æ Œ†à˜ó.4<ñ8aÆ%õ<º)ìHjBʯ©“Ú¤ö)z'ÿ÷*ßÿÿÿö“É©°p!>Žð’ åKâ¾öÊïÕ³”y;C£w¶£®½zô·d]ÕÞúÎÿóôfT¿ýYÿÿÿÿAÀªËT29ŽqPL‰é (´^/ï_½ËKÂEKbºjo¤…¶$Z³sÇ w¹DÝ5hšq‚9Baû(ˆDMo[k[ÍcÇÆZî=—…¾kpþÚ˜ Eƒ›¸·´DDDDq®îîˆ‰Wÿÿû»»º $¶ ÃÈH ª,¿ýèGÕÈÓHóUH; äg]·Ò§+é&ÌTBˆÑÛ½WUFí¢}ÇPbÿû’d_¤[×ùéCrCk{BnMåoe£ÍÈì-ìœP•¹ÿèËÿÿõÿø!ÿþú€+Ä AyWµŽñßì3JQQš[Ý ¤M²XÇ’-©Žà娹—ítAÑxƒŸf<Ï’9,͘Ëó» m?S6iŽí½¾·ÿpÏ&qZ›SSzÿÿýUÿÿÿýULÌÌÌÉĉ:ª‰J ÿà Ã&€¶ÿÿ¹¾z4BkxÞ77B]Ñ6¯¥~êU*"#×m¯‡E‘„DÄŽ0c#¿ü¿ÿÿÿÿàÉÊD Ï!mR«2uÁžú½=ñóe¤;ºÈÅ´aàv8ûF–6x™–2ÎÈÆ“¶†™òX†‚$aX¸x>= c±áÂÅ"åR™”ãZAˆìG!,ˆrÐë™õ¿åóÿÿÿÿñ™vá@¤ ÑH{2=þ¿ÿ^`_?/r‰ä}9{‘«Êe<¤s¤šùûü;ËJŸ§x,¶G:ßóßÿðçÿØõœ44Oo¿[AQ/›„U † ެÙQ°ÿû’de#k[Xùé+r>FÛ/<#\ yoe£$íÈ÷™ì´€pé §åØé¹¡ä* š›@ÕŽ¡‚P¬Á9@€á¹3,<5°ÔtãH²H˜78‚¡E,êbÝO8u]â,胥ŽOoþßÿÿÿüâßü€($ÉUÿü?ý|(ˆmIÓR>)DÌ÷oó6Rh]”³¯KGˤk…г4D$ 8wn,ûÿä€ÛXÈžCêsKNü¾‰5h 8NEi2$ªñªÈ>`*ÉX€ï¢ TŠ„ÏyƒèˆÞ…uOˆ‘—`Œ¹•Ô!.¢:X²$&WÅáÑ´(1ÒízÖ¼$Êí'g@³€Ï~'ÿÿò_þ€L8èßùþŠüˆ^s °§Fò÷VãÆ…ß¾Šë–b *„¤-ÎÉ«œn¾óÙqébà@Æ›?<#\ oiç¤íÉ­­8Ñ ¹©‘ü¯*L•*JVÙXýÉûú}>ÿÿÿÿü˯W/‡`*´¦1 2¹ið½¸ãQD‚–®£ Ï>Š·"&H`ÃQ”â-pa«ƒ¤h¦u2Æ„F‡çqÆ1É!…Èb °ñ…S*4@(x£ºÇ–¦UB¬`’è½~Ñÿÿÿÿø×ÍÎ(ʲ|;S¦AÚáÿó÷ÍW•óÉ÷ÉÒŸöÙròä‹·öN³ñ¾Ô‡~í)IÉ¿ù÷ˆŠT}ÿäêï@ SbÆä¨m]«slS¾–Ïî‚£.S[8tΑ^«¾‹—Äõ­6÷®´ Øìq#…Ï—yä²==•QÉÄIDo’û3ŒÍùh•’ŠË$ÆÔäš³OÏã ÞWoéBã»/ýïÿøÿÒ4•ÿ'•¨_€U“ÂîTßàÿ0y€*sž$kíQ,®óÌŽ´ÔÊõGóª6ëgvFƒ'˨p$ÙêÿÿÒÝt!”@£mãÿû’d²#@[Úq‰+rAGûO<#\ •#gç±+Áì¸Ð‰pIË-–o™ózÿ1~Ó¦@QdhÕDBqY묱ÆË·K¨6QV±& ­:!P¥t›õçâisÚ57ùz1=·#?RÝà«ßx6f›:Û]}f–U=“Ó[ÌÁÈûÿáÞà Ô– È_†8‚–ÿÏÉÿÈ·âñmçÍÝûG›wÕ‹l$æC+ª¿G7gG?§þexôÿÿÿü"ñUh¦•­48Þ‘"o¥µI·Cônö:5q¬âÊö:”¤S?k?Rú»:Ø|ÆN§‚ÓölÿAFƒQÇ=CEÊ—q¡'&¨<1ÍKØÃœ|I(HÊq…©{£ÌÿÿÙí_ÿÿÿLjdgq™³FÿýºyÓ}¶o<wd™•d£„%•ŽCh‹s½µ7z•­bŸ'ªô*ÝþÿûVÿý «¼TBÄñ]”¬ËÉ:ëz®=>f±ôK–§ªÛ°\+¢³ÕÆèµ¨a‘â:ZlvMP˜”ÿû’dÆcd>Øó bà?ëk_4"nMmeç°íÈù%,¼Ñ xÌ¿xãèla§ ꃃ ±Â¢Hˆz–TI©3y!Ó²1®Œû²7C¶o_þytY¯ÿÿÿñö;ÀÀ!( µŽ¿ýÿù‘¾ú.Ð_‚Éuy«£Õžê¤JÜ·D]&CZ‹êÕµå.Ul~ÏÿpNÃWÿÿÿðy7F¨°kf:ÓÇØÞ·Æé‹þŠ[dš%rR|ê––FHŸ%•z¹8, =!CjBiJÎ1X™1¡ƒåÀ<$&;8^§™V¹Ë.¹õ8®Kš”gÔ€á­c "y6ÕÿîhÙÞŸÿÿÿZÜÿ j à^ @TÂò}¿þûêçò/UÒ4iNò:]ÎnêóÕ4U÷O‘E"|¤:ÕB©OÑÿø'×ÿÿÿñ šÈd !ÆaÀöõö½mšíçòkÃçZг©0/&7=›&nWFTmµ{+<1ìâ]s‰½Žö˜—…Ò to.-h,LÎ$n€ö:L™—Ô›ÿû’dÛ#j[Yyì;rC+k?4BnM5meç¤íÉ­¬üЉ¹ šÌÝ’©±A)2"“QEIŸWdÒYïýý7ÿÿÿÿœºª (`&Á@ ›ÿý>ˆ´ûÖãØGvc ½ÙåiÐD\ýGˆ*´ŒagýwuÍE9[R©¯º±{VÍÿû+;ÿÿÿÿ…4,Ò €ba0ÁQX“NnuoSsÚ¥•/e$é¾Ý%kÑ»«n}ŸªÌLIæ‰Ä²Éi\§rIûµª¥ÊS——Eáôù¢§d]43Aeòùv³d>qNšЦ‰Mè²Lb“ÖêQ«¯º˜áïÿµÿÿÿþ¹ÆØÞ°V^¥ìˆ7O ‡ÿþš<©ë쀺©%.‡vTvÝÓ«Šôt<'èïà+§ìÿˆTö8ÿÿu3ÿÿÿÿ¸fªº2Ää8ˆ9>4Œ¥ÁyÞµóíºïÌx¹Â²¦Ö‡‡ŒÒ®R¦k¸³¦Ñ ªCR(ÕŠå,…IÕ¸µs¤J±Q”ˆÜ€¨™æÂp¨ðÑL9âŒÿû’dì‚cð[WqïkrJ«zþ(¥nNo]ű­É -ì<Ñ ¹˜d™…GņbžIÈo<÷ Þ²‚§o1 ·ÿÝ·ÿÿÿûŠSæÈœˆ„Œ-„Šÿ·×w“ýe¥ä3 µÌV©]e1×”**ïy’·tW« ‚–¯r™Ù_B)µØÿ¼+ÿÿÿÿÁ Ø×&` p§=;„Þóýí÷½U8Û>ç\°eåoáó70XÀ}0üDÀƒf‰œó£k·LôÕê>4.AeÆcÈÐ!ÒcËË™™ ˆcrT—$8VN½ƒÁù2>Ì??ï)ÿûÉÿÿÿþQ¢«,¥è&Âvaãÿ÷ûw¯Á[xœ îô5[G±• ÷™Á‘Š×3²Z¢¦Œ®-kÎèýßÿ삉ÿÿÿýÎɘV# f ±ÀºkÓöÎu¹ƒ}Ûpš³Üôù÷ÅQpƒ "»:"²µ±ªºù Žw¶5lÇ%œÔ$ãSÈÃu `½†¦4C Πÿû’dë‚#á[Wùï;rHK‹(BnNýo_ç½MÉ®,<¡ ¹¼I0v†š%(´Es³…ca±vìã¯üöÿûNÿÿÿü³#4Z³œG‰ÿû•”šÐæwv(@d@¨b‹¹ 3ÞR GkÑ Ðå:ó;½9Ÿ§?ò¿ÿõoÿÿÿè@C{ö¨“4VÝî'öû“ ·¾nþVÊÔ÷!Ôä‡_1BM|r…H™ù)e”Q6m JØDÛðëS]±,Ê—“ÌÂx|Pfᙂ•D²@-‹#‚¡Îˆ*…L%%)¡ÄC¢±1suCÎFÌRCÈ?·þŸÿÿÿÿÔ^[m0 R!q©¨ôÿÿßÿ¯½+òÚ¯žÔì¢}Xíô`ªH]Å“Êa" ¨Mœ} ¹› õ,ÏÅ„PÞæ;ÿ7ÿÿÿÿÿÿÀ¶ÖP+2¼€Æ¿+Œ¿¸ÝÆíÚÒŒóv9¬âjG‡æ¼ãŽ?{™‚©B,óÚa‘x£†¿kÒ>r[Ej? µ0ff'¡`_%6HzsÅÒñ©âÿû’dêc¥[×ùï;rF‹zÞBnOoV‡áMÉ"­ë,t¹ñÂzÆZri©¯M(ªs@É&fÒtÑ4þŸÿÿÿÿÿþ²oÿð€„Zp,3ÿÚŸ6ÑÚ ͬ( ”A‚fQ`þagXMž$H†Ï;KrPÑ/DÎ º²!:JÉü¿ÿÿ¿ÿÿÿƒgHSPCŒÛ•hnÎíñ­ýëuB+—™Áû¬¾z Æûé2>JqÔ÷T¸’¼Œù=âä­”. @nƒvìºbš×k}l+H²©´S‚a-t˜*#=Íÿû’dꆽ[Ui8krLëz½¢nMåqUç¼íÉ/-ªô… ¹8Tê<ótÓ=Žb‡šù³§Z•o¿ÿÿš~Q²Ÿýÿé ¢š›Èp0Yí`„ ƒÀ*Ùb·ÿÿÖ¾X=3(u-šÌP󹎷¸î‚glÓ”ÍT~¯ziíõB˹ݮۗþ_ÿùß¿ÿÿEÂ×ÉÒ $Im쪊ÏZ½‡ëÔÇ,s· g½c»Ì¤PØÜ˜½ŒâB¤n/ÄfrìÌas+¹ÌÜ’6Ph„®{ìå¼)/|Þ&(ÀI,i¦0z³YG®N?*U«5ˆ iT|¤„ƒj)çzÿÿèútÿÿùüdXÍEDÈ€HZxjÄy¸”;#Wÿû}Þ¸í’;¹m”h«Ä]Wê?W'! ®ô1¦ˆ=Ÿÿý[ûmöÿÿÿ•û÷ÿ×þÕ@ÀÿöÈP\‡ð§¯sé¥í7ÎjóŸ»Ò™m=|:ÿ(+†’.^klUÅÆ‹”qJÅă¬JmÚxWcf«GÛûÃ\­•ÌŠŽ‘À¨’{h¸Ãÿû’dé‚´[Tyø;rLKŠÏ 0‚mí$âÚ‰LïÚþïu.iêïs_’)D+‚¡³Ü‘’™h=Õ>¼>ð˜9/{籺Âú^ç_ºÃyÆäÆPpH*q¸’ªÿû’dè#¶[Séø;rH+j1nNÌéK‡ã ­ª¼ó‰¹›vxñ„†¢¤0£ 5MY¢q¹…‡Ó[½-ÿÿêêÒ£¦Ÿÿú°âyw¹pSŒÄLDØt52(W §»¿Z¾ìËö@gï_tS µ 8gš|¾uE|563 "Îá'j¼óïe'þ†)ÔSÿ CH Ÿ‰‰ôxšjS­f±-ñß×µ¯ÕÌózìåB˦¤’軵Î0x2†âµ!©{øÊäcKœÂ>ug—/¡Áù:±á ý ®©¢FMOõY§ÄšlyZ‘þo¬ïÊÚÄê’ Ú¤ÿíj´Yþ°Hÿý@ ÅKŠ Gó«Ý×:ܽˬP7–^±ƒ^$:„]±Üø‚’Œê ìjÕå÷wö_зd3oÛrÿÿé²µt^ÿÿûø¾0@Ax` d,[Òh|»Í¿5õoÝËV ºŽEKÕ^™‹qxdEw¶Ÿ¹+ž(\Ìý¨q: ×B mÈèXt›zŃááŠ&n¯¹Í‰ëD ÿû’dêä[Riø;rC…jŸ<¥L åGÇá뭩䲕»³×ù^ÌöÞÜHÖ¯ÌSâ˜×‰hðky›˜Sÿþÿÿº½DÃ#Èz3³ƒ3Ju›œ™Ûêûd‘9)Û@~}ùÍ@L®^ô/’Ÿ¯£ÿ¡Kÿ¦ÿÿý¬º7¾ÿÿ§«d8æA3!ÅõLž]zx…ˆpž³À>ؘf#ÕÍf9Θ@ß|…tå‡ÚF8 Ãm(ªdbps%ªè.ØôçÎ{IØÓ„ðr-4E$ .£¥ k’b„âeŽ2±ÂÔ‹ž>ôe:æÿÿéZhù÷Ñ¿ÿëŽß­ 98¤VpíD®ääÑRläWViÐÍ«-~P±bÏ “0¬cg£ªR¨ÆôY’›W·÷£õÿÿúµ›Ù¤ÓôÿøAØ»öp„¾ \$bi.#ü|zÛRD…XÒŒÍðªÒüjŽÿׇí/ˆ‘Ÿ·MÛež#e¦ž>d’÷µ(i&t2:XÁÂö©Ñæ¡‹N£†ÿû’dé#©:QÙøzàAëjŸ0BnOÁmG§¼íÉ.)ô‰¹=ʵÊLpÓš·7Oÿüx²µ‘[V§3oû…ÚÛk±bŠØ\ªÒ hw…ŒÓÖI߭Ѫäú+Æ27_^nÉ KÀ½^0z‰fÂŽº˜h‹'ßùÏoÛ숟ôÿÿøÖúrÿõÿ÷qdrä€('Æð.Á¬È„¤døøÏW»¯Ç5jõ­Ú¥•GÀ0†¢ŸÕ  ‡¦?åÕŸäìo—)±WÔ¶)êPXÆ›aœY"7Aò‘ÑhµÎ;VÌ©er‡J>Q–:ö0‚E:oÿüoþŸý?ýÆ—aÐ@`]GñŠ[7 8•ÝóOmêÜÎ9Ëéå˜ØÂ%[òãpØ,‡“-¦z˜ÇyÌQ*´G]»©šú·ªùÜÏtyV¶bš`’XpÉ oGwf«Ôÿû’dé‚#[Réï;rK Š}=nN­qG§àíÉ6­©tô¹½Ž"Îæ}‘g.¢³ÇMsZzöÿÿÇMëÚCÿëÿFÎÑ „#‡%¡†¬„ˆ9ããwùÍÍ¡®ó;¹@GâÈe¥ÊÆ  j2<µ©[4ý¥ªfCU®Ž÷^|Ù?fÿÿù_úDß_ÿ”5—‘D§¢ÉÐØ~ôƒoºfío©ÍÖeõìaí n˜šïÕžÜfh³ÞZ¢l.” w_ŒB½ö{ž²åŸÎÿšyb¥8ƒGIœiæÌ«ˆ³™ÝŒ=]ÙLž6sO"Å(s·ÿÿÊó+´î—úû…Ù ,#$ @AÑêS‚šÞ#ÖT´ž*£î V/î?ç$LïY®|£J‘9Œ5±+9sYÍoÿÿÎÙçôÌþÇ H2ÆI,„- °ñ=™˜ ¸·›¾ög^«S!2Œ;h9=DÅJEc³1=÷è¬W©Œ­kÈxåG£g³×¹Kftÿÿÿ•¿7_Òöÿë\²@(„öv7Nkö2±Ý~\§ýêþ7ieÛ×÷`™ ÃH¹!Ëæ&9j†Þ3qr.SÓW©^K-¯[ 5®j›òç^lI&•FÈ©4n“Ñÿû’dé¨[ÐiùkrJËz==nNqA§àíÉ=­é4ò•¹^¶­Ý»-Ju²>‚Öi[6­ÿùήú.ÿÚŸÿR\n§¸N}Pd|}ë:`ƧÐÓ«¶xh¾pì ªÄÅJ‡çiÙ—ñTºJn¾\â{Žþ&”:fÄèC‘Qû?ÿÿôÄ0”Óx:MvrãW°þóyýZ-]¹~½66bŸ¥¡e$äË&Àò¾¯_åmäU·Oj–ãG彟ãÝ]ÿ­óM,¥ŒC™Õ,Îqª}¤Ö[ž¬Ì¬÷z¹¬ÈY?ÿßúíLïúÛþ‰aðç B™$À¨#Là'èsƒúßWÕp?ädV³ ™0xùžÇ~u˜(h°ÕxǦÕ+Ý÷FE<®ê×vEBU¨-ÐÈ䣚ŽÒ´Ó#«/úÿoëý²÷éÖß÷‰#"ÄÔäÖäñ›ž´¿‹»§·Ï¿R)7bU*ËR$´#M'äø[‚¤»÷%úPÏgå‹£÷u޵ªÜÎîÙ'©s‘QZÓçîÝÏžÇÿû’dè[ÏëkrHgZ<ïãÜ»3¤üÄûs_:ŽÔÉUw1̧òå\ë»9…³~ì¦#¾4Î÷cÔ×Vm[{ÿöÿï›ÿ§ÿX 0™aÒÆ¾Îa†±ZÃß{w-Þ»V¥—^•8¹êZ@ä_©g%‹Ú|®wtÁ`iÃ.§×rauÞe½çÍãߦҹŠçyBƪÜǘ¦1mcS.æ%žs:)ù¿§ÿÿý;ÿ·ýjh œ*€¢Š¹‘v³{7–¹‡å‹å‘½H;¶âiH8=è,ÛšüxN'TK:ɨs¾á”ä{umjóÿ~—¦¿ÿÿÿÿÓÝNÛ{îš›oõ`ˆ±À"‰.—ìëðÅc5)y¬+gR¯#šÎ¤ºïh¥±äç_ä>Ù5çoËÑŽmí­ÿA*¯kPý¿lóýÞ­eøçÞ&œNxðÒrE!5ÿû’déŽ\OÑøSrOËj==nMq=,`íÉJ.'é…¹×SYq©žu:›K3œåM>®º²ÿõúioþ–ÿŸ hUua@ qp VQuJoX¢2˜­º¼Ø0“2%#›Î ÃcJRBÇ5vå=(EIuÏ'ú“ýÿš¨Ÿÿÿÿ¿_ÿ×ÿê¡c„DaØ0ly%ÕU$U-?SgkR¼mC•lس-—ÝœWr6…EÁëEw†+ùë–ÿuœd€V#{QtºÿÂ1–©­þ¹[,º³,}ÌÌYtÆšSê1Y[ô£R¯VXÃz̶ý¯ÿÒ«B%?ÿÿÿÿÿÿïØ]€â€Lá3¢ëá­‘Nç­wѺid²†‘øµ‡n:‘j¿CpX:p;c£ÿÖõ?¶,Sß«)“òÔçáŸwLõÕ¢·18‚µ×Z’S½]Iÿû’dçŽ#œ\Î39SrGˉé=EnOMq4,f-É.gTó•¹]•¥{º-{©öÖ›½^¯ÿSÿ©×êÿ©Ô !‰E$èÄ€0B–‚g1Âri¡«« ÿë¢-Q.cžƒñ7ç’ј l†ž©×]»o}^ºÿïmV£úõ:§ÿÿÿú½¿ÿÿZ”…$ ™Ï±0 ²Ð‘%¥Z}aRÎYÇ—ó圩§óìÜ¢Tî]ºÑB&#ó=y”º‘\ßÝ‘2/Ifíû³2z \wb·ò¶0°PÅ8”œùç%Ôó ¢ÙQÑgܦ*L5î@†¹¦œbÓ[tíÿþ‹«.—ß¹ÕýB@º–EE"hPP†bârÃ4Må|PâÚ³+”D²¼É a °Ëö)qšgWµ6÷I”vgJkïo»ècl­F«XÕ·ÿÿþ†w÷úû¿üÀDHàÀ¢Ðž¦)~‚'aï“SM^ÎõJ²ŠÓ»½¨ÖÊ.OC¯)†FúÓ­Uc2gƒÿÿ”¨}X·%£Õ,þVµ½Oþ±üsÚÅsLjê@ÇÍwJ[«ždíÿû’d选\N+kvK+‰ü`ínNÙo6LeMÉ5®(tñ)¹ÉF£Us Ißvôjÿüö[&z"†û³þ´RP ?S ˜¸º ‰&X«V3k?[«‡WÑ’©Šñr‰u y°?‚8Y}óÛ6o¿ûoöûtéçQÿý¿·ÿÛõôG`Z”‚$–I¹B}6Š®ÃÜÙ¬®Ú•ÓvýÕ4ŽA 7ó±geƒÀ3­VtLgPÎíkóÉþqðÜžQÊÔZÿ,LÛ¹w?¦ùX)8ö?,¥ÇãéÇ:·ÕX±4Ü£³žµW«åPõiŨVš½9ß­ÿùþÖ»Õ@4ŒTìt ôXH9ø/Ü YJÆ¿úŸ±L˜!2½ ‚ ÇOábEØ/”χŸüõª?ÿÕ¶Õ¿ïê¿ÿÿÿýi­0ÿM6ýM á©@pÆH±“TpÉ,ÚF^yù&£Óï5#¤Ž?²¹u f,ûʧ«õœrP¡¯# Óê¡™ +ßz/Áj;ºY$Ål»öw—Ü,h˜±‹)DeNC}Qÿû’dèc[ÎSpF+‰éß;ôþÿÿ7öÒ¨ÀÿÆ!(yP=EriQ¨µÞÿÞ6^Z'ã|–ãrû×ñ_¥é{ªk’ío¾õ¶eÿõzU2 ~hyõw_ÿÿÿëWÿýýia²Ô 8‘âk"V6ën%fõ™ž×ªm%‰ úKPKÞ§¡@ª`q})³¼üFöÖ&EÑå4ë–vô2EZ‘Í_ýjþýUæ Ë¡S¿³•"4þªC(Z§þÎÅg·ÿo·nßM¯íú}z+pÔ§Ðݲ´ +ðàâP¡FŸÒÓZÇÅÞêëÛ?ÑÕuS£ëdj%_îüŽ"ec½{âÌ"†ä¡ã6íñˆÿÿÿ­¿óèßÿ ‹p«yÌ}´Ÿ­”¤È¥»ìO¯_tX.‚¼?"xh „\Øä„V/<Õ{“q«ö1£ÂE ã{”Õ¬ßÞ[Ï“ÙVTê-S­I5h*`nÿû’déŽÙ\LƒSpI+Š <ÍnNq4,=MÁ$­é´ñ¹£®«™žê]•ªÚ÷o©ªV¯êôÿ¿ÿ^ÿ¦È¾ß[~H‚¥Ã‚Ú!$1.EAH¸Ý=sPjÖO˜í‘g©×9%ÿž˜‹óOwdk;RÛõ˜V½¬*Â:¥ÎYnÊoÿÿý+îǾÚÏÝ¿êŽ# då͆ž9:‹;δ«™ë”Tºµ ÇgU«¢˜ë…h;ˆ^ñ¦Ö©KkP3šEý¡Ì§ŒÉI§Å-|O ´’B¶SÓÒIHªuè;²õº*dUêvGZúh º×WÿoíÿÿÿÿZ–8G+!$&Se[%€é† -„¨D»=ž°×^Ñ E9õ!$Enßÿôa/^õj±Ìu¡:·ÔŸë#‹ÊC™V¥WÿÿÿéýS—W¥Uþ±#‚Å3-‰}¢aR6í*`–?:Üôi¨]Õ­ >S9ŒÈDHlr:o8¹öÁ+(ã‡#ªl—:''73©O£fMªëRh6ƒ$Ý«MÖjé'Aٗ꤅ÿû’dé„Q]αìSrS Éæïÿÿÿÿÿÿÿÿ†J‘ jCÂ'˜ˆ•V-:Y3‡bÐ,]Á‰…ÅH5:ÛZÄr ô„â»Y„¨Ÿ(ubÂW¿ûL) ‘Ÿ.^íG*Ýg¼>üò#ŒaaÃÎ$PÆvF0uó˜uÔ›NÍ8ØóŒmMþÏc‰}vîÿÿÿÿÿ¯þ8‰(W ¢ÝN•‹ ¥¦¤œm®Þ¨L^X´®>Ä…C¢‰ULiÏ‹î˜vœÑåß÷ÿÿÇŽs[ÿu¿ôøŸÿÿÿPˆ @áœì’®©$[ú dªhÁ9 bøœëÆ‘pRfB¦wYì«cBU"Äc¡3Ýû^šã…ÛôLl IBT¡éMåJ”eË.Š +,w~.ÿû’dçC¦dM krIL‰ú<§nO%2,¼íÉ”g†!(¬ªr³ûö=¼µ¯ÿ¸«ò¥•;ÿÿÿÿñ‚'K<ªô5 ôä´E€×ÀÁp[ÁÄJçMW¹õV´J¥IGP2]1>+>|X9)Ý Æü«þÀì¼käuÐhYšùfó§ïÿ[¿3º¹EêÑÿý_ÿÿþ€!špavÖ¢-²Öþ= – •+ñmŠE!nP ÐæÅëdQ'ÎWHÆ|÷ΆΟÀV}(¸``éƒk@¸­U lVТ£L%'µ—Ø{„3û½Ë†ë)ÊhŸúÄàB\–hM òVåèÉg&±'s‚¢D‰€ XCÝøç¦~ÙAÇe¸ŽC¢¨tk; È©ô©)ºý¿FÞ¿÷¬E“ÜXÎmÊ$ªV j ¢³5u_÷üþçA›”B‹ú0Æ/JPïeøé.d(o$’~a6NÔ“1\›å"ã‘Çòh‡ Ä ¸HÍÌ 32÷riQL¾Xî~Ô‰±tsRúgÿû’dè€cÂAÌJàIE9°=†L \Ù6,=+‘¡'èó pšº=¯Ýk?V‡ýó¨V³‡Ï÷»ÿÿýP<´¬¸`‡)t7×N•Žy™[‡î²] Ë€ð”M¥Ã˜Õž GÌÿlú-£éÄŠep¬gfsЈàœÊÏK¾4+%½?õ?ÓO/ÿ¡YX½y' Ihî )ãDHáÓšÛ‹DR¤ÏóI7 ¢F[Ã59—F{Œ1’ª5a¨.&›Z€º$µYРn§H25œ±ìk<‡ŽÒðHáùNXÙÊ„ Ó«$7JÄ…Uõ7ÜÛ}ýÿþÞÙÿÿÿÿ«¤»?ÿÿòÜ yˆ”¸å%(gårŠ y;vYç„et8ÂÄ3áðÏù%€”°ÏŸ`f (v 9ÄUâ’ Ôf[2ª*©NÍ_ÿàÝþU¦ºÀùW eà!j(l Áent±Çœ™}Û40,‹ä ³  µÈaënÎ]H©ÜpˆY™©"x]­äEÁÎөݼR³¿PÂg’%µâÁÿû’dñŽcÛBÍ /jàP(Yæ=‚\Ý 4 =k;›'E† p+èPõ$­þu¸4øßÿÿþwý#Ö¦Ï*öÿÿþ¦¢«@†à˜™+³eúB#cù¯â °é¤DáãC«°œÆ †˜B;TV)<ı‡jz”dVD±ÜÌí¬{­?ÿ¬y?Û鬴¢¦ààp8Ààp8 †4)§ÀuJ·Gà „ÿ]r"ÿ™d¿áù‡¤Žá'€@ðq3À¸ô„²°wã1›@w†Å-pµý"<¶NäÀ6>BßDâ!ƒ"†Äˈ—Á¼ÈŠH1PêX—þx¾nfn¹ÃAŽASh|#'R‡üØÀÐÀòf‹7DÜrIôŽ 8PC”.!ÒMýÓt ‚ ´ôh²ÙZ_ÿÿÿÿÿÿÿÿÿÿÿÿé$’I ˜)"‘9..¨Ï°.FIaF&¡2115ã¼À¬¼d§1ó¦c$š]¢«|€`]Yãc%$’¿¢£4Ót*thÿºŒAÿû’d瀌7M aàJ(J*§œY:A;¹ªÄH&—$ÐÐZkdªJÿû&»³ª’?ÿþ¥»-Öêu!þ¿«ÿÿÿÿÿÿÿÿÿÿÿÿàTAGsword being drawn James Greever Brought to you by flashkit.comÿscriptaculous-1.9.0/test/run_unit_tests.html0000644000175000017500000000101611504742473022344 0ustar fhabermannfhabermann script.aculo.us Unit Test Runner <body> Heya, 1995! </body> scriptaculous-1.9.0/CHANGELOG0000644000175000017500000015050411504742473016633 0ustar fhabermannfhabermann*V1.9.0* (December 23, 2010) * Update to Prototype 1.7 * Search for all script[src] occurrences rather than just within the head. [pgib] * Fixed scrolling Sortables for Prototype 1.7 [fragility] *V1.8.3* (October 8, 2009) * Update to Prototype 1.6.1 * Effect.toggle to return effect (to be able to do Effect.toggle(element, 'appear', {sync: true});) [RStankov] * Use element.identify() for fetching element.id in Sortable.create [RStankov] * Fix deprecated usage of Position.cumulativeOffset. [#182 state:resolved] [James Wheare] * Make loader work for application/xhtml+xml served documents. Closes #95. [Pavel Sedek] * Check for Windows Media plugin and RealPlayer plugin in Firefox on Windows to allow sound playback. Closes #36, #86. [Alexander Gavazov et al.] * Remove dead code in effects.js. Closes #125. [Confusioner] *V1.8.2* (November 18, 2008) * Update to Prototype 1.6.0.3 * Make sure InPlaceEditor converts HTML entities to text. [Sean Kirby] * Fix that Builder.node did not return extended elements on IE. Closes #71 and #77. * Fix a bug in Sortable.destroy to make sure it's called on the referenced Sortable only, which allows for the correct intialization of nested Sortables. Closes Trac #8615. [Leon Chevalier] * Change Effect.Base#render not to use eval(), so certain JavaScript runtime environments (like Adobe AIR) that do not support eval() work. [King Maxemilian, John-David Dalton] * Fixed a calculation error in Effect.Transitions.pulse that could lead to flickering, add easing and change it to be a normal 0 to 1 transition that can be used with any effects; Effect.Pulsate now uses its own implementation. [Thomas Fuchs] * Fixed Effect.ScrollTo. Changeset 8686 had a typo, document.viewport.getScrollOffsets[0] is always undefined. Removed the max check as it is not a cross-browser way to get scroll height and breaks the effect. Depending on scrollTo to do the right thing. Closes #11306. [Nick Stakenburg] * Update version check so all Prototype versions can be required, not just x.x.x. Closes #10966. [Nick Stakenburg] * Using $$ in the loader instead of getElementsByTagName to prevent limitations. Closes #9032. [Nick Stakenburg] * Fix some missing semicolons. [jdalton] * Fix an issue with Effect.ScrollTo that caused Firefox to scroll to the wrong offset in some situations. Closes #10245. [nik.wakelin] * Fixes an issue with IE ghosting on non-absolute elements. Closes #10423. [Tanrikut, tdd] *V1.8.1* (January 3, 2008) * Fix Element#getStyles in IE. Closes #10563. [Tobie Langel] * Update to Prototype 1.6.0.1 as of 8551. * Fix a regression with autocompleters not responding correctly to cursor keys on both Safari and IE. Closes #10107. [thx Zman771] *V1.8.0* (November 6, 2007) * Update to Prototype 1.6.0 final * Ajax.InPlaceEditor now can deal with callbacks that return an object. Closes #10064. [tdd] * Fix a potential problem with the loader and Firefox 2.0 on the Mac. Closes #9951. [awaters] * Add duration and distance options to Effect.Shake. Closes #8637. [amiel, rmm5t] * Update code to use new Hash implemention in Prototype 1.6. Update InPlaceEditor to use new Class.create syntax. [tdd] *V1.8.0 preview 0* (October 12, 2007) * Update to new Class.create syntax in Prototype 1.6; update to latest Prototype 1.6 trunk. * Fix bottom CSS property reassignment and initialization in queues for Effect#SlideUp. Closes #7412, #7761. * Fix an issue with String#parseStyle that could sometimes cause errors on Safari 2. * Refactoring to use Prototype 1.6. Remove dependency of Effect.tagifyText from builder. Use Prototype code style rules more consistently. * Remove the deprecated Effect2 namespace. * Update to Prototype 1.6.0_rc0. * Some effect code refactoring to take advantage of new Prototype 1.6 features. * Effect.ScrollTo is now no longer a core effect (returns a Effect.Tween instance now). * Add Effect.Tween, a new core effect. This effect tweens between two values and sets a property or calls a method on an object (including DOM elements); or allows for a callback method, which will be automatically bound to the object. Examples: var whatever = { blech: 0 }; new Effect.Tween(whatever, 5, 0, 'blech'); // sets property on the object new Effect.Tween('foo', 10, 20, 'innerHTML'); // sets property on the 'foo' DOM element new Effect.Tween('foo', 10, 20, 'update'); // method call on 'foo' DOM element new Effect.Tween('foo', 50, 0, { duration: 2.0 }, function(p){ this.setStyle({border:p.toFixed(3)+'px solid red'}); }); new Effect.Tween(null, 0, 100, function(p){ scrollTo(0,p) }); // scrolls the window * Revert the workaround for the Firefox issue that makes autocompleter input field values be remembered correctly when the back button is hit to return to a page that contains autocompleted values, as this can cause "Are you sure you want to navigate away?" popups. Closes #8411. [okada] * Improve the way deactivating the active droppable is handled. Closes #9072. [Karsten Sperling] * Next version will be 1.8.0. Update to Prototype 1.6.0_pre1. * Make draggable initialization faster. Closes #8697. [ssinghi] * Make BDD-style testing compatible with IE6 and IE7. Closes #8972. [steveluscher] * Add BDD methods to booleans. Closes #9147. [steveluscher] * Add support for full CSS inheritance in Effect.Morph. Closes #9054. [Tobie] IMPORTANT: Note that this could potentially change the outcome of classname-based morphs, so be sure to check your morph effects if you use this feature. For this feature, the new method Element#getStyles is introduced, which returns an objects which properties correspond to the CSS properties found in Element.CSS_PROPERTIES. Note that this method doesn't work seemlessly across browsers for certain non-measurable CSS properties, such as float. * Add the externalControlOnly option to the in-place editors to allow for external controls to exclusively trigger the in-place editing. Closes #9024. [tdd] * Complete rewrite of Ajax.InPlaceEditor and Ajax.InPlaceCollectionEditor. [tdd] THIS UPDATE MIGHT AFFECT BACKWARDS COMPATIBILITY. Be sure to properly test, especially if you're using multi-line editing and/or monkeypatching. Read more about all the added goodness in this article: http://mir.aculo.us/2007/7/17/in-place-editing-the-summer-2007-rewrite * Update to Prototype 1.5.2_rc0 r7076: - Works around bugs in Safari 1 and Safari 2 Regexp engines that could cause crashes - Fixes a rendering issue with opacity-based effects and floating elements on Safari * Mild refactoring of sound.js to take advantage of new Prototype features. * Add highlight element method as a shortcut to Effect.Highlight. Example: $('message').highlight({startcolor:'#ff0000'}).update('KTHXBYE'); * Improve performance of String.prototype.parseStyle by caching the dummy element used. * Add combined effects as element methods. Examples: $('message').appear().update('Oh noes!'); $('login').shake({ duration: 2 }); * Add Effect.Transitions.spring, which simulates a spring which oscillates while coming to rest. This transition is specifically targeted towards use with Effect.Move, for example as a reverteffect when using Draggables, as it will have return values >1 and cause temporary "overshooting" of the effect. Closes #8474. [edg2s] * Fix effects initialization if no options are given. Fixes #7809. [thx Kroc Camen] * Fix incorrect placement on drop for absolute ghosting elements. Update to Prototype 1.5.2_rc0 r6955 (required for #8581). Closes #8581. [tdd] * Make sure the autocompletion happens on the token where the cursor is, not the last token when using tokenized autocompleting text fields. Closes #8588. [tdd] * Fix that non-Mozilla browsers would display messages with the autocompleter back-button fix introduced in 1.7.1 beta 2. Fixes #7752, #8411. [josh, stetz] *V1.7.1 beta 3* (May 19, 2007) * Update to Prototype 1.5.1 final * New elements and handles options for Sortable.create which take arrays of elements or element ids. These overrule the normal handle and elements finding options on initialization of the sortable, and can yield huge performance increases in situations where these elements or ids are known at call time. [Thomas Fuchs] * Major performance improvement of Sortable.create when using the handle option. [Tobie Langel] * Fix Builder.node double quote escaping in attributes, fixes #8125. [Aa!] *V1.7.1 beta 2* (April 28, 2007) * Update to Prototype 1.5.1_rc4 - Various optimizations and fixes - http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/CHANGELOG?rev=6604 * Fix autocompleter indicator not appearing when calling activate() directly. Don't show indicator for local autocompleting. Fixes #7770. [pyro8019] * Don't clear out autocompleting fields in Mozilla-based browsers when navigating back to a page with the Back button, fixes #7752. [seanc] *V1.7.1 beta 1* (March 12, 2007) * Update to Prototype 1.5.1 r6386 - Fixes SlideUp/SlideDown on IE - Fixes an opacity problem with IE - Performance optimizations - See http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/CHANGELOG?rev=6381 for more information * Make builder unit tests work on IE * Fix id assignment for sounds on Firefox/Windows, fixes #7709 [Robert Wallis] * Add Sound.enable() and Sound.disable() to globally turn off Sound.play() * Added Sound.play(url,options) in new sound.js file. scriptaculous.js automatically includes this file. Based on code by Jules Gravinese, used with permission. The sound player uses native sound support on IE, and falls back to using on other browsers, which means it uses QuickTime for most cases. The recommended format to use is MP3. Examples: Sound.play('blah.mp3'); // --> plays sound immediately in 'global' track Sound.play('blah.mp3',{replace:true}); // --> stop playing all sounds in 'global' track, and play new sound Sound.play('blah.mp3',{track:'mytrack'}); // --> places the sound in the 'mytrack' track Sound.play('blah.mp3',{track:'mytrack',replace:true}); // --> stop playing all sounds in 'mytrack' track, and play new sound The sound effect used in the functional test is "Sword being drawn" by James Greever, released as freeware. * Various effects engine optimizations [Tobie Langel, Thomas Fuchs] * Make Ajax.InPlaceEditor more customizable: [thx godlie] - Add an okLink option to Ajax.InPlaceEditor so you can have a link instead of a button. Uses the 'editor_ok_link' CSS class for styling, fixes #6455 - Add an cancelButton option to Ajax.InPlaceEditor, uses the 'editor_cancel_button' CSS class - Add textBefore-, textBetween- and textAfterControls (which default to empty strings) - For consistency, cancel link now also gets 'editor_cancel_link' CSS class * Add an onDropped callback to Draggables, that fires at the end of a drag when the Draggable was dropped on a Droppable * Add revert: 'failure' option to Draggables to only revert if not dropped on a valid drop target, fixes #6909 [davidw] * Update to new Prototype Browser detection * Fix a memory leak with Effect.Morph in Firefox, fixes #7558 [Malard] * Add ability to nest single nodes in Builder.node in addition to arrays of nodes. Examples: var element = Builder.node('div', Builder.node('span','blah')); Builder.dump(); var element = DIV(SPAN('blah')); *V1.7.0* (January 19, 2007) * Cleanups for Effect.Morph * Monkeypatch Prototype 1.5.0 to incorporate [6002], fixes setStyle({opacity:0}) for IE * Fix Effect.inspect() for Prototype 1.5.0 final hash changes * Update to Prototype 1.5.0 final * New option keepBackgroundImage: true for Effect.Highlight, fixes #5037 [docwhat, tomg] * Minor tweaks for issues with application/xhtml+xml documents on Firefox, fixes #6836 [sjinks] * Fix a possible exception with Sortables, fixes #6828 [craiggwilson] * Update to Prototype 1.5.0_rc2 revision [5844] (as of Rails 1.2 RC 2) *V1.7.0 beta 2* (December 18, 2006) * Change the default setting for effects to support up to 60fps, if renderable by the browser. Add performance info to effects unit test. * Change get/setOpacity to use Prototype's new support for cross-browser opacity. * Update to Prototype 1.5.0_rc2 revision [5741], which fixes some of the reported issues with beta 1 (see Prototype's CHANGELOG for more): * Opera 9, while not officially supported, should work now with Prototype and script.aculo.us * Fixes issue with Safari when using Prototype's Ajax helpers with HTTP authorization * Add hash and CSS className support to Effect.Morph, fixes #6674 [Tobie] Examples: $(element).morph('myClass') // will morph to all the properties specified // in .className (in your external stylesheet). // All properties which cannot be morphed (such as font-style) // will be applied AfterFinish $(element).morph('font-size: 10px') // or $(element).morph({fontSize: '10px'}) // will morph the font-size to 10px *V1.7.0 beta 1* (November 21, 2006) * Add Element.morph() and Element.Methods.morph() as a shortcut to Effect.Morph Example: // basic Effect.Morph $('error_message').morph('color:#f00;font-size:17px'); // fade out after a while $('error_message').show().morph('font-size:17px').morph('opacity:0',{delay:4}); * Update to Prototype 1.5.0_rc2 revision [5580] * Add a paramName option to the inplace editor for overriding the default parameter name of "value" * Add Effect.Transform that generates parallel executing Effect.Morph sets Example: // set up transformation var transformation = new Effect.Transform([ { 'div.morphing': 'font-size:20px;padding-left:40em' }, { 'blah' : 'width:480px;border-width:10px;border-right-width:20px;margin:200px;margin-bottom:-20px;font-size:30px' } ],{ duration: 0.5 }); // play transformation (can be called more than once) transformation.play(); * Add Effect.Morph core effect that morphs to a given CSS style rule. Effect.Morph does take orginal styles given by CSS style rules or the style attribute into consideration when calculating the transforms. It works with all length and color based CSS properties, including margins, paddings, borders, opacity and text/background colors. Example: new Effect.Morph('mydiv',{ style: 'font-size:3em;color:#f00;border-width:2em', duration: 2.0 }); *V1.6.5* (November 8, 2006) * Update to Prototype 1.5.0_rc1 revision [5462] * Support the HTML 'for' attribute in Builder by using 'htmlFor', fixes #6472 [gjones, tdd] var node = Builder.node('label', { htmlFor: 'myinput' }); * Add support to run a specific failing unit test by clicking on the corresponding test result, fixes #6290 [leeo] * Add modifier key support to Event.simulateMouse, fixes #6391 [savetheclocktower] * Add rails-trunk update task, clean up references to MIT license * Add new 'with-last' queue position option to queue effects to occur in parallel with the last effect to start in the queue * Add new special core effect Effect.Event for one-shot events that follow timelines defined by effect queues new Effect.Event({ afterFinish:function(){ // do some code here }, position: 'end' }); * Do some refactoring to make use of Prototype 1.5 functionalities and save LOC * Fix an possible crash of IE on Effect.SlideUp, fixes #3192 [thx nel] * Add Builder.build() to create nodes from strings containing HTML, [DHH] var node = Builder.build("

this is neat!

"); * Add a pulses parameter to Effect.Pulsate to control the amount of pulses, fixes #6245 [leeo] For example, Effect.Pulsate('d8', {pulses: 2}) would pulsate twice. If the option is not given, it defaults to five pulses. * Fix an issue with clicking on a slider span resulting in an exception, fixes #4707 [thx sergeykojin] * Fix an issue with Draggables when no options are supplied, fixes #6045 [thx tdd] *V1.6.4* (September 6, 2006) * Hotfix IE issues with patched Prototype V1.5.0_rc1 *V1.6.3* (September 5, 2006) * Update Prototype to V1.5.0_rc1 * Merge assertElementsMatch and assertElementMatches from Prototype's [4986] unittest.js [Sam Stephenson] * Update Prototype to revision [4930] * Fix various issues with IE detection and Opera, and setOpacity, fixes #3886, #5973 * Make Sortable.serialize handle DOM IDs like "some_element_1" correctly, fixes #5324 * Add assertRespondsTo and shouldRespondTo assertions * Add experimental alternate syntax for unit tests (Behaviour Driven Development-style) * Add support for onStart, onDrag and onEnd events directly on Draggables (invoked from the Draggables.notify), fixes #4747 [thx scriptkitchen] * Add element shortcuts to Builder that can be activated by calling Builder.dump() (see the unit test), fixes #4260 [thx napalm] * Fix selection of correct option in SELECT element generated by InPlaceCollectionEditor for indexed option arrays, fixes #4789 [thx steve] * Add autoSelect option to Autocompleters to auto select an entry if only one is returned, fixes #5183 [thx cassiano dandrea] * Added delay option to Draggables and Sortables, see test/functional/dragdrop_delay_test.html for usage, implements #3325 [thx lsimon, tomg] * Remove revert cache code obsoleted by #4706, fixes #3436 (again) [thx tomg] * Fix autoscrolling inside scrollable containers when window is scrolled too, fixes #5200 [thx wseitz] * Make Effect.Puff work correctly for floating elements, fixes #3777 [thx michael hartl] * Add version and timestamp to indvidual library files for easier identification (the files are preprocessed by the Rake fresh_scriptaculous task), fixes #3015 [thx Tobie] * Add assertIndentical and assertNotIdentical unit test assertions, which test for equality and common type, fixes #5822 [thx glazedginger] * Add integration test for Ajax autocompleter for results with no linebreaks, #4149 * Fix an issue with redrawing ghosted draggables that are inside a scrolled container, fixes #3860 [thx gkupps, tsukue] * Added a custom exception to all base effects when used on non-existing DOM elements, added a assertRaise method to unit tests * Fix autoscrolling when dragging an element unto a scrollable container, fixes #5017 [thx tomg] * Fix a condition where overriding the endeffect on Draggables without overriding the starteffect too leads to a Javascript error [thx Javier Martinez] * Fix a possible error with the drag/drop logic (affects the solution to #4706) *V1.6.2* * Fix a problem in the drag and drop logic if an reverting/drag ending draggable was initialized for a new drag (for example by clicking repeatedly) for all cases where the default start/revert/end-effects are used, fixes #4706 [thx tecM0] * Fix possible memory leaks with Draggables, fixes #3436 [thx aal] * Throw nicer errors when requires script.aculo.us libraries are not loaded, fixes #5339 * Make slider handles work when not displayed initially by using CSS width/height, fixes #4011 [thx foysavas] * Update sortable functional test with onUpdate counter * Make more Element extensions unit tests work on Safari * Add the assertMatch unit test assertion for asserts with RegExps [thx Ian Tyndall] * Fix a problem with Effect.Move causing "jumping" elements because of very low float numbers in some situations * Fix a missing semicolon in dragdrop.js, fixes #5569 [thx mackalicious] * Fix a slight inaccuracy with Effect.Scale that could lead the scaling to be one pixel off * Be more prototypish with Effect.Transitions.linear * Make Effect.Scale recognize font sizes that use the pt unit, fixes #4136 [thx aljoscha] * Fix IE hack in Effect.Opacity, fixes #5444 [thx nicholas] * Fix IFRAME layout fix for IE and Autocompleter, fixes #5192 [thx tommy skaue] * Fix only option in onEmptyHover, fiex #5348 [thx glenn nilsson] * Fix Effect.BlindDown and SwitchOff handling of supplied callbacks, fixes #5089 [thx martinstrom] * Fix a problem with field focus on Ajax.InPlaceEditor and loading external text, fixes #4988, #5244 [thx rob] * Do not attempt to scroll if scrollspeed is 0/0, fixes #5035 [thx tomg] * Fix a problem with Sortable Tree serialization, fixes #4939, #4688, #4767 [thx Sammi Williams] * Fix an endless loop with sliders, fixes #3226, #4051, #4765 [thx jeff] * Make autocompleter work with update DIVs that have scrollbars, fixes #4782 [thx Tommy Skaue] * Corrected options parsing on switchoff effect, fixes #4710 [thx haldini] *V1.6.1* * Update to Prototype 1.5.0_rc0 * Add Draggable object as third parameter to snap, fixes #4074 [thx mdaines] * Fix an IE flicker with SlideUp/SlideDown, fixes #3774, [thx sbbowers] * Add parsing/setting of any currently set opacity CSS rule to default opacity effect on draggables, fixes #3682 [thx Mike A. Owens] * Added prototype $() performance patch from #4477 and updated effects.js to new Element.addMethods() syntax * Sortable trees [thx Sammi Williams, sammi@oriontransfer.co.nz] - Added functional test (test/functional/sortable_tree_test.html) - removed greedy option - modified the way Droppables.show works - added affected list - added Droppables.findDeepestChild - modified Sortable.options to work for trees - modified Sortable.onEmptyHover with additional logic to insert the element at a certain place according to the overlap - modified Sortable.onHover to avoid DOM Exceptions - modified Sortable.create to support the creation of Sortable trees - added two convenience functions - Sortable.findElements and Sortable.findTreeElements - Added Sortable.tree (and a number of private functions to facilitate it) Returns a tree structure: var root = { id: null, parent: null, children: , container: , } var child = { parent: , children: , id: (as per options.format), element: , container: , position: } This is intended to become part of the public API, and can be used to manipulate the tree programatically. - Modified Sortable.serialize to use Sortable.tree when set in the options. * Fix a problem with window scrolling on draggables [thx Gregory Hill] * Let the benchmark method return the time taken in ms, so it can be used for time-based assertions * Fix problem with id-based handle names and draggables * More Element.childrenWithClassName optimization * Added benchmark method to unittest.js; some cleaning up of unit tests * Add fix for IE memory leaks in included prototype.js from [4094] *V1.6.0* * Major speedup for sortable with handles initialization [thx Jamis Buck] * Update to latest Prototype 1.5.0_pre1 trunk * Add functional "random effects" test, also for browser compatibility testing * Fix two typos introduced with the 1.5 Methods syntax update * Add functional test for $$-triggered effects with .visualEffect * Fix shift-tab for autocompleter in Safari, fixes #4423 [thx matt] * Prepare for script.aculo.us 1.6, add Prototype 1.5 requirement and check that Element.Methods is available in the scriptaculous loader * Refactor effects.js to use the new Prototype 1.5 Element Methods syntax * Update to latest Prototype 1.5.0_pre0 trunk * Fix a problem with the draggable window scrolling code and scrolling inside overflow containers * Add passing through of scroll options from Sortable to Draggable [thx Gregory Hill] * Make it possible to scroll window on dragging, #3921 [thx rdmiller] * Make Element.forceRerendering give up on any exception (this fixes various problems with IE) * added visualEffect method for the Element Mixin, fixed so you can chain multiple calls. [Rick Olson] * Fix only option on Sortable.create to accept multiple class names, fixes #3427 [thx glenn nilsson] * Added workaround for a rendering bug in Safari when using floating elements with Effect.Appear * Update lib/prototype.js to Prototype 1.5.0_pre0 *V1.5.3* * Change version number to V1.5.3, prepare Rakefile * Remove unneeded height restoring in Effect.BlindDown as that is handled internally by the restoreAfterFinish option to Effect.Scale, fixes #3667 [thx Ross Lawley] * Added Ajax.InPlaceCollectionEditor which uses a SELECT element instead of a text field (see test/functional/ajax_inplacecollectioneditor_test.html for usage), #3491 [thx anna] * Enable in place editor to use RJS (implements a new evalScripts option for the in place editor), #3490 [thx Richard Livsey] * Added Sortable.setSequence to programmatically reorder a Sortable, #3711 [thx Mike A. Owens] * Added unit test for #3732 (currently fails due to Prototype #3877) [thx michal] * Fix span positioning for sliders with ranges not starting at 0, fixes #3731 [thx michal] * Make name option on Sortable.serialize work again, fixes #3873 * Make dragging cancel only on ESC key, not on any key, fixes #3817 * Fix Rakefile for V1.5.2 *V1.5.2* * Change version number to V1.5.2 * Fix a wrong parameter in dragdrop.js, fixes #3555 * Fix two typos in effects.js, fixes #3481 [thx jtolds] * Add assertEnumEqual for unit testing (from Prototype SVN trunk) [Sam Stephenson] * Add Sortable.sequence method to extract the current sequence of a Sortable as an array, fixes #3675 [thx sphivo] * Add limit option to effect queues to limit the maximum number of effects in a queue, new unit tests for scoped effect queues, fixes #3498 [thx Abdur-Rahman Advany] * Fix Element.collectTextNodesIgnoreClass to correctly filter child nodes, fixes #3380 [thx lam] * Fix a condition where OPTION elements could cause unwanted dragging on Draggables, fixes #3441 [thx tom] * Fix a crash because of an IE bug in Effect.SlideDown, fixes #3192 [thx Rob Mayhew] * Added experimental auto-scroll option to Draggables and Sortables, activate with scroll: 'id_of_scroll_container_element'. Note: needs testing, call syntax might change See test/functional/dragdrop3_test.html for usage/demo * Added activate method to Autocompleter that allows you to trigger the suggestions through other means than user input [DHH] *V1.5.1* * Add select option to Autocompleter to optionally use textnodes from elements with a specific CSS class (see test/functional/ajax_autocompleter_test.html for usage) * In-place editor: add ok/cancel visibility options and onblur() submission, fixes #3233 [thx pulsation] Note: currently, blur form submission breaks the cancel link functionality, if enabled * Added Effect.toggle for slide, blind and appear/fade effects, fixes #2704 [thx Azad] * Added selective component loading to scriptaculous.js, see test/unit/loading_test.html for usage [thx David Zülke] * Added local/scoped effect queues [thx David Zülke] * New core effect Effect.Move that can do absolute/relative movement [thx David Zülke] * Make default effects options modifyable globally by setting Effect.DefaultOptions * Make Draggables recognize top/left CSS properties defined in an external stylesheet, fixes #3205 [thx ansonparker] * Fixed draggables starting to drag even if mouse button was released with no movement, [thx topfunky] * Updated the README to reflect final status *V1.5.0* * Prepared for V1.5.0 final * Update lib/prototype.js to Prototype 1.4.0 final *V1.5.0_rc6* * Update lib/prototype.js to Prototype 1.4.0_rc4 * Fix Effect.SlideDown/SlideUp on Internet Explorer, includes a change to Effect.Scale, (should) fix #2962 and others, [thx wyldeone] * Make Draggables that are reverting cancel the default revert effect when they are dragged again while reverting, fixes #3188, [thx maverick] * Fix a problem with a wrong reference in Effect.Pulsate, fixes #3184, [thx cyx_] * Fix Sortable.findElements for XHTML in Gecko, fixes #3081, [thx fgnass] * Fix a problem with the slider getting NaN results when clicking directly on the track, fixes #3020, [thx rectalogic] * Fix a problem with Safari not doing sub-pixel rendering when setting opacity to 1 with Element.setOpacity * Fix slider to make handle width/height count for track length, fixes #3040, fixes #3017, [thx buggedcom] * Added Basic unit test for Effect.inspect * Fix Effect.multiple to deal correctly with delays * Safeguard Effect.Base.render to only do updates when Effect is in running state, fixes #2912 * Added inspect method to Effect.Base * Added functional test for DOM-based UL sortables #3016 * Added offset option to Effect.ScrollTo * More effects.js/dragdrop.js refactoring * Refactoring and optimizations for effects (not complete yet) * Refactoring and optimizations for Draggables/Droppables/Sortables (not complete yet) *V1.5.0_rc5* * Make Droppables.remove accept DOM IDs in addition to elements * Added some unit tests for drag and drop * Update lib/prototype.js to Prototype 1.4.0_rc3 * Make 'contents' a synonym for 'content' on Effect.Scale scaleMode option * Fix some possible exceptions in slider.js * Support for various snapping options on Draggables, adresses #2826, [thx saimonmoore] * Support horizontal ghostable Sortables, fixes #2794, [thx johnm] * Prevent an exception on IE with a functional test, see #2706 * Add functional testing of hoverclasses for sortables * Add an assert for correct UTF-8 return chars in Autocompleter * Correct IE detection in Autocompleter for Opera, fixes #2558 [thx gary] * Add onDrag callback to Draggable observers, #2827 [thx saimonmoore] * Added Form.Element.DelayedObserver to controls.js for live-search fields * Remove Element.Class in favour of Prototype Element.ClassNames, new function Element.childrenWithClassName() * Update Copyright notice in slider.js * Fix slider firing onChange events to eagerly on dragging a handle [thx wombert] * Fix a problem with Start/End spans and single handles * Add event property to Slider object so that callbacks can determine if setValue originated from a UI event or from script * Fix Builder.node() throwing unresolved errors in IE6, #2707 [thx flwombat] * Give currently active handle on slider the "selected" CSS class * Add start and end spans to slider * Make track clickable for sliders (moves last active handle [or first handle] to nearest possible position) * Make initial values on slider work for single and multiple handle sliders *V1.5.0_rc4* * Abort Effect.Highlight on elements which have display:none set (prevents problem with Safari) * Make Effect.Queue an Enumerable, fix a problem with Effect.Grow, more unit tests * Added restricted option to prevent moved of handles prior/after adjacent handles on Sliders with multiple handles * Update lib/prototype.js to Prototype 1.4.0_rc2 * Fix a bug with wrongly scrolling to the page top in Ajax.InPlaceEditor (circumvents various browser bugs) [Jon Tirsen], #2616 * major slider refactoring, changed slider range to default to [0,1]. Slider Range can be set with range:$R(from,to) option. The increment option is not active for now. * Added spans support for Control.Slider to mark spans bordered by slider handles, see unit test [thx to www.bartenbach.de for sponsoring this functionality] * Added preliminary support for optional multiple handles to Control.Slider [thx to www.bartenbach.de for sponsoring this functionality] * Fixed wrong inclusion of libs in inplace editor functional test * Fixed Effect.SlideDown/SlideUp to honor refactoring of Effect.Scale, fixes #2523 [thx obiwanki] * Reset the zIndex on Draggables correctly, #2483 [thx Jon Whitcraft] * Fix onChange callback on Sortables when dragging between sortables, #2488 [thx Dylan Greene] * Removed Builder code from effects.js, removed Object.debug (implemented as Test.Unit.inspect) * Added slider unit tests, fixed handling of values to autocalculate min/max, fixed upper/lower boundaries on setting the value programmatically * Synced to Rails 1.0 release candidate, update to Prototype 1.4.0_rc1, removed util.js, merged rests of util.js into effects.js to prepare for refactoring * Give Builder it's own file * Fix a logic issue with Autocompleter [thx tshinnic], #2457 *V1.5.0_rc3* * Make Effect position available to callbacks * Droppables.fire: send event to onDrop callback [François Beausoleil], #2389 * InPlaceEditor: Add disabling the field while loadTextURL loads and add a class while loading, plus fix various bugs with Internet Explorer and InPlaceEditor, [Jon Tirsen] #2302, #2303 * Made Droppables.remove work again [thx Mindaugas Pelionis], #2409 * Fixed that IE6 would incorrectly render the "fix-windowed-elements-overlapping" IFRAME on autocompletion [thx tshinnic], #2403 * Fixed Element.getOpacity throwing an error on Safari in some situations (this caused the autocompleter not to work) * Added format option to Sortable.create and Sortable.serialize to allow custom id formats. The format option takes a regular expression where the first grouping that matches is used for building the parameters. The default format is /^[^_]*_(.*)$/ which matches the string_identifier format. If you want to use the full id of the elements, use "format: /(.*)/". More examples are available in the sortable unit test file. * Started refactorings to use the new Prototype features and general code-cleanup * Update lib/prototype.js to Prototype 1.4.0_pre11 * Fixed a typo breaking the up arrow key for autocompletion [thx tshinnic], #2406 * Changed the handle option on Draggbles to accept classnames, or ids or elements [thx to Andrew West], #2274 * Force indicator to be hidden on hiding autocompletion update element, #2342 * Make Draggables honor external CSS positioning [thx to Mark Shawkey], #2359 * Make zindex handling for Draggables honor external CSS styles * Fix two Sortable.serialize issues, [thx Avi, Gorou], #2339, #2357 * Make Element.getOpacity work with IE, added unit tests [thx to Greg Hill] * Make Element.setOpacity honor non-alpha filters on IE (it now works with filters for alpha PNGs) * Fixed that Element.class.remove wrongly deleted spaces between class names, fixes #2311, #2313 * Fixed Builder for OPTION and OPTGROUP tags on Firefox < 1.5 and Internet Explorer 6, completely fixes #2325 * Improved Builder implementation to deal with Firefox-specific requirements and innerHTML parsing, partly fixes #2325 *V1.5.0_rc2* * Update lib/prototype.js to corrected Prototype 1.4.0_pre7 (fixed a problem with IE) * Update lib/prototype.js to Prototype 1.4.0_pre7 * Reverted to patched version of Prototype 1.4.0_pre4 for the time being (getResponseHeader problem on Mozilla) * Attempt to fix crashes in Safari 2.0.1, probably related to the event registering und unregistering in Draggables, possibly fixes #2310 * Update lib/prototype.js to Prototype 1.4.0_pre6 * Changed effects_test.html functional test to incoporate Firefox anti-flicker overflow:hidden CSS property *V1.5.0_rc1* * Prepared Rakefile and README for V1.5.0_rc1 release * Droppables w/greedy and hoverclass are now reverted when dragged item is no longer over them, fixes #2184 * Let Effect.Highlight correctly parse IE colors, add String.prototype.parseColor() for this, fixes #2037 * Fix Effect.Highlight to restore background image only if there was one * Made Effect.tagifyText work again on IE * Added String.prototype.toArray because Strings aren't iterable on IE * Fixed Element.getOpacity falsely returning 0 on IE * Some cleaning up in util.js * Cleaned up Effect.Opacity * Removed useless line in Position.page * Make scriptaculous.js work if a query strings are used when calling it * Fixed typos in slider.js and the functional test * Fixed a bug with Safari and the InPlaceEditor with form submission. Add support for interpreting simple
s into linebreaks. [Jon Tirsen] * New Control.Slider() for horizontal and vertical sliders [Marty Haught] * Fixed autoapplying a 'layout' on IE with Effect.Opacity not working for elements given as id string * Make Effect.Parallel render final frames and call beforeFinish/afterFinish on included effects * Make Element.setOpacity work correctly again (browser-specific extensions, except for IE, are disabled at this time) * Added focusing the text field or text area created when using Ajax.InPlaceEditor #2126 [thx to Lee Mallabone] * Fixed Element.Class.childrenWith not returning the correct elements #2120 [cmees AT rogers DOT com] * Added MIT-LICENSE header to scriptaculous.js, cut back on license info in other libs to keep files smaller * Fix issues with form elements inside draggables not clickable with Firefox #2129 * Fixed an error in dragdrop.js with Draggables when no Droppables are defined * Fixed an issue with Element.makePositioned causing Effect.SlideDown to fail on Safari * Make effects "stateless" by cleaning up element.style after finish of effect #2133 [agr30 AT uni-koeln DOT de] * Add "internal" events to effects, to make them more easily extendable [Martin Bialasinski] * Set container element height to auto on finishing Effect.BlindDown und Effect.SlideDown #2123 [Tony Arnold] * Fixed a weird char in dragdrop.js * Controls.js Autocompleter.Base.updateElement() hook #2116 [Rob Wills] * Refactoring to use the Prototype enumerable extensions * Update to Prototype 1.4.0_pre4 *V1.5.0_pre4* * Added a queue option to effects for easy stacking and simple timeline building. Valid values are "front", "end" and "parallel" (default), see for test/functional/effects_queue_test.html for usage * Added a setup function to the core effects that gets called by Effect.Base when first entering into running state, which allows them to query the current state of an element or other page properties when queuing and/or delays are used * Added a state instance variable to Effect.Base that indicates whether a effect that uses the queue is idle, running or finished * Fixed a flicker with Effect.Puff * General code cleaning to get rid of (legitimate) Mozilla strict javascript warnings * Changes to assertVisible in unittest.js * Slight refactoring of Effect.Text, now known as Effect.multiple(), change first parameter to also accept an array of strings or elements, or a NodeList of elements (if a single element or a string is given, defaults to $('element').childNodes) * Made tagifyText work with IE. defaults to a style of "position: relative; zoom:1;" for the created SPAN wrappers. It also replaces spaces with non-breakable spaces. These sit-ups are required to work around problems with rendering elements with the proprietary IE "layout" and non-quirksmode documents. * Add a break to scriptaculous.js when the includes are done [thx to Danilo Celic] * Fixed a problem with the Autocompleter when hitting ESC would select the entry in IE and redisplay the entries box in Safari * Fixed that the onDrop callback on Droppables didn't receive the dopped element as second parameter * Make check for correct Prototype version on loading script.aculo.us * Changed implementation of Builder to an innerHTML-based approach to make it work with IE6 (note: removed special "style" handling for now) * Changed non-sync Effects to use a common setInterval call for better timing and page update speeds. See the new Effect.Queue object. * Fixed a problem with setting opacity in Effect.Opacity to very small values * Changed the implemention of Effect.Base to use setInterval * Set version number to 1.5_pre4_trunk * Added experimental Effect.Text function that allows to start delayed text effects, see test/functional/texteffects_test.html. * Added experimental Effect.tagifyText(element) which wraps an elements text nodes characters in relatively positioned span elements * Added "delay" option to Effect.Base to start an effect only after a specified delay * Finetuning unittest.js + even more unit tests * Added support for Firefox and Konqueror automatic unit testing on Linux [Michael Schuerig] * Added basic unit test files for Effects, updated unit testing tests * Fix typo in lib/prototype.js fix in R2069 (whoops) * Added unit test for Position.clone * Made the Postition.cumulative override recognize KHTML and AppleWebKit * Fix the "hide form controls" iframe fix on the Autocompleter on Internet Explorer *V1.5.0_pre3* * More positioning fixes, expanded Element.clone [thx to Michael Schuerig] * Fixed some JavaScript warnings about redeclared vars [Courtenay] * Fixed a problem with autocompleting update divs not correctly positioned inside positioned elements [thx to Jonathan Feinberg] * Workaround for a Safari bug on absolutely positioned children of the BODY element * Added test/run_functional_test.html to more easily find your way around in the functional tests * Fixed some missing var declarations in effects.js * Support for automatic unit testing on IE/Win [Jon Tirsen] * Added loading the text for the Ajax.InPlaceEditor from the server, more CSS support [Richard Livsey, Jon Tirsen] * Made builder_test.html unit test work with Safari, fixed (one of two) caching issues with javascripttest.rb, added ajax_autocompleter_test.html to Rakefile unittests * Fixed Element.Class getting false matches on class names like classA-foobar, added unit tests [Martin Bialasinski] * Added a test to evluate the Fade/Appear effects across browsers and elements (test/functional/effects6_test.html) * Framework for completely self-running in-browser unit tests on Mac OS X (try "rake unittest") [Jon Tirsen] * Updates to Ajax.InPlaceEditor (Highlighting, Ajax options, more) [Jon Tirsen] * Made event registering on Draggables happen per drag for improved performance [thx to Cathy] * Moved Element.collectTextNodesIgnoreClass to util.js (preparation for refactoring) * Made sortable onChange option work again * Fixed a bug with Sortables resulting in wrong result when using Sortable.serialize with onUpdate on ghostly Sortables [thx Richard Livsey, Caleb Buxton] * Changed version number in scriptaculous.js to 1.5_pre3 * Moved setting focus in Autocompleter to updateElement function to make it overridable [Brian Palmer] * Added special handling for style attributes to Builder [Michael Schuerig] * Changed opacity=1.0 check back to be inline with its original (pre 1.5) implementation to prevent flickering in Firefox < 1.1 on opacity-based effects (this also fixes flickering with drag-and-drop, sortable lists and autocompleting text fields). Note that this potentially breaks correct colors in some situations. [thx to David Zülke] * Automatically deactivate browser built-in autocompletion on autocompleting textfields, fixes part of Rails #1824. * Fixed a problem with Ajax.InPlaceEditor causing a JavaScript exception on Safari [thx to Patrick Lenz] *V1.5.0_pre2* * Fixed a weird character in dragdrop.js, added check to allow empty containers on Sortables (useful with dropOnEmpty option) [thx to Dave Strus] * Added unit test runner file test/run_unit_tests.html, new unit test files must be listed in test/unit/index.html * Added unit tests for Prototype string functions *V1.5.0_pre1* * Prepared README for V1.5.0_pre1 * Added a main scriptaculous.js file to load in the other libraries transparently: in the HEAD section of an HTML file is now all that's needed to include all of the script.aculo.us libraries, given that they all can be accessed by the same path as scriptaculous.js is. * Fixed possible problem with greedy Droppables when using the dropOnEmpty option on Sortable.create * Added new CSS/background color features to Ajax.InPlaceEditor [Jon Tirsen] * Added unit test for Autocompleter, first Version * Added Event.simulateKey/s to unittest.js. Note that due to a bug in Firefox this will only work with Firefox up to v1.0.4 (see https://bugzilla.mozilla.org/show_bug.cgi?id=289940) * Fixed a condition where standard a href=xxx links wouldn't work in autocomplete results. These do now, the onclick event is not cancelled. [thx to Jasper Slits] * Fix showing ghosting marker only on ghosting Sortables * Some more Builder stuff, expanded builder unit tests * Moved stuff that didn't belong into specific libs into util.js; util.js is now required for all script.aculo.us libs * Corrected weirdness in unittest.js * Added dropOnEmpty option to Sortables to allow dropping on empty lists (see test/functional/sortable3_test.html) * Changed algoritm for drag/drop position setting * Changed workaround for class attributes (fixes a Firefox 1.0 error) from klass to className to be more Javascriptesque [thx to Martin Bialasinski] * Fixed a typo in ajax_inplaceeditor_test.html * Updated Rakefile to add unittest.js and util.js to the package * Added util.js which contains various utlity functions and extensions to Prototype * Major restructuring * Added TEXTAREA support to Ajax.InPlaceEditor [Sanford Barr] * Added Ghost Train alpha 0.1.0. See ghosttrain/test.html. * More features for Ajax.InPlaceEditor [Jon Tirsen] * Tweaks to unittest.css [Thomas Fuchs] * Refactoring and new features in unittest.js [Thomas Fuchs] [Jon Tirsen] * Fixed a wrong variable reference in Effect.Scale * Fix Element.makePositioned to recognize the 'static' position * Allow to choose the parameter name for Ajax.Autocompleter [Cameron Braid] * Changed resolving indicator DOM element more flexibility [Cameron Braid] * Fixed a reference in Ajax.InPlaceEditor * Added contributors to unittest.js * Souped-up Ajax.InPlaceEditor, added support for a form id and specifying all the texts through options [Jon Tirsen] * Make unit testing look good [Michael Schuerig] * Changed default revert duration for Draggables to distance-dependent algorithm [suggested by San] * Fix double unescaping in Autocompleter * Refactoring auf Autocompleter classes to use camelCase (note: changes the syntax of some of the options) * Add updateElement option to Autocompleter [Rob Sharp] * Updated Ajax.InPlaceEditor, refactoring of unit testing [Jon Tirsen] * Added preliminary version of Ajax.InPlaceEditor to controls.js; added experimental Firefox only functional testing for it (inplaceeditor_result.html) [Jon Tirsen] * Added some addtional test files. * Fixes a bug with Droppables not recognizing a drop if no hoverclass is given [thanks drewie] * Fixes to ghosting marker, allow a predefined marker (element with id "dropmarker"). * Changed Effect.Opacity to better handle 100% opacity * Various fixes to ghosting, improves compatiblity with Safari and IE. [thanks to David Zülke] * Added experimental ghosting option to Sortables. See sortable_functional_ghosting.html for usage. * Renamed the clone option on Draggables to "ghosting". * Added experimental "clone" option to Draggable to so that a "clone" stays in place while dragging a translucent version of the draggable element. Currently, this requires relatively positioned elements, and doesn't work with sortable lists (but should after some tweaking). See dragdrop_function_4.html test file for details. * Added Element.getStyle to find computed CSS styles of an element. Note: doesn't work in all cases in Safari, see my bug report at http://bugzilla.opendarwin.org/show_bug.cgi?id=4125 *1.1beta1* * Fixed rendering of last frame of animation when from/to is not 0.0/1.0. [thanks to David Zülke] * Updated internal Prototype JavaScript framework to version 1.4.0_pre2 (patched w/ workaround for Ajax.Updater init bug) * Some refactoring of controls.js to get rid of "dirty" implementation detail (dont' ask) * Added returning the generated combined effects to allow for .cancel() on all effects * Updated internal Prototype JavaScript framework to version 1.4.0_pre2 *Rails 0.13.1* * Updated Ajax.Autocompleter to deal with parameters options correctly [Martin Marinschek] * Updated controls.js to allow multple matches in local localcompletion [Ivan Krstic] * Make version of prototype.js in lib have a nicer Event object [David Zülke] * Added incremental and local autocompleting and loads of documentation to controls.js [Ivan Krstic] * Experimental: make version of prototype.js in lib destroy events on page unload to prevent browser memory leaks * Fixed a possible memory leak in dragdrop.js * Make version of prototype.js in lib compatible with some 3rd-party JavaScript libraries (like IE7) by refactoring to use Object.extend() for testing [David Zülke] * Make effects.js, dragdrop.js and controls.js compatible with some 3rd-party JavaScript libraries (like IE7) by refactoring to use Object.extend() [David Zülke] * Changed some tests to work better * Always reset background color on Effect.Highlight; this make change backwards-compatibility, to be sure include style="background-color:(target-color)" on your elements or else elements will fall back to their CSS rules (which is a good thing in most circumstances) * Removed a possible memory leaks with IE with sortables and droppables (removed references from elements) * Changes to class extension in effects.js * Make Effect.Highlight restore any previously set background color when finishing (makes effect work with set CSS classes) * Added capability to remove draggables/droppables and redeclare sortables in dragdrop.js * Added Effect.ScrollTo to smoothly scroll the page to an element * Better Firefox flickering handling on SlideUp/SlideDown * Some cleaning up in effects.js * Removed a possible memory leak in IE with draggables * Added support for cancelling dragging my hitting ESC * Changed logic of drag-and-drop to only include the last referenced droppable when firing a drop event. This change also offers slight performance gains. [Dominik Wagner] * Added addtional effects test page, added tests for scriptfragment matching *1.0.0* * Changed auto-hiding update div in Ajax.Autocompleter * Changed default serialization on Ajax.Autocompleter to use Form.Element.serialize * Added test file for drag/drop inside scrolled elements * Fixed dragging of unpositioned elements in Internet Explorer * Change default behaviour of Ajax.Autocompleter to do automatic overlapping, sizing and appear/fade effects * Fixed Internet Explorer hide-windowed-controls iframe handling * Changed Ajax.Autocompleter event handling * Added onShow/onHide callbacks to Ajax.Autocompleter to allow for customized handling/effects * Fixed SlideUp/SlideDown to restore the overflow CSS property (note: Firefox 1.0.X is buggy, set overflow:hidden as a workaround) * Fixed BlindUp/BlindDown to restore the overflow CSS property (note: Firefox 1.0.X is buggy, set overflow:hidden as a workaround) * Fixed draggables with revert:false on repeated drags behaving badly * Expanded the revert option on draggables to optionally take a function and revert only if it returns true * Added the dragged element as a parameter to the Draggables.notify callbacks [Michael Sokolov] * Removed a deprecated reference to Effect2 om Effect.Fold * Make the percentage on Element.setContentZoom absolute * Corrected rendering of Ajax.AutoCompleter when focus is lost while updating * Added (crude) functional tests * Some slight refactoring in controls.js * Changed dragdrop.js to use the Effect namespace for its effects * Updated to Prototype 1.3.0: removal of prototype-ext.js; refactoring. * Fixed behaviour of cursor keys in Safari on autocomplete script * Fixed Position.within_including_scrolloffsets * Fixed sortables that are absolutely positioned * Fixed unhandled whitespace in Ajax.Autocompleter * Updated prototype-ext.js to include additions for Ajax.Autocompleter * Added controls.js, contains AJAX autocompleting text fields from #960 * Refactored Event object * Renamed effects2.js to effects.js * Fixed draggables on pages with no droppables * Moved Event, Position and Element.Class to prototype-ext.js in preparation to Rails 0.13 * Added Effect.Transitions.pulse * Added Effect.Pulsate and Effect.Fold effect by Justin Palmer * Added transitions by Mark Pilgrim: .full, .none * Added effects by Mark Pilgrim: Effect.Grow, Effect.Shrink * Changed effects namespace to Effect. (Effect2 is deprecated, but works too) * Changed old Effect.ContentZoom class to Element.setContentZoom() function * Greatly expanded Effect.Highlight to have user-defined colors and autodetecting the background color * Converted remaining effects (Squish, Highlight) to new format * Sortable.create now passes the zindex, starteffect, reverteffect and endeffect options to the underlying Draggables * Sortable.serialize now honors the only option on Sortable.create * New overridable options on Draggables: zindex, starteffect, reverteffect, endeffect * Fix a Gecko engine flicker on Sortables in dragdrop.js * Fixed event.isLeftClick * Some small changes in effects2.js * Refactoring of dragdrop.js * Added an Object.prototype.inspect() and more verbose messages for js unit testing * Added test/unittest.js and initial tests in test/html. * Cleaning up of effects2.js (convert tabs to spaces) * Added Rakefile for distribution packaging (default task = make distribution, rake clean for cleaning up) * Initial check-in and directory layout for the script.aculo.us JavaScripts scriptaculous-1.9.0/MIT-LICENSE0000644000175000017500000000212211504742473017045 0ustar fhabermannfhabermannCopyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.scriptaculous-1.9.0/lib/0000755000175000017500000000000011504742473016162 5ustar fhabermannfhabermannscriptaculous-1.9.0/lib/prototype.js0000644000175000017500000047676011504742473020611 0ustar fhabermannfhabermann/* Prototype JavaScript framework, version 1.7 * (c) 2005-2010 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ * *--------------------------------------------------------------------------*/ var Prototype = { Version: '1.7', Browser: (function(){ var ua = navigator.userAgent; var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]'; return { IE: !!window.attachEvent && !isOpera, Opera: isOpera, WebKit: ua.indexOf('AppleWebKit/') > -1, Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1, MobileSafari: /Apple.*Mobile/.test(ua) } })(), BrowserFeatures: { XPath: !!document.evaluate, SelectorsAPI: !!document.querySelector, ElementExtensions: (function() { var constructor = window.Element || window.HTMLElement; return !!(constructor && constructor.prototype); })(), SpecificElementExtensions: (function() { if (typeof window.HTMLDivElement !== 'undefined') return true; var div = document.createElement('div'), form = document.createElement('form'), isSupported = false; if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) { isSupported = true; } div = form = null; return isSupported; })() }, ScriptFragment: ']*>([\\S\\s]*?)<\/script>', JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, emptyFunction: function() { }, K: function(x) { return x } }; if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false; /* Based on Alex Arnell's inheritance implementation. */ var Class = (function() { var IS_DONTENUM_BUGGY = (function(){ for (var p in { toString: 1 }) { if (p === 'toString') return false; } return true; })(); function subclass() {}; function create() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift(); function klass() { this.initialize.apply(this, arguments); } Object.extend(klass, Class.Methods); klass.superclass = parent; klass.subclasses = []; if (parent) { subclass.prototype = parent.prototype; klass.prototype = new subclass; parent.subclasses.push(klass); } for (var i = 0, length = properties.length; i < length; i++) klass.addMethods(properties[i]); if (!klass.prototype.initialize) klass.prototype.initialize = Prototype.emptyFunction; klass.prototype.constructor = klass; return klass; } function addMethods(source) { var ancestor = this.superclass && this.superclass.prototype, properties = Object.keys(source); if (IS_DONTENUM_BUGGY) { if (source.toString != Object.prototype.toString) properties.push("toString"); if (source.valueOf != Object.prototype.valueOf) properties.push("valueOf"); } for (var i = 0, length = properties.length; i < length; i++) { var property = properties[i], value = source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames()[0] == "$super") { var method = value; value = (function(m) { return function() { return ancestor[m].apply(this, arguments); }; })(property).wrap(method); value.valueOf = method.valueOf.bind(method); value.toString = method.toString.bind(method); } this.prototype[property] = value; } return this; } return { create: create, Methods: { addMethods: addMethods } }; })(); (function() { var _toString = Object.prototype.toString, NULL_TYPE = 'Null', UNDEFINED_TYPE = 'Undefined', BOOLEAN_TYPE = 'Boolean', NUMBER_TYPE = 'Number', STRING_TYPE = 'String', OBJECT_TYPE = 'Object', FUNCTION_CLASS = '[object Function]', BOOLEAN_CLASS = '[object Boolean]', NUMBER_CLASS = '[object Number]', STRING_CLASS = '[object String]', ARRAY_CLASS = '[object Array]', DATE_CLASS = '[object Date]', NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON && typeof JSON.stringify === 'function' && JSON.stringify(0) === '0' && typeof JSON.stringify(Prototype.K) === 'undefined'; function Type(o) { switch(o) { case null: return NULL_TYPE; case (void 0): return UNDEFINED_TYPE; } var type = typeof o; switch(type) { case 'boolean': return BOOLEAN_TYPE; case 'number': return NUMBER_TYPE; case 'string': return STRING_TYPE; } return OBJECT_TYPE; } function extend(destination, source) { for (var property in source) destination[property] = source[property]; return destination; } function inspect(object) { try { if (isUndefined(object)) return 'undefined'; if (object === null) return 'null'; return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } } function toJSON(value) { return Str('', { '': value }, []); } function Str(key, holder, stack) { var value = holder[key], type = typeof value; if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') { value = value.toJSON(key); } var _class = _toString.call(value); switch (_class) { case NUMBER_CLASS: case BOOLEAN_CLASS: case STRING_CLASS: value = value.valueOf(); } switch (value) { case null: return 'null'; case true: return 'true'; case false: return 'false'; } type = typeof value; switch (type) { case 'string': return value.inspect(true); case 'number': return isFinite(value) ? String(value) : 'null'; case 'object': for (var i = 0, length = stack.length; i < length; i++) { if (stack[i] === value) { throw new TypeError(); } } stack.push(value); var partial = []; if (_class === ARRAY_CLASS) { for (var i = 0, length = value.length; i < length; i++) { var str = Str(i, value, stack); partial.push(typeof str === 'undefined' ? 'null' : str); } partial = '[' + partial.join(',') + ']'; } else { var keys = Object.keys(value); for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i], str = Str(key, value, stack); if (typeof str !== "undefined") { partial.push(key.inspect(true)+ ':' + str); } } partial = '{' + partial.join(',') + '}'; } stack.pop(); return partial; } } function stringify(object) { return JSON.stringify(object); } function toQueryString(object) { return $H(object).toQueryString(); } function toHTML(object) { return object && object.toHTML ? object.toHTML() : String.interpret(object); } function keys(object) { if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); } var results = []; for (var property in object) { if (object.hasOwnProperty(property)) { results.push(property); } } return results; } function values(object) { var results = []; for (var property in object) results.push(object[property]); return results; } function clone(object) { return extend({ }, object); } function isElement(object) { return !!(object && object.nodeType == 1); } function isArray(object) { return _toString.call(object) === ARRAY_CLASS; } var hasNativeIsArray = (typeof Array.isArray == 'function') && Array.isArray([]) && !Array.isArray({}); if (hasNativeIsArray) { isArray = Array.isArray; } function isHash(object) { return object instanceof Hash; } function isFunction(object) { return _toString.call(object) === FUNCTION_CLASS; } function isString(object) { return _toString.call(object) === STRING_CLASS; } function isNumber(object) { return _toString.call(object) === NUMBER_CLASS; } function isDate(object) { return _toString.call(object) === DATE_CLASS; } function isUndefined(object) { return typeof object === "undefined"; } extend(Object, { extend: extend, inspect: inspect, toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON, toQueryString: toQueryString, toHTML: toHTML, keys: Object.keys || keys, values: values, clone: clone, isElement: isElement, isArray: isArray, isHash: isHash, isFunction: isFunction, isString: isString, isNumber: isNumber, isDate: isDate, isUndefined: isUndefined }); })(); Object.extend(Function.prototype, (function() { var slice = Array.prototype.slice; function update(array, args) { var arrayLength = array.length, length = args.length; while (length--) array[arrayLength + length] = args[length]; return array; } function merge(array, args) { array = slice.call(array, 0); return update(array, args); } function argumentNames() { var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') .replace(/\s+/g, '').split(','); return names.length == 1 && !names[0] ? [] : names; } function bind(context) { if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; var __method = this, args = slice.call(arguments, 1); return function() { var a = merge(args, arguments); return __method.apply(context, a); } } function bindAsEventListener(context) { var __method = this, args = slice.call(arguments, 1); return function(event) { var a = update([event || window.event], args); return __method.apply(context, a); } } function curry() { if (!arguments.length) return this; var __method = this, args = slice.call(arguments, 0); return function() { var a = merge(args, arguments); return __method.apply(this, a); } } function delay(timeout) { var __method = this, args = slice.call(arguments, 1); timeout = timeout * 1000; return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); } function defer() { var args = update([0.01], arguments); return this.delay.apply(this, args); } function wrap(wrapper) { var __method = this; return function() { var a = update([__method.bind(this)], arguments); return wrapper.apply(this, a); } } function methodize() { if (this._methodized) return this._methodized; var __method = this; return this._methodized = function() { var a = update([this], arguments); return __method.apply(null, a); }; } return { argumentNames: argumentNames, bind: bind, bindAsEventListener: bindAsEventListener, curry: curry, delay: delay, defer: defer, wrap: wrap, methodize: methodize } })()); (function(proto) { function toISOString() { return this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + this.getUTCDate().toPaddedString(2) + 'T' + this.getUTCHours().toPaddedString(2) + ':' + this.getUTCMinutes().toPaddedString(2) + ':' + this.getUTCSeconds().toPaddedString(2) + 'Z'; } function toJSON() { return this.toISOString(); } if (!proto.toISOString) proto.toISOString = toISOString; if (!proto.toJSON) proto.toJSON = toJSON; })(Date.prototype); RegExp.prototype.match = RegExp.prototype.test; RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback(); }, registerCallback: function() { this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, execute: function() { this.callback(this); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer = null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.execute(); this.currentlyExecuting = false; } catch(e) { this.currentlyExecuting = false; throw e; } } } }); Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\' } }); Object.extend(String.prototype, (function() { var NATIVE_JSON_PARSE_SUPPORT = window.JSON && typeof JSON.parse === 'function' && JSON.parse('{"test": true}').test; function prepareReplacement(replacement) { if (Object.isFunction(replacement)) return replacement; var template = new Template(replacement); return function(match) { return template.evaluate(match) }; } function gsub(pattern, replacement) { var result = '', source = this, match; replacement = prepareReplacement(replacement); if (Object.isString(pattern)) pattern = RegExp.escape(pattern); if (!(pattern.length || pattern.source)) { replacement = replacement(''); return replacement + source.split('').join(replacement) + replacement; } while (source.length > 0) { if (match = source.match(pattern)) { result += source.slice(0, match.index); result += String.interpret(replacement(match)); source = source.slice(match.index + match[0].length); } else { result += source, source = ''; } } return result; } function sub(pattern, replacement, count) { replacement = prepareReplacement(replacement); count = Object.isUndefined(count) ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); } function scan(pattern, iterator) { this.gsub(pattern, iterator); return String(this); } function truncate(length, truncation) { length = length || 30; truncation = Object.isUndefined(truncation) ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(this); } function strip() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); } function stripTags() { return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); } function stripScripts() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); } function extractScripts() { var matchAll = new RegExp(Prototype.ScriptFragment, 'img'), matchOne = new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); } function evalScripts() { return this.extractScripts().map(function(script) { return eval(script) }); } function escapeHTML() { return this.replace(/&/g,'&').replace(//g,'>'); } function unescapeHTML() { return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); } function toQueryParams(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, function(hash, pair) { if ((pair = pair.split('='))[0]) { var key = decodeURIComponent(pair.shift()), value = pair.length > 1 ? pair.join('=') : pair[0]; if (value != undefined) value = decodeURIComponent(value); if (key in hash) { if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; hash[key].push(value); } else hash[key] = value; } return hash; }); } function toArray() { return this.split(''); } function succ() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); } function times(count) { return count < 1 ? '' : new Array(count + 1).join(this); } function camelize() { return this.replace(/-+(.)?/g, function(match, chr) { return chr ? chr.toUpperCase() : ''; }); } function capitalize() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); } function underscore() { return this.replace(/::/g, '/') .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') .replace(/([a-z\d])([A-Z])/g, '$1_$2') .replace(/-/g, '_') .toLowerCase(); } function dasherize() { return this.replace(/_/g, '-'); } function inspect(useDoubleQuotes) { var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) { if (character in String.specialChar) { return String.specialChar[character]; } return '\\u00' + character.charCodeAt().toPaddedString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; } function unfilterJSON(filter) { return this.replace(filter || Prototype.JSONFilter, '$1'); } function isJSON() { var str = this; if (str.blank()) return false; str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'); str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, ''); return (/^[\],:{}\s]*$/).test(str); } function evalJSON(sanitize) { var json = this.unfilterJSON(), cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; if (cx.test(json)) { json = json.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); } function parseJSON() { var json = this.unfilterJSON(); return JSON.parse(json); } function include(pattern) { return this.indexOf(pattern) > -1; } function startsWith(pattern) { return this.lastIndexOf(pattern, 0) === 0; } function endsWith(pattern) { var d = this.length - pattern.length; return d >= 0 && this.indexOf(pattern, d) === d; } function empty() { return this == ''; } function blank() { return /^\s*$/.test(this); } function interpolate(object, pattern) { return new Template(this, pattern).evaluate(object); } return { gsub: gsub, sub: sub, scan: scan, truncate: truncate, strip: String.prototype.trim || strip, stripTags: stripTags, stripScripts: stripScripts, extractScripts: extractScripts, evalScripts: evalScripts, escapeHTML: escapeHTML, unescapeHTML: unescapeHTML, toQueryParams: toQueryParams, parseQuery: toQueryParams, toArray: toArray, succ: succ, times: times, camelize: camelize, capitalize: capitalize, underscore: underscore, dasherize: dasherize, inspect: inspect, unfilterJSON: unfilterJSON, isJSON: isJSON, evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON, include: include, startsWith: startsWith, endsWith: endsWith, empty: empty, blank: blank, interpolate: interpolate }; })()); var Template = Class.create({ initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; }, evaluate: function(object) { if (object && Object.isFunction(object.toTemplateReplacements)) object = object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { if (object == null) return (match[1] + ''); var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3], pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; var $break = { }; var Enumerable = (function() { function each(iterator, context) { var index = 0; try { this._each(function(value) { iterator.call(context, value, index++); }); } catch (e) { if (e != $break) throw e; } return this; } function eachSlice(number, iterator, context) { var index = -number, slices = [], array = this.toArray(); if (number < 1) return array; while ((index += number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator, context); } function all(iterator, context) { iterator = iterator || Prototype.K; var result = true; this.each(function(value, index) { result = result && !!iterator.call(context, value, index); if (!result) throw $break; }); return result; } function any(iterator, context) { iterator = iterator || Prototype.K; var result = false; this.each(function(value, index) { if (result = !!iterator.call(context, value, index)) throw $break; }); return result; } function collect(iterator, context) { iterator = iterator || Prototype.K; var results = []; this.each(function(value, index) { results.push(iterator.call(context, value, index)); }); return results; } function detect(iterator, context) { var result; this.each(function(value, index) { if (iterator.call(context, value, index)) { result = value; throw $break; } }); return result; } function findAll(iterator, context) { var results = []; this.each(function(value, index) { if (iterator.call(context, value, index)) results.push(value); }); return results; } function grep(filter, iterator, context) { iterator = iterator || Prototype.K; var results = []; if (Object.isString(filter)) filter = new RegExp(RegExp.escape(filter)); this.each(function(value, index) { if (filter.match(value)) results.push(iterator.call(context, value, index)); }); return results; } function include(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) != -1) return true; var found = false; this.each(function(value) { if (value == object) { found = true; throw $break; } }); return found; } function inGroupsOf(number, fillWith) { fillWith = Object.isUndefined(fillWith) ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); } function inject(memo, iterator, context) { this.each(function(value, index) { memo = iterator.call(context, memo, value, index); }); return memo; } function invoke(method) { var args = $A(arguments).slice(1); return this.map(function(value) { return value[method].apply(value, args); }); } function max(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value >= result) result = value; }); return result; } function min(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value < result) result = value; }); return result; } function partition(iterator, context) { iterator = iterator || Prototype.K; var trues = [], falses = []; this.each(function(value, index) { (iterator.call(context, value, index) ? trues : falses).push(value); }); return [trues, falses]; } function pluck(property) { var results = []; this.each(function(value) { results.push(value[property]); }); return results; } function reject(iterator, context) { var results = []; this.each(function(value, index) { if (!iterator.call(context, value, index)) results.push(value); }); return results; } function sortBy(iterator, context) { return this.map(function(value, index) { return { value: value, criteria: iterator.call(context, value, index) }; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); } function toArray() { return this.map(); } function zip() { var iterator = Prototype.K, args = $A(arguments); if (Object.isFunction(args.last())) iterator = args.pop(); var collections = [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); } function size() { return this.toArray().length; } function inspect() { return '#'; } return { each: each, eachSlice: eachSlice, all: all, every: all, any: any, some: any, collect: collect, map: collect, detect: detect, findAll: findAll, select: findAll, filter: findAll, grep: grep, include: include, member: include, inGroupsOf: inGroupsOf, inject: inject, invoke: invoke, max: max, min: min, partition: partition, pluck: pluck, reject: reject, sortBy: sortBy, toArray: toArray, entries: toArray, zip: zip, size: size, inspect: inspect, find: detect }; })(); function $A(iterable) { if (!iterable) return []; if ('toArray' in Object(iterable)) return iterable.toArray(); var length = iterable.length || 0, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } function $w(string) { if (!Object.isString(string)) return []; string = string.strip(); return string ? string.split(/\s+/) : []; } Array.from = $A; (function() { var arrayProto = Array.prototype, slice = arrayProto.slice, _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available function each(iterator, context) { for (var i = 0, length = this.length >>> 0; i < length; i++) { if (i in this) iterator.call(context, this[i], i, this); } } if (!_each) _each = each; function clear() { this.length = 0; return this; } function first() { return this[0]; } function last() { return this[this.length - 1]; } function compact() { return this.select(function(value) { return value != null; }); } function flatten() { return this.inject([], function(array, value) { if (Object.isArray(value)) return array.concat(value.flatten()); array.push(value); return array; }); } function without() { var values = slice.call(arguments, 0); return this.select(function(value) { return !values.include(value); }); } function reverse(inline) { return (inline === false ? this.toArray() : this)._reverse(); } function uniq(sorted) { return this.inject([], function(array, value, index) { if (0 == index || (sorted ? array.last() != value : !array.include(value))) array.push(value); return array; }); } function intersect(array) { return this.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); }); } function clone() { return slice.call(this, 0); } function size() { return this.length; } function inspect() { return '[' + this.map(Object.inspect).join(', ') + ']'; } function indexOf(item, i) { i || (i = 0); var length = this.length; if (i < 0) i = length + i; for (; i < length; i++) if (this[i] === item) return i; return -1; } function lastIndexOf(item, i) { i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; var n = this.slice(0, i).reverse().indexOf(item); return (n < 0) ? n : i - n - 1; } function concat() { var array = slice.call(this, 0), item; for (var i = 0, length = arguments.length; i < length; i++) { item = arguments[i]; if (Object.isArray(item) && !('callee' in item)) { for (var j = 0, arrayLength = item.length; j < arrayLength; j++) array.push(item[j]); } else { array.push(item); } } return array; } Object.extend(arrayProto, Enumerable); if (!arrayProto._reverse) arrayProto._reverse = arrayProto.reverse; Object.extend(arrayProto, { _each: _each, clear: clear, first: first, last: last, compact: compact, flatten: flatten, without: without, reverse: reverse, uniq: uniq, intersect: intersect, clone: clone, toArray: clone, size: size, inspect: inspect }); var CONCAT_ARGUMENTS_BUGGY = (function() { return [].concat(arguments)[0][0] !== 1; })(1,2) if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat; if (!arrayProto.indexOf) arrayProto.indexOf = indexOf; if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf; })(); function $H(object) { return new Hash(object); }; var Hash = Class.create(Enumerable, (function() { function initialize(object) { this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); } function _each(iterator) { for (var key in this._object) { var value = this._object[key], pair = [key, value]; pair.key = key; pair.value = value; iterator(pair); } } function set(key, value) { return this._object[key] = value; } function get(key) { if (this._object[key] !== Object.prototype[key]) return this._object[key]; } function unset(key) { var value = this._object[key]; delete this._object[key]; return value; } function toObject() { return Object.clone(this._object); } function keys() { return this.pluck('key'); } function values() { return this.pluck('value'); } function index(value) { var match = this.detect(function(pair) { return pair.value === value; }); return match && match.key; } function merge(object) { return this.clone().update(object); } function update(object) { return new Hash(object).inject(this, function(result, pair) { result.set(pair.key, pair.value); return result; }); } function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; return key + '=' + encodeURIComponent(String.interpret(value)); } function toQueryString() { return this.inject([], function(results, pair) { var key = encodeURIComponent(pair.key), values = pair.value; if (values && typeof values == 'object') { if (Object.isArray(values)) { var queryValues = []; for (var i = 0, len = values.length, value; i < len; i++) { value = values[i]; queryValues.push(toQueryPair(key, value)); } return results.concat(queryValues); } } else results.push(toQueryPair(key, values)); return results; }).join('&'); } function inspect() { return '#'; } function clone() { return new Hash(this); } return { initialize: initialize, _each: _each, set: set, get: get, unset: unset, toObject: toObject, toTemplateReplacements: toObject, keys: keys, values: values, index: index, merge: merge, update: update, toQueryString: toQueryString, inspect: inspect, toJSON: toObject, clone: clone }; })()); Hash.from = $H; Object.extend(Number.prototype, (function() { function toColorPart() { return this.toPaddedString(2, 16); } function succ() { return this + 1; } function times(iterator, context) { $R(0, this, true).each(iterator, context); return this; } function toPaddedString(length, radix) { var string = this.toString(radix || 10); return '0'.times(length - string.length) + string; } function abs() { return Math.abs(this); } function round() { return Math.round(this); } function ceil() { return Math.ceil(this); } function floor() { return Math.floor(this); } return { toColorPart: toColorPart, succ: succ, times: times, toPaddedString: toPaddedString, abs: abs, round: round, ceil: ceil, floor: floor }; })()); function $R(start, end, exclusive) { return new ObjectRange(start, end, exclusive); } var ObjectRange = Class.create(Enumerable, (function() { function initialize(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; } function _each(iterator) { var value = this.start; while (this.include(value)) { iterator(value); value = value.succ(); } } function include(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } return { initialize: initialize, _each: _each, include: include }; })()); var Abstract = { }; var Try = { these: function() { var returnValue; for (var i = 0, length = arguments.length; i < length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) { } } return returnValue; } }; var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 }; Ajax.Responders = { responders: [], _each: function(iterator) { this.responders._each(iterator); }, register: function(responder) { if (!this.include(responder)) this.responders.push(responder); }, unregister: function(responder) { this.responders = this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { if (Object.isFunction(responder[callback])) { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); } }; Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++ }, onComplete: function() { Ajax.activeRequestCount-- } }); Ajax.Base = Class.create({ initialize: function(options) { this.options = { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '', evalJSON: true, evalJS: true }; Object.extend(this.options, options || { }); this.options.method = this.options.method.toLowerCase(); if (Object.isHash(this.options.parameters)) this.options.parameters = this.options.parameters.toObject(); } }); Ajax.Request = Class.create(Ajax.Base, { _complete: false, initialize: function($super, url, options) { $super(options); this.transport = Ajax.getTransport(); this.request(url); }, request: function(url) { this.url = url; this.method = this.options.method; var params = Object.isString(this.options.parameters) ? this.options.parameters : Object.toQueryString(this.options.parameters); if (!['get', 'post'].include(this.method)) { params += (params ? '&' : '') + "_method=" + this.method; this.method = 'post'; } if (params && this.method === 'get') { this.url += (this.url.include('?') ? '&' : '?') + params; } this.parameters = params.toQueryParams(); try { var response = new Ajax.Response(this); if (this.options.onCreate) this.options.onCreate(response); Ajax.Responders.dispatch('onCreate', this, response); this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); this.transport.onreadystatechange = this.onStateChange.bind(this); this.setRequestHeaders(); this.body = this.method == 'post' ? (this.options.postBody || params) : null; this.transport.send(this.body); /* Force Firefox to handle ready state 4 for synchronous requests */ if (!this.options.asynchronous && this.transport.overrideMimeType) this.onStateChange(); } catch (e) { this.dispatchException(e); } }, onStateChange: function() { var readyState = this.transport.readyState; if (readyState > 1 && !((readyState == 4) && this._complete)) this.respondToReadyState(this.transport.readyState); }, setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, success: function() { var status = this.getStatus(); return !status || (status >= 200 && status < 300) || status == 304; }, getStatus: function() { try { if (this.transport.status === 1223) return 204; return this.transport.status || 0; } catch (e) { return 0 } }, respondToReadyState: function(readyState) { var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); if (state == 'Complete') { try { this._complete = true; (this.options['on' + response.status] || this.options['on' + (this.success() ? 'Success' : 'Failure')] || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' || (this.options.evalJS && this.isSameOrigin() && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } try { (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); } catch (e) { this.dispatchException(e); } if (state == 'Complete') { this.transport.onreadystatechange = Prototype.emptyFunction; } }, isSameOrigin: function() { var m = this.url.match(/^\s*https?:\/\/[^\/]*/); return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ protocol: location.protocol, domain: document.domain, port: location.port ? ':' + location.port : '' })); }, getHeader: function(name) { try { return this.transport.getResponseHeader(name) || null; } catch (e) { return null; } }, evalResponse: function() { try { return eval((this.transport.responseText || '').unfilterJSON()); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Response = Class.create({ initialize: function(request){ this.request = request; var transport = this.transport = request.transport, readyState = this.readyState = transport.readyState; if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { this.status = this.getStatus(); this.statusText = this.getStatusText(); this.responseText = String.interpret(transport.responseText); this.headerJSON = this._getHeaderJSON(); } if (readyState == 4) { var xml = transport.responseXML; this.responseXML = Object.isUndefined(xml) ? null : xml; this.responseJSON = this._getResponseJSON(); } }, status: 0, statusText: '', getStatus: Ajax.Request.prototype.getStatus, getStatusText: function() { try { return this.transport.statusText || ''; } catch (e) { return '' } }, getHeader: Ajax.Request.prototype.getHeader, getAllHeaders: function() { try { return this.getAllResponseHeaders(); } catch (e) { return null } }, getResponseHeader: function(name) { return this.transport.getResponseHeader(name); }, getAllResponseHeaders: function() { return this.transport.getAllResponseHeaders(); }, _getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; json = decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } }, _getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json')) || this.responseText.blank()) return null; try { return this.responseText.evalJSON(options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } } }); Ajax.Updater = Class.create(Ajax.Request, { initialize: function($super, container, url, options) { this.container = { success: (container.success || container), failure: (container.failure || (container.success ? null : container)) }; options = Object.clone(options); var onComplete = options.onComplete; options.onComplete = (function(response, json) { this.updateContent(response.responseText); if (Object.isFunction(onComplete)) onComplete(response, json); }).bind(this); $super(url, options); }, updateContent: function(responseText) { var receiver = this.container[this.success() ? 'success' : 'failure'], options = this.options; if (!options.evalScripts) responseText = responseText.stripScripts(); if (receiver = $(receiver)) { if (options.insertion) { if (Object.isString(options.insertion)) { var insertion = { }; insertion[options.insertion] = responseText; receiver.insert(insertion); } else options.insertion(receiver, responseText); } else receiver.update(responseText); } } }); Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { initialize: function($super, container, url, options) { $super(options); this.onComplete = this.options.onComplete; this.frequency = (this.options.frequency || 2); this.decay = (this.options.decay || 1); this.updater = { }; this.container = container; this.url = url; this.start(); }, start: function() { this.options.onComplete = this.updateComplete.bind(this); this.onTimerEvent(); }, stop: function() { this.updater.options.onComplete = undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, updateComplete: function(response) { if (this.options.decay) { this.decay = (response.responseText == this.lastText ? this.decay * this.options.decay : 1); this.lastText = response.responseText; } this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); }, onTimerEvent: function() { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); function $(element) { if (arguments.length > 1) { for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } if (Prototype.BrowserFeatures.XPath) { document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; }; } /*--------------------------------------------------------------------------*/ if (!Node) var Node = { }; if (!Node.ELEMENT_NODE) { Object.extend(Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12 }); } (function(global) { function shouldUseCache(tagName, attributes) { if (tagName === 'select') return false; if ('type' in attributes) return false; return true; } var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){ try { var el = document.createElement(''); return el.tagName.toLowerCase() === 'input' && el.name === 'x'; } catch(err) { return false; } })(); var element = global.Element; global.Element = function(tagName, attributes) { attributes = attributes || { }; tagName = tagName.toLowerCase(); var cache = Element.cache; if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) { tagName = '<' + tagName + ' name="' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attributes); } if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); var node = shouldUseCache(tagName, attributes) ? cache[tagName].cloneNode(false) : document.createElement(tagName); return Element.writeAttribute(node, attributes); }; Object.extend(global.Element, element || { }); if (element) global.Element.prototype = element.prototype; })(this); Element.idCounter = 1; Element.cache = { }; Element._purgeElement = function(element) { var uid = element._prototypeUID; if (uid) { Element.stopObserving(element); element._prototypeUID = void 0; delete Element.Storage[uid]; } } Element.Methods = { visible: function(element) { return $(element).style.display != 'none'; }, toggle: function(element) { element = $(element); Element[Element.visible(element) ? 'hide' : 'show'](element); return element; }, hide: function(element) { element = $(element); element.style.display = 'none'; return element; }, show: function(element) { element = $(element); element.style.display = ''; return element; }, remove: function(element) { element = $(element); element.parentNode.removeChild(element); return element; }, update: (function(){ var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){ var el = document.createElement("select"), isBuggy = true; el.innerHTML = ""; if (el.options && el.options[0]) { isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION"; } el = null; return isBuggy; })(); var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){ try { var el = document.createElement("table"); if (el && el.tBodies) { el.innerHTML = "test"; var isBuggy = typeof el.tBodies[0] == "undefined"; el = null; return isBuggy; } } catch (e) { return true; } })(); var LINK_ELEMENT_INNERHTML_BUGGY = (function() { try { var el = document.createElement('div'); el.innerHTML = ""; var isBuggy = (el.childNodes.length === 0); el = null; return isBuggy; } catch(e) { return true; } })(); var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY; var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () { var s = document.createElement("script"), isBuggy = false; try { s.appendChild(document.createTextNode("")); isBuggy = !s.firstChild || s.firstChild && s.firstChild.nodeType !== 3; } catch (e) { isBuggy = true; } s = null; return isBuggy; })(); function update(element, content) { element = $(element); var purgeElement = Element._purgeElement; var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); var tagName = element.tagName.toUpperCase(); if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) { element.text = content; return element; } if (ANY_INNERHTML_BUGGY) { if (tagName in Element._insertionTranslations.tags) { while (element.firstChild) { element.removeChild(element.firstChild); } Element._getContentFromAnonymousElement(tagName, content.stripScripts()) .each(function(node) { element.appendChild(node) }); } else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf(' -1) { while (element.firstChild) { element.removeChild(element.firstChild); } var nodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts(), true); nodes.each(function(node) { element.appendChild(node) }); } else { element.innerHTML = content.stripScripts(); } } else { element.innerHTML = content.stripScripts(); } content.evalScripts.bind(content).defer(); return element; } return update; })(), replace: function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); else if (!Object.isElement(content)) { content = Object.toHTML(content); var range = element.ownerDocument.createRange(); range.selectNode(element); content.evalScripts.bind(content).defer(); content = range.createContextualFragment(content.stripScripts()); } element.parentNode.replaceChild(content, element); return element; }, insert: function(element, insertions) { element = $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = {bottom:insertions}; var content, insert, tagName, childNodes; for (var position in insertions) { content = insertions[position]; position = position.toLowerCase(); insert = Element._insertionTranslations[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { insert(element, content); continue; } content = Object.toHTML(content); tagName = ((position == 'before' || position == 'after') ? element.parentNode : element).tagName.toUpperCase(); childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); if (position == 'top' || position == 'after') childNodes.reverse(); childNodes.each(insert.curry(element)); content.evalScripts.bind(content).defer(); } return element; }, wrap: function(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); else wrapper = new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, inspect: function(element) { element = $(element); var result = '<' + element.tagName.toLowerCase(); $H({'id': 'id', 'className': 'class'}).each(function(pair) { var property = pair.first(), attribute = pair.last(), value = (element[property] || '').toString(); if (value) result += ' ' + attribute + '=' + value.inspect(true); }); return result + '>'; }, recursivelyCollect: function(element, property, maximumLength) { element = $(element); maximumLength = maximumLength || -1; var elements = []; while (element = element[property]) { if (element.nodeType == 1) elements.push(Element.extend(element)); if (elements.length == maximumLength) break; } return elements; }, ancestors: function(element) { return Element.recursivelyCollect(element, 'parentNode'); }, descendants: function(element) { return Element.select(element, "*"); }, firstDescendant: function(element) { element = $(element).firstChild; while (element && element.nodeType != 1) element = element.nextSibling; return $(element); }, immediateDescendants: function(element) { var results = [], child = $(element).firstChild; while (child) { if (child.nodeType === 1) { results.push(Element.extend(child)); } child = child.nextSibling; } return results; }, previousSiblings: function(element, maximumLength) { return Element.recursivelyCollect(element, 'previousSibling'); }, nextSiblings: function(element) { return Element.recursivelyCollect(element, 'nextSibling'); }, siblings: function(element) { element = $(element); return Element.previousSiblings(element).reverse() .concat(Element.nextSiblings(element)); }, match: function(element, selector) { element = $(element); if (Object.isString(selector)) return Prototype.Selector.match(element, selector); return selector.match(element); }, up: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(element.parentNode); var ancestors = Element.ancestors(element); return Object.isNumber(expression) ? ancestors[expression] : Prototype.Selector.find(ancestors, expression, index); }, down: function(element, expression, index) { element = $(element); if (arguments.length == 1) return Element.firstDescendant(element); return Object.isNumber(expression) ? Element.descendants(element)[expression] : Element.select(element, expression)[index || 0]; }, previous: function(element, expression, index) { element = $(element); if (Object.isNumber(expression)) index = expression, expression = false; if (!Object.isNumber(index)) index = 0; if (expression) { return Prototype.Selector.find(element.previousSiblings(), expression, index); } else { return element.recursivelyCollect("previousSibling", index + 1)[index]; } }, next: function(element, expression, index) { element = $(element); if (Object.isNumber(expression)) index = expression, expression = false; if (!Object.isNumber(index)) index = 0; if (expression) { return Prototype.Selector.find(element.nextSiblings(), expression, index); } else { var maximumLength = Object.isNumber(index) ? index + 1 : 1; return element.recursivelyCollect("nextSibling", index + 1)[index]; } }, select: function(element) { element = $(element); var expressions = Array.prototype.slice.call(arguments, 1).join(', '); return Prototype.Selector.select(expressions, element); }, adjacent: function(element) { element = $(element); var expressions = Array.prototype.slice.call(arguments, 1).join(', '); return Prototype.Selector.select(expressions, element.parentNode).without(element); }, identify: function(element) { element = $(element); var id = Element.readAttribute(element, 'id'); if (id) return id; do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id)); Element.writeAttribute(element, 'id', id); return id; }, readAttribute: function(element, name) { element = $(element); if (Prototype.Browser.IE) { var t = Element._attributeTranslations.read; if (t.values[name]) return t.values[name](element, name); if (t.names[name]) name = t.names[name]; if (name.include(':')) { return (!element.attributes || !element.attributes[name]) ? null : element.attributes[name].value; } } return element.getAttribute(name); }, writeAttribute: function(element, name, value) { element = $(element); var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; else attributes[name] = Object.isUndefined(value) ? true : value; for (var attr in attributes) { name = t.names[attr] || attr; value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, getHeight: function(element) { return Element.getDimensions(element).height; }, getWidth: function(element) { return Element.getDimensions(element).width; }, classNames: function(element) { return new Element.ClassNames(element); }, hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); }, addClassName: function(element, className) { if (!(element = $(element))) return; if (!Element.hasClassName(element, className)) element.className += (element.className ? ' ' : '') + className; return element; }, removeClassName: function(element, className) { if (!(element = $(element))) return; element.className = element.className.replace( new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); return element; }, toggleClassName: function(element, className) { if (!(element = $(element))) return; return Element[Element.hasClassName(element, className) ? 'removeClassName' : 'addClassName'](element, className); }, cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, empty: function(element) { return $(element).innerHTML.blank(); }, descendantOf: function(element, ancestor) { element = $(element), ancestor = $(ancestor); if (element.compareDocumentPosition) return (element.compareDocumentPosition(ancestor) & 8) === 8; if (ancestor.contains) return ancestor.contains(element) && ancestor !== element; while (element = element.parentNode) if (element == ancestor) return true; return false; }, scrollTo: function(element) { element = $(element); var pos = Element.cumulativeOffset(element); window.scrollTo(pos[0], pos[1]); return element; }, getStyle: function(element, style) { element = $(element); style = style == 'float' ? 'cssFloat' : style.camelize(); var value = element.style[style]; if (!value || value == 'auto') { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } if (style == 'opacity') return value ? parseFloat(value) : 1.0; return value == 'auto' ? null : value; }, getOpacity: function(element) { return $(element).getStyle('opacity'); }, setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, setOpacity: function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }, makePositioned: function(element) { element = $(element); var pos = Element.getStyle(element, 'position'); if (pos == 'static' || !pos) { element._madePositioned = true; element.style.position = 'relative'; if (Prototype.Browser.Opera) { element.style.top = 0; element.style.left = 0; } } return element; }, undoPositioned: function(element) { element = $(element); if (element._madePositioned) { element._madePositioned = undefined; element.style.position = element.style.top = element.style.left = element.style.bottom = element.style.right = ''; } return element; }, makeClipping: function(element) { element = $(element); if (element._overflow) return element; element._overflow = Element.getStyle(element, 'overflow') || 'auto'; if (element._overflow !== 'hidden') element.style.overflow = 'hidden'; return element; }, undoClipping: function(element) { element = $(element); if (!element._overflow) return element; element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; element._overflow = null; return element; }, clonePosition: function(element, source) { var options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || { }); source = $(source); var p = Element.viewportOffset(source), delta = [0, 0], parent = null; element = $(element); if (Element.getStyle(element, 'position') == 'absolute') { parent = Element.getOffsetParent(element); delta = Element.viewportOffset(parent); } if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; if (options.setHeight) element.style.height = source.offsetHeight + 'px'; return element; } }; Object.extend(Element.Methods, { getElementsBySelector: Element.Methods.select, childElements: Element.Methods.immediateDescendants }); Element._attributeTranslations = { write: { names: { className: 'class', htmlFor: 'for' }, values: { } } }; if (Prototype.Browser.Opera) { Element.Methods.getStyle = Element.Methods.getStyle.wrap( function(proceed, element, style) { switch (style) { case 'height': case 'width': if (!Element.visible(element)) return null; var dim = parseInt(proceed(element, style), 10); if (dim !== element['offset' + style.capitalize()]) return dim + 'px'; var properties; if (style === 'height') { properties = ['border-top-width', 'padding-top', 'padding-bottom', 'border-bottom-width']; } else { properties = ['border-left-width', 'padding-left', 'padding-right', 'border-right-width']; } return properties.inject(dim, function(memo, property) { var val = proceed(element, property); return val === null ? memo : memo - parseInt(val, 10); }) + 'px'; default: return proceed(element, style); } } ); Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( function(proceed, element, attribute) { if (attribute === 'title') return element.title; return proceed(element, attribute); } ); } else if (Prototype.Browser.IE) { Element.Methods.getStyle = function(element, style) { element = $(element); style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); var value = element.style[style]; if (!value && element.currentStyle) value = element.currentStyle[style]; if (style == 'opacity') { if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) if (value[1]) return parseFloat(value[1]) / 100; return 1.0; } if (value == 'auto') { if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) return element['offset' + style.capitalize()] + 'px'; return null; } return value; }; Element.Methods.setOpacity = function(element, value) { function stripAlpha(filter){ return filter.replace(/alpha\([^\)]*\)/gi,''); } element = $(element); var currentStyle = element.currentStyle; if ((currentStyle && !currentStyle.hasLayout) || (!currentStyle && element.style.zoom == 'normal')) element.style.zoom = 1; var filter = element.getStyle('filter'), style = element.style; if (value == 1 || value === '') { (filter = stripAlpha(filter)) ? style.filter = filter : style.removeAttribute('filter'); return element; } else if (value < 0.00001) value = 0; style.filter = stripAlpha(filter) + 'alpha(opacity=' + (value * 100) + ')'; return element; }; Element._attributeTranslations = (function(){ var classProp = 'className', forProp = 'for', el = document.createElement('div'); el.setAttribute(classProp, 'x'); if (el.className !== 'x') { el.setAttribute('class', 'x'); if (el.className === 'x') { classProp = 'class'; } } el = null; el = document.createElement('label'); el.setAttribute(forProp, 'x'); if (el.htmlFor !== 'x') { el.setAttribute('htmlFor', 'x'); if (el.htmlFor === 'x') { forProp = 'htmlFor'; } } el = null; return { read: { names: { 'class': classProp, 'className': classProp, 'for': forProp, 'htmlFor': forProp }, values: { _getAttr: function(element, attribute) { return element.getAttribute(attribute); }, _getAttr2: function(element, attribute) { return element.getAttribute(attribute, 2); }, _getAttrNode: function(element, attribute) { var node = element.getAttributeNode(attribute); return node ? node.value : ""; }, _getEv: (function(){ var el = document.createElement('div'), f; el.onclick = Prototype.emptyFunction; var value = el.getAttribute('onclick'); if (String(value).indexOf('{') > -1) { f = function(element, attribute) { attribute = element.getAttribute(attribute); if (!attribute) return null; attribute = attribute.toString(); attribute = attribute.split('{')[1]; attribute = attribute.split('}')[0]; return attribute.strip(); }; } else if (value === '') { f = function(element, attribute) { attribute = element.getAttribute(attribute); if (!attribute) return null; return attribute.strip(); }; } el = null; return f; })(), _flag: function(element, attribute) { return $(element).hasAttribute(attribute) ? attribute : null; }, style: function(element) { return element.style.cssText.toLowerCase(); }, title: function(element) { return element.title; } } } } })(); Element._attributeTranslations.write = { names: Object.extend({ cellpadding: 'cellPadding', cellspacing: 'cellSpacing' }, Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked = !!value; }, style: function(element, value) { element.style.cssText = value ? value : ''; } } }; Element._attributeTranslations.has = {}; $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; Element._attributeTranslations.has[attr.toLowerCase()] = attr; }); (function(v) { Object.extend(v, { href: v._getAttr2, src: v._getAttr2, type: v._getAttr, action: v._getAttrNode, disabled: v._flag, checked: v._flag, readonly: v._flag, multiple: v._flag, onload: v._getEv, onunload: v._getEv, onclick: v._getEv, ondblclick: v._getEv, onmousedown: v._getEv, onmouseup: v._getEv, onmouseover: v._getEv, onmousemove: v._getEv, onmouseout: v._getEv, onfocus: v._getEv, onblur: v._getEv, onkeypress: v._getEv, onkeydown: v._getEv, onkeyup: v._getEv, onsubmit: v._getEv, onreset: v._getEv, onselect: v._getEv, onchange: v._getEv }); })(Element._attributeTranslations.read.values); if (Prototype.BrowserFeatures.ElementExtensions) { (function() { function _descendants(element) { var nodes = element.getElementsByTagName('*'), results = []; for (var i = 0, node; node = nodes[i]; i++) if (node.tagName !== "!") // Filter out comment nodes. results.push(node); return results; } Element.Methods.down = function(element, expression, index) { element = $(element); if (arguments.length == 1) return element.firstDescendant(); return Object.isNumber(expression) ? _descendants(element)[expression] : Element.select(element, expression)[index || 0]; } })(); } } else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1) ? 0.999999 : (value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }; } else if (Prototype.Browser.WebKit) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; if (value == 1) if (element.tagName.toUpperCase() == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } return element; }; } if ('outerHTML' in document.documentElement) { Element.Methods.replace = function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { element.parentNode.replaceChild(content, element); return element; } content = Object.toHTML(content); var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); if (Element._insertionTranslations.tags[tagName]) { var nextSibling = element.next(), fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); parent.removeChild(element); if (nextSibling) fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); else fragments.each(function(node) { parent.appendChild(node) }); } else element.outerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } Element._returnOffset = function(l, t) { var result = [l, t]; result.left = l; result.top = t; return result; }; Element._getContentFromAnonymousElement = function(tagName, html, force) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; var workaround = false; if (t) workaround = true; else if (force) { workaround = true; t = ['', '', 0]; } if (workaround) { div.innerHTML = ' ' + t[0] + html + t[1]; div.removeChild(div.firstChild); for (var i = t[2]; i--; ) { div = div.firstChild; } } else { div.innerHTML = html; } return $A(div.childNodes); }; Element._insertionTranslations = { before: function(element, node) { element.parentNode.insertBefore(node, element); }, top: function(element, node) { element.insertBefore(node, element.firstChild); }, bottom: function(element, node) { element.appendChild(node); }, after: function(element, node) { element.parentNode.insertBefore(node, element.nextSibling); }, tags: { TABLE: ['', '
', 1], TBODY: ['', '
', 2], TR: ['', '
', 3], TD: ['
', '
', 4], SELECT: ['', 1] } }; (function() { var tags = Element._insertionTranslations.tags; Object.extend(tags, { THEAD: tags.TBODY, TFOOT: tags.TBODY, TH: tags.TD }); })(); Element.Methods.Simulated = { hasAttribute: function(element, attribute) { attribute = Element._attributeTranslations.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute); return !!(node && node.specified); } }; Element.Methods.ByTag = { }; Object.extend(Element, Element.Methods); (function(div) { if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) { window.HTMLElement = { }; window.HTMLElement.prototype = div['__proto__']; Prototype.BrowserFeatures.ElementExtensions = true; } div = null; })(document.createElement('div')); Element.extend = (function() { function checkDeficiency(tagName) { if (typeof window.Element != 'undefined') { var proto = window.Element.prototype; if (proto) { var id = '_' + (Math.random()+'').slice(2), el = document.createElement(tagName); proto[id] = 'x'; var isBuggy = (el[id] !== 'x'); delete proto[id]; el = null; return isBuggy; } } return false; } function extendElementWith(element, methods) { for (var property in methods) { var value = methods[property]; if (Object.isFunction(value) && !(property in element)) element[property] = value.methodize(); } } var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object'); if (Prototype.BrowserFeatures.SpecificElementExtensions) { if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) { return function(element) { if (element && typeof element._extendedByPrototype == 'undefined') { var t = element.tagName; if (t && (/^(?:object|applet|embed)$/i.test(t))) { extendElementWith(element, Element.Methods); extendElementWith(element, Element.Methods.Simulated); extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]); } } return element; } } return Prototype.K; } var Methods = { }, ByTag = Element.Methods.ByTag; var extend = Object.extend(function(element) { if (!element || typeof element._extendedByPrototype != 'undefined' || element.nodeType != 1 || element == window) return element; var methods = Object.clone(Methods), tagName = element.tagName.toUpperCase(); if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); extendElementWith(element, methods); element._extendedByPrototype = Prototype.emptyFunction; return element; }, { refresh: function() { if (!Prototype.BrowserFeatures.ElementExtensions) { Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); } } }); extend.refresh(); return extend; })(); if (document.documentElement.hasAttribute) { Element.hasAttribute = function(element, attribute) { return element.hasAttribute(attribute); }; } else { Element.hasAttribute = Element.Methods.Simulated.hasAttribute; } Element.addMethods = function(methods) { var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; if (!methods) { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM": Object.clone(Form.Methods), "INPUT": Object.clone(Form.Element.Methods), "SELECT": Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods), "BUTTON": Object.clone(Form.Element.Methods) }); } if (arguments.length == 2) { var tagName = methods; methods = arguments[1]; } if (!tagName) Object.extend(Element.Methods, methods || { }); else { if (Object.isArray(tagName)) tagName.each(extend); else extend(tagName); } function extend(tagName) { tagName = tagName.toUpperCase(); if (!Element.Methods.ByTag[tagName]) Element.Methods.ByTag[tagName] = { }; Object.extend(Element.Methods.ByTag[tagName], methods); } function copy(methods, destination, onlyIfAbsent) { onlyIfAbsent = onlyIfAbsent || false; for (var property in methods) { var value = methods[property]; if (!Object.isFunction(value)) continue; if (!onlyIfAbsent || !(property in destination)) destination[property] = value.methodize(); } } function findDOMClass(tagName) { var klass; var trans = { "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": "FrameSet", "IFRAME": "IFrame" }; if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; var element = document.createElement(tagName), proto = element['__proto__'] || element.constructor.prototype; element = null; return proto; } var elementPrototype = window.HTMLElement ? HTMLElement.prototype : Element.prototype; if (F.ElementExtensions) { copy(Element.Methods, elementPrototype); copy(Element.Methods.Simulated, elementPrototype, true); } if (F.SpecificElementExtensions) { for (var tag in Element.Methods.ByTag) { var klass = findDOMClass(tag); if (Object.isUndefined(klass)) continue; copy(T[tag], klass.prototype); } } Object.extend(Element, Element.Methods); delete Element.ByTag; if (Element.extend.refresh) Element.extend.refresh(); Element.cache = { }; }; document.viewport = { getDimensions: function() { return { width: this.getWidth(), height: this.getHeight() }; }, getScrollOffsets: function() { return Element._returnOffset( window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); } }; (function(viewport) { var B = Prototype.Browser, doc = document, element, property = {}; function getRootElement() { if (B.WebKit && !doc.evaluate) return document; if (B.Opera && window.parseFloat(window.opera.version()) < 9.5) return document.body; return document.documentElement; } function define(D) { if (!element) element = getRootElement(); property[D] = 'client' + D; viewport['get' + D] = function() { return element[property[D]] }; return viewport['get' + D](); } viewport.getWidth = define.curry('Width'); viewport.getHeight = define.curry('Height'); })(document.viewport); Element.Storage = { UID: 1 }; Element.addMethods({ getStorage: function(element) { if (!(element = $(element))) return; var uid; if (element === window) { uid = 0; } else { if (typeof element._prototypeUID === "undefined") element._prototypeUID = Element.Storage.UID++; uid = element._prototypeUID; } if (!Element.Storage[uid]) Element.Storage[uid] = $H(); return Element.Storage[uid]; }, store: function(element, key, value) { if (!(element = $(element))) return; if (arguments.length === 2) { Element.getStorage(element).update(key); } else { Element.getStorage(element).set(key, value); } return element; }, retrieve: function(element, key, defaultValue) { if (!(element = $(element))) return; var hash = Element.getStorage(element), value = hash.get(key); if (Object.isUndefined(value)) { hash.set(key, defaultValue); value = defaultValue; } return value; }, clone: function(element, deep) { if (!(element = $(element))) return; var clone = element.cloneNode(deep); clone._prototypeUID = void 0; if (deep) { var descendants = Element.select(clone, '*'), i = descendants.length; while (i--) { descendants[i]._prototypeUID = void 0; } } return Element.extend(clone); }, purge: function(element) { if (!(element = $(element))) return; var purgeElement = Element._purgeElement; purgeElement(element); var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); return null; } }); (function() { function toDecimal(pctString) { var match = pctString.match(/^(\d+)%?$/i); if (!match) return null; return (Number(match[1]) / 100); } function getPixelValue(value, property, context) { var element = null; if (Object.isElement(value)) { element = value; value = element.getStyle(property); } if (value === null) { return null; } if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) { return window.parseFloat(value); } var isPercentage = value.include('%'), isViewport = (context === document.viewport); if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) { var style = element.style.left, rStyle = element.runtimeStyle.left; element.runtimeStyle.left = element.currentStyle.left; element.style.left = value || 0; value = element.style.pixelLeft; element.style.left = style; element.runtimeStyle.left = rStyle; return value; } if (element && isPercentage) { context = context || element.parentNode; var decimal = toDecimal(value); var whole = null; var position = element.getStyle('position'); var isHorizontal = property.include('left') || property.include('right') || property.include('width'); var isVertical = property.include('top') || property.include('bottom') || property.include('height'); if (context === document.viewport) { if (isHorizontal) { whole = document.viewport.getWidth(); } else if (isVertical) { whole = document.viewport.getHeight(); } } else { if (isHorizontal) { whole = $(context).measure('width'); } else if (isVertical) { whole = $(context).measure('height'); } } return (whole === null) ? 0 : whole * decimal; } return 0; } function toCSSPixels(number) { if (Object.isString(number) && number.endsWith('px')) { return number; } return number + 'px'; } function isDisplayed(element) { var originalElement = element; while (element && element.parentNode) { var display = element.getStyle('display'); if (display === 'none') { return false; } element = $(element.parentNode); } return true; } var hasLayout = Prototype.K; if ('currentStyle' in document.documentElement) { hasLayout = function(element) { if (!element.currentStyle.hasLayout) { element.style.zoom = 1; } return element; }; } function cssNameFor(key) { if (key.include('border')) key = key + '-width'; return key.camelize(); } Element.Layout = Class.create(Hash, { initialize: function($super, element, preCompute) { $super(); this.element = $(element); Element.Layout.PROPERTIES.each( function(property) { this._set(property, null); }, this); if (preCompute) { this._preComputing = true; this._begin(); Element.Layout.PROPERTIES.each( this._compute, this ); this._end(); this._preComputing = false; } }, _set: function(property, value) { return Hash.prototype.set.call(this, property, value); }, set: function(property, value) { throw "Properties of Element.Layout are read-only."; }, get: function($super, property) { var value = $super(property); return value === null ? this._compute(property) : value; }, _begin: function() { if (this._prepared) return; var element = this.element; if (isDisplayed(element)) { this._prepared = true; return; } var originalStyles = { position: element.style.position || '', width: element.style.width || '', visibility: element.style.visibility || '', display: element.style.display || '' }; element.store('prototype_original_styles', originalStyles); var position = element.getStyle('position'), width = element.getStyle('width'); if (width === "0px" || width === null) { element.style.display = 'block'; width = element.getStyle('width'); } var context = (position === 'fixed') ? document.viewport : element.parentNode; element.setStyle({ position: 'absolute', visibility: 'hidden', display: 'block' }); var positionedWidth = element.getStyle('width'); var newWidth; if (width && (positionedWidth === width)) { newWidth = getPixelValue(element, 'width', context); } else if (position === 'absolute' || position === 'fixed') { newWidth = getPixelValue(element, 'width', context); } else { var parent = element.parentNode, pLayout = $(parent).getLayout(); newWidth = pLayout.get('width') - this.get('margin-left') - this.get('border-left') - this.get('padding-left') - this.get('padding-right') - this.get('border-right') - this.get('margin-right'); } element.setStyle({ width: newWidth + 'px' }); this._prepared = true; }, _end: function() { var element = this.element; var originalStyles = element.retrieve('prototype_original_styles'); element.store('prototype_original_styles', null); element.setStyle(originalStyles); this._prepared = false; }, _compute: function(property) { var COMPUTATIONS = Element.Layout.COMPUTATIONS; if (!(property in COMPUTATIONS)) { throw "Property not found."; } return this._set(property, COMPUTATIONS[property].call(this, this.element)); }, toObject: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var obj = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) obj[key] = value; }, this); return obj; }, toHash: function() { var obj = this.toObject.apply(this, arguments); return new Hash(obj); }, toCSS: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var css = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) css[cssNameFor(key)] = value + 'px'; }, this); return css; }, inspect: function() { return "#"; } }); Object.extend(Element.Layout, { PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'), COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'), COMPUTATIONS: { 'height': function(element) { if (!this._preComputing) this._begin(); var bHeight = this.get('border-box-height'); if (bHeight <= 0) { if (!this._preComputing) this._end(); return 0; } var bTop = this.get('border-top'), bBottom = this.get('border-bottom'); var pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); if (!this._preComputing) this._end(); return bHeight - bTop - bBottom - pTop - pBottom; }, 'width': function(element) { if (!this._preComputing) this._begin(); var bWidth = this.get('border-box-width'); if (bWidth <= 0) { if (!this._preComputing) this._end(); return 0; } var bLeft = this.get('border-left'), bRight = this.get('border-right'); var pLeft = this.get('padding-left'), pRight = this.get('padding-right'); if (!this._preComputing) this._end(); return bWidth - bLeft - bRight - pLeft - pRight; }, 'padding-box-height': function(element) { var height = this.get('height'), pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); return height + pTop + pBottom; }, 'padding-box-width': function(element) { var width = this.get('width'), pLeft = this.get('padding-left'), pRight = this.get('padding-right'); return width + pLeft + pRight; }, 'border-box-height': function(element) { if (!this._preComputing) this._begin(); var height = element.offsetHeight; if (!this._preComputing) this._end(); return height; }, 'border-box-width': function(element) { if (!this._preComputing) this._begin(); var width = element.offsetWidth; if (!this._preComputing) this._end(); return width; }, 'margin-box-height': function(element) { var bHeight = this.get('border-box-height'), mTop = this.get('margin-top'), mBottom = this.get('margin-bottom'); if (bHeight <= 0) return 0; return bHeight + mTop + mBottom; }, 'margin-box-width': function(element) { var bWidth = this.get('border-box-width'), mLeft = this.get('margin-left'), mRight = this.get('margin-right'); if (bWidth <= 0) return 0; return bWidth + mLeft + mRight; }, 'top': function(element) { var offset = element.positionedOffset(); return offset.top; }, 'bottom': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pHeight = parent.measure('height'); var mHeight = this.get('border-box-height'); return pHeight - mHeight - offset.top; }, 'left': function(element) { var offset = element.positionedOffset(); return offset.left; }, 'right': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pWidth = parent.measure('width'); var mWidth = this.get('border-box-width'); return pWidth - mWidth - offset.left; }, 'padding-top': function(element) { return getPixelValue(element, 'paddingTop'); }, 'padding-bottom': function(element) { return getPixelValue(element, 'paddingBottom'); }, 'padding-left': function(element) { return getPixelValue(element, 'paddingLeft'); }, 'padding-right': function(element) { return getPixelValue(element, 'paddingRight'); }, 'border-top': function(element) { return getPixelValue(element, 'borderTopWidth'); }, 'border-bottom': function(element) { return getPixelValue(element, 'borderBottomWidth'); }, 'border-left': function(element) { return getPixelValue(element, 'borderLeftWidth'); }, 'border-right': function(element) { return getPixelValue(element, 'borderRightWidth'); }, 'margin-top': function(element) { return getPixelValue(element, 'marginTop'); }, 'margin-bottom': function(element) { return getPixelValue(element, 'marginBottom'); }, 'margin-left': function(element) { return getPixelValue(element, 'marginLeft'); }, 'margin-right': function(element) { return getPixelValue(element, 'marginRight'); } } }); if ('getBoundingClientRect' in document.documentElement) { Object.extend(Element.Layout.COMPUTATIONS, { 'right': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.right - rect.right).round(); }, 'bottom': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.bottom - rect.bottom).round(); } }); } Element.Offset = Class.create({ initialize: function(left, top) { this.left = left.round(); this.top = top.round(); this[0] = this.left; this[1] = this.top; }, relativeTo: function(offset) { return new Element.Offset( this.left - offset.left, this.top - offset.top ); }, inspect: function() { return "#".interpolate(this); }, toString: function() { return "[#{left}, #{top}]".interpolate(this); }, toArray: function() { return [this.left, this.top]; } }); function getLayout(element, preCompute) { return new Element.Layout(element, preCompute); } function measure(element, property) { return $(element).getLayout().get(property); } function getDimensions(element) { element = $(element); var display = Element.getStyle(element, 'display'); if (display && display !== 'none') { return { width: element.offsetWidth, height: element.offsetHeight }; } var style = element.style; var originalStyles = { visibility: style.visibility, position: style.position, display: style.display }; var newStyles = { visibility: 'hidden', display: 'block' }; if (originalStyles.position !== 'fixed') newStyles.position = 'absolute'; Element.setStyle(element, newStyles); var dimensions = { width: element.offsetWidth, height: element.offsetHeight }; Element.setStyle(element, originalStyles); return dimensions; } function getOffsetParent(element) { element = $(element); if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element)) return $(document.body); var isInline = (Element.getStyle(element, 'display') === 'inline'); if (!isInline && element.offsetParent) return $(element.offsetParent); while ((element = element.parentNode) && element !== document.body) { if (Element.getStyle(element, 'position') !== 'static') { return isHtml(element) ? $(document.body) : $(element); } } return $(document.body); } function cumulativeOffset(element) { element = $(element); var valueT = 0, valueL = 0; if (element.parentNode) { do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); } return new Element.Offset(valueL, valueT); } function positionedOffset(element) { element = $(element); var layout = element.getLayout(); var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (isBody(element)) break; var p = Element.getStyle(element, 'position'); if (p !== 'static') break; } } while (element); valueL -= layout.get('margin-top'); valueT -= layout.get('margin-left'); return new Element.Offset(valueL, valueT); } function cumulativeScrollOffset(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return new Element.Offset(valueL, valueT); } function viewportOffset(forElement) { element = $(element); var valueT = 0, valueL = 0, docBody = document.body; var element = forElement; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == docBody && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (element != docBody) { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return new Element.Offset(valueL, valueT); } function absolutize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'absolute') { return element; } var offsetParent = getOffsetParent(element); var eOffset = element.viewportOffset(), pOffset = offsetParent.viewportOffset(); var offset = eOffset.relativeTo(pOffset); var layout = element.getLayout(); element.store('prototype_absolutize_original_styles', { left: element.getStyle('left'), top: element.getStyle('top'), width: element.getStyle('width'), height: element.getStyle('height') }); element.setStyle({ position: 'absolute', top: offset.top + 'px', left: offset.left + 'px', width: layout.get('width') + 'px', height: layout.get('height') + 'px' }); return element; } function relativize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'relative') { return element; } var originalStyles = element.retrieve('prototype_absolutize_original_styles'); if (originalStyles) element.setStyle(originalStyles); return element; } if (Prototype.Browser.IE) { getOffsetParent = getOffsetParent.wrap( function(proceed, element) { element = $(element); if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element)) return $(document.body); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); positionedOffset = positionedOffset.wrap(function(proceed, element) { element = $(element); if (!element.parentNode) return new Element.Offset(0, 0); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); var offsetParent = element.getOffsetParent(); if (offsetParent && offsetParent.getStyle('position') === 'fixed') hasLayout(offsetParent); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; }); } else if (Prototype.Browser.Webkit) { cumulativeOffset = function(element) { element = $(element); var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) if (Element.getStyle(element, 'position') == 'absolute') break; element = element.offsetParent; } while (element); return new Element.Offset(valueL, valueT); }; } Element.addMethods({ getLayout: getLayout, measure: measure, getDimensions: getDimensions, getOffsetParent: getOffsetParent, cumulativeOffset: cumulativeOffset, positionedOffset: positionedOffset, cumulativeScrollOffset: cumulativeScrollOffset, viewportOffset: viewportOffset, absolutize: absolutize, relativize: relativize }); function isBody(element) { return element.nodeName.toUpperCase() === 'BODY'; } function isHtml(element) { return element.nodeName.toUpperCase() === 'HTML'; } function isDocument(element) { return element.nodeType === Node.DOCUMENT_NODE; } function isDetached(element) { return element !== document.body && !Element.descendantOf(element, document.body); } if ('getBoundingClientRect' in document.documentElement) { Element.addMethods({ viewportOffset: function(element) { element = $(element); if (isDetached(element)) return new Element.Offset(0, 0); var rect = element.getBoundingClientRect(), docEl = document.documentElement; return new Element.Offset(rect.left - docEl.clientLeft, rect.top - docEl.clientTop); } }); } })(); window.$$ = function() { var expression = $A(arguments).join(', '); return Prototype.Selector.select(expression, document); }; Prototype.Selector = (function() { function select() { throw new Error('Method "Prototype.Selector.select" must be defined.'); } function match() { throw new Error('Method "Prototype.Selector.match" must be defined.'); } function find(elements, expression, index) { index = index || 0; var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i; for (i = 0; i < length; i++) { if (match(elements[i], expression) && index == matchIndex++) { return Element.extend(elements[i]); } } } function extendElements(elements) { for (var i = 0, length = elements.length; i < length; i++) { Element.extend(elements[i]); } return elements; } var K = Prototype.K; return { select: select, match: match, find: find, extendElements: (Element.extend === K) ? K : extendElements, extendElement: Element.extend }; })(); /*! * Sizzle CSS Selector Engine - v1.0 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true; [0, 0].sort(function(){ baseHasDuplicate = false; return 0; }); var Sizzle = function(selector, context, results, seed) { results = results || []; var origContext = context = context || document; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context), soFar = selector; while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) selector += parts.shift(); set = posProcess( selector, set ); } } } else { if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { var ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray(set); } else { prune = false; } while ( parts.length ) { var cur = parts.pop(), pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { throw "Syntax error, unrecognized expression: " + (cur || selector); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function(results){ if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort(sortOrder); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[i-1] ) { results.splice(i--, 1); } } } } return results; }; Sizzle.matches = function(expr, set){ return Sizzle(expr, null, null, set); }; Sizzle.find = function(expr, context, isXML){ var set, match; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice(1,1); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace(/\\/g, ""); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = context.getElementsByTagName("*"); } return {set: set, expr: expr}; }; Sizzle.filter = function(expr, set, inplace, not){ var old = expr, result = [], curLoop = set, match, anyFound, isXMLFilter = set && set[0] && isXML(set[0]); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.match[ type ].exec( expr )) != null ) { var filter = Expr.filter[ type ], found, item; anyFound = false; if ( curLoop == result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } if ( expr == old ) { if ( anyFound == null ) { throw "Syntax error, unrecognized expression: " + expr; } else { break; } } old = expr; } return curLoop; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function(elem){ return elem.getAttribute("href"); } }, relative: { "+": function(checkSet, part, isXML){ var isPartStr = typeof part === "string", isTag = isPartStr && !/\W/.test(part), isPartStrNotTag = isPartStr && !isTag; if ( isTag && !isXML ) { part = part.toUpperCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function(checkSet, part, isXML){ var isPartStr = typeof part === "string"; if ( isPartStr && !/\W/.test(part) ) { part = isXML ? part : part.toUpperCase(); for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName === part ? parent : false; } } } else { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); }, "~": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); } }, find: { ID: function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? [m] : []; } }, NAME: function(match, context, isXML){ if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName(match[1]); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function(match, context){ return context.getElementsByTagName(match[1]); } }, preFilter: { CLASS: function(match, curLoop, inplace, result, not, isXML){ match = " " + match[1].replace(/\\/g, "") + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) { if ( !inplace ) result.push( elem ); } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function(match){ return match[1].replace(/\\/g, ""); }, TAG: function(match, curLoop){ for ( var i = 0; curLoop[i] === false; i++ ){} return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); }, CHILD: function(match){ if ( match[1] == "nth" ) { var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } match[0] = done++; return match; }, ATTR: function(match, curLoop, inplace, result, not, isXML){ var name = match[1].replace(/\\/g, ""); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function(match, curLoop, inplace, result, not){ if ( match[1] === "not" ) { if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function(match){ match.unshift( true ); return match; } }, filters: { enabled: function(elem){ return elem.disabled === false && elem.type !== "hidden"; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ elem.parentNode.selectedIndex; return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, has: function(elem, i, match){ return !!Sizzle( match[3], elem ).length; }, header: function(elem){ return /h\d/i.test( elem.nodeName ); }, text: function(elem){ return "text" === elem.type; }, radio: function(elem){ return "radio" === elem.type; }, checkbox: function(elem){ return "checkbox" === elem.type; }, file: function(elem){ return "file" === elem.type; }, password: function(elem){ return "password" === elem.type; }, submit: function(elem){ return "submit" === elem.type; }, image: function(elem){ return "image" === elem.type; }, reset: function(elem){ return "reset" === elem.type; }, button: function(elem){ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; }, input: function(elem){ return /input|select|textarea|button/i.test(elem.nodeName); } }, setFilters: { first: function(elem, i){ return i === 0; }, last: function(elem, i, match, array){ return i === array.length - 1; }, even: function(elem, i){ return i % 2 === 0; }, odd: function(elem, i){ return i % 2 === 1; }, lt: function(elem, i, match){ return i < match[3] - 0; }, gt: function(elem, i, match){ return i > match[3] - 0; }, nth: function(elem, i, match){ return match[3] - 0 == i; }, eq: function(elem, i, match){ return match[3] - 0 == i; } }, filter: { PSEUDO: function(elem, match, i, array){ var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var i = 0, l = not.length; i < l; i++ ) { if ( not[i] === elem ) { return false; } } return true; } }, CHILD: function(elem, match){ var type = match[1], node = elem; switch (type) { case 'only': case 'first': while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) return false; } if ( type == 'first') return true; node = elem; case 'last': while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) return false; } return true; case 'nth': var first = match[2], last = match[3]; if ( first == 1 && last == 0 ) { return true; } var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first == 0 ) { return diff == 0; } else { return ( diff % first == 0 && diff / first >= 0 ); } } }, ID: function(elem, match){ return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function(elem, match){ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; }, CLASS: function(elem, match){ return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function(elem, match){ var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value != check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function(elem, match, i, array){ var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source ); } var makeArray = function(array, results) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; try { Array.prototype.slice.call( document.documentElement.childNodes, 0 ); } catch(e){ makeArray = function(array, results) { var ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var i = 0, l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( var i = 0; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { if ( a == b ) { hasDuplicate = true; } return 0; } var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( "sourceIndex" in document.documentElement ) { sortOrder = function( a, b ) { if ( !a.sourceIndex || !b.sourceIndex ) { if ( a == b ) { hasDuplicate = true; } return 0; } var ret = a.sourceIndex - b.sourceIndex; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( document.createRange ) { sortOrder = function( a, b ) { if ( !a.ownerDocument || !b.ownerDocument ) { if ( a == b ) { hasDuplicate = true; } return 0; } var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); aRange.setStart(a, 0); aRange.setEnd(a, 0); bRange.setStart(b, 0); bRange.setEnd(b, 0); var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } (function(){ var form = document.createElement("div"), id = "script" + (new Date).getTime(); form.innerHTML = ""; var root = document.documentElement; root.insertBefore( form, root.firstChild ); if ( !!document.getElementById( id ) ) { Expr.find.ID = function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function(elem, match){ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); root = form = null; // release memory in IE })(); (function(){ var div = document.createElement("div"); div.appendChild( document.createComment("") ); if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function(match, context){ var results = context.getElementsByTagName(match[1]); if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } div.innerHTML = ""; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function(elem){ return elem.getAttribute("href", 2); }; } div = null; // release memory in IE })(); if ( document.querySelectorAll ) (function(){ var oldSizzle = Sizzle, div = document.createElement("div"); div.innerHTML = "

"; if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function(query, context, extra, seed){ context = context || document; if ( !seed && context.nodeType === 9 && !isXML(context) ) { try { return makeArray( context.querySelectorAll(query), extra ); } catch(e){} } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } div = null; // release memory in IE })(); if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ var div = document.createElement("div"); div.innerHTML = "
"; if ( div.getElementsByClassName("e").length === 0 ) return; div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) return; Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context, isXML) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; div = null; // release memory in IE })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ){ elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ) { elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } var contains = document.compareDocumentPosition ? function(a, b){ return a.compareDocumentPosition(b) & 16; } : function(a, b){ return a !== b && (a.contains ? a.contains(b) : true); }; var isXML = function(elem){ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML"; }; var posProcess = function(selector, context){ var tmpSet = [], later = "", match, root = context.nodeType ? [context] : context; while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); }; window.Sizzle = Sizzle; })(); Prototype._original_property = window.Sizzle; ;(function(engine) { var extendElements = Prototype.Selector.extendElements; function select(selector, scope) { return extendElements(engine(selector, scope || document)); } function match(element, selector) { return engine.matches(selector, [element]).length == 1; } Prototype.Selector.engine = engine; Prototype.Selector.select = select; Prototype.Selector.match = match; })(Sizzle); window.Sizzle = Prototype._original_property; delete Prototype._original_property; var Form = { reset: function(form) { form = $(form); form.reset(); return form; }, serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (Object.isUndefined(options.hash)) options.hash = true; var key, value, submitted = false, submit = options.submit, accumulator, initial; if (options.hash) { initial = {}; accumulator = function(result, key, value) { if (key in result) { if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; return result; }; } else { initial = ''; accumulator = function(result, key, value) { return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + encodeURIComponent(value); } } return elements.inject(initial, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { result = accumulator(result, key, value); } } return result; }); } }; Form.Methods = { serialize: function(form, options) { return Form.serializeElements(Form.getElements(form), options); }, getElements: function(form) { var elements = $(form).getElementsByTagName('*'), element, arr = [ ], serializers = Form.Element.Serializers; for (var i = 0; element = elements[i]; i++) { arr.push(element); } return arr.inject([], function(elements, child) { if (serializers[child.tagName.toLowerCase()]) elements.push(Element.extend(child)); return elements; }) }, getInputs: function(form, typeName, name) { form = $(form); var inputs = form.getElementsByTagName('input'); if (!typeName && !name) return $A(inputs).map(Element.extend); for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { var input = inputs[i]; if ((typeName && input.type != typeName) || (name && input.name != name)) continue; matchingInputs.push(Element.extend(input)); } return matchingInputs; }, disable: function(form) { form = $(form); Form.getElements(form).invoke('disable'); return form; }, enable: function(form) { form = $(form); Form.getElements(form).invoke('enable'); return form; }, findFirstElement: function(form) { var elements = $(form).getElements().findAll(function(element) { return 'hidden' != element.type && !element.disabled; }); var firstByIndex = elements.findAll(function(element) { return element.hasAttribute('tabIndex') && element.tabIndex >= 0; }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { return /^(?:input|select|textarea)$/i.test(element.tagName); }); }, focusFirstElement: function(form) { form = $(form); var element = form.findFirstElement(); if (element) element.activate(); return form; }, request: function(form, options) { form = $(form), options = Object.clone(options || { }); var params = options.parameters, action = form.readAttribute('action') || ''; if (action.blank()) action = window.location.href; options.parameters = form.serialize(true); if (params) { if (Object.isString(params)) params = params.toQueryParams(); Object.extend(options.parameters, params); } if (form.hasAttribute('method') && !options.method) options.method = form.method; return new Ajax.Request(action, options); } }; /*--------------------------------------------------------------------------*/ Form.Element = { focus: function(element) { $(element).focus(); return element; }, select: function(element) { $(element).select(); return element; } }; Form.Element.Methods = { serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); return Form.Element.Serializers[method](element); }, setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, clear: function(element) { $(element).value = ''; return element; }, present: function(element) { return $(element).value != ''; }, activate: function(element) { element = $(element); try { element.focus(); if (element.select && (element.tagName.toLowerCase() != 'input' || !(/^(?:button|reset|submit)$/i.test(element.type)))) element.select(); } catch (e) { } return element; }, disable: function(element) { element = $(element); element.disabled = true; return element; }, enable: function(element) { element = $(element); element.disabled = false; return element; } }; /*--------------------------------------------------------------------------*/ var Field = Form.Element; var $F = Form.Element.Methods.getValue; /*--------------------------------------------------------------------------*/ Form.Element.Serializers = (function() { function input(element, value) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return inputSelector(element, value); default: return valueSelector(element, value); } } function inputSelector(element, value) { if (Object.isUndefined(value)) return element.checked ? element.value : null; else element.checked = !!value; } function valueSelector(element, value) { if (Object.isUndefined(value)) return element.value; else element.value = value; } function select(element, value) { if (Object.isUndefined(value)) return (element.type === 'select-one' ? selectOne : selectMany)(element); var opt, currentValue, single = !Object.isArray(value); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; currentValue = this.optionValue(opt); if (single) { if (currentValue == value) { opt.selected = true; return; } } else opt.selected = value.include(currentValue); } } function selectOne(element) { var index = element.selectedIndex; return index >= 0 ? optionValue(element.options[index]) : null; } function selectMany(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(optionValue(opt)); } return values; } function optionValue(opt) { return Element.hasAttribute(opt, 'value') ? opt.value : opt.text; } return { input: input, inputSelector: inputSelector, textarea: valueSelector, select: select, selectOne: selectOne, selectMany: selectMany, optionValue: optionValue, button: valueSelector }; })(); /*--------------------------------------------------------------------------*/ Abstract.TimedObserver = Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); this.element = $(element); this.lastValue = this.getValue(); }, execute: function() { var value = this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue != value : String(this.lastValue) != String(value)) { this.callback(this.element, value); this.lastValue = value; } } }); Form.Element.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.serialize(this.element); } }); /*--------------------------------------------------------------------------*/ Abstract.EventObserver = Class.create({ initialize: function(element, callback) { this.element = $(element); this.callback = callback; this.lastValue = this.getValue(); if (this.element.tagName.toLowerCase() == 'form') this.registerFormCallbacks(); else this.registerCallback(this.element); }, onElementEvent: function() { var value = this.getValue(); if (this.lastValue != value) { this.callback(this.element, value); this.lastValue = value; } }, registerFormCallbacks: function() { Form.getElements(this.element).each(this.registerCallback, this); }, registerCallback: function(element) { if (element.type) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': Event.observe(element, 'click', this.onElementEvent.bind(this)); break; default: Event.observe(element, 'change', this.onElementEvent.bind(this)); break; } } } }); Form.Element.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.serialize(this.element); } }); (function() { var Event = { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, KEY_INSERT: 45, cache: {} }; var docEl = document.documentElement; var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl && 'onmouseleave' in docEl; var isIELegacyEvent = function(event) { return false; }; if (window.attachEvent) { if (window.addEventListener) { isIELegacyEvent = function(event) { return !(event instanceof window.Event); }; } else { isIELegacyEvent = function(event) { return true; }; } } var _isButton; function _isButtonForDOMEvents(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); } var legacyButtonMap = { 0: 1, 1: 4, 2: 2 }; function _isButtonForLegacyEvents(event, code) { return event.button === legacyButtonMap[code]; } function _isButtonForWebKit(event, code) { switch (code) { case 0: return event.which == 1 && !event.metaKey; case 1: return event.which == 2 || (event.which == 1 && event.metaKey); case 2: return event.which == 3; default: return false; } } if (window.attachEvent) { if (!window.addEventListener) { _isButton = _isButtonForLegacyEvents; } else { _isButton = function(event, code) { return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) : _isButtonForDOMEvents(event, code); } } } else if (Prototype.Browser.WebKit) { _isButton = _isButtonForWebKit; } else { _isButton = _isButtonForDOMEvents; } function isLeftClick(event) { return _isButton(event, 0) } function isMiddleClick(event) { return _isButton(event, 1) } function isRightClick(event) { return _isButton(event, 2) } function element(event) { event = Event.extend(event); var node = event.target, type = event.type, currentTarget = event.currentTarget; if (currentTarget && currentTarget.tagName) { if (type === 'load' || type === 'error' || (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' && currentTarget.type === 'radio')) node = currentTarget; } if (node.nodeType == Node.TEXT_NODE) node = node.parentNode; return Element.extend(node); } function findElement(event, expression) { var element = Event.element(event); if (!expression) return element; while (element) { if (Object.isElement(element) && Prototype.Selector.match(element, expression)) { return Element.extend(element); } element = element.parentNode; } } function pointer(event) { return { x: pointerX(event), y: pointerY(event) }; } function pointerX(event) { var docElement = document.documentElement, body = document.body || { scrollLeft: 0 }; return event.pageX || (event.clientX + (docElement.scrollLeft || body.scrollLeft) - (docElement.clientLeft || 0)); } function pointerY(event) { var docElement = document.documentElement, body = document.body || { scrollTop: 0 }; return event.pageY || (event.clientY + (docElement.scrollTop || body.scrollTop) - (docElement.clientTop || 0)); } function stop(event) { Event.extend(event); event.preventDefault(); event.stopPropagation(); event.stopped = true; } Event.Methods = { isLeftClick: isLeftClick, isMiddleClick: isMiddleClick, isRightClick: isRightClick, element: element, findElement: findElement, pointer: pointer, pointerX: pointerX, pointerY: pointerY, stop: stop }; var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { m[name] = Event.Methods[name].methodize(); return m; }); if (window.attachEvent) { function _relatedTarget(event) { var element; switch (event.type) { case 'mouseover': case 'mouseenter': element = event.fromElement; break; case 'mouseout': case 'mouseleave': element = event.toElement; break; default: return null; } return Element.extend(element); } var additionalMethods = { stopPropagation: function() { this.cancelBubble = true }, preventDefault: function() { this.returnValue = false }, inspect: function() { return '[object Event]' } }; Event.extend = function(event, element) { if (!event) return false; if (!isIELegacyEvent(event)) return event; if (event._extendedByPrototype) return event; event._extendedByPrototype = Prototype.emptyFunction; var pointer = Event.pointer(event); Object.extend(event, { target: event.srcElement || element, relatedTarget: _relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); Object.extend(event, methods); Object.extend(event, additionalMethods); return event; }; } else { Event.extend = Prototype.K; } if (window.addEventListener) { Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__; Object.extend(Event.prototype, methods); } function _createResponder(element, eventName, handler) { var registry = Element.retrieve(element, 'prototype_event_registry'); if (Object.isUndefined(registry)) { CACHE.push(element); registry = Element.retrieve(element, 'prototype_event_registry', $H()); } var respondersForEvent = registry.get(eventName); if (Object.isUndefined(respondersForEvent)) { respondersForEvent = []; registry.set(eventName, respondersForEvent); } if (respondersForEvent.pluck('handler').include(handler)) return false; var responder; if (eventName.include(":")) { responder = function(event) { if (Object.isUndefined(event.eventName)) return false; if (event.eventName !== eventName) return false; Event.extend(event, element); handler.call(element, event); }; } else { if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED && (eventName === "mouseenter" || eventName === "mouseleave")) { if (eventName === "mouseenter" || eventName === "mouseleave") { responder = function(event) { Event.extend(event, element); var parent = event.relatedTarget; while (parent && parent !== element) { try { parent = parent.parentNode; } catch(e) { parent = element; } } if (parent === element) return; handler.call(element, event); }; } } else { responder = function(event) { Event.extend(event, element); handler.call(element, event); }; } } responder.handler = handler; respondersForEvent.push(responder); return responder; } function _destroyCache() { for (var i = 0, length = CACHE.length; i < length; i++) { Event.stopObserving(CACHE[i]); CACHE[i] = null; } } var CACHE = []; if (Prototype.Browser.IE) window.attachEvent('onunload', _destroyCache); if (Prototype.Browser.WebKit) window.addEventListener('unload', Prototype.emptyFunction, false); var _getDOMEventName = Prototype.K, translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) { _getDOMEventName = function(eventName) { return (translations[eventName] || eventName); }; } function observe(element, eventName, handler) { element = $(element); var responder = _createResponder(element, eventName, handler); if (!responder) return element; if (eventName.include(':')) { if (element.addEventListener) element.addEventListener("dataavailable", responder, false); else { element.attachEvent("ondataavailable", responder); element.attachEvent("onlosecapture", responder); } } else { var actualEventName = _getDOMEventName(eventName); if (element.addEventListener) element.addEventListener(actualEventName, responder, false); else element.attachEvent("on" + actualEventName, responder); } return element; } function stopObserving(element, eventName, handler) { element = $(element); var registry = Element.retrieve(element, 'prototype_event_registry'); if (!registry) return element; if (!eventName) { registry.each( function(pair) { var eventName = pair.key; stopObserving(element, eventName); }); return element; } var responders = registry.get(eventName); if (!responders) return element; if (!handler) { responders.each(function(r) { stopObserving(element, eventName, r.handler); }); return element; } var i = responders.length, responder; while (i--) { if (responders[i].handler === handler) { responder = responders[i]; break; } } if (!responder) return element; if (eventName.include(':')) { if (element.removeEventListener) element.removeEventListener("dataavailable", responder, false); else { element.detachEvent("ondataavailable", responder); element.detachEvent("onlosecapture", responder); } } else { var actualEventName = _getDOMEventName(eventName); if (element.removeEventListener) element.removeEventListener(actualEventName, responder, false); else element.detachEvent('on' + actualEventName, responder); } registry.set(eventName, responders.without(responder)); return element; } function fire(element, eventName, memo, bubble) { element = $(element); if (Object.isUndefined(bubble)) bubble = true; if (element == document && document.createEvent && !element.dispatchEvent) element = document.documentElement; var event; if (document.createEvent) { event = document.createEvent('HTMLEvents'); event.initEvent('dataavailable', bubble, true); } else { event = document.createEventObject(); event.eventType = bubble ? 'ondataavailable' : 'onlosecapture'; } event.eventName = eventName; event.memo = memo || { }; if (document.createEvent) element.dispatchEvent(event); else element.fireEvent(event.eventType, event); return Event.extend(event); } Event.Handler = Class.create({ initialize: function(element, eventName, selector, callback) { this.element = $(element); this.eventName = eventName; this.selector = selector; this.callback = callback; this.handler = this.handleEvent.bind(this); }, start: function() { Event.observe(this.element, this.eventName, this.handler); return this; }, stop: function() { Event.stopObserving(this.element, this.eventName, this.handler); return this; }, handleEvent: function(event) { var element = Event.findElement(event, this.selector); if (element) this.callback.call(this.element, event, element); } }); function on(element, eventName, selector, callback) { element = $(element); if (Object.isFunction(selector) && Object.isUndefined(callback)) { callback = selector, selector = null; } return new Event.Handler(element, eventName, selector, callback).start(); } Object.extend(Event, Event.Methods); Object.extend(Event, { fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Element.addMethods({ fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Object.extend(document, { fire: fire.methodize(), observe: observe.methodize(), stopObserving: stopObserving.methodize(), on: on.methodize(), loaded: false }); if (window.Event) Object.extend(window.Event, Event); else window.Event = Event; })(); (function() { /* Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */ var timer; function fireContentLoadedEvent() { if (document.loaded) return; if (timer) window.clearTimeout(timer); document.loaded = true; document.fire('dom:loaded'); } function checkReadyState() { if (document.readyState === 'complete') { document.stopObserving('readystatechange', checkReadyState); fireContentLoadedEvent(); } } function pollDoScroll() { try { document.documentElement.doScroll('left'); } catch(e) { timer = pollDoScroll.defer(); return; } fireContentLoadedEvent(); } if (document.addEventListener) { document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); } else { document.observe('readystatechange', checkReadyState); if (window == top) timer = pollDoScroll.defer(); } Event.observe(window, 'load', fireContentLoadedEvent); })(); Element.addMethods(); /*------------------------------- DEPRECATED -------------------------------*/ Hash.toQueryString = Object.toQueryString; var Toggle = { display: Element.toggle }; Element.Methods.childOf = Element.Methods.descendantOf; var Insertion = { Before: function(element, content) { return Element.insert(element, {before:content}); }, Top: function(element, content) { return Element.insert(element, {top:content}); }, Bottom: function(element, content) { return Element.insert(element, {bottom:content}); }, After: function(element, content) { return Element.insert(element, {after:content}); } }; var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); var Position = { includeScrollOffsets: false, prepare: function() { this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; }, within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, overlap: function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }, cumulativeOffset: Element.Methods.cumulativeOffset, positionedOffset: Element.Methods.positionedOffset, absolutize: function(element) { Position.prepare(); return Element.absolutize(element); }, relativize: function(element) { Position.prepare(); return Element.relativize(element); }, realOffset: Element.Methods.cumulativeScrollOffset, offsetParent: Element.Methods.getOffsetParent, page: Element.Methods.viewportOffset, clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } }; /*--------------------------------------------------------------------------*/ if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ function iter(name) { return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; } instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? function(element, className) { className = className.toString().strip(); var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); return cond ? document._getElementsByXPath('.//*' + cond, element) : []; } : function(element, className) { className = className.toString().strip(); var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); if (!classNames && !className) return elements; var nodes = $(element).getElementsByTagName('*'); className = ' ' + className + ' '; for (var i = 0, child, cn; child = nodes[i]; i++) { if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || (classNames && classNames.all(function(name) { return !name.toString().blank() && cn.include(' ' + name + ' '); })))) elements.push(Element.extend(child)); } return elements; }; return function(className, parentElement) { return $(parentElement || document.body).getElementsByClassName(className); }; }(Element.Methods); /*--------------------------------------------------------------------------*/ Element.ClassNames = Class.create(); Element.ClassNames.prototype = { initialize: function(element) { this.element = $(element); }, _each: function(iterator) { this.element.className.split(/\s+/).select(function(name) { return name.length > 0; })._each(iterator); }, set: function(className) { this.element.className = className; }, add: function(classNameToAdd) { if (this.include(classNameToAdd)) return; this.set($A(this).concat(classNameToAdd).join(' ')); }, remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, toString: function() { return $A(this).join(' '); } }; Object.extend(Element.ClassNames.prototype, Enumerable); /*--------------------------------------------------------------------------*/ (function() { window.Selector = Class.create({ initialize: function(expression) { this.expression = expression.strip(); }, findElements: function(rootElement) { return Prototype.Selector.select(this.expression, rootElement); }, match: function(element) { return Prototype.Selector.match(element, this.expression); }, toString: function() { return this.expression; }, inspect: function() { return "#"; } }); Object.extend(Selector, { matchElements: function(elements, expression) { var match = Prototype.Selector.match, results = []; for (var i = 0, length = elements.length; i < length; i++) { var element = elements[i]; if (match(element, expression)) { results.push(Element.extend(element)); } } return results; }, findElement: function(elements, expression, index) { index = index || 0; var matchIndex = 0, element; for (var i = 0, length = elements.length; i < length; i++) { element = elements[i]; if (Prototype.Selector.match(element, expression) && index === matchIndex++) { return Element.extend(element); } } }, findChildElements: function(element, expressions) { var selector = expressions.toArray().join(', '); return Prototype.Selector.select(selector, element || document); } }); })(); scriptaculous-1.9.0/README.rdoc0000644000175000017500000000412011504742473017217 0ustar fhabermannfhabermann== script.aculo.us web 2.0 javascript The Web is changing. The 30-year-old terminal-like technology it was originally is gradually giving way to new ways of doing things. The power of AJAX allows for rich user interaction without the trouble that has bugged traditional web applications. Building upon the wonderful Prototype JavaScript library, script.aculo.us provides you with some great additional ingredients to mix in. For more information, see http://script.aculo.us/ Looking for documentation? http://madrobby.github.com/scriptaculous/ == What's new in this release? See the CHANGELOG file for information on what's new. You can follow http://twitter.com/scriptaculous if you want to be updated as we fix bugs and add new features. == Installation/Usage script.aculo.us includes the Prototype JavaScript Framework V1.6.0. You can use later versions, as they become available (see http://prototypejs.org/). Put prototype.js, and the six files scriptaculous.js, builder.js, effects.js, dragdrop.js, controls.js and slider.js in a directory of your website, e.g. /javascripts. (The sound.js and unittest.js files are optional) Now, you can include the scripts by adding the following tags to the HEAD section of your HTML pages: scriptaculous.js will automatically load the other files of the script.aculo.us distribution in, provided they are accessible via the same path. See http://madrobby.github.com/scriptaculous/ for detailed usage instructions. == The distribution Besides the script.aculo.us files in src, there's a complete test tree included which holds functional and unit tests for script.aculo.us. If you need examples on how to implement things, the best place to start is by opening test/run_functional_tests.html or test/run_unit_tests.html in your browser, and looking at the sources of the examples provided. == License script.aculo.us is licensed under the terms of the MIT License, see the included MIT-LICENSE file.