old_sql 1.12.0 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/public/javascripts/old_sql/MochiKit-1.4.2/Changes +362 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/LICENSE.txt +69 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/MANIFEST +179 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/META.json +17 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Async.html +814 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Base.html +1703 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Color.html +755 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DOM.html +1197 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DateTime.html +168 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DragAndDrop.html +187 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Format.html +300 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Iter.html +524 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Logging.html +420 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/LoggingPane.html +142 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Position.html +38 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Selector.html +240 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Signal.html +508 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Sortable.html +244 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Style.html +385 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/VersionHistory.html +384 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Visual.html +1161 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/index.html +447 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/js/toc.js +113 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Async.rst +767 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Base.rst +1445 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Color.rst +651 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DOM.rst +1143 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DateTime.rst +145 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DragAndDrop.rst +197 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Format.rst +258 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Iter.rst +454 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Logging.rst +348 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/LoggingPane.rst +128 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Position.rst +26 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Selector.rst +203 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Signal.rst +498 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Sortable.rst +186 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Style.rst +353 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/VersionHistory.rst +362 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Visual.rst +895 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/index.rst +83 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.css +69 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.js +401 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.json +10 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.xml +40 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/index.html +96 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.css +4 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.js +95 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/index.html +31 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dnd_sortable.css +23 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dropmarker.png +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/icon.png +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/index.html +54 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable2_test.html +150 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable3_test.html +42 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable4_test.html +90 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable5_test.html +29 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_test.html +38 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_tree_test.html +189 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.css +28 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.js +73 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/index.html +38 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_bigslide.html +36 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blind.html +65 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blindslide.html +31 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_combi.css +18 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_fadeappear.html +61 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_grow_shrink.html +38 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_onload.html +67 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue.html +67 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue_limit.html +30 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_scroll.html +483 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_slide.html +62 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/full.html +71 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/icon.png +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/index.html +150 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/index.html +88 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.css +54 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.js +373 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/index.html +78 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.css +5 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.js +85 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/index.html +46 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.css +78 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.js +11 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/index.html +74 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.css +73 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.js +125 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/index.html +88 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.css +17 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.js +59 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/index.html +28 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.css +3 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.js +19 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_boxes.html +45 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_full.html +119 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_ghost.html +40 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_hoverclass.html +43 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_scroll.html +91 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_snap.html +54 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/index.html +93 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/simple_dnd.css +64 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/index.html +71 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.css +66 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.js +203 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/SyntaxHighlighter.css +177 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/Tests.html +339 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushCSharp.js +30 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushDelphi.js +31 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushJScript.js +22 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPhp.js +23 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPython.js +71 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushSql.js +40 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushVb.js +29 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushXml.js +61 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shCore.js +622 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.css +1 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.html +19 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.js +70 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/bg_docheader.gif +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_bullet.gif +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_logo_doc.gif +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/documentation.css +130 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/general.css +48 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Async.js +682 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Base.js +1489 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Color.js +863 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DOM.js +1256 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DateTime.js +222 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DragAndDrop.js +793 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Format.js +304 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Iter.js +844 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Logging.js +315 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/LoggingPane.js +353 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MochiKit.js +188 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MockDOM.js +115 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Position.js +236 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Selector.js +415 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Signal.js +897 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Sortable.js +589 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Style.js +594 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Test.js +162 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Visual.js +2026 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/__package__.js +18 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/MochiKit.js +7829 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/__package__.js +6 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/customize.html +251 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/FakeJSAN.js +40 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js +381 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/TestRunner.js +159 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/test.css +28 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/cli.js +6 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/index.html +25 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/standalone.js +16 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Base.js +577 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Color.js +137 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DateTime.js +52 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DragAndDrop.js +30 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Format.js +89 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Iter.js +186 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Logging.js +88 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.html +408 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.json +1 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Base.html +34 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Color.html +84 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM-Safari.html +48 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM.html +363 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DateTime.html +39 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html +54 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Format.html +39 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Iter.html +38 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-JSAN.html +32 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Logging.html +40 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-MochiKit.html +18 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Selector.html +295 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Signal.html +43 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Style.html +223 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Visual.html +197 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Signal.js +481 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/COPYING +28 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Base.js +406 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Canvas.js +683 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/EasyPlot.js +161 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Layout.js +756 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit.js +151 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit_Packed.js +2177 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SVG.js +705 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetCanvas.js +348 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetSVG.js +247 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/dummy.svg +9 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/excanvas.js +723 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/README +1 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.html +2 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.txt +2 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.html +302 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.txt +139 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.html +172 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.txt +81 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.html +155 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.txt +50 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.html +428 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.txt +330 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.html +368 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.txt +256 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.html +436 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.txt +299 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.html +159 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.txt +64 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.html +131 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.txt +34 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.html +131 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.txt +34 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.html +334 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.txt +151 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.html +304 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.txt +144 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/barsample.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/black.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/blue.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/cyan.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/doc.css +62 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/generate.py +37 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/green.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/orange.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/piesample.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/purple.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/red.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/scripts/custom_rhino.jar +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py +58 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/axis.html +31 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.html +25 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.js +143 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/debug.html +56 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.html +58 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.js +133 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.html +57 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.js +136 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/dynamic.html +161 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/firefox.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/konqueror.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/mozilla.ico +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/msie.gif +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/opera.ico +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/safari.gif +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels-img.html +38 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels.html +43 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/prototype_compat.html +28 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-easy.html +29 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-horiz.html +53 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-neg.html +29 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-svg.html +61 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart.html +57 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sample.txt +6 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.html +29 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.js +141 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.html +26 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.js +147 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.html +24 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.js +89 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/tests.css +66 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.html +20 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.js +31 -0
- metadata +264 -2
@@ -0,0 +1,1143 @@
|
|
1
|
+
.. title:: MochiKit.DOM - painless DOM manipulation API
|
2
|
+
|
3
|
+
Name
|
4
|
+
====
|
5
|
+
|
6
|
+
MochiKit.DOM - painless DOM manipulation API
|
7
|
+
|
8
|
+
|
9
|
+
Synopsis
|
10
|
+
========
|
11
|
+
|
12
|
+
::
|
13
|
+
|
14
|
+
var rows = [
|
15
|
+
["dataA1", "dataA2", "dataA3"],
|
16
|
+
["dataB1", "dataB2", "dataB3"]
|
17
|
+
];
|
18
|
+
row_display = function (row) {
|
19
|
+
return TR(null, map(partial(TD, null), row));
|
20
|
+
}
|
21
|
+
var newTable = TABLE({'class': 'prettytable'},
|
22
|
+
THEAD(null,
|
23
|
+
row_display(["head1", "head2", "head3"])),
|
24
|
+
TFOOT(null,
|
25
|
+
row_display(["foot1", "foot2", "foot3"])),
|
26
|
+
TBODY(null,
|
27
|
+
map(row_display, rows)));
|
28
|
+
// put that in your document.createElement and smoke it!
|
29
|
+
swapDOM(oldTable, newTable);
|
30
|
+
|
31
|
+
|
32
|
+
Description
|
33
|
+
===========
|
34
|
+
|
35
|
+
As you probably know, the DOM APIs are some of the most painful
|
36
|
+
Java-inspired APIs you'll run across from a highly dynamic
|
37
|
+
language. Don't worry about that though, because they provide a
|
38
|
+
reasonable basis to build something that sucks a lot less.
|
39
|
+
|
40
|
+
MochiKit.DOM takes much of its inspiration from Nevow's [1]_ stan
|
41
|
+
[2]_. This means you choose a tag, give it some attributes, then
|
42
|
+
stuff it full of *whatever objects you want*. MochiKit.DOM isn't
|
43
|
+
stupid, it knows that a string should be a text node, and that you
|
44
|
+
want functions to be called, and that ``Array``-like objects should be
|
45
|
+
expanded, and stupid ``null`` values should be skipped.
|
46
|
+
|
47
|
+
Hell, it will let you return strings from functions, and use iterators
|
48
|
+
from :mochiref:`MochiKit.Iter`. If that's not enough, just teach it
|
49
|
+
new tricks with :mochiref:`registerDOMConverter`. If you have never
|
50
|
+
used an API like this for creating DOM elements, you've been wasting
|
51
|
+
your damn time. Get with it!
|
52
|
+
|
53
|
+
|
54
|
+
Dependencies
|
55
|
+
============
|
56
|
+
|
57
|
+
- :mochiref:`MochiKit.Base`
|
58
|
+
- :mochiref:`MochiKit.Style` (optional since MochiKit 1.4 for
|
59
|
+
backwards-compatibility)
|
60
|
+
- :mochiref:`MochiKit.Iter` (optional since MochiKit 1.4)
|
61
|
+
|
62
|
+
|
63
|
+
Overview
|
64
|
+
========
|
65
|
+
|
66
|
+
DOM Coercion Rules
|
67
|
+
------------------
|
68
|
+
|
69
|
+
In order of precedence, :mochiref:`createDOM` coerces given arguments
|
70
|
+
to DOM nodes using the following rules:
|
71
|
+
|
72
|
+
1. Functions are called with a ``this`` and first argument of the
|
73
|
+
parent node and their return value is subject to the following
|
74
|
+
rules (even this one).
|
75
|
+
2. ``undefined`` and ``null`` are ignored.
|
76
|
+
3. If :mochiref:`MochiKit.Iter` is loaded, iterables are flattened
|
77
|
+
(as if they were passed in-line as nodes) and each return value is
|
78
|
+
subject to these rules.
|
79
|
+
4. Values that look like DOM nodes (objects with a ``.nodeType > 0``)
|
80
|
+
are ``.appendChild``'ed to the created DOM fragment.
|
81
|
+
5. Strings are wrapped up with ``document.createTextNode``
|
82
|
+
6. Objects that have a ``.dom(node)`` or ``.__dom__(node)`` method
|
83
|
+
are called with the parent node and their result is coerced using
|
84
|
+
these rules. (MochiKit 1.4+).
|
85
|
+
7. Objects that are not strings are run through the ``domConverters``
|
86
|
+
:mochiref:`MochiKit.Base.AdapterRegistry` (see
|
87
|
+
:mochiref:`registerDOMConverter`). The adapted value is subject
|
88
|
+
to these same rules (e.g. if the adapter returns a string, it
|
89
|
+
will be coerced to a text node).
|
90
|
+
8. If no adapter is available, ``.toString()`` is used to create a
|
91
|
+
text node.
|
92
|
+
|
93
|
+
|
94
|
+
Creating DOM Element Trees
|
95
|
+
--------------------------
|
96
|
+
|
97
|
+
:mochiref:`createDOM` provides you with an excellent facility for
|
98
|
+
creating DOM trees that is easy on the wrists. One of the best ways to
|
99
|
+
understand how to use it is to take a look at an example::
|
100
|
+
|
101
|
+
var rows = [
|
102
|
+
["dataA1", "dataA2", "dataA3"],
|
103
|
+
["dataB1", "dataB2", "dataB3"]
|
104
|
+
];
|
105
|
+
row_display = function (row) {
|
106
|
+
return TR(null, map(partial(TD, null), row));
|
107
|
+
}
|
108
|
+
var newTable = TABLE({'class': 'prettytable'},
|
109
|
+
THEAD(null,
|
110
|
+
row_display(["head1", "head2", "head3"])),
|
111
|
+
TFOOT(null,
|
112
|
+
row_display(["foot1", "foot2", "foot3"])),
|
113
|
+
TBODY(null,
|
114
|
+
map(row_display, rows)));
|
115
|
+
|
116
|
+
|
117
|
+
This will create a table with the following visual layout (if it were
|
118
|
+
inserted into the document DOM):
|
119
|
+
|
120
|
+
+--------+--------+--------+
|
121
|
+
| head1 | head2 | head3 |
|
122
|
+
+========+========+========+
|
123
|
+
| dataA1 | dataA2 | dataA3 |
|
124
|
+
+--------+--------+--------+
|
125
|
+
| dataB1 | dataB2 | dataB3 |
|
126
|
+
+--------+--------+--------+
|
127
|
+
| foot1 | foot2 | foot3 |
|
128
|
+
+--------+--------+--------+
|
129
|
+
|
130
|
+
Corresponding to the following HTML::
|
131
|
+
|
132
|
+
<table class="prettytable">
|
133
|
+
<thead>
|
134
|
+
<tr>
|
135
|
+
<td>head1</td>
|
136
|
+
<td>head2</td>
|
137
|
+
<td>head3</td>
|
138
|
+
</tr>
|
139
|
+
</thead>
|
140
|
+
<tfoot>
|
141
|
+
<tr>
|
142
|
+
<td>foot1</td>
|
143
|
+
<td>foot2</td>
|
144
|
+
<td>foot3</td>
|
145
|
+
</tr>
|
146
|
+
</tfoot>
|
147
|
+
<tbody>
|
148
|
+
<tr>
|
149
|
+
<td>dataA1</td>
|
150
|
+
<td>dataA2</td>
|
151
|
+
<td>dataA3</td>
|
152
|
+
</tr>
|
153
|
+
<tr>
|
154
|
+
<td>dataB1</td>
|
155
|
+
<td>dataB2</td>
|
156
|
+
<td>dataB3</td>
|
157
|
+
</tr>
|
158
|
+
</tbody>
|
159
|
+
</table>
|
160
|
+
|
161
|
+
|
162
|
+
DOM Context
|
163
|
+
-----------
|
164
|
+
|
165
|
+
In order to prevent having to pass a ``window`` and/or ``document``
|
166
|
+
variable to every MochiKit.DOM function (e.g. when working with a
|
167
|
+
child window), MochiKit.DOM maintains a context variable for each of
|
168
|
+
them. They are managed with the :mochiref:`withWindow` and
|
169
|
+
:mochiref:`withDocument` functions, and can be acquired with
|
170
|
+
:mochiref:`currentWindow()` and :mochiref:`currentDocument()`
|
171
|
+
|
172
|
+
For example, if you are creating DOM nodes in a child window, you
|
173
|
+
could do something like this::
|
174
|
+
|
175
|
+
withWindow(child, function () {
|
176
|
+
var doc = currentDocument();
|
177
|
+
appendChildNodes(doc.body, H1(null, "This is in the child!"));
|
178
|
+
});
|
179
|
+
|
180
|
+
Note that :mochiref:`withWindow(win, ...)` also implies
|
181
|
+
:mochiref:`withDocument(win.document, ...)`.
|
182
|
+
|
183
|
+
|
184
|
+
DOM Gotchas
|
185
|
+
-----------
|
186
|
+
|
187
|
+
Performance Tradeoff:
|
188
|
+
DOM is much easier to get correct and more flexible than working
|
189
|
+
directly with markup as strings. Modifying ``innerHTML`` is still
|
190
|
+
the fastest way to make document changes.
|
191
|
+
|
192
|
+
Internet Explorer:
|
193
|
+
Internet Explorer's DOM implementation is quite poor in comparison
|
194
|
+
to the other popular implementations. In order to avoid memory
|
195
|
+
leaks due to circular references, you should use
|
196
|
+
:mochiref:`MochiKit.Signal.connect` for all of your event handling
|
197
|
+
needs. Additionally, when creating tables with DOM, it is required
|
198
|
+
to use a ``TBODY`` tag (see `Creating DOM Element Trees`_ for an
|
199
|
+
example of this).
|
200
|
+
|
201
|
+
|
202
|
+
API Reference
|
203
|
+
=============
|
204
|
+
|
205
|
+
Functions
|
206
|
+
---------
|
207
|
+
|
208
|
+
:mochidef:`$(id[, ...])`:
|
209
|
+
|
210
|
+
An alias for :mochiref:`getElement(id[, ...])`
|
211
|
+
|
212
|
+
*Availability*:
|
213
|
+
Available in MochiKit 1.3.1+
|
214
|
+
|
215
|
+
|
216
|
+
:mochidef:`addElementClass(element, className)`:
|
217
|
+
|
218
|
+
Ensure that the given ``element`` has ``className`` set as part of
|
219
|
+
its class attribute. This will not disturb other class names.
|
220
|
+
``element`` is looked up with :mochiref:`getElement`, so string
|
221
|
+
identifiers are also acceptable.
|
222
|
+
|
223
|
+
*Availability*:
|
224
|
+
Available in MochiKit 1.3.1+
|
225
|
+
|
226
|
+
|
227
|
+
:mochidef:`addLoadEvent(func)`:
|
228
|
+
|
229
|
+
Note that :mochiref:`addLoadEvent` can not be used in combination
|
230
|
+
with :mochiref:`MochiKit.Signal` if the ``onload`` event is
|
231
|
+
connected. Once an event is connected with
|
232
|
+
:mochiref:`MochiKit.Signal`, no other APIs may be used for that
|
233
|
+
same event.
|
234
|
+
|
235
|
+
This will stack ``window.onload`` functions on top of each other.
|
236
|
+
Each function added will be called after ``onload`` in the order
|
237
|
+
that they were added.
|
238
|
+
|
239
|
+
*Availability*:
|
240
|
+
Available in MochiKit 1.3.1+
|
241
|
+
|
242
|
+
|
243
|
+
:mochidef:`addToCallStack(target, path, func[, once])`:
|
244
|
+
|
245
|
+
Note that :mochiref:`addToCallStack` is not compatible with
|
246
|
+
:mochiref:`MochiKit.Signal`. Once an event is connected with
|
247
|
+
:mochiref:`MochiKit.Signal`, no other APIs may be used for that
|
248
|
+
same event.
|
249
|
+
|
250
|
+
Set the property ``path`` of ``target`` to a function that calls
|
251
|
+
the existing function at that property (if any), then calls
|
252
|
+
``func``.
|
253
|
+
|
254
|
+
If ``target[path]()`` returns exactly ``false``, then ``func``
|
255
|
+
will not be called.
|
256
|
+
|
257
|
+
If ``once`` is ``true``, then ``target[path]`` is set to ``null``
|
258
|
+
after the function call stack has completed.
|
259
|
+
|
260
|
+
If called several times for the same ``target[path]``, it will
|
261
|
+
create a stack of functions (instead of just a pair).
|
262
|
+
|
263
|
+
*Availability*:
|
264
|
+
Available in MochiKit 1.3.1+
|
265
|
+
|
266
|
+
|
267
|
+
:mochidef:`appendChildNodes(node[, childNode[, ...]])`:
|
268
|
+
|
269
|
+
Append children to a DOM element using the `DOM Coercion Rules`_.
|
270
|
+
|
271
|
+
``node``:
|
272
|
+
A reference to the DOM element to add children to (if a string
|
273
|
+
is given, :mochiref:`getElement(node)` will be used to locate
|
274
|
+
the node)
|
275
|
+
|
276
|
+
``childNode``...:
|
277
|
+
All additional arguments, if any, will be coerced into DOM
|
278
|
+
nodes that are appended as children using the `DOM Coercion
|
279
|
+
Rules`_.
|
280
|
+
|
281
|
+
*returns*:
|
282
|
+
The given DOM element
|
283
|
+
|
284
|
+
*Availability*:
|
285
|
+
Available in MochiKit 1.3.1+
|
286
|
+
|
287
|
+
:mochidef:`insertSiblingNodesBefore(node[, siblingNode[, ...]])`:
|
288
|
+
|
289
|
+
Insert children into the DOM structure using the `DOM Coercion
|
290
|
+
Rules`_.
|
291
|
+
|
292
|
+
``node``:
|
293
|
+
A reference to the DOM element you want to insert children
|
294
|
+
before (if a string is given, :mochiref:`getElement(node)`
|
295
|
+
will be used to locate the node)
|
296
|
+
|
297
|
+
``siblingNode``...:
|
298
|
+
All additional arguments, if any, will be coerced into DOM
|
299
|
+
nodes that are inserted as siblings using the `DOM Coercion
|
300
|
+
Rules`_.
|
301
|
+
|
302
|
+
*returns*:
|
303
|
+
The parent of the given DOM element
|
304
|
+
|
305
|
+
*Availability*:
|
306
|
+
Available in MochiKit 1.4+
|
307
|
+
|
308
|
+
|
309
|
+
:mochidef:`insertSiblingNodesAfter(node[, siblingNode[, ...]])`:
|
310
|
+
|
311
|
+
Insert children into the DOM structure using the `DOM Coercion
|
312
|
+
Rules`_.
|
313
|
+
|
314
|
+
``node``:
|
315
|
+
A reference to the DOM element you want to insert children
|
316
|
+
after (if a string is given, :mochiref:`getElement(node)`
|
317
|
+
will be used to locate the node)
|
318
|
+
|
319
|
+
``siblingNode``...:
|
320
|
+
All additional arguments, if any, will be coerced into DOM
|
321
|
+
nodes that are inserted as siblings using the `DOM Coercion
|
322
|
+
Rules`_.
|
323
|
+
|
324
|
+
*returns*:
|
325
|
+
The parent of the given DOM element
|
326
|
+
|
327
|
+
*Availability*:
|
328
|
+
Available in MochiKit 1.4+
|
329
|
+
|
330
|
+
|
331
|
+
:mochidef:`createDOM(name[, attrs[, node[, ...]]])`:
|
332
|
+
|
333
|
+
Create a DOM fragment in a really convenient manner, much like
|
334
|
+
Nevow`s [1]_ stan [2]_.
|
335
|
+
|
336
|
+
Partially applied versions of this function for common tags are
|
337
|
+
available as aliases:
|
338
|
+
|
339
|
+
- ``A``
|
340
|
+
- ``BUTTON``
|
341
|
+
- ``BR``
|
342
|
+
- ``CANVAS``
|
343
|
+
- ``DD``
|
344
|
+
- ``DIV``
|
345
|
+
- ``DL``
|
346
|
+
- ``DT``
|
347
|
+
- ``FIELDSET``
|
348
|
+
- ``FORM``
|
349
|
+
- ``H1``
|
350
|
+
- ``H2``
|
351
|
+
- ``H3``
|
352
|
+
- ``H4``
|
353
|
+
- ``H5``
|
354
|
+
- ``H6``
|
355
|
+
- ``HR``
|
356
|
+
- ``IMG``
|
357
|
+
- ``INPUT``
|
358
|
+
- ``LABEL``
|
359
|
+
- ``LEGEND``
|
360
|
+
- ``LI``
|
361
|
+
- ``OL``
|
362
|
+
- ``OPTGROUP``
|
363
|
+
- ``OPTION``
|
364
|
+
- ``P``
|
365
|
+
- ``PRE``
|
366
|
+
- ``SELECT``
|
367
|
+
- ``SPAN``
|
368
|
+
- ``STRONG``
|
369
|
+
- ``TABLE``
|
370
|
+
- ``TBODY``
|
371
|
+
- ``TD``
|
372
|
+
- ``TEXTAREA``
|
373
|
+
- ``TFOOT``
|
374
|
+
- ``TH``
|
375
|
+
- ``THEAD``
|
376
|
+
- ``TR``
|
377
|
+
- ``TT``
|
378
|
+
- ``UL``
|
379
|
+
|
380
|
+
See `Creating DOM Element Trees`_ for a comprehensive example.
|
381
|
+
|
382
|
+
``name``:
|
383
|
+
The kind of fragment to create (e.g. 'span'), such as you
|
384
|
+
would pass to ``document.createElement``.
|
385
|
+
|
386
|
+
``attrs``:
|
387
|
+
An object whose properties will be used as the attributes
|
388
|
+
(e.g. ``{'style': 'display:block'}``), or ``null`` if no
|
389
|
+
attributes need to be set.
|
390
|
+
|
391
|
+
See :mochiref:`updateNodeAttributes` for more information.
|
392
|
+
|
393
|
+
For convenience, if ``attrs`` is a string, ``null`` is used
|
394
|
+
and the string will be considered the first ``node``.
|
395
|
+
|
396
|
+
``node``...:
|
397
|
+
All additional arguments, if any, will be coerced into DOM
|
398
|
+
nodes that are appended as children using the `DOM Coercion
|
399
|
+
Rules`_.
|
400
|
+
|
401
|
+
*returns*:
|
402
|
+
A DOM element
|
403
|
+
|
404
|
+
*Availability*:
|
405
|
+
Available in MochiKit 1.3.1+
|
406
|
+
|
407
|
+
|
408
|
+
:mochidef:`createDOMFunc(tag[, attrs[, node[, ...]]])`:
|
409
|
+
|
410
|
+
Convenience function to create a partially applied createDOM
|
411
|
+
function. You'd want to use this if you add additional convenience
|
412
|
+
functions for creating tags, or if you find yourself creating a
|
413
|
+
lot of tags with a bunch of the same attributes or contents.
|
414
|
+
|
415
|
+
See :mochiref:`createDOM` for more detailed descriptions of the
|
416
|
+
arguments.
|
417
|
+
|
418
|
+
``tag``:
|
419
|
+
The name of the tag
|
420
|
+
|
421
|
+
``attrs``:
|
422
|
+
Optionally specify the attributes to apply
|
423
|
+
|
424
|
+
``node``...:
|
425
|
+
Optionally specify any children nodes it should have
|
426
|
+
|
427
|
+
*returns*:
|
428
|
+
function that takes additional arguments and calls
|
429
|
+
:mochiref:`createDOM`
|
430
|
+
|
431
|
+
*Availability*:
|
432
|
+
Available in MochiKit 1.3.1+
|
433
|
+
|
434
|
+
|
435
|
+
:mochidef:`currentDocument()`:
|
436
|
+
|
437
|
+
Return the current ``document`` `DOM Context`_. This will always
|
438
|
+
be the same as the global ``document`` unless
|
439
|
+
:mochiref:`withDocument` or :mochiref:`withWindow` is currently
|
440
|
+
executing.
|
441
|
+
|
442
|
+
*Availability*:
|
443
|
+
Available in MochiKit 1.3.1+
|
444
|
+
|
445
|
+
|
446
|
+
:mochidef:`currentWindow()`:
|
447
|
+
|
448
|
+
Return the current ``window`` `DOM Context`_. This will always be
|
449
|
+
the same as the global ``window`` unless :mochiref:`withWindow` is
|
450
|
+
currently executing.
|
451
|
+
|
452
|
+
*Availability*:
|
453
|
+
Available in MochiKit 1.3.1+
|
454
|
+
|
455
|
+
|
456
|
+
:mochidef:`emitHTML(dom[, lst])`:
|
457
|
+
|
458
|
+
Convert a DOM tree to an ``Array`` of HTML string fragments. This should
|
459
|
+
be used for debugging/testing purposes only.
|
460
|
+
|
461
|
+
The DOM property ``innerHTML`` or ``cloneNode(true)`` method should
|
462
|
+
be used for most purposes.
|
463
|
+
|
464
|
+
*Availability*:
|
465
|
+
Available in MochiKit 1.3.1+
|
466
|
+
|
467
|
+
|
468
|
+
:mochidef:`escapeHTML(s)`:
|
469
|
+
|
470
|
+
Make a string safe for HTML, converting the usual suspects (``<``,
|
471
|
+
``>``, ``"``, ``&``) to their HTML character entity equivalents.
|
472
|
+
|
473
|
+
*Availability*:
|
474
|
+
Available in MochiKit 1.3.1+
|
475
|
+
|
476
|
+
|
477
|
+
:mochidef:`focusOnLoad(element)`:
|
478
|
+
|
479
|
+
Note that :mochiref:`focusOnLoad` can not be used in combination
|
480
|
+
with :mochiref:`MochiKit.Signal` if the ``onload`` event is
|
481
|
+
connected. Once an event is connected with
|
482
|
+
:mochiref:`MochiKit.Signal`, no other APIs may be used for that
|
483
|
+
same event.
|
484
|
+
|
485
|
+
This adds an onload event to focus the given element.
|
486
|
+
|
487
|
+
*Availability*:
|
488
|
+
Available in MochiKit 1.3.1+
|
489
|
+
|
490
|
+
|
491
|
+
:mochidef:`formContents(elem=document.body)`:
|
492
|
+
|
493
|
+
Search the DOM tree, starting at ``elem``, for any elements with a
|
494
|
+
``name`` and ``value`` attribute. Return a 2-element ``Array`` of
|
495
|
+
``names`` and ``values`` suitable for use with
|
496
|
+
:mochiref:`MochiKit.Base.queryString`.
|
497
|
+
|
498
|
+
*Availability*:
|
499
|
+
Available in MochiKit 1.3.1+
|
500
|
+
|
501
|
+
|
502
|
+
:mochidef:`getElement(id[, ...])`:
|
503
|
+
|
504
|
+
A small quick little function to encapsulate the
|
505
|
+
``getElementById`` method. It includes a check to ensure we can
|
506
|
+
use that method.
|
507
|
+
|
508
|
+
If the id isn't a string, it will be returned as-is.
|
509
|
+
|
510
|
+
Also available as :mochiref:`$(...)` for convenience and
|
511
|
+
compatibility with other JavaScript frameworks.
|
512
|
+
|
513
|
+
If multiple arguments are given, an ``Array`` will be returned.
|
514
|
+
|
515
|
+
*Availability*:
|
516
|
+
Available in MochiKit 1.3.1+
|
517
|
+
|
518
|
+
|
519
|
+
:mochidef:`getElementsByTagAndClassName(tagName, className, parent=document)`:
|
520
|
+
|
521
|
+
Returns an array of elements in ``parent`` that match the tag name
|
522
|
+
and class name provided. If ``parent`` is a string, it will be
|
523
|
+
looked up with :mochiref:`getElement`.
|
524
|
+
|
525
|
+
If ``tagName`` is ``null`` or ``"*"``, all elements will be
|
526
|
+
searched for the matching class.
|
527
|
+
|
528
|
+
If ``className`` is ``null``, all elements matching the provided
|
529
|
+
tag are returned.
|
530
|
+
|
531
|
+
*Availability*:
|
532
|
+
Available in MochiKit 1.3.1+
|
533
|
+
|
534
|
+
|
535
|
+
:mochidef:`getFirstElementByTagAndClassName(tagName, className, parent=document)`:
|
536
|
+
|
537
|
+
Return the first element in ``parent`` that matches the tag name
|
538
|
+
and class name provided. If ``parent`` is a string, it will be
|
539
|
+
looked up with :mochiref:`getElement`.
|
540
|
+
|
541
|
+
If ``tagName`` is ``null`` or ``"*"``, all elements will be searched
|
542
|
+
for the matching class.
|
543
|
+
|
544
|
+
If ``className`` is ``null``, the first element matching the provided
|
545
|
+
tag will be returned.
|
546
|
+
|
547
|
+
*Availability*:
|
548
|
+
Available in MochiKit 1.4+
|
549
|
+
|
550
|
+
|
551
|
+
:mochidef:`getFirstParentByTagAndClassName(elem, tagName='*', className=null)`:
|
552
|
+
|
553
|
+
Returns the first parent of ``elem`` that matches the tag name and class
|
554
|
+
name provided. If ``elem`` is a string, it will be looked up using
|
555
|
+
:mochiref:`getElement`.
|
556
|
+
|
557
|
+
If ``tagName`` is ``null`` or ``"*"``, all elements will be searched
|
558
|
+
for the matching class.
|
559
|
+
|
560
|
+
If ``className`` is ``null``, the first element matching the provided
|
561
|
+
tag name will be returned.
|
562
|
+
|
563
|
+
If no match is found, ``null`` will be returned.
|
564
|
+
|
565
|
+
*Availability*:
|
566
|
+
Available in MochiKit 1.4+
|
567
|
+
|
568
|
+
|
569
|
+
:mochidef:`getNodeAttribute(node, attr)`:
|
570
|
+
|
571
|
+
Get the value of the given attribute for a DOM element without
|
572
|
+
ever raising an exception (will return ``null`` on exception).
|
573
|
+
|
574
|
+
``node``:
|
575
|
+
A reference to the DOM element to update (if a string is
|
576
|
+
given, :mochiref:`getElement(node)` will be used to locate the
|
577
|
+
node)
|
578
|
+
|
579
|
+
``attr``:
|
580
|
+
The name of the attribute
|
581
|
+
|
582
|
+
Note that it will do the right thing for IE, so don't do
|
583
|
+
the ``class`` -> ``className`` hack yourself.
|
584
|
+
|
585
|
+
*returns*:
|
586
|
+
The attribute's value, or ``null``
|
587
|
+
|
588
|
+
*Availability*:
|
589
|
+
Available in MochiKit 1.3.1+
|
590
|
+
|
591
|
+
|
592
|
+
:mochidef:`hasElementClass(element, className[, ...])`:
|
593
|
+
|
594
|
+
Return ``true`` if ``className`` is found on the ``element``.
|
595
|
+
``element`` is looked up with :mochiref:`getElement`, so string
|
596
|
+
identifiers are also acceptable.
|
597
|
+
|
598
|
+
*Availability*:
|
599
|
+
Available in MochiKit 1.3.1+
|
600
|
+
|
601
|
+
|
602
|
+
:mochidef:`isChildNode(node, maybeParent)`:
|
603
|
+
|
604
|
+
Determine whether ``node`` is a child node or decendant node of
|
605
|
+
``maybeParent``. Returns ``true`` if so, and ``false`` if not.
|
606
|
+
A node is considered a child node of itself for the purposes of
|
607
|
+
this function.
|
608
|
+
|
609
|
+
If either ``node`` or ``maybeParent`` are strings, the related
|
610
|
+
nodes will be looked up with :mochiref:`getElement`.
|
611
|
+
|
612
|
+
*Availability*:
|
613
|
+
Available in MochiKit 1.4+
|
614
|
+
|
615
|
+
|
616
|
+
:mochidef:`registerDOMConverter(name, check, wrap[, override])`:
|
617
|
+
|
618
|
+
Register an adapter to convert objects that match ``check(obj,
|
619
|
+
ctx)`` to a DOM element, or something that can be converted to a
|
620
|
+
DOM element (i.e. number, bool, string, function, iterable).
|
621
|
+
|
622
|
+
*Availability*:
|
623
|
+
Available in MochiKit 1.3.1+
|
624
|
+
|
625
|
+
|
626
|
+
:mochidef:`removeElement(node)`:
|
627
|
+
|
628
|
+
Remove and return ``node`` from a DOM tree.
|
629
|
+
|
630
|
+
``node``:
|
631
|
+
the DOM element (or string id of one) to be removed
|
632
|
+
|
633
|
+
*returns*
|
634
|
+
The removed element
|
635
|
+
|
636
|
+
*Availability*:
|
637
|
+
Available in MochiKit 1.3.1+
|
638
|
+
|
639
|
+
|
640
|
+
:mochidef:`removeElementClass(element, className)`:
|
641
|
+
|
642
|
+
Ensure that the given ``element`` does not have ``className`` set
|
643
|
+
as part of its class attribute. This will not disturb other class
|
644
|
+
names. ``element`` is looked up with :mochiref:`getElement`, so
|
645
|
+
string identifiers are also acceptable.
|
646
|
+
|
647
|
+
*Availability*:
|
648
|
+
Available in MochiKit 1.3.1+
|
649
|
+
|
650
|
+
|
651
|
+
:mochidef:`removeEmptyTextNodes(node)`:
|
652
|
+
|
653
|
+
Remove all text node children that contain only whitespace from
|
654
|
+
``node``. Useful in situations where such empty text nodes can
|
655
|
+
interfere with DOM traversal.
|
656
|
+
|
657
|
+
``node``:
|
658
|
+
the DOM element (or string id of one) to remove whitespace child
|
659
|
+
nodes from.
|
660
|
+
|
661
|
+
*Availability*:
|
662
|
+
Available in MochiKit 1.4+
|
663
|
+
|
664
|
+
|
665
|
+
:mochidef:`replaceChildNodes(node[, childNode[, ...]])`:
|
666
|
+
|
667
|
+
Remove all children from the given DOM element, then append any
|
668
|
+
given childNodes to it (by calling :mochiref:`appendChildNodes`).
|
669
|
+
|
670
|
+
``node``:
|
671
|
+
A reference to the DOM element to add children to (if a string
|
672
|
+
is given, :mochiref:`getElement(node)` will be used to locate
|
673
|
+
the node)
|
674
|
+
|
675
|
+
``childNode``...:
|
676
|
+
All additional arguments, if any, will be coerced into DOM
|
677
|
+
nodes that are appended as children using the `DOM Coercion
|
678
|
+
Rules`_.
|
679
|
+
|
680
|
+
*returns*:
|
681
|
+
The given DOM element
|
682
|
+
|
683
|
+
*Availability*:
|
684
|
+
Available in MochiKit 1.3.1+
|
685
|
+
|
686
|
+
|
687
|
+
:mochidef:`scrapeText(node[, asArray=false])`:
|
688
|
+
|
689
|
+
Walk a DOM tree in-order and scrape all of the text out of it as a
|
690
|
+
``string``.
|
691
|
+
|
692
|
+
If ``asArray`` is ``true``, then an ``Array`` will be returned
|
693
|
+
with each individual text node. These two are equivalent::
|
694
|
+
|
695
|
+
assert( scrapeText(node) == scrapeText(node, true).join("") );
|
696
|
+
|
697
|
+
*Availability*:
|
698
|
+
Available in MochiKit 1.3.1+
|
699
|
+
|
700
|
+
|
701
|
+
:mochidef:`setElementClass(element, className)`:
|
702
|
+
|
703
|
+
Set the entire class attribute of ``element`` to ``className``.
|
704
|
+
``element`` is looked up with :mochiref:`getElement`, so string
|
705
|
+
identifiers are also acceptable.
|
706
|
+
|
707
|
+
*Availability*:
|
708
|
+
Available in MochiKit 1.3.1+
|
709
|
+
|
710
|
+
|
711
|
+
:mochidef:`setNodeAttribute(node, attr, value)`:
|
712
|
+
|
713
|
+
Set the value of the given attribute for a DOM element without
|
714
|
+
ever raising an exception (will return null on exception). If
|
715
|
+
setting more than one attribute, you should use
|
716
|
+
:mochiref:`updateNodeAttributes`.
|
717
|
+
|
718
|
+
``node``:
|
719
|
+
A reference to the DOM element to update (if a string is
|
720
|
+
given, :mochiref:`getElement(node)` will be used to locate the
|
721
|
+
node)
|
722
|
+
|
723
|
+
``attr``:
|
724
|
+
The name of the attribute
|
725
|
+
|
726
|
+
Note that it will do the right thing for IE, so don't do the
|
727
|
+
``class`` -> ``className`` hack yourself.
|
728
|
+
|
729
|
+
Also note that the DOM element object property with the same
|
730
|
+
name will also be set if not already identical to the attribute
|
731
|
+
value. This is needed to compensate for weird attributes that
|
732
|
+
distinguish between the property and attribute values (i.e. the
|
733
|
+
"value" attribute for fields).
|
734
|
+
|
735
|
+
``value``:
|
736
|
+
The value of the attribute, may be an object to be merged
|
737
|
+
(e.g. for setting style).
|
738
|
+
|
739
|
+
*returns*:
|
740
|
+
The given DOM element or ``null`` on failure
|
741
|
+
|
742
|
+
*Availability*:
|
743
|
+
Available in MochiKit 1.3.1+
|
744
|
+
|
745
|
+
|
746
|
+
:mochidef:`swapDOM(dest, src)`:
|
747
|
+
|
748
|
+
Replace ``dest`` in a DOM tree with ``src``, returning ``src``.
|
749
|
+
|
750
|
+
``dest``:
|
751
|
+
a DOM element (or string id of one) to be replaced
|
752
|
+
|
753
|
+
``src``:
|
754
|
+
the DOM element (or string id of one) to replace it with, or
|
755
|
+
``null`` if ``dest`` is to be removed (replaced with nothing).
|
756
|
+
|
757
|
+
*returns*:
|
758
|
+
a DOM element (``src``)
|
759
|
+
|
760
|
+
*Availability*:
|
761
|
+
Available in MochiKit 1.3.1+
|
762
|
+
|
763
|
+
|
764
|
+
:mochidef:`swapElementClass(element, fromClass, toClass)`:
|
765
|
+
|
766
|
+
If ``fromClass`` is set on ``element``, replace it with
|
767
|
+
``toClass``. This will not disturb other classes on that element.
|
768
|
+
``element`` is looked up with :mochiref:`getElement`, so string
|
769
|
+
identifiers are also acceptable.
|
770
|
+
|
771
|
+
*Availability*:
|
772
|
+
Available in MochiKit 1.3.1+
|
773
|
+
|
774
|
+
|
775
|
+
:mochidef:`toggleElementClass(className[, element[, ...]])`:
|
776
|
+
|
777
|
+
Toggle the presence of a given ``className`` in the class
|
778
|
+
attribute of all given elements. All elements will be looked up
|
779
|
+
with :mochiref:`getElement`, so string identifiers are acceptable.
|
780
|
+
|
781
|
+
*Availability*:
|
782
|
+
Available in MochiKit 1.3.1+
|
783
|
+
|
784
|
+
|
785
|
+
:mochidef:`toHTML(dom)`:
|
786
|
+
|
787
|
+
Convert a DOM tree to a HTML string using :mochiref:`emitHTML`.
|
788
|
+
This should be used for debugging/testing purposes only.
|
789
|
+
|
790
|
+
The DOM property ``innerHTML`` or ``cloneNode(true)`` method should
|
791
|
+
be used for most purposes.
|
792
|
+
|
793
|
+
*Availability*:
|
794
|
+
Available in MochiKit 1.3.1+
|
795
|
+
|
796
|
+
|
797
|
+
:mochidef:`updateNodeAttributes(node, attrs)`:
|
798
|
+
|
799
|
+
Update the attributes of a DOM element from a given object.
|
800
|
+
|
801
|
+
``node``:
|
802
|
+
A reference to the DOM element to update (if a string is
|
803
|
+
given, :mochiref:`getElement(node)` will be used to locate the
|
804
|
+
node)
|
805
|
+
|
806
|
+
``attrs``:
|
807
|
+
An object whose properties will be used to set the attributes
|
808
|
+
(e.g. ``{'class': 'invisible'}``), or ``null`` if no
|
809
|
+
attributes need to be set. If an object is given for the
|
810
|
+
attribute value (e.g. ``{'style': {'display': 'block'}}``)
|
811
|
+
then :mochiref:`MochiKit.Base.updatetree` will be used to set
|
812
|
+
that attribute.
|
813
|
+
|
814
|
+
Note that it will do the right thing for IE, so don't do the
|
815
|
+
``class`` -> ``className`` hack yourself, and it deals with
|
816
|
+
setting "on..." event handlers correctly.
|
817
|
+
|
818
|
+
Also note that the DOM element object property with the same
|
819
|
+
name will also be set if not already identical to the attribute
|
820
|
+
value. This is needed to compensate for weird attributes that
|
821
|
+
distinguish between the property and attribute values (i.e. the
|
822
|
+
"value" attribute for fields).
|
823
|
+
|
824
|
+
*returns*:
|
825
|
+
The given DOM element
|
826
|
+
|
827
|
+
*Availability*:
|
828
|
+
Available in MochiKit 1.3.1+
|
829
|
+
|
830
|
+
|
831
|
+
:mochidef:`withWindow(win, func)`:
|
832
|
+
|
833
|
+
Call ``func`` with the ``window`` `DOM Context`_ set to ``win``
|
834
|
+
and the ``document`` `DOM Context`_ set to ``win.document``. When
|
835
|
+
``func()`` returns or throws an error, the `DOM Context`_ will be
|
836
|
+
restored to its previous state.
|
837
|
+
|
838
|
+
The return value of ``func()`` is returned by this function.
|
839
|
+
|
840
|
+
*Availability*:
|
841
|
+
Available in MochiKit 1.3.1+
|
842
|
+
|
843
|
+
|
844
|
+
:mochidef:`withDocument(doc, func)`:
|
845
|
+
|
846
|
+
Call ``func`` with the ``doc`` `DOM Context`_ set to ``doc``.
|
847
|
+
When ``func()`` returns or throws an error, the `DOM Context`_
|
848
|
+
will be restored to its previous state.
|
849
|
+
|
850
|
+
The return value of ``func()`` is returned by this function.
|
851
|
+
|
852
|
+
*Availability*:
|
853
|
+
Available in MochiKit 1.3.1+
|
854
|
+
|
855
|
+
|
856
|
+
Style Functions
|
857
|
+
---------------
|
858
|
+
|
859
|
+
These functions were previously available in MochiKit.DOM, but have been
|
860
|
+
moved to :mochiref:`MochiKit.Style` in recent versions. Function aliases
|
861
|
+
remain for backwards compability.
|
862
|
+
|
863
|
+
|
864
|
+
:mochidef:`computedStyle(htmlElement, cssProperty, mozillaEquivalentCSS)`:
|
865
|
+
|
866
|
+
Looks up a CSS property for the given element. The element can be
|
867
|
+
specified as either a string with the element's ID or the element
|
868
|
+
object itself.
|
869
|
+
|
870
|
+
``cssProperty``:
|
871
|
+
MochiKit 1.3.1 expects camel case, e.g. ``backgroundColor``.
|
872
|
+
MochiKit 1.4+ expects CSS selector case, e.g. ``background-color``,
|
873
|
+
but will accept camel case for backwards-compatibility.
|
874
|
+
|
875
|
+
``mozillaEquivalentCSS``:
|
876
|
+
MochiKit 1.3.1 expects selector case.
|
877
|
+
MochiKit 1.4+ ignores this argument.
|
878
|
+
|
879
|
+
*Availability*:
|
880
|
+
Available in MochiKit 1.3.1, deprecated in favor of
|
881
|
+
:mochiref:`MochiKit.Style.getStyle` in 1.4+
|
882
|
+
|
883
|
+
|
884
|
+
:mochidef:`elementDimensions(element)`:
|
885
|
+
|
886
|
+
Return the absolute pixel width and height (including padding and border,
|
887
|
+
but not margins) of ``element`` as an object with ``w`` and ``h``
|
888
|
+
properties, or ``undefined`` if ``element`` is not in the document.
|
889
|
+
``element`` may be specified as a string to be looked up with
|
890
|
+
:mochiref:`getElement`, a DOM element, or trivially as an object with
|
891
|
+
``w`` and/or ``h`` properties.
|
892
|
+
|
893
|
+
*Availability*:
|
894
|
+
Available in MochiKit 1.3.1, deprecated in favor of
|
895
|
+
:mochiref:`MochiKit.Style.getElementDimensions` in 1.4+
|
896
|
+
|
897
|
+
|
898
|
+
:mochidef:`elementPosition(element[, relativeTo={x: 0, y: 0}])`:
|
899
|
+
|
900
|
+
Return the absolute pixel position of ``element`` in the document
|
901
|
+
as an object with ``x`` and ``y`` properties, or ``undefined`` if
|
902
|
+
``element`` is not in the document. ``element`` may be specified
|
903
|
+
as a string to be looked up with :mochiref:`getElement`, a DOM
|
904
|
+
element, or trivially as an object with ``x`` and/or ``y``
|
905
|
+
properties.
|
906
|
+
|
907
|
+
If ``relativeTo`` is given, then its coordinates are subtracted from
|
908
|
+
the absolute position of ``element``, e.g.::
|
909
|
+
|
910
|
+
var elemPos = elementPosition(elem);
|
911
|
+
var anotherElemPos = elementPosition(anotherElem);
|
912
|
+
var relPos = elementPosition(elem, anotherElem);
|
913
|
+
assert( relPos.x == (elemPos.x - anotherElemPos.x) );
|
914
|
+
assert( relPos.y == (elemPos.y - anotherElemPos.y) );
|
915
|
+
|
916
|
+
``relativeTo`` may be specified as a string to be looked up with
|
917
|
+
:mochiref:`getElement`, a DOM element, or trivially as an object
|
918
|
+
with ``x`` and/or ``y`` properties.
|
919
|
+
|
920
|
+
*Availability*:
|
921
|
+
Available in MochiKit 1.3.1, deprecated in favor of
|
922
|
+
:mochiref:`MochiKit.Style.getElementPosition` in 1.4+
|
923
|
+
|
924
|
+
|
925
|
+
:mochidef:`getViewportDimensions()`:
|
926
|
+
|
927
|
+
Return the pixel width and height of the viewport as an object
|
928
|
+
with ``w`` and ``h`` properties. ``element`` is looked up with
|
929
|
+
:mochiref:`getElement`, so string identifiers are also acceptable.
|
930
|
+
|
931
|
+
*Availability*:
|
932
|
+
Available in MochiKit 1.3.1, moved to
|
933
|
+
:mochiref:`MochiKit.Style.getViewportDimensions` in 1.4+
|
934
|
+
|
935
|
+
|
936
|
+
:mochidef:`hideElement(element, ...)`:
|
937
|
+
|
938
|
+
Partial form of :mochiref:`setDisplayForElement`, specifically::
|
939
|
+
|
940
|
+
partial(setDisplayForElement, "none")
|
941
|
+
|
942
|
+
For information about the caveats of using a ``style.display``
|
943
|
+
based show/hide mechanism, and a CSS based alternative, see
|
944
|
+
`Element Visibility`_.
|
945
|
+
|
946
|
+
.. _`Element Visibility`: Style.html#element-visibility
|
947
|
+
|
948
|
+
*Availability*:
|
949
|
+
Available in MochiKit 1.3.1, moved to
|
950
|
+
:mochiref:`MochiKit.Style.hideElement` in 1.4+
|
951
|
+
|
952
|
+
|
953
|
+
:mochidef:`makeClipping(element)`:
|
954
|
+
|
955
|
+
Ensure that ``element.style.overflow = 'hidden'``. If ``element`` is a
|
956
|
+
string, then it will be looked up with :mochiref:`getElement`.
|
957
|
+
|
958
|
+
Returns the original values of ``overflow``, ``overflow-y`` and
|
959
|
+
``overflow-y`` so that they may be restored with
|
960
|
+
:mochiref:`undoClipping(element, overflow)`.
|
961
|
+
|
962
|
+
*Availability*:
|
963
|
+
Available in MochiKit 1.4+, moved to
|
964
|
+
:mochiref:`MochiKit.Style.makeClipping` in 1.4.1+
|
965
|
+
|
966
|
+
|
967
|
+
:mochidef:`makePositioned(element)`:
|
968
|
+
|
969
|
+
Ensure that ``element.style.position`` is set to ``"relative"`` if it
|
970
|
+
is not set or is ``"static"``. If ``element`` is a
|
971
|
+
string, then it will be looked up with :mochiref:`getElement`.
|
972
|
+
|
973
|
+
*Availability*:
|
974
|
+
Available in MochiKit 1.4+, moved to
|
975
|
+
:mochiref:`MochiKit.Style.makePositioned` in 1.4.1+
|
976
|
+
|
977
|
+
|
978
|
+
:mochidef:`setElementDimensions(element, dimensions[, units='px'])`:
|
979
|
+
|
980
|
+
Sets the dimensions of ``element`` in the document from an object
|
981
|
+
with ``w`` and ``h`` properties.
|
982
|
+
|
983
|
+
``node``:
|
984
|
+
A reference to the DOM element to update (if a string is
|
985
|
+
given, :mochiref:`getElement(node)` will be used to locate the
|
986
|
+
node)
|
987
|
+
|
988
|
+
``dimensions``:
|
989
|
+
An object with ``w`` and ``h`` properties
|
990
|
+
|
991
|
+
``units``:
|
992
|
+
Optionally set the units to use, default is ``px``
|
993
|
+
|
994
|
+
*Availability*:
|
995
|
+
Available in MochiKit 1.3.1, moved to
|
996
|
+
:mochiref:`MochiKit.Style.setElementDimensions` in 1.4+
|
997
|
+
|
998
|
+
|
999
|
+
:mochidef:`setElementPosition(element, position[, units='px'])`:
|
1000
|
+
|
1001
|
+
Sets the absolute position of ``element`` in the document from an
|
1002
|
+
object with ``x`` and ``y`` properties.
|
1003
|
+
|
1004
|
+
``node``:
|
1005
|
+
A reference to the DOM element to update (if a string is
|
1006
|
+
given, :mochiref:`getElement(node)` will be used to locate the
|
1007
|
+
node)
|
1008
|
+
|
1009
|
+
``position``:
|
1010
|
+
An object with ``x`` and ``y`` properties
|
1011
|
+
|
1012
|
+
``units``:
|
1013
|
+
Optionally set the units to use, default is ``px``
|
1014
|
+
|
1015
|
+
*Availability*:
|
1016
|
+
Available in MochiKit 1.3.1, moved to
|
1017
|
+
:mochiref:`MochiKit.Style.setElementPosition` in 1.4+
|
1018
|
+
|
1019
|
+
|
1020
|
+
:mochidef:`setDisplayForElement(display, element[, ...])`:
|
1021
|
+
|
1022
|
+
Change the ``style.display`` for the given element(s). Usually
|
1023
|
+
used as the partial forms:
|
1024
|
+
|
1025
|
+
- :mochiref:`showElement(element, ...)`
|
1026
|
+
- :mochiref:`hideElement(element, ...)`
|
1027
|
+
|
1028
|
+
Elements are looked up with :mochiref:`getElement`, so string
|
1029
|
+
identifiers are acceptable.
|
1030
|
+
|
1031
|
+
For information about the caveats of using a ``style.display``
|
1032
|
+
based show/hide mechanism, and a CSS based alternative, see
|
1033
|
+
`Element Visibility`_.
|
1034
|
+
|
1035
|
+
*Availability*:
|
1036
|
+
Available in MochiKit 1.3.1, moved to
|
1037
|
+
:mochiref:`MochiKit.Style.setDisplayForElement` in 1.4+
|
1038
|
+
|
1039
|
+
|
1040
|
+
:mochidef:`setOpacity(element, opacity)`:
|
1041
|
+
|
1042
|
+
Sets ``opacity`` for ``element``. Valid ``opacity`` values range
|
1043
|
+
from 0 (invisible) to 1 (opaque). ``element`` is looked up with
|
1044
|
+
:mochiref:`getElement`, so string identifiers are also acceptable.
|
1045
|
+
|
1046
|
+
*Availability*:
|
1047
|
+
Available in MochiKit 1.3.1, moved to
|
1048
|
+
:mochiref:`MochiKit.Style.setOpacity` in 1.4+
|
1049
|
+
|
1050
|
+
|
1051
|
+
:mochidef:`showElement(element, ...)`:
|
1052
|
+
|
1053
|
+
Partial form of :mochiref:`setDisplayForElement`, specifically::
|
1054
|
+
|
1055
|
+
partial(setDisplayForElement, "block")
|
1056
|
+
|
1057
|
+
For information about the caveats of using a ``style.display``
|
1058
|
+
based show/hide mechanism, and a CSS based alternative, see
|
1059
|
+
`Element Visibility`_.
|
1060
|
+
|
1061
|
+
*Availability*:
|
1062
|
+
Available in MochiKit 1.3.1, moved to
|
1063
|
+
:mochiref:`MochiKit.Style.showElement` in 1.4+
|
1064
|
+
|
1065
|
+
|
1066
|
+
:mochidef:`undoClipping(element, overflow)`:
|
1067
|
+
|
1068
|
+
Restore the setting of ``element.style.overflow`` set by
|
1069
|
+
:mochiref:`makeClipping(element)`. If ``element`` is a string, then
|
1070
|
+
it will be looked up with :mochiref:`getElement`.
|
1071
|
+
|
1072
|
+
*Availability*:
|
1073
|
+
Available in MochiKit 1.4+, moved to
|
1074
|
+
:mochiref:`MochiKit.Style.undoClipping` in 1.4.1+
|
1075
|
+
|
1076
|
+
|
1077
|
+
:mochidef:`undoPositioned(element)`:
|
1078
|
+
|
1079
|
+
Restore the setting of ``element.style.position`` set by
|
1080
|
+
:mochiref:`makePositioned(element)`. If ``element`` is a string, then
|
1081
|
+
it will be looked up with :mochiref:`getElement`.
|
1082
|
+
|
1083
|
+
*Availability*:
|
1084
|
+
Available in MochiKit 1.4+, moved to
|
1085
|
+
:mochiref:`MochiKit.Style.undoPositioned` in 1.4.1+
|
1086
|
+
|
1087
|
+
|
1088
|
+
Style Objects
|
1089
|
+
-------------
|
1090
|
+
|
1091
|
+
These objects are available in MochiKit 1.3.1, but have been moved to
|
1092
|
+
:mochiref:`MochiKit.Style` in 1.4+.
|
1093
|
+
|
1094
|
+
:mochidef:`Coordinates(x, y)`:
|
1095
|
+
|
1096
|
+
Constructs an object with ``x`` and ``y`` properties. ``obj.toString()``
|
1097
|
+
returns something like ``{x: 0, y: 42}`` for debugging.
|
1098
|
+
|
1099
|
+
*Availability*:
|
1100
|
+
Available in MochiKit 1.3.1, moved to
|
1101
|
+
:mochiref:`MochiKit.Style.Coordinates` in 1.4+
|
1102
|
+
|
1103
|
+
:mochidef:`Dimensions(w, h)`:
|
1104
|
+
|
1105
|
+
Constructs an object with ``w`` and ``h`` properties. ``obj.toString()``
|
1106
|
+
returns something like ``{w: 0, h: 42}`` for debugging.
|
1107
|
+
|
1108
|
+
*Availability*:
|
1109
|
+
Available in MochiKit 1.3.1, moved to
|
1110
|
+
:mochiref:`MochiKit.Style.Dimensions` in 1.4+
|
1111
|
+
|
1112
|
+
|
1113
|
+
|
1114
|
+
See Also
|
1115
|
+
========
|
1116
|
+
|
1117
|
+
.. [1] Nevow, a web application construction kit for Python:
|
1118
|
+
http://divmod.org/trac/wiki/DivmodNevow
|
1119
|
+
.. [2] nevow.stan is a domain specific language for Python (read as
|
1120
|
+
"crazy getitem/call overloading abuse") that Donovan and I
|
1121
|
+
schemed up at PyCon 2003 at this super ninja Python/C++
|
1122
|
+
programmer's (David Abrahams) hotel room. Donovan later
|
1123
|
+
inflicted this upon the masses in Nevow. Check out the Nevow
|
1124
|
+
Guide for some examples:
|
1125
|
+
http://divmod.org/trac/wiki/DivmodNevow
|
1126
|
+
|
1127
|
+
|
1128
|
+
Authors
|
1129
|
+
=======
|
1130
|
+
|
1131
|
+
- Bob Ippolito <bob@redivi.com>
|
1132
|
+
|
1133
|
+
|
1134
|
+
Copyright
|
1135
|
+
=========
|
1136
|
+
|
1137
|
+
Copyright 2005 Bob Ippolito <bob@redivi.com>. This program is
|
1138
|
+
dual-licensed free software; you can redistribute it and/or modify it
|
1139
|
+
under the terms of the `MIT License`_ or the `Academic Free License
|
1140
|
+
v2.1`_.
|
1141
|
+
|
1142
|
+
.. _`MIT License`: http://www.opensource.org/licenses/mit-license.php
|
1143
|
+
.. _`Academic Free License v2.1`: http://www.opensource.org/licenses/afl-2.1.php
|