old_sql 1.16.0 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +24 -13
- data/app/controllers/old_sql/report_controller.rb +3 -17
- data/app/views/layouts/old_sql/chart.html.erb +11 -0
- data/app/views/old_sql/report/chart.html.erb +8 -25
- data/lib/generators/old_sql/templates/user_design_template.csv +2 -3
- data/lib/generators/old_sql/templates/user_old_sql_demo_chart_design.yml +18 -9
- data/lib/old_sql/report_design/chart.rb +2 -2
- data/lib/old_sql/report_design/chart_item.rb +4 -4
- data/lib/old_sql/report_design/chart_parser.rb +2 -2
- data/public/javascripts/old_sql/chart.js +33 -0
- metadata +5 -265
- data/public/javascripts/old_sql/MochiKit-1.4.2/Changes +0 -362
- data/public/javascripts/old_sql/MochiKit-1.4.2/LICENSE.txt +0 -69
- data/public/javascripts/old_sql/MochiKit-1.4.2/MANIFEST +0 -179
- data/public/javascripts/old_sql/MochiKit-1.4.2/META.json +0 -17
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Async.html +0 -814
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Base.html +0 -1703
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Color.html +0 -755
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DOM.html +0 -1197
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DateTime.html +0 -168
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DragAndDrop.html +0 -187
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Format.html +0 -300
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Iter.html +0 -524
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Logging.html +0 -420
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/LoggingPane.html +0 -142
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Position.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Selector.html +0 -240
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Signal.html +0 -508
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Sortable.html +0 -244
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Style.html +0 -385
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/VersionHistory.html +0 -384
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Visual.html +0 -1161
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/index.html +0 -447
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/js/toc.js +0 -113
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Async.rst +0 -767
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Base.rst +0 -1445
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Color.rst +0 -651
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DOM.rst +0 -1143
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DateTime.rst +0 -145
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DragAndDrop.rst +0 -197
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Format.rst +0 -258
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Iter.rst +0 -454
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Logging.rst +0 -348
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/LoggingPane.rst +0 -128
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Position.rst +0 -26
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Selector.rst +0 -203
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Signal.rst +0 -498
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Sortable.rst +0 -186
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Style.rst +0 -353
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/VersionHistory.rst +0 -362
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Visual.rst +0 -895
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/index.rst +0 -83
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.css +0 -69
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.js +0 -401
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.json +0 -10
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.xml +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/index.html +0 -96
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.css +0 -4
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.js +0 -95
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/index.html +0 -31
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dnd_sortable.css +0 -23
- 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 +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable2_test.html +0 -150
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable3_test.html +0 -42
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable4_test.html +0 -90
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable5_test.html +0 -29
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_test.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_tree_test.html +0 -189
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.css +0 -28
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.js +0 -73
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/index.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_bigslide.html +0 -36
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blind.html +0 -65
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blindslide.html +0 -31
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_combi.css +0 -18
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_fadeappear.html +0 -61
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_grow_shrink.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_onload.html +0 -67
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue.html +0 -67
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue_limit.html +0 -30
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_scroll.html +0 -483
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_slide.html +0 -62
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/full.html +0 -71
- 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 +0 -150
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/index.html +0 -88
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.css +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.js +0 -373
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/index.html +0 -78
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.css +0 -5
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.js +0 -85
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/index.html +0 -46
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.css +0 -78
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.js +0 -11
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/index.html +0 -74
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.css +0 -73
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.js +0 -125
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/index.html +0 -88
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.css +0 -17
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.js +0 -59
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/index.html +0 -28
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.css +0 -3
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.js +0 -19
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_boxes.html +0 -45
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_full.html +0 -119
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_ghost.html +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_hoverclass.html +0 -43
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_scroll.html +0 -91
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_snap.html +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/index.html +0 -93
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/simple_dnd.css +0 -64
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/index.html +0 -71
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.css +0 -66
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.js +0 -203
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/SyntaxHighlighter.css +0 -177
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/Tests.html +0 -339
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushCSharp.js +0 -30
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushDelphi.js +0 -31
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushJScript.js +0 -22
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPhp.js +0 -23
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPython.js +0 -71
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushSql.js +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushVb.js +0 -29
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushXml.js +0 -61
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shCore.js +0 -622
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.css +0 -1
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.html +0 -19
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.js +0 -70
- 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 +0 -130
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/general.css +0 -48
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Async.js +0 -682
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Base.js +0 -1489
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Color.js +0 -863
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DOM.js +0 -1256
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DateTime.js +0 -222
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DragAndDrop.js +0 -793
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Format.js +0 -304
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Iter.js +0 -844
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Logging.js +0 -315
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/LoggingPane.js +0 -353
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MochiKit.js +0 -188
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MockDOM.js +0 -115
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Position.js +0 -236
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Selector.js +0 -415
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Signal.js +0 -897
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Sortable.js +0 -589
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Style.js +0 -594
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Test.js +0 -162
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Visual.js +0 -2026
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/__package__.js +0 -18
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/MochiKit.js +0 -7829
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/__package__.js +0 -6
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/customize.html +0 -251
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/FakeJSAN.js +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js +0 -381
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/TestRunner.js +0 -159
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/test.css +0 -28
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/cli.js +0 -6
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/index.html +0 -25
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/standalone.js +0 -16
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Base.js +0 -577
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Color.js +0 -137
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DateTime.js +0 -52
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DragAndDrop.js +0 -30
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Format.js +0 -89
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Iter.js +0 -186
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Logging.js +0 -88
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.html +0 -408
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.json +0 -1
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Base.html +0 -34
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Color.html +0 -84
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM-Safari.html +0 -48
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM.html +0 -363
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DateTime.html +0 -39
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Format.html +0 -39
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Iter.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-JSAN.html +0 -32
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Logging.html +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-MochiKit.html +0 -18
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Selector.html +0 -295
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Signal.html +0 -43
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Style.html +0 -223
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Visual.html +0 -197
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Signal.js +0 -481
- data/public/javascripts/old_sql/plotkit-0.9.1/COPYING +0 -28
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Base.js +0 -406
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Canvas.js +0 -683
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/EasyPlot.js +0 -161
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Layout.js +0 -756
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit.js +0 -151
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit_Packed.js +0 -2177
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SVG.js +0 -705
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetCanvas.js +0 -348
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetSVG.js +0 -247
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/dummy.svg +0 -9
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/excanvas.js +0 -723
- data/public/javascripts/old_sql/plotkit-0.9.1/README +0 -1
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.html +0 -2
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.txt +0 -2
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.html +0 -302
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.txt +0 -139
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.html +0 -172
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.txt +0 -81
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.html +0 -155
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.txt +0 -50
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.html +0 -428
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.txt +0 -330
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.html +0 -368
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.txt +0 -256
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.html +0 -436
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.txt +0 -299
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.html +0 -159
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.txt +0 -64
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.html +0 -131
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.txt +0 -34
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.html +0 -131
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.txt +0 -34
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.html +0 -334
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.txt +0 -151
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.html +0 -304
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.txt +0 -144
- 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 +0 -62
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/generate.py +0 -37
- 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 +0 -58
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/axis.html +0 -31
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.html +0 -25
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.js +0 -143
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/debug.html +0 -56
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.html +0 -58
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.js +0 -133
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.html +0 -57
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.js +0 -136
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/dynamic.html +0 -161
- 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 +0 -38
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels.html +0 -43
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/prototype_compat.html +0 -28
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-easy.html +0 -29
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-horiz.html +0 -53
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-neg.html +0 -29
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-svg.html +0 -61
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart.html +0 -57
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sample.txt +0 -6
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.html +0 -29
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.js +0 -141
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.html +0 -26
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.js +0 -147
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.html +0 -24
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.js +0 -89
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/tests.css +0 -66
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.html +0 -20
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.js +0 -31
@@ -1,415 +0,0 @@
|
|
1
|
-
/***
|
2
|
-
|
3
|
-
MochiKit.Selector 1.4.2
|
4
|
-
|
5
|
-
See <http://mochikit.com/> for documentation, downloads, license, etc.
|
6
|
-
|
7
|
-
(c) 2005 Bob Ippolito and others. All rights Reserved.
|
8
|
-
|
9
|
-
***/
|
10
|
-
|
11
|
-
MochiKit.Base._deps('Selector', ['Base', 'DOM', 'Iter']);
|
12
|
-
|
13
|
-
MochiKit.Selector.NAME = "MochiKit.Selector";
|
14
|
-
MochiKit.Selector.VERSION = "1.4.2";
|
15
|
-
|
16
|
-
MochiKit.Selector.__repr__ = function () {
|
17
|
-
return "[" + this.NAME + " " + this.VERSION + "]";
|
18
|
-
};
|
19
|
-
|
20
|
-
MochiKit.Selector.toString = function () {
|
21
|
-
return this.__repr__();
|
22
|
-
};
|
23
|
-
|
24
|
-
MochiKit.Selector.EXPORT = [
|
25
|
-
"Selector",
|
26
|
-
"findChildElements",
|
27
|
-
"findDocElements",
|
28
|
-
"$$"
|
29
|
-
];
|
30
|
-
|
31
|
-
MochiKit.Selector.EXPORT_OK = [
|
32
|
-
];
|
33
|
-
|
34
|
-
MochiKit.Selector.Selector = function (expression) {
|
35
|
-
this.params = {classNames: [], pseudoClassNames: []};
|
36
|
-
this.expression = expression.toString().replace(/(^\s+|\s+$)/g, '');
|
37
|
-
this.parseExpression();
|
38
|
-
this.compileMatcher();
|
39
|
-
};
|
40
|
-
|
41
|
-
MochiKit.Selector.Selector.prototype = {
|
42
|
-
/***
|
43
|
-
|
44
|
-
Selector class: convenient object to make CSS selections.
|
45
|
-
|
46
|
-
***/
|
47
|
-
__class__: MochiKit.Selector.Selector,
|
48
|
-
|
49
|
-
/** @id MochiKit.Selector.Selector.prototype.parseExpression */
|
50
|
-
parseExpression: function () {
|
51
|
-
function abort(message) {
|
52
|
-
throw 'Parse error in selector: ' + message;
|
53
|
-
}
|
54
|
-
|
55
|
-
if (this.expression == '') {
|
56
|
-
abort('empty expression');
|
57
|
-
}
|
58
|
-
|
59
|
-
var repr = MochiKit.Base.repr;
|
60
|
-
var params = this.params;
|
61
|
-
var expr = this.expression;
|
62
|
-
var match, modifier, clause, rest;
|
63
|
-
while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!^$*]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) {
|
64
|
-
params.attributes = params.attributes || [];
|
65
|
-
params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''});
|
66
|
-
expr = match[1];
|
67
|
-
}
|
68
|
-
|
69
|
-
if (expr == '*') {
|
70
|
-
return this.params.wildcard = true;
|
71
|
-
}
|
72
|
-
|
73
|
-
while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+(?:\([^)]*\))?)(.*)/i)) {
|
74
|
-
modifier = match[1];
|
75
|
-
clause = match[2];
|
76
|
-
rest = match[3];
|
77
|
-
switch (modifier) {
|
78
|
-
case '#':
|
79
|
-
params.id = clause;
|
80
|
-
break;
|
81
|
-
case '.':
|
82
|
-
params.classNames.push(clause);
|
83
|
-
break;
|
84
|
-
case ':':
|
85
|
-
params.pseudoClassNames.push(clause);
|
86
|
-
break;
|
87
|
-
case '':
|
88
|
-
case undefined:
|
89
|
-
params.tagName = clause.toUpperCase();
|
90
|
-
break;
|
91
|
-
default:
|
92
|
-
abort(repr(expr));
|
93
|
-
}
|
94
|
-
expr = rest;
|
95
|
-
}
|
96
|
-
|
97
|
-
if (expr.length > 0) {
|
98
|
-
abort(repr(expr));
|
99
|
-
}
|
100
|
-
},
|
101
|
-
|
102
|
-
/** @id MochiKit.Selector.Selector.prototype.buildMatchExpression */
|
103
|
-
buildMatchExpression: function () {
|
104
|
-
var repr = MochiKit.Base.repr;
|
105
|
-
var params = this.params;
|
106
|
-
var conditions = [];
|
107
|
-
var clause, i;
|
108
|
-
|
109
|
-
function childElements(element) {
|
110
|
-
return "MochiKit.Base.filter(function (node) { return node.nodeType == 1; }, " + element + ".childNodes)";
|
111
|
-
}
|
112
|
-
|
113
|
-
if (params.wildcard) {
|
114
|
-
conditions.push('true');
|
115
|
-
}
|
116
|
-
if (clause = params.id) {
|
117
|
-
conditions.push('element.id == ' + repr(clause));
|
118
|
-
}
|
119
|
-
if (clause = params.tagName) {
|
120
|
-
conditions.push('element.tagName.toUpperCase() == ' + repr(clause));
|
121
|
-
}
|
122
|
-
if ((clause = params.classNames).length > 0) {
|
123
|
-
for (i = 0; i < clause.length; i++) {
|
124
|
-
conditions.push('MochiKit.DOM.hasElementClass(element, ' + repr(clause[i]) + ')');
|
125
|
-
}
|
126
|
-
}
|
127
|
-
if ((clause = params.pseudoClassNames).length > 0) {
|
128
|
-
for (i = 0; i < clause.length; i++) {
|
129
|
-
var match = clause[i].match(/^([^(]+)(?:\((.*)\))?$/);
|
130
|
-
var pseudoClass = match[1];
|
131
|
-
var pseudoClassArgument = match[2];
|
132
|
-
switch (pseudoClass) {
|
133
|
-
case 'root':
|
134
|
-
conditions.push('element.nodeType == 9 || element === element.ownerDocument.documentElement'); break;
|
135
|
-
case 'nth-child':
|
136
|
-
case 'nth-last-child':
|
137
|
-
case 'nth-of-type':
|
138
|
-
case 'nth-last-of-type':
|
139
|
-
match = pseudoClassArgument.match(/^((?:(\d+)n\+)?(\d+)|odd|even)$/);
|
140
|
-
if (!match) {
|
141
|
-
throw "Invalid argument to pseudo element nth-child: " + pseudoClassArgument;
|
142
|
-
}
|
143
|
-
var a, b;
|
144
|
-
if (match[0] == 'odd') {
|
145
|
-
a = 2;
|
146
|
-
b = 1;
|
147
|
-
} else if (match[0] == 'even') {
|
148
|
-
a = 2;
|
149
|
-
b = 0;
|
150
|
-
} else {
|
151
|
-
a = match[2] && parseInt(match) || null;
|
152
|
-
b = parseInt(match[3]);
|
153
|
-
}
|
154
|
-
conditions.push('this.nthChild(element,' + a + ',' + b
|
155
|
-
+ ',' + !!pseudoClass.match('^nth-last') // Reverse
|
156
|
-
+ ',' + !!pseudoClass.match('of-type$') // Restrict to same tagName
|
157
|
-
+ ')');
|
158
|
-
break;
|
159
|
-
case 'first-child':
|
160
|
-
conditions.push('this.nthChild(element, null, 1)');
|
161
|
-
break;
|
162
|
-
case 'last-child':
|
163
|
-
conditions.push('this.nthChild(element, null, 1, true)');
|
164
|
-
break;
|
165
|
-
case 'first-of-type':
|
166
|
-
conditions.push('this.nthChild(element, null, 1, false, true)');
|
167
|
-
break;
|
168
|
-
case 'last-of-type':
|
169
|
-
conditions.push('this.nthChild(element, null, 1, true, true)');
|
170
|
-
break;
|
171
|
-
case 'only-child':
|
172
|
-
conditions.push(childElements('element.parentNode') + '.length == 1');
|
173
|
-
break;
|
174
|
-
case 'only-of-type':
|
175
|
-
conditions.push('MochiKit.Base.filter(function (node) { return node.tagName == element.tagName; }, ' + childElements('element.parentNode') + ').length == 1');
|
176
|
-
break;
|
177
|
-
case 'empty':
|
178
|
-
conditions.push('element.childNodes.length == 0');
|
179
|
-
break;
|
180
|
-
case 'enabled':
|
181
|
-
conditions.push('(this.isUIElement(element) && element.disabled === false)');
|
182
|
-
break;
|
183
|
-
case 'disabled':
|
184
|
-
conditions.push('(this.isUIElement(element) && element.disabled === true)');
|
185
|
-
break;
|
186
|
-
case 'checked':
|
187
|
-
conditions.push('(this.isUIElement(element) && element.checked === true)');
|
188
|
-
break;
|
189
|
-
case 'not':
|
190
|
-
var subselector = new MochiKit.Selector.Selector(pseudoClassArgument);
|
191
|
-
conditions.push('!( ' + subselector.buildMatchExpression() + ')')
|
192
|
-
break;
|
193
|
-
}
|
194
|
-
}
|
195
|
-
}
|
196
|
-
if (clause = params.attributes) {
|
197
|
-
MochiKit.Base.map(function (attribute) {
|
198
|
-
var value = 'MochiKit.DOM.getNodeAttribute(element, ' + repr(attribute.name) + ')';
|
199
|
-
var splitValueBy = function (delimiter) {
|
200
|
-
return value + '.split(' + repr(delimiter) + ')';
|
201
|
-
}
|
202
|
-
conditions.push(value + ' != null');
|
203
|
-
switch (attribute.operator) {
|
204
|
-
case '=':
|
205
|
-
conditions.push(value + ' == ' + repr(attribute.value));
|
206
|
-
break;
|
207
|
-
case '~=':
|
208
|
-
conditions.push('MochiKit.Base.findValue(' + splitValueBy(' ') + ', ' + repr(attribute.value) + ') > -1');
|
209
|
-
break;
|
210
|
-
case '^=':
|
211
|
-
conditions.push(value + '.substring(0, ' + attribute.value.length + ') == ' + repr(attribute.value));
|
212
|
-
break;
|
213
|
-
case '$=':
|
214
|
-
conditions.push(value + '.substring(' + value + '.length - ' + attribute.value.length + ') == ' + repr(attribute.value));
|
215
|
-
break;
|
216
|
-
case '*=':
|
217
|
-
conditions.push(value + '.match(' + repr(attribute.value) + ')');
|
218
|
-
break;
|
219
|
-
case '|=':
|
220
|
-
conditions.push(splitValueBy('-') + '[0].toUpperCase() == ' + repr(attribute.value.toUpperCase()));
|
221
|
-
break;
|
222
|
-
case '!=':
|
223
|
-
conditions.push(value + ' != ' + repr(attribute.value));
|
224
|
-
break;
|
225
|
-
case '':
|
226
|
-
case undefined:
|
227
|
-
// Condition already added above
|
228
|
-
break;
|
229
|
-
default:
|
230
|
-
throw 'Unknown operator ' + attribute.operator + ' in selector';
|
231
|
-
}
|
232
|
-
}, clause);
|
233
|
-
}
|
234
|
-
|
235
|
-
return conditions.join(' && ');
|
236
|
-
},
|
237
|
-
|
238
|
-
/** @id MochiKit.Selector.Selector.prototype.compileMatcher */
|
239
|
-
compileMatcher: function () {
|
240
|
-
var code = 'return (!element.tagName) ? false : ' +
|
241
|
-
this.buildMatchExpression() + ';';
|
242
|
-
this.match = new Function('element', code);
|
243
|
-
},
|
244
|
-
|
245
|
-
/** @id MochiKit.Selector.Selector.prototype.nthChild */
|
246
|
-
nthChild: function (element, a, b, reverse, sametag){
|
247
|
-
var siblings = MochiKit.Base.filter(function (node) {
|
248
|
-
return node.nodeType == 1;
|
249
|
-
}, element.parentNode.childNodes);
|
250
|
-
if (sametag) {
|
251
|
-
siblings = MochiKit.Base.filter(function (node) {
|
252
|
-
return node.tagName == element.tagName;
|
253
|
-
}, siblings);
|
254
|
-
}
|
255
|
-
if (reverse) {
|
256
|
-
siblings = MochiKit.Iter.reversed(siblings);
|
257
|
-
}
|
258
|
-
if (a) {
|
259
|
-
var actualIndex = MochiKit.Base.findIdentical(siblings, element);
|
260
|
-
return ((actualIndex + 1 - b) / a) % 1 == 0;
|
261
|
-
} else {
|
262
|
-
return b == MochiKit.Base.findIdentical(siblings, element) + 1;
|
263
|
-
}
|
264
|
-
},
|
265
|
-
|
266
|
-
/** @id MochiKit.Selector.Selector.prototype.isUIElement */
|
267
|
-
isUIElement: function (element) {
|
268
|
-
return MochiKit.Base.findValue(['input', 'button', 'select', 'option', 'textarea', 'object'],
|
269
|
-
element.tagName.toLowerCase()) > -1;
|
270
|
-
},
|
271
|
-
|
272
|
-
/** @id MochiKit.Selector.Selector.prototype.findElements */
|
273
|
-
findElements: function (scope, axis) {
|
274
|
-
var element;
|
275
|
-
|
276
|
-
if (axis == undefined) {
|
277
|
-
axis = "";
|
278
|
-
}
|
279
|
-
|
280
|
-
function inScope(element, scope) {
|
281
|
-
if (axis == "") {
|
282
|
-
return MochiKit.DOM.isChildNode(element, scope);
|
283
|
-
} else if (axis == ">") {
|
284
|
-
return element.parentNode === scope;
|
285
|
-
} else if (axis == "+") {
|
286
|
-
return element === nextSiblingElement(scope);
|
287
|
-
} else if (axis == "~") {
|
288
|
-
var sibling = scope;
|
289
|
-
while (sibling = nextSiblingElement(sibling)) {
|
290
|
-
if (element === sibling) {
|
291
|
-
return true;
|
292
|
-
}
|
293
|
-
}
|
294
|
-
return false;
|
295
|
-
} else {
|
296
|
-
throw "Invalid axis: " + axis;
|
297
|
-
}
|
298
|
-
}
|
299
|
-
|
300
|
-
if (element = MochiKit.DOM.getElement(this.params.id)) {
|
301
|
-
if (this.match(element)) {
|
302
|
-
if (!scope || inScope(element, scope)) {
|
303
|
-
return [element];
|
304
|
-
}
|
305
|
-
}
|
306
|
-
}
|
307
|
-
|
308
|
-
function nextSiblingElement(node) {
|
309
|
-
node = node.nextSibling;
|
310
|
-
while (node && node.nodeType != 1) {
|
311
|
-
node = node.nextSibling;
|
312
|
-
}
|
313
|
-
return node;
|
314
|
-
}
|
315
|
-
|
316
|
-
if (axis == "") {
|
317
|
-
scope = (scope || MochiKit.DOM.currentDocument()).getElementsByTagName(this.params.tagName || '*');
|
318
|
-
} else if (axis == ">") {
|
319
|
-
if (!scope) {
|
320
|
-
throw "> combinator not allowed without preceeding expression";
|
321
|
-
}
|
322
|
-
scope = MochiKit.Base.filter(function (node) {
|
323
|
-
return node.nodeType == 1;
|
324
|
-
}, scope.childNodes);
|
325
|
-
} else if (axis == "+") {
|
326
|
-
if (!scope) {
|
327
|
-
throw "+ combinator not allowed without preceeding expression";
|
328
|
-
}
|
329
|
-
scope = nextSiblingElement(scope) && [nextSiblingElement(scope)];
|
330
|
-
} else if (axis == "~") {
|
331
|
-
if (!scope) {
|
332
|
-
throw "~ combinator not allowed without preceeding expression";
|
333
|
-
}
|
334
|
-
var newscope = [];
|
335
|
-
while (nextSiblingElement(scope)) {
|
336
|
-
scope = nextSiblingElement(scope);
|
337
|
-
newscope.push(scope);
|
338
|
-
}
|
339
|
-
scope = newscope;
|
340
|
-
}
|
341
|
-
|
342
|
-
if (!scope) {
|
343
|
-
return [];
|
344
|
-
}
|
345
|
-
|
346
|
-
var results = MochiKit.Base.filter(MochiKit.Base.bind(function (scopeElt) {
|
347
|
-
return this.match(scopeElt);
|
348
|
-
}, this), scope);
|
349
|
-
|
350
|
-
return results;
|
351
|
-
},
|
352
|
-
|
353
|
-
/** @id MochiKit.Selector.Selector.prototype.repr */
|
354
|
-
repr: function () {
|
355
|
-
return 'Selector(' + this.expression + ')';
|
356
|
-
},
|
357
|
-
|
358
|
-
toString: MochiKit.Base.forwardCall("repr")
|
359
|
-
};
|
360
|
-
|
361
|
-
MochiKit.Base.update(MochiKit.Selector, {
|
362
|
-
|
363
|
-
/** @id MochiKit.Selector.findChildElements */
|
364
|
-
findChildElements: function (element, expressions) {
|
365
|
-
var uniq = function(arr) {
|
366
|
-
var res = [];
|
367
|
-
for (var i = 0; i < arr.length; i++) {
|
368
|
-
if (MochiKit.Base.findIdentical(res, arr[i]) < 0) {
|
369
|
-
res.push(arr[i]);
|
370
|
-
}
|
371
|
-
}
|
372
|
-
return res;
|
373
|
-
};
|
374
|
-
return MochiKit.Base.flattenArray(MochiKit.Base.map(function (expression) {
|
375
|
-
var nextScope = "";
|
376
|
-
var reducer = function (results, expr) {
|
377
|
-
if (match = expr.match(/^[>+~]$/)) {
|
378
|
-
nextScope = match[0];
|
379
|
-
return results;
|
380
|
-
} else {
|
381
|
-
var selector = new MochiKit.Selector.Selector(expr);
|
382
|
-
var elements = MochiKit.Iter.reduce(function (elements, result) {
|
383
|
-
return MochiKit.Base.extend(elements, selector.findElements(result || element, nextScope));
|
384
|
-
}, results, []);
|
385
|
-
nextScope = "";
|
386
|
-
return elements;
|
387
|
-
}
|
388
|
-
};
|
389
|
-
var exprs = expression.replace(/(^\s+|\s+$)/g, '').split(/\s+/);
|
390
|
-
return uniq(MochiKit.Iter.reduce(reducer, exprs, [null]));
|
391
|
-
}, expressions));
|
392
|
-
},
|
393
|
-
|
394
|
-
findDocElements: function () {
|
395
|
-
return MochiKit.Selector.findChildElements(MochiKit.DOM.currentDocument(), arguments);
|
396
|
-
},
|
397
|
-
|
398
|
-
__new__: function () {
|
399
|
-
var m = MochiKit.Base;
|
400
|
-
|
401
|
-
this.$$ = this.findDocElements;
|
402
|
-
|
403
|
-
this.EXPORT_TAGS = {
|
404
|
-
":common": this.EXPORT,
|
405
|
-
":all": m.concat(this.EXPORT, this.EXPORT_OK)
|
406
|
-
};
|
407
|
-
|
408
|
-
m.nameFunctions(this);
|
409
|
-
}
|
410
|
-
});
|
411
|
-
|
412
|
-
MochiKit.Selector.__new__();
|
413
|
-
|
414
|
-
MochiKit.Base._exportSymbols(this, MochiKit.Selector);
|
415
|
-
|
@@ -1,897 +0,0 @@
|
|
1
|
-
/***
|
2
|
-
|
3
|
-
MochiKit.Signal 1.4.2
|
4
|
-
|
5
|
-
See <http://mochikit.com/> for documentation, downloads, license, etc.
|
6
|
-
|
7
|
-
(c) 2006 Jonathan Gardner, Beau Hartshorne, Bob Ippolito. All rights Reserved.
|
8
|
-
|
9
|
-
***/
|
10
|
-
|
11
|
-
MochiKit.Base._deps('Signal', ['Base', 'DOM', 'Style']);
|
12
|
-
|
13
|
-
MochiKit.Signal.NAME = 'MochiKit.Signal';
|
14
|
-
MochiKit.Signal.VERSION = '1.4.2';
|
15
|
-
|
16
|
-
MochiKit.Signal._observers = [];
|
17
|
-
|
18
|
-
/** @id MochiKit.Signal.Event */
|
19
|
-
MochiKit.Signal.Event = function (src, e) {
|
20
|
-
this._event = e || window.event;
|
21
|
-
this._src = src;
|
22
|
-
};
|
23
|
-
|
24
|
-
MochiKit.Base.update(MochiKit.Signal.Event.prototype, {
|
25
|
-
|
26
|
-
__repr__: function () {
|
27
|
-
var repr = MochiKit.Base.repr;
|
28
|
-
var str = '{event(): ' + repr(this.event()) +
|
29
|
-
', src(): ' + repr(this.src()) +
|
30
|
-
', type(): ' + repr(this.type()) +
|
31
|
-
', target(): ' + repr(this.target());
|
32
|
-
|
33
|
-
if (this.type() &&
|
34
|
-
this.type().indexOf('key') === 0 ||
|
35
|
-
this.type().indexOf('mouse') === 0 ||
|
36
|
-
this.type().indexOf('click') != -1 ||
|
37
|
-
this.type() == 'contextmenu') {
|
38
|
-
str += ', modifier(): ' + '{alt: ' + repr(this.modifier().alt) +
|
39
|
-
', ctrl: ' + repr(this.modifier().ctrl) +
|
40
|
-
', meta: ' + repr(this.modifier().meta) +
|
41
|
-
', shift: ' + repr(this.modifier().shift) +
|
42
|
-
', any: ' + repr(this.modifier().any) + '}';
|
43
|
-
}
|
44
|
-
|
45
|
-
if (this.type() && this.type().indexOf('key') === 0) {
|
46
|
-
str += ', key(): {code: ' + repr(this.key().code) +
|
47
|
-
', string: ' + repr(this.key().string) + '}';
|
48
|
-
}
|
49
|
-
|
50
|
-
if (this.type() && (
|
51
|
-
this.type().indexOf('mouse') === 0 ||
|
52
|
-
this.type().indexOf('click') != -1 ||
|
53
|
-
this.type() == 'contextmenu')) {
|
54
|
-
|
55
|
-
str += ', mouse(): {page: ' + repr(this.mouse().page) +
|
56
|
-
', client: ' + repr(this.mouse().client);
|
57
|
-
|
58
|
-
if (this.type() != 'mousemove' && this.type() != 'mousewheel') {
|
59
|
-
str += ', button: {left: ' + repr(this.mouse().button.left) +
|
60
|
-
', middle: ' + repr(this.mouse().button.middle) +
|
61
|
-
', right: ' + repr(this.mouse().button.right) + '}';
|
62
|
-
}
|
63
|
-
if (this.type() == 'mousewheel') {
|
64
|
-
str += ', wheel: ' + repr(this.mouse().wheel);
|
65
|
-
}
|
66
|
-
str += '}';
|
67
|
-
}
|
68
|
-
if (this.type() == 'mouseover' || this.type() == 'mouseout' ||
|
69
|
-
this.type() == 'mouseenter' || this.type() == 'mouseleave') {
|
70
|
-
str += ', relatedTarget(): ' + repr(this.relatedTarget());
|
71
|
-
}
|
72
|
-
str += '}';
|
73
|
-
return str;
|
74
|
-
},
|
75
|
-
|
76
|
-
/** @id MochiKit.Signal.Event.prototype.toString */
|
77
|
-
toString: function () {
|
78
|
-
return this.__repr__();
|
79
|
-
},
|
80
|
-
|
81
|
-
/** @id MochiKit.Signal.Event.prototype.src */
|
82
|
-
src: function () {
|
83
|
-
return this._src;
|
84
|
-
},
|
85
|
-
|
86
|
-
/** @id MochiKit.Signal.Event.prototype.event */
|
87
|
-
event: function () {
|
88
|
-
return this._event;
|
89
|
-
},
|
90
|
-
|
91
|
-
/** @id MochiKit.Signal.Event.prototype.type */
|
92
|
-
type: function () {
|
93
|
-
if (this._event.type === "DOMMouseScroll") {
|
94
|
-
return "mousewheel";
|
95
|
-
} else {
|
96
|
-
return this._event.type || undefined;
|
97
|
-
}
|
98
|
-
},
|
99
|
-
|
100
|
-
/** @id MochiKit.Signal.Event.prototype.target */
|
101
|
-
target: function () {
|
102
|
-
return this._event.target || this._event.srcElement;
|
103
|
-
},
|
104
|
-
|
105
|
-
_relatedTarget: null,
|
106
|
-
/** @id MochiKit.Signal.Event.prototype.relatedTarget */
|
107
|
-
relatedTarget: function () {
|
108
|
-
if (this._relatedTarget !== null) {
|
109
|
-
return this._relatedTarget;
|
110
|
-
}
|
111
|
-
|
112
|
-
var elem = null;
|
113
|
-
if (this.type() == 'mouseover' || this.type() == 'mouseenter') {
|
114
|
-
elem = (this._event.relatedTarget ||
|
115
|
-
this._event.fromElement);
|
116
|
-
} else if (this.type() == 'mouseout' || this.type() == 'mouseleave') {
|
117
|
-
elem = (this._event.relatedTarget ||
|
118
|
-
this._event.toElement);
|
119
|
-
}
|
120
|
-
try {
|
121
|
-
if (elem !== null && elem.nodeType !== null) {
|
122
|
-
this._relatedTarget = elem;
|
123
|
-
return elem;
|
124
|
-
}
|
125
|
-
} catch (ignore) {
|
126
|
-
// Firefox 3 throws a permission denied error when accessing
|
127
|
-
// any property on XUL elements (e.g. scrollbars)...
|
128
|
-
}
|
129
|
-
|
130
|
-
return undefined;
|
131
|
-
},
|
132
|
-
|
133
|
-
_modifier: null,
|
134
|
-
/** @id MochiKit.Signal.Event.prototype.modifier */
|
135
|
-
modifier: function () {
|
136
|
-
if (this._modifier !== null) {
|
137
|
-
return this._modifier;
|
138
|
-
}
|
139
|
-
var m = {};
|
140
|
-
m.alt = this._event.altKey;
|
141
|
-
m.ctrl = this._event.ctrlKey;
|
142
|
-
m.meta = this._event.metaKey || false; // IE and Opera punt here
|
143
|
-
m.shift = this._event.shiftKey;
|
144
|
-
m.any = m.alt || m.ctrl || m.shift || m.meta;
|
145
|
-
this._modifier = m;
|
146
|
-
return m;
|
147
|
-
},
|
148
|
-
|
149
|
-
_key: null,
|
150
|
-
/** @id MochiKit.Signal.Event.prototype.key */
|
151
|
-
key: function () {
|
152
|
-
if (this._key !== null) {
|
153
|
-
return this._key;
|
154
|
-
}
|
155
|
-
var k = {};
|
156
|
-
if (this.type() && this.type().indexOf('key') === 0) {
|
157
|
-
|
158
|
-
/*
|
159
|
-
|
160
|
-
If you're looking for a special key, look for it in keydown or
|
161
|
-
keyup, but never keypress. If you're looking for a Unicode
|
162
|
-
chracter, look for it with keypress, but never keyup or
|
163
|
-
keydown.
|
164
|
-
|
165
|
-
Notes:
|
166
|
-
|
167
|
-
FF key event behavior:
|
168
|
-
key event charCode keyCode
|
169
|
-
DOWN ku,kd 0 40
|
170
|
-
DOWN kp 0 40
|
171
|
-
ESC ku,kd 0 27
|
172
|
-
ESC kp 0 27
|
173
|
-
a ku,kd 0 65
|
174
|
-
a kp 97 0
|
175
|
-
shift+a ku,kd 0 65
|
176
|
-
shift+a kp 65 0
|
177
|
-
1 ku,kd 0 49
|
178
|
-
1 kp 49 0
|
179
|
-
shift+1 ku,kd 0 0
|
180
|
-
shift+1 kp 33 0
|
181
|
-
|
182
|
-
IE key event behavior:
|
183
|
-
(IE doesn't fire keypress events for special keys.)
|
184
|
-
key event keyCode
|
185
|
-
DOWN ku,kd 40
|
186
|
-
DOWN kp undefined
|
187
|
-
ESC ku,kd 27
|
188
|
-
ESC kp 27
|
189
|
-
a ku,kd 65
|
190
|
-
a kp 97
|
191
|
-
shift+a ku,kd 65
|
192
|
-
shift+a kp 65
|
193
|
-
1 ku,kd 49
|
194
|
-
1 kp 49
|
195
|
-
shift+1 ku,kd 49
|
196
|
-
shift+1 kp 33
|
197
|
-
|
198
|
-
Safari key event behavior:
|
199
|
-
(Safari sets charCode and keyCode to something crazy for
|
200
|
-
special keys.)
|
201
|
-
key event charCode keyCode
|
202
|
-
DOWN ku,kd 63233 40
|
203
|
-
DOWN kp 63233 63233
|
204
|
-
ESC ku,kd 27 27
|
205
|
-
ESC kp 27 27
|
206
|
-
a ku,kd 97 65
|
207
|
-
a kp 97 97
|
208
|
-
shift+a ku,kd 65 65
|
209
|
-
shift+a kp 65 65
|
210
|
-
1 ku,kd 49 49
|
211
|
-
1 kp 49 49
|
212
|
-
shift+1 ku,kd 33 49
|
213
|
-
shift+1 kp 33 33
|
214
|
-
|
215
|
-
*/
|
216
|
-
|
217
|
-
/* look for special keys here */
|
218
|
-
if (this.type() == 'keydown' || this.type() == 'keyup') {
|
219
|
-
k.code = this._event.keyCode;
|
220
|
-
k.string = (MochiKit.Signal._specialKeys[k.code] ||
|
221
|
-
'KEY_UNKNOWN');
|
222
|
-
this._key = k;
|
223
|
-
return k;
|
224
|
-
|
225
|
-
/* look for characters here */
|
226
|
-
} else if (this.type() == 'keypress') {
|
227
|
-
|
228
|
-
/*
|
229
|
-
|
230
|
-
Special key behavior:
|
231
|
-
|
232
|
-
IE: does not fire keypress events for special keys
|
233
|
-
FF: sets charCode to 0, and sets the correct keyCode
|
234
|
-
Safari: sets keyCode and charCode to something stupid
|
235
|
-
|
236
|
-
*/
|
237
|
-
|
238
|
-
k.code = 0;
|
239
|
-
k.string = '';
|
240
|
-
|
241
|
-
if (typeof(this._event.charCode) != 'undefined' &&
|
242
|
-
this._event.charCode !== 0 &&
|
243
|
-
!MochiKit.Signal._specialMacKeys[this._event.charCode]) {
|
244
|
-
k.code = this._event.charCode;
|
245
|
-
k.string = String.fromCharCode(k.code);
|
246
|
-
} else if (this._event.keyCode &&
|
247
|
-
typeof(this._event.charCode) == 'undefined') { // IE
|
248
|
-
k.code = this._event.keyCode;
|
249
|
-
k.string = String.fromCharCode(k.code);
|
250
|
-
}
|
251
|
-
|
252
|
-
this._key = k;
|
253
|
-
return k;
|
254
|
-
}
|
255
|
-
}
|
256
|
-
return undefined;
|
257
|
-
},
|
258
|
-
|
259
|
-
_mouse: null,
|
260
|
-
/** @id MochiKit.Signal.Event.prototype.mouse */
|
261
|
-
mouse: function () {
|
262
|
-
if (this._mouse !== null) {
|
263
|
-
return this._mouse;
|
264
|
-
}
|
265
|
-
|
266
|
-
var m = {};
|
267
|
-
var e = this._event;
|
268
|
-
|
269
|
-
if (this.type() && (
|
270
|
-
this.type().indexOf('mouse') === 0 ||
|
271
|
-
this.type().indexOf('click') != -1 ||
|
272
|
-
this.type() == 'contextmenu')) {
|
273
|
-
|
274
|
-
m.client = new MochiKit.Style.Coordinates(0, 0);
|
275
|
-
if (e.clientX || e.clientY) {
|
276
|
-
m.client.x = (!e.clientX || e.clientX < 0) ? 0 : e.clientX;
|
277
|
-
m.client.y = (!e.clientY || e.clientY < 0) ? 0 : e.clientY;
|
278
|
-
}
|
279
|
-
|
280
|
-
m.page = new MochiKit.Style.Coordinates(0, 0);
|
281
|
-
if (e.pageX || e.pageY) {
|
282
|
-
m.page.x = (!e.pageX || e.pageX < 0) ? 0 : e.pageX;
|
283
|
-
m.page.y = (!e.pageY || e.pageY < 0) ? 0 : e.pageY;
|
284
|
-
} else {
|
285
|
-
/*
|
286
|
-
|
287
|
-
The IE shortcut can be off by two. We fix it. See:
|
288
|
-
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/getboundingclientrect.asp
|
289
|
-
|
290
|
-
This is similar to the method used in
|
291
|
-
MochiKit.Style.getElementPosition().
|
292
|
-
|
293
|
-
*/
|
294
|
-
var de = MochiKit.DOM._document.documentElement;
|
295
|
-
var b = MochiKit.DOM._document.body;
|
296
|
-
|
297
|
-
m.page.x = e.clientX +
|
298
|
-
(de.scrollLeft || b.scrollLeft) -
|
299
|
-
(de.clientLeft || 0);
|
300
|
-
|
301
|
-
m.page.y = e.clientY +
|
302
|
-
(de.scrollTop || b.scrollTop) -
|
303
|
-
(de.clientTop || 0);
|
304
|
-
|
305
|
-
}
|
306
|
-
if (this.type() != 'mousemove' && this.type() != 'mousewheel') {
|
307
|
-
m.button = {};
|
308
|
-
m.button.left = false;
|
309
|
-
m.button.right = false;
|
310
|
-
m.button.middle = false;
|
311
|
-
|
312
|
-
/* we could check e.button, but which is more consistent */
|
313
|
-
if (e.which) {
|
314
|
-
m.button.left = (e.which == 1);
|
315
|
-
m.button.middle = (e.which == 2);
|
316
|
-
m.button.right = (e.which == 3);
|
317
|
-
|
318
|
-
/*
|
319
|
-
|
320
|
-
Mac browsers and right click:
|
321
|
-
|
322
|
-
- Safari doesn't fire any click events on a right
|
323
|
-
click:
|
324
|
-
http://bugs.webkit.org/show_bug.cgi?id=6595
|
325
|
-
|
326
|
-
- Firefox fires the event, and sets ctrlKey = true
|
327
|
-
|
328
|
-
- Opera fires the event, and sets metaKey = true
|
329
|
-
|
330
|
-
oncontextmenu is fired on right clicks between
|
331
|
-
browsers and across platforms.
|
332
|
-
|
333
|
-
*/
|
334
|
-
|
335
|
-
} else {
|
336
|
-
m.button.left = !!(e.button & 1);
|
337
|
-
m.button.right = !!(e.button & 2);
|
338
|
-
m.button.middle = !!(e.button & 4);
|
339
|
-
}
|
340
|
-
}
|
341
|
-
if (this.type() == 'mousewheel') {
|
342
|
-
m.wheel = new MochiKit.Style.Coordinates(0, 0);
|
343
|
-
if (e.wheelDeltaX || e.wheelDeltaY) {
|
344
|
-
m.wheel.x = e.wheelDeltaX / -40 || 0;
|
345
|
-
m.wheel.y = e.wheelDeltaY / -40 || 0;
|
346
|
-
} else if (e.wheelDelta) {
|
347
|
-
m.wheel.y = e.wheelDelta / -40;
|
348
|
-
} else {
|
349
|
-
m.wheel.y = e.detail || 0;
|
350
|
-
}
|
351
|
-
}
|
352
|
-
this._mouse = m;
|
353
|
-
return m;
|
354
|
-
}
|
355
|
-
return undefined;
|
356
|
-
},
|
357
|
-
|
358
|
-
/** @id MochiKit.Signal.Event.prototype.stop */
|
359
|
-
stop: function () {
|
360
|
-
this.stopPropagation();
|
361
|
-
this.preventDefault();
|
362
|
-
},
|
363
|
-
|
364
|
-
/** @id MochiKit.Signal.Event.prototype.stopPropagation */
|
365
|
-
stopPropagation: function () {
|
366
|
-
if (this._event.stopPropagation) {
|
367
|
-
this._event.stopPropagation();
|
368
|
-
} else {
|
369
|
-
this._event.cancelBubble = true;
|
370
|
-
}
|
371
|
-
},
|
372
|
-
|
373
|
-
/** @id MochiKit.Signal.Event.prototype.preventDefault */
|
374
|
-
preventDefault: function () {
|
375
|
-
if (this._event.preventDefault) {
|
376
|
-
this._event.preventDefault();
|
377
|
-
} else if (this._confirmUnload === null) {
|
378
|
-
this._event.returnValue = false;
|
379
|
-
}
|
380
|
-
},
|
381
|
-
|
382
|
-
_confirmUnload: null,
|
383
|
-
|
384
|
-
/** @id MochiKit.Signal.Event.prototype.confirmUnload */
|
385
|
-
confirmUnload: function (msg) {
|
386
|
-
if (this.type() == 'beforeunload') {
|
387
|
-
this._confirmUnload = msg;
|
388
|
-
this._event.returnValue = msg;
|
389
|
-
}
|
390
|
-
}
|
391
|
-
});
|
392
|
-
|
393
|
-
/* Safari sets keyCode to these special values onkeypress. */
|
394
|
-
MochiKit.Signal._specialMacKeys = {
|
395
|
-
3: 'KEY_ENTER',
|
396
|
-
63289: 'KEY_NUM_PAD_CLEAR',
|
397
|
-
63276: 'KEY_PAGE_UP',
|
398
|
-
63277: 'KEY_PAGE_DOWN',
|
399
|
-
63275: 'KEY_END',
|
400
|
-
63273: 'KEY_HOME',
|
401
|
-
63234: 'KEY_ARROW_LEFT',
|
402
|
-
63232: 'KEY_ARROW_UP',
|
403
|
-
63235: 'KEY_ARROW_RIGHT',
|
404
|
-
63233: 'KEY_ARROW_DOWN',
|
405
|
-
63302: 'KEY_INSERT',
|
406
|
-
63272: 'KEY_DELETE'
|
407
|
-
};
|
408
|
-
|
409
|
-
/* for KEY_F1 - KEY_F12 */
|
410
|
-
(function () {
|
411
|
-
var _specialMacKeys = MochiKit.Signal._specialMacKeys;
|
412
|
-
for (i = 63236; i <= 63242; i++) {
|
413
|
-
// no F0
|
414
|
-
_specialMacKeys[i] = 'KEY_F' + (i - 63236 + 1);
|
415
|
-
}
|
416
|
-
})();
|
417
|
-
|
418
|
-
/* Standard keyboard key codes. */
|
419
|
-
MochiKit.Signal._specialKeys = {
|
420
|
-
8: 'KEY_BACKSPACE',
|
421
|
-
9: 'KEY_TAB',
|
422
|
-
12: 'KEY_NUM_PAD_CLEAR', // weird, for Safari and Mac FF only
|
423
|
-
13: 'KEY_ENTER',
|
424
|
-
16: 'KEY_SHIFT',
|
425
|
-
17: 'KEY_CTRL',
|
426
|
-
18: 'KEY_ALT',
|
427
|
-
19: 'KEY_PAUSE',
|
428
|
-
20: 'KEY_CAPS_LOCK',
|
429
|
-
27: 'KEY_ESCAPE',
|
430
|
-
32: 'KEY_SPACEBAR',
|
431
|
-
33: 'KEY_PAGE_UP',
|
432
|
-
34: 'KEY_PAGE_DOWN',
|
433
|
-
35: 'KEY_END',
|
434
|
-
36: 'KEY_HOME',
|
435
|
-
37: 'KEY_ARROW_LEFT',
|
436
|
-
38: 'KEY_ARROW_UP',
|
437
|
-
39: 'KEY_ARROW_RIGHT',
|
438
|
-
40: 'KEY_ARROW_DOWN',
|
439
|
-
44: 'KEY_PRINT_SCREEN',
|
440
|
-
45: 'KEY_INSERT',
|
441
|
-
46: 'KEY_DELETE',
|
442
|
-
59: 'KEY_SEMICOLON', // weird, for Safari and IE only
|
443
|
-
91: 'KEY_WINDOWS_LEFT',
|
444
|
-
92: 'KEY_WINDOWS_RIGHT',
|
445
|
-
93: 'KEY_SELECT',
|
446
|
-
106: 'KEY_NUM_PAD_ASTERISK',
|
447
|
-
107: 'KEY_NUM_PAD_PLUS_SIGN',
|
448
|
-
109: 'KEY_NUM_PAD_HYPHEN-MINUS',
|
449
|
-
110: 'KEY_NUM_PAD_FULL_STOP',
|
450
|
-
111: 'KEY_NUM_PAD_SOLIDUS',
|
451
|
-
144: 'KEY_NUM_LOCK',
|
452
|
-
145: 'KEY_SCROLL_LOCK',
|
453
|
-
186: 'KEY_SEMICOLON',
|
454
|
-
187: 'KEY_EQUALS_SIGN',
|
455
|
-
188: 'KEY_COMMA',
|
456
|
-
189: 'KEY_HYPHEN-MINUS',
|
457
|
-
190: 'KEY_FULL_STOP',
|
458
|
-
191: 'KEY_SOLIDUS',
|
459
|
-
192: 'KEY_GRAVE_ACCENT',
|
460
|
-
219: 'KEY_LEFT_SQUARE_BRACKET',
|
461
|
-
220: 'KEY_REVERSE_SOLIDUS',
|
462
|
-
221: 'KEY_RIGHT_SQUARE_BRACKET',
|
463
|
-
222: 'KEY_APOSTROPHE'
|
464
|
-
// undefined: 'KEY_UNKNOWN'
|
465
|
-
};
|
466
|
-
|
467
|
-
(function () {
|
468
|
-
/* for KEY_0 - KEY_9 */
|
469
|
-
var _specialKeys = MochiKit.Signal._specialKeys;
|
470
|
-
for (var i = 48; i <= 57; i++) {
|
471
|
-
_specialKeys[i] = 'KEY_' + (i - 48);
|
472
|
-
}
|
473
|
-
|
474
|
-
/* for KEY_A - KEY_Z */
|
475
|
-
for (i = 65; i <= 90; i++) {
|
476
|
-
_specialKeys[i] = 'KEY_' + String.fromCharCode(i);
|
477
|
-
}
|
478
|
-
|
479
|
-
/* for KEY_NUM_PAD_0 - KEY_NUM_PAD_9 */
|
480
|
-
for (i = 96; i <= 105; i++) {
|
481
|
-
_specialKeys[i] = 'KEY_NUM_PAD_' + (i - 96);
|
482
|
-
}
|
483
|
-
|
484
|
-
/* for KEY_F1 - KEY_F12 */
|
485
|
-
for (i = 112; i <= 123; i++) {
|
486
|
-
// no F0
|
487
|
-
_specialKeys[i] = 'KEY_F' + (i - 112 + 1);
|
488
|
-
}
|
489
|
-
})();
|
490
|
-
|
491
|
-
/* Internal object to keep track of created signals. */
|
492
|
-
MochiKit.Signal.Ident = function (ident) {
|
493
|
-
this.source = ident.source;
|
494
|
-
this.signal = ident.signal;
|
495
|
-
this.listener = ident.listener;
|
496
|
-
this.isDOM = ident.isDOM;
|
497
|
-
this.objOrFunc = ident.objOrFunc;
|
498
|
-
this.funcOrStr = ident.funcOrStr;
|
499
|
-
this.connected = ident.connected;
|
500
|
-
};
|
501
|
-
|
502
|
-
MochiKit.Signal.Ident.prototype = {};
|
503
|
-
|
504
|
-
MochiKit.Base.update(MochiKit.Signal, {
|
505
|
-
|
506
|
-
__repr__: function () {
|
507
|
-
return '[' + this.NAME + ' ' + this.VERSION + ']';
|
508
|
-
},
|
509
|
-
|
510
|
-
toString: function () {
|
511
|
-
return this.__repr__();
|
512
|
-
},
|
513
|
-
|
514
|
-
_unloadCache: function () {
|
515
|
-
var self = MochiKit.Signal;
|
516
|
-
var observers = self._observers;
|
517
|
-
|
518
|
-
for (var i = 0; i < observers.length; i++) {
|
519
|
-
if (observers[i].signal !== 'onload' && observers[i].signal !== 'onunload') {
|
520
|
-
self._disconnect(observers[i]);
|
521
|
-
}
|
522
|
-
}
|
523
|
-
},
|
524
|
-
|
525
|
-
_listener: function (src, sig, func, obj, isDOM) {
|
526
|
-
var self = MochiKit.Signal;
|
527
|
-
var E = self.Event;
|
528
|
-
if (!isDOM) {
|
529
|
-
/* We don't want to re-bind already bound methods */
|
530
|
-
if (typeof(func.im_self) == 'undefined') {
|
531
|
-
return MochiKit.Base.bindLate(func, obj);
|
532
|
-
} else {
|
533
|
-
return func;
|
534
|
-
}
|
535
|
-
}
|
536
|
-
obj = obj || src;
|
537
|
-
if (typeof(func) == "string") {
|
538
|
-
if (sig === 'onload' || sig === 'onunload') {
|
539
|
-
return function (nativeEvent) {
|
540
|
-
obj[func].apply(obj, [new E(src, nativeEvent)]);
|
541
|
-
|
542
|
-
var ident = new MochiKit.Signal.Ident({
|
543
|
-
source: src, signal: sig, objOrFunc: obj, funcOrStr: func});
|
544
|
-
|
545
|
-
MochiKit.Signal._disconnect(ident);
|
546
|
-
};
|
547
|
-
} else {
|
548
|
-
return function (nativeEvent) {
|
549
|
-
obj[func].apply(obj, [new E(src, nativeEvent)]);
|
550
|
-
};
|
551
|
-
}
|
552
|
-
} else {
|
553
|
-
if (sig === 'onload' || sig === 'onunload') {
|
554
|
-
return function (nativeEvent) {
|
555
|
-
func.apply(obj, [new E(src, nativeEvent)]);
|
556
|
-
|
557
|
-
var ident = new MochiKit.Signal.Ident({
|
558
|
-
source: src, signal: sig, objOrFunc: func});
|
559
|
-
|
560
|
-
MochiKit.Signal._disconnect(ident);
|
561
|
-
};
|
562
|
-
} else {
|
563
|
-
return function (nativeEvent) {
|
564
|
-
func.apply(obj, [new E(src, nativeEvent)]);
|
565
|
-
};
|
566
|
-
}
|
567
|
-
}
|
568
|
-
},
|
569
|
-
|
570
|
-
_browserAlreadyHasMouseEnterAndLeave: function () {
|
571
|
-
return /MSIE/.test(navigator.userAgent);
|
572
|
-
},
|
573
|
-
|
574
|
-
_browserLacksMouseWheelEvent: function () {
|
575
|
-
return /Gecko\//.test(navigator.userAgent);
|
576
|
-
},
|
577
|
-
|
578
|
-
_mouseEnterListener: function (src, sig, func, obj) {
|
579
|
-
var E = MochiKit.Signal.Event;
|
580
|
-
return function (nativeEvent) {
|
581
|
-
var e = new E(src, nativeEvent);
|
582
|
-
try {
|
583
|
-
e.relatedTarget().nodeName;
|
584
|
-
} catch (err) {
|
585
|
-
/* probably hit a permission denied error; possibly one of
|
586
|
-
* firefox's screwy anonymous DIVs inside an input element.
|
587
|
-
* Allow this event to propogate up.
|
588
|
-
*/
|
589
|
-
return;
|
590
|
-
}
|
591
|
-
e.stop();
|
592
|
-
if (MochiKit.DOM.isChildNode(e.relatedTarget(), src)) {
|
593
|
-
/* We've moved between our node and a child. Ignore. */
|
594
|
-
return;
|
595
|
-
}
|
596
|
-
e.type = function () { return sig; };
|
597
|
-
if (typeof(func) == "string") {
|
598
|
-
return obj[func].apply(obj, [e]);
|
599
|
-
} else {
|
600
|
-
return func.apply(obj, [e]);
|
601
|
-
}
|
602
|
-
};
|
603
|
-
},
|
604
|
-
|
605
|
-
_getDestPair: function (objOrFunc, funcOrStr) {
|
606
|
-
var obj = null;
|
607
|
-
var func = null;
|
608
|
-
if (typeof(funcOrStr) != 'undefined') {
|
609
|
-
obj = objOrFunc;
|
610
|
-
func = funcOrStr;
|
611
|
-
if (typeof(funcOrStr) == 'string') {
|
612
|
-
if (typeof(objOrFunc[funcOrStr]) != "function") {
|
613
|
-
throw new Error("'funcOrStr' must be a function on 'objOrFunc'");
|
614
|
-
}
|
615
|
-
} else if (typeof(funcOrStr) != 'function') {
|
616
|
-
throw new Error("'funcOrStr' must be a function or string");
|
617
|
-
}
|
618
|
-
} else if (typeof(objOrFunc) != "function") {
|
619
|
-
throw new Error("'objOrFunc' must be a function if 'funcOrStr' is not given");
|
620
|
-
} else {
|
621
|
-
func = objOrFunc;
|
622
|
-
}
|
623
|
-
return [obj, func];
|
624
|
-
},
|
625
|
-
|
626
|
-
/** @id MochiKit.Signal.connect */
|
627
|
-
connect: function (src, sig, objOrFunc/* optional */, funcOrStr) {
|
628
|
-
src = MochiKit.DOM.getElement(src);
|
629
|
-
var self = MochiKit.Signal;
|
630
|
-
|
631
|
-
if (typeof(sig) != 'string') {
|
632
|
-
throw new Error("'sig' must be a string");
|
633
|
-
}
|
634
|
-
|
635
|
-
var destPair = self._getDestPair(objOrFunc, funcOrStr);
|
636
|
-
var obj = destPair[0];
|
637
|
-
var func = destPair[1];
|
638
|
-
if (typeof(obj) == 'undefined' || obj === null) {
|
639
|
-
obj = src;
|
640
|
-
}
|
641
|
-
|
642
|
-
var isDOM = !!(src.addEventListener || src.attachEvent);
|
643
|
-
if (isDOM && (sig === "onmouseenter" || sig === "onmouseleave")
|
644
|
-
&& !self._browserAlreadyHasMouseEnterAndLeave()) {
|
645
|
-
var listener = self._mouseEnterListener(src, sig.substr(2), func, obj);
|
646
|
-
if (sig === "onmouseenter") {
|
647
|
-
sig = "onmouseover";
|
648
|
-
} else {
|
649
|
-
sig = "onmouseout";
|
650
|
-
}
|
651
|
-
} else if (isDOM && sig == "onmousewheel" && self._browserLacksMouseWheelEvent()) {
|
652
|
-
var listener = self._listener(src, sig, func, obj, isDOM);
|
653
|
-
sig = "onDOMMouseScroll";
|
654
|
-
} else {
|
655
|
-
var listener = self._listener(src, sig, func, obj, isDOM);
|
656
|
-
}
|
657
|
-
|
658
|
-
if (src.addEventListener) {
|
659
|
-
src.addEventListener(sig.substr(2), listener, false);
|
660
|
-
} else if (src.attachEvent) {
|
661
|
-
src.attachEvent(sig, listener); // useCapture unsupported
|
662
|
-
}
|
663
|
-
|
664
|
-
var ident = new MochiKit.Signal.Ident({
|
665
|
-
source: src,
|
666
|
-
signal: sig,
|
667
|
-
listener: listener,
|
668
|
-
isDOM: isDOM,
|
669
|
-
objOrFunc: objOrFunc,
|
670
|
-
funcOrStr: funcOrStr,
|
671
|
-
connected: true
|
672
|
-
});
|
673
|
-
self._observers.push(ident);
|
674
|
-
|
675
|
-
if (!isDOM && typeof(src.__connect__) == 'function') {
|
676
|
-
var args = MochiKit.Base.extend([ident], arguments, 1);
|
677
|
-
src.__connect__.apply(src, args);
|
678
|
-
}
|
679
|
-
|
680
|
-
return ident;
|
681
|
-
},
|
682
|
-
|
683
|
-
_disconnect: function (ident) {
|
684
|
-
// already disconnected
|
685
|
-
if (!ident.connected) {
|
686
|
-
return;
|
687
|
-
}
|
688
|
-
ident.connected = false;
|
689
|
-
var src = ident.source;
|
690
|
-
var sig = ident.signal;
|
691
|
-
var listener = ident.listener;
|
692
|
-
// check isDOM
|
693
|
-
if (!ident.isDOM) {
|
694
|
-
if (typeof(src.__disconnect__) == 'function') {
|
695
|
-
src.__disconnect__(ident, sig, ident.objOrFunc, ident.funcOrStr);
|
696
|
-
}
|
697
|
-
return;
|
698
|
-
}
|
699
|
-
if (src.removeEventListener) {
|
700
|
-
src.removeEventListener(sig.substr(2), listener, false);
|
701
|
-
} else if (src.detachEvent) {
|
702
|
-
src.detachEvent(sig, listener); // useCapture unsupported
|
703
|
-
} else {
|
704
|
-
throw new Error("'src' must be a DOM element");
|
705
|
-
}
|
706
|
-
},
|
707
|
-
|
708
|
-
/** @id MochiKit.Signal.disconnect */
|
709
|
-
disconnect: function (ident) {
|
710
|
-
var self = MochiKit.Signal;
|
711
|
-
var observers = self._observers;
|
712
|
-
var m = MochiKit.Base;
|
713
|
-
if (arguments.length > 1) {
|
714
|
-
// compatibility API
|
715
|
-
var src = MochiKit.DOM.getElement(arguments[0]);
|
716
|
-
var sig = arguments[1];
|
717
|
-
var obj = arguments[2];
|
718
|
-
var func = arguments[3];
|
719
|
-
for (var i = observers.length - 1; i >= 0; i--) {
|
720
|
-
var o = observers[i];
|
721
|
-
if (o.source === src && o.signal === sig && o.objOrFunc === obj && o.funcOrStr === func) {
|
722
|
-
self._disconnect(o);
|
723
|
-
if (!self._lock) {
|
724
|
-
observers.splice(i, 1);
|
725
|
-
} else {
|
726
|
-
self._dirty = true;
|
727
|
-
}
|
728
|
-
return true;
|
729
|
-
}
|
730
|
-
}
|
731
|
-
} else {
|
732
|
-
var idx = m.findIdentical(observers, ident);
|
733
|
-
if (idx >= 0) {
|
734
|
-
self._disconnect(ident);
|
735
|
-
if (!self._lock) {
|
736
|
-
observers.splice(idx, 1);
|
737
|
-
} else {
|
738
|
-
self._dirty = true;
|
739
|
-
}
|
740
|
-
return true;
|
741
|
-
}
|
742
|
-
}
|
743
|
-
return false;
|
744
|
-
},
|
745
|
-
|
746
|
-
/** @id MochiKit.Signal.disconnectAllTo */
|
747
|
-
disconnectAllTo: function (objOrFunc, /* optional */funcOrStr) {
|
748
|
-
var self = MochiKit.Signal;
|
749
|
-
var observers = self._observers;
|
750
|
-
var disconnect = self._disconnect;
|
751
|
-
var locked = self._lock;
|
752
|
-
var dirty = self._dirty;
|
753
|
-
if (typeof(funcOrStr) === 'undefined') {
|
754
|
-
funcOrStr = null;
|
755
|
-
}
|
756
|
-
for (var i = observers.length - 1; i >= 0; i--) {
|
757
|
-
var ident = observers[i];
|
758
|
-
if (ident.objOrFunc === objOrFunc &&
|
759
|
-
(funcOrStr === null || ident.funcOrStr === funcOrStr)) {
|
760
|
-
disconnect(ident);
|
761
|
-
if (locked) {
|
762
|
-
dirty = true;
|
763
|
-
} else {
|
764
|
-
observers.splice(i, 1);
|
765
|
-
}
|
766
|
-
}
|
767
|
-
}
|
768
|
-
self._dirty = dirty;
|
769
|
-
},
|
770
|
-
|
771
|
-
/** @id MochiKit.Signal.disconnectAll */
|
772
|
-
disconnectAll: function (src/* optional */, sig) {
|
773
|
-
src = MochiKit.DOM.getElement(src);
|
774
|
-
var m = MochiKit.Base;
|
775
|
-
var signals = m.flattenArguments(m.extend(null, arguments, 1));
|
776
|
-
var self = MochiKit.Signal;
|
777
|
-
var disconnect = self._disconnect;
|
778
|
-
var observers = self._observers;
|
779
|
-
var i, ident;
|
780
|
-
var locked = self._lock;
|
781
|
-
var dirty = self._dirty;
|
782
|
-
if (signals.length === 0) {
|
783
|
-
// disconnect all
|
784
|
-
for (i = observers.length - 1; i >= 0; i--) {
|
785
|
-
ident = observers[i];
|
786
|
-
if (ident.source === src) {
|
787
|
-
disconnect(ident);
|
788
|
-
if (!locked) {
|
789
|
-
observers.splice(i, 1);
|
790
|
-
} else {
|
791
|
-
dirty = true;
|
792
|
-
}
|
793
|
-
}
|
794
|
-
}
|
795
|
-
} else {
|
796
|
-
var sigs = {};
|
797
|
-
for (i = 0; i < signals.length; i++) {
|
798
|
-
sigs[signals[i]] = true;
|
799
|
-
}
|
800
|
-
for (i = observers.length - 1; i >= 0; i--) {
|
801
|
-
ident = observers[i];
|
802
|
-
if (ident.source === src && ident.signal in sigs) {
|
803
|
-
disconnect(ident);
|
804
|
-
if (!locked) {
|
805
|
-
observers.splice(i, 1);
|
806
|
-
} else {
|
807
|
-
dirty = true;
|
808
|
-
}
|
809
|
-
}
|
810
|
-
}
|
811
|
-
}
|
812
|
-
self._dirty = dirty;
|
813
|
-
},
|
814
|
-
|
815
|
-
/** @id MochiKit.Signal.signal */
|
816
|
-
signal: function (src, sig) {
|
817
|
-
var self = MochiKit.Signal;
|
818
|
-
var observers = self._observers;
|
819
|
-
src = MochiKit.DOM.getElement(src);
|
820
|
-
var args = MochiKit.Base.extend(null, arguments, 2);
|
821
|
-
var errors = [];
|
822
|
-
self._lock = true;
|
823
|
-
for (var i = 0; i < observers.length; i++) {
|
824
|
-
var ident = observers[i];
|
825
|
-
if (ident.source === src && ident.signal === sig &&
|
826
|
-
ident.connected) {
|
827
|
-
try {
|
828
|
-
ident.listener.apply(src, args);
|
829
|
-
} catch (e) {
|
830
|
-
errors.push(e);
|
831
|
-
}
|
832
|
-
}
|
833
|
-
}
|
834
|
-
self._lock = false;
|
835
|
-
if (self._dirty) {
|
836
|
-
self._dirty = false;
|
837
|
-
for (var i = observers.length - 1; i >= 0; i--) {
|
838
|
-
if (!observers[i].connected) {
|
839
|
-
observers.splice(i, 1);
|
840
|
-
}
|
841
|
-
}
|
842
|
-
}
|
843
|
-
if (errors.length == 1) {
|
844
|
-
throw errors[0];
|
845
|
-
} else if (errors.length > 1) {
|
846
|
-
var e = new Error("Multiple errors thrown in handling 'sig', see errors property");
|
847
|
-
e.errors = errors;
|
848
|
-
throw e;
|
849
|
-
}
|
850
|
-
}
|
851
|
-
|
852
|
-
});
|
853
|
-
|
854
|
-
MochiKit.Signal.EXPORT_OK = [];
|
855
|
-
|
856
|
-
MochiKit.Signal.EXPORT = [
|
857
|
-
'connect',
|
858
|
-
'disconnect',
|
859
|
-
'signal',
|
860
|
-
'disconnectAll',
|
861
|
-
'disconnectAllTo'
|
862
|
-
];
|
863
|
-
|
864
|
-
MochiKit.Signal.__new__ = function (win) {
|
865
|
-
var m = MochiKit.Base;
|
866
|
-
this._document = document;
|
867
|
-
this._window = win;
|
868
|
-
this._lock = false;
|
869
|
-
this._dirty = false;
|
870
|
-
|
871
|
-
try {
|
872
|
-
this.connect(window, 'onunload', this._unloadCache);
|
873
|
-
} catch (e) {
|
874
|
-
// pass: might not be a browser
|
875
|
-
}
|
876
|
-
|
877
|
-
this.EXPORT_TAGS = {
|
878
|
-
':common': this.EXPORT,
|
879
|
-
':all': m.concat(this.EXPORT, this.EXPORT_OK)
|
880
|
-
};
|
881
|
-
|
882
|
-
m.nameFunctions(this);
|
883
|
-
};
|
884
|
-
|
885
|
-
MochiKit.Signal.__new__(this);
|
886
|
-
|
887
|
-
//
|
888
|
-
// XXX: Internet Explorer blows
|
889
|
-
//
|
890
|
-
if (MochiKit.__export__) {
|
891
|
-
connect = MochiKit.Signal.connect;
|
892
|
-
disconnect = MochiKit.Signal.disconnect;
|
893
|
-
disconnectAll = MochiKit.Signal.disconnectAll;
|
894
|
-
signal = MochiKit.Signal.signal;
|
895
|
-
}
|
896
|
-
|
897
|
-
MochiKit.Base._exportSymbols(this, MochiKit.Signal);
|