From 36af3d4cdf6f2b2ca851558e0074d38065f5a198 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 3 Oct 2008 13:26:32 +0000 Subject: [PATCH] MDL-16784 Adding YUI 2.6.0 --- lib/yui/README.txt | 2 +- lib/yui/animation/README | 71 + lib/yui/animation/animation-debug.js | 1385 ++ lib/yui/animation/animation-min.js | 23 + lib/yui/animation/animation.js | 1381 ++ lib/yui/assets/skins/sam/asc.gif | Bin 0 -> 177 bytes lib/yui/assets/skins/sam/autocomplete.css | 7 + lib/yui/assets/skins/sam/blankimage.png | Bin 0 -> 2314 bytes lib/yui/assets/skins/sam/button.css | 7 + lib/yui/assets/skins/sam/calendar.css | 7 + lib/yui/assets/skins/sam/carousel.css | 7 + lib/yui/assets/skins/sam/colorpicker.css | 7 + lib/yui/assets/skins/sam/container.css | 7 + lib/yui/assets/skins/sam/datatable.css | 7 + lib/yui/assets/skins/sam/desc.gif | Bin 0 -> 177 bytes lib/yui/assets/skins/sam/dt-arrow-dn.png | Bin 0 -> 116 bytes lib/yui/assets/skins/sam/dt-arrow-up.png | Bin 0 -> 116 bytes lib/yui/assets/skins/sam/editor-knob.gif | Bin 0 -> 138 bytes .../assets/skins/sam/editor-sprite-active.gif | Bin 0 -> 5614 bytes lib/yui/assets/skins/sam/editor-sprite.gif | Bin 0 -> 5690 bytes lib/yui/assets/skins/sam/editor.css | 7 + .../assets/skins/sam/header_background.png | Bin 0 -> 158 bytes lib/yui/assets/skins/sam/hue_bg.png | Bin 0 -> 1120 bytes lib/yui/assets/skins/sam/imagecropper.css | 7 + lib/yui/assets/skins/sam/layout.css | 7 + lib/yui/assets/skins/sam/layout_sprite.png | Bin 0 -> 1409 bytes lib/yui/assets/skins/sam/loading.gif | Bin 0 -> 2673 bytes lib/yui/assets/skins/sam/logger.css | 7 + .../skins/sam/menu-button-arrow-disabled.png | Bin 0 -> 173 bytes .../assets/skins/sam/menu-button-arrow.png | Bin 0 -> 173 bytes lib/yui/assets/skins/sam/menu.css | 7 + .../sam/menubaritem_submenuindicator.png | Bin 0 -> 3618 bytes .../menubaritem_submenuindicator_disabled.png | Bin 0 -> 3618 bytes .../assets/skins/sam/menuitem_checkbox.png | Bin 0 -> 3625 bytes .../skins/sam/menuitem_checkbox_disabled.png | Bin 0 -> 3625 bytes .../skins/sam/menuitem_submenuindicator.png | Bin 0 -> 3617 bytes .../menuitem_submenuindicator_disabled.png | Bin 0 -> 3617 bytes lib/yui/assets/skins/sam/paginator.css | 7 + lib/yui/assets/skins/sam/picker_mask.png | Bin 0 -> 12174 bytes lib/yui/assets/skins/sam/profilerviewer.css | 7 + lib/yui/assets/skins/sam/resize.css | 7 + lib/yui/assets/skins/sam/simpleeditor.css | 7 + lib/yui/assets/skins/sam/skin.css | 26 + lib/yui/assets/skins/sam/slider.css | 7 + .../skins/sam/split-button-arrow-active.png | Bin 0 -> 280 bytes .../skins/sam/split-button-arrow-disabled.png | Bin 0 -> 185 bytes .../skins/sam/split-button-arrow-focus.png | Bin 0 -> 185 bytes .../skins/sam/split-button-arrow-hover.png | Bin 0 -> 185 bytes .../assets/skins/sam/split-button-arrow.png | Bin 0 -> 185 bytes lib/yui/assets/skins/sam/sprite.png | Bin 0 -> 3745 bytes lib/yui/assets/skins/sam/sprite.psd | Bin 0 -> 118162 bytes lib/yui/assets/skins/sam/tabview.css | 7 + lib/yui/assets/skins/sam/treeview-loading.gif | Bin 0 -> 2673 bytes lib/yui/assets/skins/sam/treeview-sprite.gif | Bin 0 -> 4326 bytes lib/yui/assets/skins/sam/treeview.css | 7 + lib/yui/assets/skins/sam/wait.gif | Bin 0 -> 1100 bytes lib/yui/assets/skins/sam/yuitest.css | 7 + lib/yui/autocomplete/README | 212 + .../autocomplete/assets/autocomplete-core.css | 7 + .../assets/skins/sam/autocomplete-skin.css | 57 + .../assets/skins/sam/autocomplete.css | 7 + lib/yui/autocomplete/autocomplete-debug.js | 2917 +++ lib/yui/autocomplete/autocomplete-min.js | 12 + lib/yui/autocomplete/autocomplete.js | 2873 +++ lib/yui/base/README | 29 + lib/yui/base/base-min.css | 7 + lib/yui/base/base.css | 82 + lib/yui/button/README | 436 + lib/yui/button/assets/button-core.css | 44 + .../button/assets/skins/sam/button-skin.css | 240 + lib/yui/button/assets/skins/sam/button.css | 7 + .../skins/sam/menu-button-arrow-disabled.png | Bin 0 -> 173 bytes .../assets/skins/sam/menu-button-arrow.png | Bin 0 -> 173 bytes .../skins/sam/split-button-arrow-active.png | Bin 0 -> 280 bytes .../skins/sam/split-button-arrow-disabled.png | Bin 0 -> 185 bytes .../skins/sam/split-button-arrow-focus.png | Bin 0 -> 185 bytes .../skins/sam/split-button-arrow-hover.png | Bin 0 -> 185 bytes .../assets/skins/sam/split-button-arrow.png | Bin 0 -> 185 bytes lib/yui/button/button-debug.js | 4859 +++++ lib/yui/button/button-min.js | 11 + lib/yui/button/button.js | 4798 +++++ lib/yui/calendar/README | 421 + lib/yui/calendar/assets/calendar-core.css | 132 + lib/yui/calendar/assets/calendar.css | 320 + lib/yui/calendar/assets/calgrad.png | Bin 0 -> 497 bytes lib/yui/calendar/assets/callt.gif | Bin 0 -> 93 bytes lib/yui/calendar/assets/calrt.gif | Bin 0 -> 94 bytes lib/yui/calendar/assets/calx.gif | Bin 0 -> 88 bytes .../assets/skins/sam/calendar-skin.css | 361 + .../calendar/assets/skins/sam/calendar.css | 7 + lib/yui/calendar/calendar-debug.js | 7168 +++++++ lib/yui/calendar/calendar-min.js | 18 + lib/yui/calendar/calendar.js | 7138 +++++++ lib/yui/carousel/README | 5 + lib/yui/carousel/assets/ajax-loader.gif | Bin 0 -> 3208 bytes lib/yui/carousel/assets/carousel-core.css | 82 + .../assets/skins/sam/carousel-skin.css | 119 + .../carousel/assets/skins/sam/carousel.css | 7 + lib/yui/carousel/carousel-beta-debug.js | 2945 +++ lib/yui/carousel/carousel-beta-min.js | 11 + lib/yui/carousel/carousel-beta.js | 2913 +++ lib/yui/charts/README | 38 + lib/yui/charts/assets/charts.swf | Bin 0 -> 67900 bytes lib/yui/charts/charts-experimental-debug.js | 2291 +++ lib/yui/charts/charts-experimental-min.js | 16 + lib/yui/charts/charts-experimental.js | 2287 +++ lib/yui/colorpicker/README | 21 + .../colorpicker/assets/colorpicker-core.css | 6 + lib/yui/colorpicker/assets/hue_thumb.png | Bin 0 -> 195 bytes lib/yui/colorpicker/assets/picker_mask.png | Bin 0 -> 12174 bytes lib/yui/colorpicker/assets/picker_thumb.png | Bin 0 -> 192 bytes .../assets/skins/sam/colorpicker-skin.css | 105 + .../assets/skins/sam/colorpicker.css | 7 + .../colorpicker/assets/skins/sam/hue_bg.png | Bin 0 -> 1120 bytes .../assets/skins/sam/picker_mask.png | Bin 0 -> 12174 bytes lib/yui/colorpicker/colorpicker-debug.js | 1755 ++ lib/yui/colorpicker/colorpicker-min.js | 9 + lib/yui/colorpicker/colorpicker.js | 1735 ++ lib/yui/connection/README | 302 + lib/yui/connection/connection-debug.js | 1409 ++ lib/yui/connection/connection-min.js | 8 + lib/yui/connection/connection.js | 1379 ++ lib/yui/container/README | 1129 + lib/yui/container/assets/alrt16_1.gif | Bin 0 -> 971 bytes lib/yui/container/assets/blck16_1.gif | Bin 0 -> 591 bytes lib/yui/container/assets/close12_1.gif | Bin 0 -> 85 bytes lib/yui/container/assets/container-core.css | 168 + lib/yui/container/assets/container.css | 325 + lib/yui/container/assets/hlp16_1.gif | Bin 0 -> 928 bytes lib/yui/container/assets/info16_1.gif | Bin 0 -> 601 bytes .../assets/skins/sam/container-skin.css | 242 + .../container/assets/skins/sam/container.css | 7 + lib/yui/container/assets/tip16_1.gif | Bin 0 -> 552 bytes lib/yui/container/assets/warn16_1.gif | Bin 0 -> 580 bytes lib/yui/container/container-debug.js | 8861 ++++++++ lib/yui/container/container-min.js | 19 + lib/yui/container/container.js | 8837 ++++++++ lib/yui/container/container_core-debug.js | 5059 +++++ lib/yui/container/container_core-min.js | 13 + lib/yui/container/container_core.js | 5049 +++++ lib/yui/cookie/README | 20 + lib/yui/cookie/cookie-debug.js | 424 + lib/yui/cookie/cookie-min.js | 7 + lib/yui/cookie/cookie.js | 424 + lib/yui/datasource/README | 140 + lib/yui/datasource/datasource-debug.js | 2886 +++ lib/yui/datasource/datasource-min.js | 11 + lib/yui/datasource/datasource.js | 2816 +++ lib/yui/datatable/README | 446 + lib/yui/datatable/assets/datatable-core.css | 86 + lib/yui/datatable/assets/datatable.css | 49 + .../assets/skins/sam/datatable-skin.css | 243 + .../datatable/assets/skins/sam/datatable.css | 7 + .../assets/skins/sam/dt-arrow-dn.png | Bin 0 -> 116 bytes .../assets/skins/sam/dt-arrow-up.png | Bin 0 -> 116 bytes lib/yui/datatable/datatable-debug.js | 16962 ++++++++++++++++ lib/yui/datatable/datatable-min.js | 29 + lib/yui/datatable/datatable.js | 16725 +++++++++++++++ lib/yui/dom/README | 135 + lib/yui/dom/dom-debug.js | 1277 ++ lib/yui/dom/dom-min.js | 8 + lib/yui/dom/dom.js | 1241 ++ lib/yui/dragdrop/README | 180 + lib/yui/dragdrop/dragdrop-debug.js | 3731 ++++ lib/yui/dragdrop/dragdrop-min.js | 10 + lib/yui/dragdrop/dragdrop.js | 3622 ++++ lib/yui/editor/README | 270 + lib/yui/editor/assets/editor-core.css | 573 + lib/yui/editor/assets/simpleeditor-core.css | 573 + .../editor/assets/skins/sam/blankimage.png | Bin 0 -> 2314 bytes .../editor/assets/skins/sam/editor-knob.gif | Bin 0 -> 138 bytes .../editor/assets/skins/sam/editor-skin.css | 707 + .../assets/skins/sam/editor-sprite-active.gif | Bin 0 -> 5614 bytes .../editor/assets/skins/sam/editor-sprite.gif | Bin 0 -> 5690 bytes lib/yui/editor/assets/skins/sam/editor.css | 7 + .../assets/skins/sam/simpleeditor-skin.css | 707 + .../editor/assets/skins/sam/simpleeditor.css | 7 + lib/yui/editor/editor-debug.js | 8994 ++++++++ lib/yui/editor/editor-min.js | 28 + lib/yui/editor/editor.js | 8891 ++++++++ lib/yui/editor/simpleeditor-debug.js | 6971 +++++++ lib/yui/editor/simpleeditor-min.js | 23 + lib/yui/editor/simpleeditor.js | 6890 +++++++ lib/yui/element/README | 34 + lib/yui/element/element-beta-debug.js | 1017 + lib/yui/element/element-beta-min.js | 8 + lib/yui/element/element-beta.js | 1003 + lib/yui/event/README | 252 + lib/yui/event/event-debug.js | 2587 +++ lib/yui/event/event-min.js | 11 + lib/yui/event/event.js | 2562 +++ lib/yui/fonts/README | 50 + lib/yui/fonts/fonts-min.css | 7 + lib/yui/fonts/fonts.css | 46 + lib/yui/get/README | 25 + lib/yui/get/get-debug.js | 742 + lib/yui/get/get-min.js | 7 + lib/yui/get/get.js | 724 + lib/yui/grids/README | 86 + lib/yui/grids/grids-min.css | 7 + lib/yui/grids/grids.css | 285 + lib/yui/history/README | 62 + lib/yui/history/assets/blank.html | 1 + lib/yui/history/history-debug.js | 789 + lib/yui/history/history-min.js | 7 + lib/yui/history/history.js | 788 + lib/yui/imagecropper/README | 22 + .../imagecropper/assets/imagecropper-core.css | 33 + .../assets/skins/sam/imagecropper-skin.css | 16 + .../assets/skins/sam/imagecropper.css | 7 + .../imagecropper/imagecropper-beta-debug.js | 907 + lib/yui/imagecropper/imagecropper-beta-min.js | 8 + lib/yui/imagecropper/imagecropper-beta.js | 889 + lib/yui/imageloader/README | 23 + lib/yui/imageloader/imageloader-debug.js | 487 + lib/yui/imageloader/imageloader-min.js | 7 + lib/yui/imageloader/imageloader.js | 481 + lib/yui/json/README | 22 + lib/yui/json/json-debug.js | 396 + lib/yui/json/json-min.js | 7 + lib/yui/json/json.js | 396 + lib/yui/layout/README | 28 + lib/yui/layout/assets/layout-core.css | 158 + .../layout/assets/skins/sam/layout-skin.css | 198 + lib/yui/layout/assets/skins/sam/layout.css | 7 + .../layout/assets/skins/sam/layout_sprite.png | Bin 0 -> 1409 bytes lib/yui/layout/layout-debug.js | 2245 ++ lib/yui/layout/layout-min.js | 11 + lib/yui/layout/layout.js | 2230 ++ lib/yui/logger/README | 116 + lib/yui/logger/assets/logger-core.css | 7 + lib/yui/logger/assets/logger.css | 57 + .../logger/assets/skins/sam/logger-skin.css | 55 + lib/yui/logger/assets/skins/sam/logger.css | 7 + lib/yui/logger/logger-debug.js | 2044 ++ lib/yui/logger/logger-min.js | 9 + lib/yui/logger/logger.js | 2044 ++ lib/yui/menu/README | 1130 + lib/yui/menu/assets/menu-core.css | 238 + lib/yui/menu/assets/menu.css | 497 + lib/yui/menu/assets/menu_down_arrow.png | Bin 0 -> 3624 bytes .../menu/assets/menu_down_arrow_disabled.png | Bin 0 -> 3621 bytes lib/yui/menu/assets/menu_up_arrow.png | Bin 0 -> 936 bytes .../menu/assets/menu_up_arrow_disabled.png | Bin 0 -> 936 bytes .../assets/menubaritem_submenuindicator.png | Bin 0 -> 3623 bytes .../menubaritem_submenuindicator_disabled.png | Bin 0 -> 3623 bytes .../menubaritem_submenuindicator_selected.png | Bin 0 -> 3623 bytes lib/yui/menu/assets/menuitem_checkbox.png | Bin 0 -> 956 bytes .../assets/menuitem_checkbox_disabled.png | Bin 0 -> 956 bytes .../assets/menuitem_checkbox_selected.png | Bin 0 -> 956 bytes .../menu/assets/menuitem_submenuindicator.png | Bin 0 -> 942 bytes .../menuitem_submenuindicator_disabled.png | Bin 0 -> 942 bytes .../menuitem_submenuindicator_selected.png | Bin 0 -> 942 bytes lib/yui/menu/assets/skins/sam/menu-skin.css | 325 + lib/yui/menu/assets/skins/sam/menu.css | 7 + .../sam/menubaritem_submenuindicator.png | Bin 0 -> 3618 bytes .../menubaritem_submenuindicator_disabled.png | Bin 0 -> 3618 bytes .../assets/skins/sam/menuitem_checkbox.png | Bin 0 -> 3625 bytes .../skins/sam/menuitem_checkbox_disabled.png | Bin 0 -> 3625 bytes .../skins/sam/menuitem_submenuindicator.png | Bin 0 -> 3617 bytes .../menuitem_submenuindicator_disabled.png | Bin 0 -> 3617 bytes lib/yui/menu/menu-debug.js | 9666 +++++++++ lib/yui/menu/menu-min.js | 15 + lib/yui/menu/menu.js | 9619 +++++++++ lib/yui/paginator/README | 5 + lib/yui/paginator/assets/paginator-core.css | 6 + .../assets/skins/sam/paginator-skin.css | 78 + .../paginator/assets/skins/sam/paginator.css | 7 + lib/yui/paginator/paginator-debug.js | 2314 +++ lib/yui/paginator/paginator-min.js | 10 + lib/yui/paginator/paginator.js | 2314 +++ lib/yui/profiler/README | 14 + lib/yui/profiler/profiler-debug.js | 380 + lib/yui/profiler/profiler-min.js | 7 + lib/yui/profiler/profiler.js | 380 + lib/yui/profilerviewer/README | 9 + .../profilerviewer/assets/skins/sam/asc.gif | Bin 0 -> 177 bytes .../profilerviewer/assets/skins/sam/desc.gif | Bin 0 -> 177 bytes .../assets/skins/sam/header_background.png | Bin 0 -> 158 bytes .../assets/skins/sam/profilerviewer.css | 7 + .../profilerviewer/assets/skins/sam/wait.gif | Bin 0 -> 1100 bytes .../profilerviewer-beta-debug.js | 1227 ++ .../profilerviewer/profilerviewer-beta-min.js | 9 + lib/yui/profilerviewer/profilerviewer-beta.js | 1190 ++ lib/yui/reset-fonts-grids/README | 32 + .../reset-fonts-grids/reset-fonts-grids.css | 7 + lib/yui/reset-fonts/README | 19 + lib/yui/reset-fonts/reset-fonts.css | 7 + lib/yui/reset/README | 64 + lib/yui/reset/reset-min.css | 7 + lib/yui/reset/reset.css | 25 + lib/yui/resize/README | 24 + lib/yui/resize/assets/resize-core.css | 173 + .../resize/assets/skins/sam/layout_sprite.png | Bin 0 -> 1409 bytes .../resize/assets/skins/sam/resize-skin.css | 129 + lib/yui/resize/assets/skins/sam/resize.css | 7 + lib/yui/resize/resize-debug.js | 1740 ++ lib/yui/resize/resize-min.js | 10 + lib/yui/resize/resize.js | 1680 ++ lib/yui/selector/README | 23 + lib/yui/selector/selector-beta-debug.js | 673 + lib/yui/selector/selector-beta-min.js | 8 + lib/yui/selector/selector-beta.js | 666 + lib/yui/slider/README | 114 + lib/yui/slider/assets/bg-fader.gif | Bin 0 -> 433 bytes lib/yui/slider/assets/bg-h.gif | Bin 0 -> 212 bytes lib/yui/slider/assets/bg-v-e.gif | Bin 0 -> 476 bytes lib/yui/slider/assets/bg-v.gif | Bin 0 -> 481 bytes lib/yui/slider/assets/left-thumb.png | Bin 0 -> 348 bytes lib/yui/slider/assets/right-thumb.png | Bin 0 -> 356 bytes .../slider/assets/skins/sam/slider-skin.css | 20 + lib/yui/slider/assets/skins/sam/slider.css | 7 + lib/yui/slider/assets/slider-core.css | 15 + lib/yui/slider/assets/thumb-bar.gif | Bin 0 -> 580 bytes lib/yui/slider/assets/thumb-e.gif | Bin 0 -> 340 bytes lib/yui/slider/assets/thumb-fader.gif | Bin 0 -> 645 bytes lib/yui/slider/assets/thumb-n.gif | Bin 0 -> 612 bytes lib/yui/slider/assets/thumb-s.gif | Bin 0 -> 615 bytes lib/yui/slider/assets/thumb-w.gif | Bin 0 -> 340 bytes lib/yui/slider/slider-debug.js | 1976 ++ lib/yui/slider/slider-min.js | 9 + lib/yui/slider/slider.js | 1935 ++ lib/yui/tabview/README | 51 + lib/yui/tabview/assets/border_tabs.css | 58 + lib/yui/tabview/assets/loading.gif | Bin 0 -> 729 bytes lib/yui/tabview/assets/skin-sam.css | 77 + .../tabview/assets/skins/sam/tabview-skin.css | 187 + lib/yui/tabview/assets/skins/sam/tabview.css | 7 + lib/yui/tabview/assets/tabview-core.css | 122 + lib/yui/tabview/assets/tabview.css | 113 + lib/yui/tabview/tabview-debug.js | 949 + lib/yui/tabview/tabview-min.js | 8 + lib/yui/tabview/tabview.js | 941 + lib/yui/treeview/README | 211 + lib/yui/treeview/assets/skins/sam/loading.gif | Bin 0 -> 2673 bytes .../assets/skins/sam/treeview-loading.gif | Bin 0 -> 2673 bytes .../assets/skins/sam/treeview-skin.css | 198 + .../assets/skins/sam/treeview-sprite.gif | Bin 0 -> 4326 bytes .../treeview/assets/skins/sam/treeview.css | 7 + lib/yui/treeview/assets/sprite-menu.gif | Bin 0 -> 452 bytes lib/yui/treeview/assets/sprite-orig.gif | Bin 0 -> 3289 bytes lib/yui/treeview/assets/treeview-core.css | 6 + lib/yui/treeview/assets/treeview-loading.gif | Bin 0 -> 2673 bytes lib/yui/treeview/assets/treeview-menu.css | 65 + lib/yui/treeview/assets/treeview.css | 7 + lib/yui/treeview/treeview-debug.js | 3435 ++++ lib/yui/treeview/treeview-min.js | 11 + lib/yui/treeview/treeview.js | 3366 +++ lib/yui/uploader/README | 30 + lib/yui/uploader/assets/uploader.swf | Bin 0 -> 6754 bytes .../uploader/uploader-experimental-debug.js | 1069 + lib/yui/uploader/uploader-experimental-min.js | 14 + lib/yui/uploader/uploader-experimental.js | 1066 + lib/yui/utilities/README | 40 + lib/yui/utilities/utilities.js | 36 + lib/yui/yahoo-dom-event/README | 35 + lib/yui/yahoo-dom-event/yahoo-dom-event.js | 12 + lib/yui/yahoo/README | 106 + lib/yui/yahoo/yahoo-debug.js | 986 + lib/yui/yahoo/yahoo-min.js | 7 + lib/yui/yahoo/yahoo.js | 986 + lib/yui/yuiloader-dom-event/README | 13 + .../yuiloader-dom-event.js | 15 + lib/yui/yuiloader/README | 83 + lib/yui/yuiloader/yuiloader-debug.js | 3677 ++++ lib/yui/yuiloader/yuiloader-min.js | 10 + lib/yui/yuiloader/yuiloader.js | 3677 ++++ lib/yui/yuitest/README | 34 + .../yuitest/assets/skins/sam/yuitest-skin.css | 7 + lib/yui/yuitest/assets/skins/sam/yuitest.css | 7 + lib/yui/yuitest/assets/testlogger.css | 33 + lib/yui/yuitest/assets/yuitest-core.css | 7 + lib/yui/yuitest/yuitest-debug.js | 3370 +++ lib/yui/yuitest/yuitest-min.js | 11 + lib/yui/yuitest/yuitest.js | 3370 +++ lib/yui/yuitest/yuitest_core-debug.js | 1991 ++ lib/yui/yuitest/yuitest_core-min.js | 9 + lib/yui/yuitest/yuitest_core.js | 1991 ++ 378 files changed, 263821 insertions(+), 1 deletion(-) create mode 100755 lib/yui/animation/README create mode 100755 lib/yui/animation/animation-debug.js create mode 100755 lib/yui/animation/animation-min.js create mode 100755 lib/yui/animation/animation.js create mode 100644 lib/yui/assets/skins/sam/asc.gif create mode 100755 lib/yui/assets/skins/sam/autocomplete.css create mode 100755 lib/yui/assets/skins/sam/blankimage.png create mode 100755 lib/yui/assets/skins/sam/button.css create mode 100755 lib/yui/assets/skins/sam/calendar.css create mode 100644 lib/yui/assets/skins/sam/carousel.css create mode 100755 lib/yui/assets/skins/sam/colorpicker.css create mode 100755 lib/yui/assets/skins/sam/container.css create mode 100755 lib/yui/assets/skins/sam/datatable.css create mode 100644 lib/yui/assets/skins/sam/desc.gif create mode 100755 lib/yui/assets/skins/sam/dt-arrow-dn.png create mode 100755 lib/yui/assets/skins/sam/dt-arrow-up.png create mode 100755 lib/yui/assets/skins/sam/editor-knob.gif create mode 100755 lib/yui/assets/skins/sam/editor-sprite-active.gif create mode 100755 lib/yui/assets/skins/sam/editor-sprite.gif create mode 100755 lib/yui/assets/skins/sam/editor.css create mode 100644 lib/yui/assets/skins/sam/header_background.png create mode 100755 lib/yui/assets/skins/sam/hue_bg.png create mode 100644 lib/yui/assets/skins/sam/imagecropper.css create mode 100644 lib/yui/assets/skins/sam/layout.css create mode 100644 lib/yui/assets/skins/sam/layout_sprite.png create mode 100644 lib/yui/assets/skins/sam/loading.gif create mode 100755 lib/yui/assets/skins/sam/logger.css create mode 100755 lib/yui/assets/skins/sam/menu-button-arrow-disabled.png create mode 100755 lib/yui/assets/skins/sam/menu-button-arrow.png create mode 100755 lib/yui/assets/skins/sam/menu.css create mode 100644 lib/yui/assets/skins/sam/menubaritem_submenuindicator.png create mode 100644 lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png create mode 100644 lib/yui/assets/skins/sam/menuitem_checkbox.png create mode 100644 lib/yui/assets/skins/sam/menuitem_checkbox_disabled.png create mode 100644 lib/yui/assets/skins/sam/menuitem_submenuindicator.png create mode 100644 lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png create mode 100644 lib/yui/assets/skins/sam/paginator.css create mode 100755 lib/yui/assets/skins/sam/picker_mask.png create mode 100644 lib/yui/assets/skins/sam/profilerviewer.css create mode 100644 lib/yui/assets/skins/sam/resize.css create mode 100644 lib/yui/assets/skins/sam/simpleeditor.css create mode 100755 lib/yui/assets/skins/sam/skin.css create mode 100644 lib/yui/assets/skins/sam/slider.css create mode 100755 lib/yui/assets/skins/sam/split-button-arrow-active.png create mode 100755 lib/yui/assets/skins/sam/split-button-arrow-disabled.png create mode 100755 lib/yui/assets/skins/sam/split-button-arrow-focus.png create mode 100755 lib/yui/assets/skins/sam/split-button-arrow-hover.png create mode 100755 lib/yui/assets/skins/sam/split-button-arrow.png create mode 100755 lib/yui/assets/skins/sam/sprite.png create mode 100644 lib/yui/assets/skins/sam/sprite.psd create mode 100755 lib/yui/assets/skins/sam/tabview.css create mode 100755 lib/yui/assets/skins/sam/treeview-loading.gif create mode 100755 lib/yui/assets/skins/sam/treeview-sprite.gif create mode 100755 lib/yui/assets/skins/sam/treeview.css create mode 100644 lib/yui/assets/skins/sam/wait.gif create mode 100755 lib/yui/assets/skins/sam/yuitest.css create mode 100755 lib/yui/autocomplete/README create mode 100755 lib/yui/autocomplete/assets/autocomplete-core.css create mode 100755 lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css create mode 100755 lib/yui/autocomplete/assets/skins/sam/autocomplete.css create mode 100755 lib/yui/autocomplete/autocomplete-debug.js create mode 100755 lib/yui/autocomplete/autocomplete-min.js create mode 100755 lib/yui/autocomplete/autocomplete.js create mode 100755 lib/yui/base/README create mode 100755 lib/yui/base/base-min.css create mode 100755 lib/yui/base/base.css create mode 100755 lib/yui/button/README create mode 100755 lib/yui/button/assets/button-core.css create mode 100755 lib/yui/button/assets/skins/sam/button-skin.css create mode 100755 lib/yui/button/assets/skins/sam/button.css create mode 100755 lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png create mode 100755 lib/yui/button/assets/skins/sam/menu-button-arrow.png create mode 100755 lib/yui/button/assets/skins/sam/split-button-arrow-active.png create mode 100755 lib/yui/button/assets/skins/sam/split-button-arrow-disabled.png create mode 100755 lib/yui/button/assets/skins/sam/split-button-arrow-focus.png create mode 100755 lib/yui/button/assets/skins/sam/split-button-arrow-hover.png create mode 100755 lib/yui/button/assets/skins/sam/split-button-arrow.png create mode 100644 lib/yui/button/button-debug.js create mode 100644 lib/yui/button/button-min.js create mode 100644 lib/yui/button/button.js create mode 100755 lib/yui/calendar/README create mode 100755 lib/yui/calendar/assets/calendar-core.css create mode 100755 lib/yui/calendar/assets/calendar.css create mode 100644 lib/yui/calendar/assets/calgrad.png create mode 100755 lib/yui/calendar/assets/callt.gif create mode 100755 lib/yui/calendar/assets/calrt.gif create mode 100755 lib/yui/calendar/assets/calx.gif create mode 100755 lib/yui/calendar/assets/skins/sam/calendar-skin.css create mode 100755 lib/yui/calendar/assets/skins/sam/calendar.css create mode 100755 lib/yui/calendar/calendar-debug.js create mode 100755 lib/yui/calendar/calendar-min.js create mode 100755 lib/yui/calendar/calendar.js create mode 100644 lib/yui/carousel/README create mode 100644 lib/yui/carousel/assets/ajax-loader.gif create mode 100644 lib/yui/carousel/assets/carousel-core.css create mode 100644 lib/yui/carousel/assets/skins/sam/carousel-skin.css create mode 100644 lib/yui/carousel/assets/skins/sam/carousel.css create mode 100644 lib/yui/carousel/carousel-beta-debug.js create mode 100644 lib/yui/carousel/carousel-beta-min.js create mode 100644 lib/yui/carousel/carousel-beta.js create mode 100644 lib/yui/charts/README create mode 100644 lib/yui/charts/assets/charts.swf create mode 100644 lib/yui/charts/charts-experimental-debug.js create mode 100644 lib/yui/charts/charts-experimental-min.js create mode 100644 lib/yui/charts/charts-experimental.js create mode 100755 lib/yui/colorpicker/README create mode 100644 lib/yui/colorpicker/assets/colorpicker-core.css create mode 100755 lib/yui/colorpicker/assets/hue_thumb.png create mode 100755 lib/yui/colorpicker/assets/picker_mask.png create mode 100755 lib/yui/colorpicker/assets/picker_thumb.png create mode 100755 lib/yui/colorpicker/assets/skins/sam/colorpicker-skin.css create mode 100755 lib/yui/colorpicker/assets/skins/sam/colorpicker.css create mode 100755 lib/yui/colorpicker/assets/skins/sam/hue_bg.png create mode 100755 lib/yui/colorpicker/assets/skins/sam/picker_mask.png create mode 100644 lib/yui/colorpicker/colorpicker-debug.js create mode 100644 lib/yui/colorpicker/colorpicker-min.js create mode 100644 lib/yui/colorpicker/colorpicker.js create mode 100755 lib/yui/connection/README create mode 100755 lib/yui/connection/connection-debug.js create mode 100755 lib/yui/connection/connection-min.js create mode 100755 lib/yui/connection/connection.js create mode 100755 lib/yui/container/README create mode 100755 lib/yui/container/assets/alrt16_1.gif create mode 100755 lib/yui/container/assets/blck16_1.gif create mode 100755 lib/yui/container/assets/close12_1.gif create mode 100755 lib/yui/container/assets/container-core.css create mode 100755 lib/yui/container/assets/container.css create mode 100755 lib/yui/container/assets/hlp16_1.gif create mode 100755 lib/yui/container/assets/info16_1.gif create mode 100755 lib/yui/container/assets/skins/sam/container-skin.css create mode 100755 lib/yui/container/assets/skins/sam/container.css create mode 100755 lib/yui/container/assets/tip16_1.gif create mode 100755 lib/yui/container/assets/warn16_1.gif create mode 100755 lib/yui/container/container-debug.js create mode 100755 lib/yui/container/container-min.js create mode 100755 lib/yui/container/container.js create mode 100755 lib/yui/container/container_core-debug.js create mode 100755 lib/yui/container/container_core-min.js create mode 100755 lib/yui/container/container_core.js create mode 100644 lib/yui/cookie/README create mode 100644 lib/yui/cookie/cookie-debug.js create mode 100644 lib/yui/cookie/cookie-min.js create mode 100644 lib/yui/cookie/cookie.js create mode 100755 lib/yui/datasource/README create mode 100644 lib/yui/datasource/datasource-debug.js create mode 100644 lib/yui/datasource/datasource-min.js create mode 100644 lib/yui/datasource/datasource.js create mode 100755 lib/yui/datatable/README create mode 100755 lib/yui/datatable/assets/datatable-core.css create mode 100755 lib/yui/datatable/assets/datatable.css create mode 100755 lib/yui/datatable/assets/skins/sam/datatable-skin.css create mode 100755 lib/yui/datatable/assets/skins/sam/datatable.css create mode 100755 lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png create mode 100755 lib/yui/datatable/assets/skins/sam/dt-arrow-up.png create mode 100644 lib/yui/datatable/datatable-debug.js create mode 100644 lib/yui/datatable/datatable-min.js create mode 100644 lib/yui/datatable/datatable.js create mode 100755 lib/yui/dom/README create mode 100755 lib/yui/dom/dom-debug.js create mode 100755 lib/yui/dom/dom-min.js create mode 100755 lib/yui/dom/dom.js create mode 100755 lib/yui/dragdrop/README create mode 100755 lib/yui/dragdrop/dragdrop-debug.js create mode 100755 lib/yui/dragdrop/dragdrop-min.js create mode 100755 lib/yui/dragdrop/dragdrop.js create mode 100755 lib/yui/editor/README create mode 100755 lib/yui/editor/assets/editor-core.css create mode 100644 lib/yui/editor/assets/simpleeditor-core.css create mode 100755 lib/yui/editor/assets/skins/sam/blankimage.png create mode 100755 lib/yui/editor/assets/skins/sam/editor-knob.gif create mode 100755 lib/yui/editor/assets/skins/sam/editor-skin.css create mode 100755 lib/yui/editor/assets/skins/sam/editor-sprite-active.gif create mode 100755 lib/yui/editor/assets/skins/sam/editor-sprite.gif create mode 100755 lib/yui/editor/assets/skins/sam/editor.css create mode 100644 lib/yui/editor/assets/skins/sam/simpleeditor-skin.css create mode 100644 lib/yui/editor/assets/skins/sam/simpleeditor.css create mode 100644 lib/yui/editor/editor-debug.js create mode 100644 lib/yui/editor/editor-min.js create mode 100644 lib/yui/editor/editor.js create mode 100644 lib/yui/editor/simpleeditor-debug.js create mode 100644 lib/yui/editor/simpleeditor-min.js create mode 100644 lib/yui/editor/simpleeditor.js create mode 100755 lib/yui/element/README create mode 100755 lib/yui/element/element-beta-debug.js create mode 100755 lib/yui/element/element-beta-min.js create mode 100755 lib/yui/element/element-beta.js create mode 100755 lib/yui/event/README create mode 100755 lib/yui/event/event-debug.js create mode 100755 lib/yui/event/event-min.js create mode 100755 lib/yui/event/event.js create mode 100755 lib/yui/fonts/README create mode 100755 lib/yui/fonts/fonts-min.css create mode 100755 lib/yui/fonts/fonts.css create mode 100644 lib/yui/get/README create mode 100644 lib/yui/get/get-debug.js create mode 100644 lib/yui/get/get-min.js create mode 100644 lib/yui/get/get.js create mode 100755 lib/yui/grids/README create mode 100755 lib/yui/grids/grids-min.css create mode 100755 lib/yui/grids/grids.css create mode 100755 lib/yui/history/README create mode 100755 lib/yui/history/assets/blank.html create mode 100644 lib/yui/history/history-debug.js create mode 100644 lib/yui/history/history-min.js create mode 100644 lib/yui/history/history.js create mode 100644 lib/yui/imagecropper/README create mode 100644 lib/yui/imagecropper/assets/imagecropper-core.css create mode 100644 lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css create mode 100644 lib/yui/imagecropper/assets/skins/sam/imagecropper.css create mode 100644 lib/yui/imagecropper/imagecropper-beta-debug.js create mode 100644 lib/yui/imagecropper/imagecropper-beta-min.js create mode 100644 lib/yui/imagecropper/imagecropper-beta.js create mode 100755 lib/yui/imageloader/README create mode 100644 lib/yui/imageloader/imageloader-debug.js create mode 100644 lib/yui/imageloader/imageloader-min.js create mode 100644 lib/yui/imageloader/imageloader.js create mode 100644 lib/yui/json/README create mode 100644 lib/yui/json/json-debug.js create mode 100644 lib/yui/json/json-min.js create mode 100644 lib/yui/json/json.js create mode 100644 lib/yui/layout/README create mode 100644 lib/yui/layout/assets/layout-core.css create mode 100644 lib/yui/layout/assets/skins/sam/layout-skin.css create mode 100644 lib/yui/layout/assets/skins/sam/layout.css create mode 100644 lib/yui/layout/assets/skins/sam/layout_sprite.png create mode 100644 lib/yui/layout/layout-debug.js create mode 100644 lib/yui/layout/layout-min.js create mode 100644 lib/yui/layout/layout.js create mode 100755 lib/yui/logger/README create mode 100755 lib/yui/logger/assets/logger-core.css create mode 100755 lib/yui/logger/assets/logger.css create mode 100755 lib/yui/logger/assets/skins/sam/logger-skin.css create mode 100755 lib/yui/logger/assets/skins/sam/logger.css create mode 100755 lib/yui/logger/logger-debug.js create mode 100755 lib/yui/logger/logger-min.js create mode 100755 lib/yui/logger/logger.js create mode 100755 lib/yui/menu/README create mode 100755 lib/yui/menu/assets/menu-core.css create mode 100755 lib/yui/menu/assets/menu.css create mode 100644 lib/yui/menu/assets/menu_down_arrow.png create mode 100644 lib/yui/menu/assets/menu_down_arrow_disabled.png create mode 100644 lib/yui/menu/assets/menu_up_arrow.png create mode 100644 lib/yui/menu/assets/menu_up_arrow_disabled.png create mode 100644 lib/yui/menu/assets/menubaritem_submenuindicator.png create mode 100644 lib/yui/menu/assets/menubaritem_submenuindicator_disabled.png create mode 100644 lib/yui/menu/assets/menubaritem_submenuindicator_selected.png create mode 100644 lib/yui/menu/assets/menuitem_checkbox.png create mode 100644 lib/yui/menu/assets/menuitem_checkbox_disabled.png create mode 100644 lib/yui/menu/assets/menuitem_checkbox_selected.png create mode 100644 lib/yui/menu/assets/menuitem_submenuindicator.png create mode 100644 lib/yui/menu/assets/menuitem_submenuindicator_disabled.png create mode 100644 lib/yui/menu/assets/menuitem_submenuindicator_selected.png create mode 100755 lib/yui/menu/assets/skins/sam/menu-skin.css create mode 100755 lib/yui/menu/assets/skins/sam/menu.css create mode 100644 lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator.png create mode 100644 lib/yui/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png create mode 100644 lib/yui/menu/assets/skins/sam/menuitem_checkbox.png create mode 100644 lib/yui/menu/assets/skins/sam/menuitem_checkbox_disabled.png create mode 100644 lib/yui/menu/assets/skins/sam/menuitem_submenuindicator.png create mode 100644 lib/yui/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png create mode 100755 lib/yui/menu/menu-debug.js create mode 100755 lib/yui/menu/menu-min.js create mode 100755 lib/yui/menu/menu.js create mode 100644 lib/yui/paginator/README create mode 100644 lib/yui/paginator/assets/paginator-core.css create mode 100644 lib/yui/paginator/assets/skins/sam/paginator-skin.css create mode 100644 lib/yui/paginator/assets/skins/sam/paginator.css create mode 100644 lib/yui/paginator/paginator-debug.js create mode 100644 lib/yui/paginator/paginator-min.js create mode 100644 lib/yui/paginator/paginator.js create mode 100644 lib/yui/profiler/README create mode 100644 lib/yui/profiler/profiler-debug.js create mode 100644 lib/yui/profiler/profiler-min.js create mode 100644 lib/yui/profiler/profiler.js create mode 100644 lib/yui/profilerviewer/README create mode 100644 lib/yui/profilerviewer/assets/skins/sam/asc.gif create mode 100644 lib/yui/profilerviewer/assets/skins/sam/desc.gif create mode 100644 lib/yui/profilerviewer/assets/skins/sam/header_background.png create mode 100644 lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css create mode 100644 lib/yui/profilerviewer/assets/skins/sam/wait.gif create mode 100644 lib/yui/profilerviewer/profilerviewer-beta-debug.js create mode 100644 lib/yui/profilerviewer/profilerviewer-beta-min.js create mode 100644 lib/yui/profilerviewer/profilerviewer-beta.js create mode 100755 lib/yui/reset-fonts-grids/README create mode 100755 lib/yui/reset-fonts-grids/reset-fonts-grids.css create mode 100644 lib/yui/reset-fonts/README create mode 100644 lib/yui/reset-fonts/reset-fonts.css create mode 100755 lib/yui/reset/README create mode 100755 lib/yui/reset/reset-min.css create mode 100755 lib/yui/reset/reset.css create mode 100644 lib/yui/resize/README create mode 100644 lib/yui/resize/assets/resize-core.css create mode 100644 lib/yui/resize/assets/skins/sam/layout_sprite.png create mode 100644 lib/yui/resize/assets/skins/sam/resize-skin.css create mode 100644 lib/yui/resize/assets/skins/sam/resize.css create mode 100644 lib/yui/resize/resize-debug.js create mode 100644 lib/yui/resize/resize-min.js create mode 100644 lib/yui/resize/resize.js create mode 100644 lib/yui/selector/README create mode 100644 lib/yui/selector/selector-beta-debug.js create mode 100644 lib/yui/selector/selector-beta-min.js create mode 100644 lib/yui/selector/selector-beta.js create mode 100755 lib/yui/slider/README create mode 100644 lib/yui/slider/assets/bg-fader.gif create mode 100644 lib/yui/slider/assets/bg-h.gif create mode 100644 lib/yui/slider/assets/bg-v-e.gif create mode 100644 lib/yui/slider/assets/bg-v.gif create mode 100644 lib/yui/slider/assets/left-thumb.png create mode 100644 lib/yui/slider/assets/right-thumb.png create mode 100644 lib/yui/slider/assets/skins/sam/slider-skin.css create mode 100644 lib/yui/slider/assets/skins/sam/slider.css create mode 100644 lib/yui/slider/assets/slider-core.css create mode 100644 lib/yui/slider/assets/thumb-bar.gif create mode 100644 lib/yui/slider/assets/thumb-e.gif create mode 100644 lib/yui/slider/assets/thumb-fader.gif create mode 100644 lib/yui/slider/assets/thumb-n.gif create mode 100644 lib/yui/slider/assets/thumb-s.gif create mode 100644 lib/yui/slider/assets/thumb-w.gif create mode 100755 lib/yui/slider/slider-debug.js create mode 100755 lib/yui/slider/slider-min.js create mode 100755 lib/yui/slider/slider.js create mode 100755 lib/yui/tabview/README create mode 100755 lib/yui/tabview/assets/border_tabs.css create mode 100755 lib/yui/tabview/assets/loading.gif create mode 100755 lib/yui/tabview/assets/skin-sam.css create mode 100755 lib/yui/tabview/assets/skins/sam/tabview-skin.css create mode 100755 lib/yui/tabview/assets/skins/sam/tabview.css create mode 100755 lib/yui/tabview/assets/tabview-core.css create mode 100644 lib/yui/tabview/assets/tabview.css create mode 100755 lib/yui/tabview/tabview-debug.js create mode 100755 lib/yui/tabview/tabview-min.js create mode 100755 lib/yui/tabview/tabview.js create mode 100755 lib/yui/treeview/README create mode 100644 lib/yui/treeview/assets/skins/sam/loading.gif create mode 100755 lib/yui/treeview/assets/skins/sam/treeview-loading.gif create mode 100755 lib/yui/treeview/assets/skins/sam/treeview-skin.css create mode 100755 lib/yui/treeview/assets/skins/sam/treeview-sprite.gif create mode 100755 lib/yui/treeview/assets/skins/sam/treeview.css create mode 100644 lib/yui/treeview/assets/sprite-menu.gif create mode 100755 lib/yui/treeview/assets/sprite-orig.gif create mode 100755 lib/yui/treeview/assets/treeview-core.css create mode 100755 lib/yui/treeview/assets/treeview-loading.gif create mode 100644 lib/yui/treeview/assets/treeview-menu.css create mode 100755 lib/yui/treeview/assets/treeview.css create mode 100755 lib/yui/treeview/treeview-debug.js create mode 100755 lib/yui/treeview/treeview-min.js create mode 100755 lib/yui/treeview/treeview.js create mode 100644 lib/yui/uploader/README create mode 100644 lib/yui/uploader/assets/uploader.swf create mode 100644 lib/yui/uploader/uploader-experimental-debug.js create mode 100644 lib/yui/uploader/uploader-experimental-min.js create mode 100644 lib/yui/uploader/uploader-experimental.js create mode 100755 lib/yui/utilities/README create mode 100755 lib/yui/utilities/utilities.js create mode 100755 lib/yui/yahoo-dom-event/README create mode 100755 lib/yui/yahoo-dom-event/yahoo-dom-event.js create mode 100755 lib/yui/yahoo/README create mode 100755 lib/yui/yahoo/yahoo-debug.js create mode 100755 lib/yui/yahoo/yahoo-min.js create mode 100755 lib/yui/yahoo/yahoo.js create mode 100644 lib/yui/yuiloader-dom-event/README create mode 100644 lib/yui/yuiloader-dom-event/yuiloader-dom-event.js create mode 100755 lib/yui/yuiloader/README create mode 100644 lib/yui/yuiloader/yuiloader-debug.js create mode 100644 lib/yui/yuiloader/yuiloader-min.js create mode 100644 lib/yui/yuiloader/yuiloader.js create mode 100755 lib/yui/yuitest/README create mode 100755 lib/yui/yuitest/assets/skins/sam/yuitest-skin.css create mode 100755 lib/yui/yuitest/assets/skins/sam/yuitest.css create mode 100755 lib/yui/yuitest/assets/testlogger.css create mode 100755 lib/yui/yuitest/assets/yuitest-core.css create mode 100644 lib/yui/yuitest/yuitest-debug.js create mode 100644 lib/yui/yuitest/yuitest-min.js create mode 100644 lib/yui/yuitest/yuitest.js create mode 100644 lib/yui/yuitest/yuitest_core-debug.js create mode 100644 lib/yui/yuitest/yuitest_core-min.js create mode 100644 lib/yui/yuitest/yuitest_core.js diff --git a/lib/yui/README.txt b/lib/yui/README.txt index 7c891ccc12..d1e35ad849 100644 --- a/lib/yui/README.txt +++ b/lib/yui/README.txt @@ -10,5 +10,5 @@ Updated to YUI 0.12.0, 23 November 2006 Updated to YUI 0.12.1, 8 January 2007 Updated to YUI 0.12.2, 8 Febuary 2007 Updated to YUI 2.3.0, 3 August 2007 -Updated to YUI 2.5.0, 7 March 2008 Updated to YUI 2.5.2, 25 July 2008 +Updated to YUI 2.6.0, 03 October 2008 diff --git a/lib/yui/animation/README b/lib/yui/animation/README new file mode 100755 index 0000000000..113994467d --- /dev/null +++ b/lib/yui/animation/README @@ -0,0 +1,71 @@ +Animation Release Notes + +*** version 2.6.0 *** +* ColorAnim updated to use getAncestorBy + +*** version 2.5.2 *** +* no change + +*** version 2.5.1 *** +* no change + +*** version 2.5.0 *** +* replace toString overrides with static NAME property + +*** version 2.4.0 *** +* calling stop() on an non-animated Anim no longer fires onComplete + +*** version 2.3.1 *** +* no change + +*** version 2.3.0 *** + +* duration of zero now executes 1 frame animation +* added setEl() method to enable reuse +* fixed stop() for multiple animations + +*** version 2.3.0 *** +* duration of zero now executes 1 frame animation +* added setEl() method to enable reuse +* fixed stop() for multiple animations + +*** version 2.2.2 *** +* no change + +*** version 2.2.1 *** +* no change + +*** version 2.2.0 *** +* Fixed AnimMgr.stop() when called without tween + +*** version 0.12.2 *** +* raised AnimMgr.fps to 1000 + +*** version 0.12.1 *** +* minified version no longer strips line breaks + +*** version 0.12.0 *** +* added boolean finish argument to Anim.stop() + +*** version 0.11.3 *** +* no changes + +*** version 0.11.1 *** +* changed "prototype" shorthand to "proto" (workaround firefox < 1.5 scoping +bug) + +*** version 0.11.0 *** +* ColorAnim subclass added +* Motion and Scroll now inherit from ColorAnim +* getDefaultUnit method added +* defaultUnit and defaultUnits deprecated +* getDefault and setDefault methods deprecated + +*** version 0.10.0 *** +* Scroll now handles relative ("by") animation correctly +* Now converts "auto" values of "from" to appropriate initial values + +*** version 0.9.0 *** +* Initial release + + diff --git a/lib/yui/animation/animation-debug.js b/lib/yui/animation/animation-debug.js new file mode 100755 index 0000000000..c85005d239 --- /dev/null +++ b/lib/yui/animation/animation-debug.js @@ -0,0 +1,1385 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +(function() { + +var Y = YAHOO.util; + +/* +Copyright (c) 2006, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +*/ + +/** + * The animation module provides allows effects to be added to HTMLElements. + * @module animation + * @requires yahoo, event, dom + */ + +/** + * + * Base animation class that provides the interface for building animated effects. + *

Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);

+ * @class Anim + * @namespace YAHOO.util + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @requires YAHOO.util.CustomEvent + * @constructor + * @param {String | HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + +var Anim = function(el, attributes, duration, method) { + if (!el) { + YAHOO.log('element required to create Anim instance', 'error', 'Anim'); + } + this.init(el, attributes, duration, method); +}; + +Anim.NAME = 'Anim'; + +Anim.prototype = { + /** + * Provides a readable name for the Anim instance. + * @method toString + * @return {String} + */ + toString: function() { + var el = this.getEl() || {}; + var id = el.id || el.tagName; + return (this.constructor.NAME + ': ' + id); + }, + + patterns: { // cached for performance + noNegatives: /width|height|opacity|padding/i, // keep at zero or above + offsetAttribute: /^((width|height)|(top|left))$/, // use offsetValue as default + defaultUnit: /width|height|top$|bottom$|left$|right$/i, // use 'px' by default + offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i // IE may return these, so convert these to offset + }, + + /** + * Returns the value computed by the animation's "method". + * @method doMethod + * @param {String} attr The name of the attribute. + * @param {Number} start The value this attribute should start from for this animation. + * @param {Number} end The value this attribute should end at for this animation. + * @return {Number} The Value to be applied to the attribute. + */ + doMethod: function(attr, start, end) { + return this.method(this.currentFrame, start, end - start, this.totalFrames); + }, + + /** + * Applies a value to an attribute. + * @method setAttribute + * @param {String} attr The name of the attribute. + * @param {Number} val The value to be applied to the attribute. + * @param {String} unit The unit ('px', '%', etc.) of the value. + */ + setAttribute: function(attr, val, unit) { + if ( this.patterns.noNegatives.test(attr) ) { + val = (val > 0) ? val : 0; + } + + Y.Dom.setStyle(this.getEl(), attr, val + unit); + }, + + /** + * Returns current value of the attribute. + * @method getAttribute + * @param {String} attr The name of the attribute. + * @return {Number} val The current value of the attribute. + */ + getAttribute: function(attr) { + var el = this.getEl(); + var val = Y.Dom.getStyle(el, attr); + + if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) { + return parseFloat(val); + } + + var a = this.patterns.offsetAttribute.exec(attr) || []; + var pos = !!( a[3] ); // top or left + var box = !!( a[2] ); // width or height + + // use offsets for width/height and abs pos top/left + if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) { + val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)]; + } else { // default to zero for other 'auto' + val = 0; + } + + return val; + }, + + /** + * Returns the unit to use when none is supplied. + * @method getDefaultUnit + * @param {attr} attr The name of the attribute. + * @return {String} The default unit to be used. + */ + getDefaultUnit: function(attr) { + if ( this.patterns.defaultUnit.test(attr) ) { + return 'px'; + } + + return ''; + }, + + /** + * Sets the actual values to be used during the animation. Should only be needed for subclass use. + * @method setRuntimeAttribute + * @param {Object} attr The attribute object + * @private + */ + setRuntimeAttribute: function(attr) { + var start; + var end; + var attributes = this.attributes; + + this.runtimeAttributes[attr] = {}; + + var isset = function(prop) { + return (typeof prop !== 'undefined'); + }; + + if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) { + return false; // note return; nothing to animate to + } + + start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr); + + // To beats by, per SMIL 2.1 spec + if ( isset(attributes[attr]['to']) ) { + end = attributes[attr]['to']; + } else if ( isset(attributes[attr]['by']) ) { + if (start.constructor == Array) { + end = []; + for (var i = 0, len = start.length; i < len; ++i) { + end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" + } + } else { + end = start + attributes[attr]['by'] * 1; + } + } + + this.runtimeAttributes[attr].start = start; + this.runtimeAttributes[attr].end = end; + + // set units if needed + this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? + attributes[attr]['unit'] : this.getDefaultUnit(attr); + return true; + }, + + /** + * Constructor for Anim instance. + * @method init + * @param {String | HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + init: function(el, attributes, duration, method) { + /** + * Whether or not the animation is running. + * @property isAnimated + * @private + * @type Boolean + */ + var isAnimated = false; + + /** + * A Date object that is created when the animation begins. + * @property startTime + * @private + * @type Date + */ + var startTime = null; + + /** + * The number of frames this animation was able to execute. + * @property actualFrames + * @private + * @type Int + */ + var actualFrames = 0; + + /** + * The element to be animated. + * @property el + * @private + * @type HTMLElement + */ + el = Y.Dom.get(el); + + /** + * The collection of attributes to be animated. + * Each attribute must have at least a "to" or "by" defined in order to animate. + * If "to" is supplied, the animation will end with the attribute at that value. + * If "by" is supplied, the animation will end at that value plus its starting value. + * If both are supplied, "to" is used, and "by" is ignored. + * Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values). + * @property attributes + * @type Object + */ + this.attributes = attributes || {}; + + /** + * The length of the animation. Defaults to "1" (second). + * @property duration + * @type Number + */ + this.duration = !YAHOO.lang.isUndefined(duration) ? duration : 1; + + /** + * The method that will provide values to the attribute(s) during the animation. + * Defaults to "YAHOO.util.Easing.easeNone". + * @property method + * @type Function + */ + this.method = method || Y.Easing.easeNone; + + /** + * Whether or not the duration should be treated as seconds. + * Defaults to true. + * @property useSeconds + * @type Boolean + */ + this.useSeconds = true; // default to seconds + + /** + * The location of the current animation on the timeline. + * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. + * @property currentFrame + * @type Int + */ + this.currentFrame = 0; + + /** + * The total number of frames to be executed. + * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. + * @property totalFrames + * @type Int + */ + this.totalFrames = Y.AnimMgr.fps; + + /** + * Changes the animated element + * @method setEl + */ + this.setEl = function(element) { + el = Y.Dom.get(element); + }; + + /** + * Returns a reference to the animated element. + * @method getEl + * @return {HTMLElement} + */ + this.getEl = function() { return el; }; + + /** + * Checks whether the element is currently animated. + * @method isAnimated + * @return {Boolean} current value of isAnimated. + */ + this.isAnimated = function() { + return isAnimated; + }; + + /** + * Returns the animation start time. + * @method getStartTime + * @return {Date} current value of startTime. + */ + this.getStartTime = function() { + return startTime; + }; + + this.runtimeAttributes = {}; + + var logger = {}; + logger.log = function() {YAHOO.log.apply(window, arguments)}; + + logger.log('creating new instance of ' + this); + + /** + * Starts the animation by registering it with the animation manager. + * @method animate + */ + this.animate = function() { + if ( this.isAnimated() ) { + return false; + } + + this.currentFrame = 0; + + this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration; + + if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration + this.totalFrames = 1; + } + Y.AnimMgr.registerElement(this); + return true; + }; + + /** + * Stops the animation. Normally called by AnimMgr when animation completes. + * @method stop + * @param {Boolean} finish (optional) If true, animation will jump to final frame. + */ + this.stop = function(finish) { + if (!this.isAnimated()) { // nothing to stop + return false; + } + + if (finish) { + this.currentFrame = this.totalFrames; + this._onTween.fire(); + } + Y.AnimMgr.stop(this); + }; + + var onStart = function() { + this.onStart.fire(); + + this.runtimeAttributes = {}; + for (var attr in this.attributes) { + this.setRuntimeAttribute(attr); + } + + isAnimated = true; + actualFrames = 0; + startTime = new Date(); + }; + + /** + * Feeds the starting and ending values for each animated attribute to doMethod once per frame, then applies the resulting value to the attribute(s). + * @private + */ + + var onTween = function() { + var data = { + duration: new Date() - this.getStartTime(), + currentFrame: this.currentFrame + }; + + data.toString = function() { + return ( + 'duration: ' + data.duration + + ', currentFrame: ' + data.currentFrame + ); + }; + + this.onTween.fire(data); + + var runtimeAttributes = this.runtimeAttributes; + + for (var attr in runtimeAttributes) { + this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit); + } + + actualFrames += 1; + }; + + var onComplete = function() { + var actual_duration = (new Date() - startTime) / 1000 ; + + var data = { + duration: actual_duration, + frames: actualFrames, + fps: actualFrames / actual_duration + }; + + data.toString = function() { + return ( + 'duration: ' + data.duration + + ', frames: ' + data.frames + + ', fps: ' + data.fps + ); + }; + + isAnimated = false; + actualFrames = 0; + this.onComplete.fire(data); + }; + + /** + * Custom event that fires after onStart, useful in subclassing + * @private + */ + this._onStart = new Y.CustomEvent('_start', this, true); + + /** + * Custom event that fires when animation begins + * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction) + * @event onStart + */ + this.onStart = new Y.CustomEvent('start', this); + + /** + * Custom event that fires between each frame + * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction) + * @event onTween + */ + this.onTween = new Y.CustomEvent('tween', this); + + /** + * Custom event that fires after onTween + * @private + */ + this._onTween = new Y.CustomEvent('_tween', this, true); + + /** + * Custom event that fires when animation ends + * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction) + * @event onComplete + */ + this.onComplete = new Y.CustomEvent('complete', this); + /** + * Custom event that fires after onComplete + * @private + */ + this._onComplete = new Y.CustomEvent('_complete', this, true); + + this._onStart.subscribe(onStart); + this._onTween.subscribe(onTween); + this._onComplete.subscribe(onComplete); + } +}; + + Y.Anim = Anim; +})(); +/** + * Handles animation queueing and threading. + * Used by Anim and subclasses. + * @class AnimMgr + * @namespace YAHOO.util + */ +YAHOO.util.AnimMgr = new function() { + /** + * Reference to the animation Interval. + * @property thread + * @private + * @type Int + */ + var thread = null; + + /** + * The current queue of registered animation objects. + * @property queue + * @private + * @type Array + */ + var queue = []; + + /** + * The number of active animations. + * @property tweenCount + * @private + * @type Int + */ + var tweenCount = 0; + + /** + * Base frame rate (frames per second). + * Arbitrarily high for better x-browser calibration (slower browsers drop more frames). + * @property fps + * @type Int + * + */ + this.fps = 1000; + + /** + * Interval delay in milliseconds, defaults to fastest possible. + * @property delay + * @type Int + * + */ + this.delay = 1; + + /** + * Adds an animation instance to the animation queue. + * All animation instances must be registered in order to animate. + * @method registerElement + * @param {object} tween The Anim instance to be be registered + */ + this.registerElement = function(tween) { + queue[queue.length] = tween; + tweenCount += 1; + tween._onStart.fire(); + this.start(); + }; + + /** + * removes an animation instance from the animation queue. + * All animation instances must be registered in order to animate. + * @method unRegister + * @param {object} tween The Anim instance to be be registered + * @param {Int} index The index of the Anim instance + * @private + */ + this.unRegister = function(tween, index) { + index = index || getIndex(tween); + if (!tween.isAnimated() || index == -1) { + return false; + } + + tween._onComplete.fire(); + queue.splice(index, 1); + + tweenCount -= 1; + if (tweenCount <= 0) { + this.stop(); + } + + return true; + }; + + /** + * Starts the animation thread. + * Only one thread can run at a time. + * @method start + */ + this.start = function() { + if (thread === null) { + thread = setInterval(this.run, this.delay); + } + }; + + /** + * Stops the animation thread or a specific animation instance. + * @method stop + * @param {object} tween A specific Anim instance to stop (optional) + * If no instance given, Manager stops thread and all animations. + */ + this.stop = function(tween) { + if (!tween) { + clearInterval(thread); + + for (var i = 0, len = queue.length; i < len; ++i) { + this.unRegister(queue[0], 0); + } + + queue = []; + thread = null; + tweenCount = 0; + } + else { + this.unRegister(tween); + } + }; + + /** + * Called per Interval to handle each animation frame. + * @method run + */ + this.run = function() { + for (var i = 0, len = queue.length; i < len; ++i) { + var tween = queue[i]; + if ( !tween || !tween.isAnimated() ) { continue; } + + if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null) + { + tween.currentFrame += 1; + + if (tween.useSeconds) { + correctFrame(tween); + } + tween._onTween.fire(); + } + else { YAHOO.util.AnimMgr.stop(tween, i); } + } + }; + + var getIndex = function(anim) { + for (var i = 0, len = queue.length; i < len; ++i) { + if (queue[i] == anim) { + return i; // note return; + } + } + return -1; + }; + + /** + * On the fly frame correction to keep animation on time. + * @method correctFrame + * @private + * @param {Object} tween The Anim instance being corrected. + */ + var correctFrame = function(tween) { + var frames = tween.totalFrames; + var frame = tween.currentFrame; + var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames); + var elapsed = (new Date() - tween.getStartTime()); + var tweak = 0; + + if (elapsed < tween.duration * 1000) { // check if falling behind + tweak = Math.round((elapsed / expected - 1) * tween.currentFrame); + } else { // went over duration, so jump to end + tweak = frames - (frame + 1); + } + if (tweak > 0 && isFinite(tweak)) { // adjust if needed + if (tween.currentFrame + tweak >= frames) {// dont go past last frame + tweak = frames - (frame + 1); + } + + tween.currentFrame += tweak; + } + }; +}; +/** + * Used to calculate Bezier splines for any number of control points. + * @class Bezier + * @namespace YAHOO.util + * + */ +YAHOO.util.Bezier = new function() { + /** + * Get the current position of the animated element based on t. + * Each point is an array of "x" and "y" values (0 = x, 1 = y) + * At least 2 points are required (start and end). + * First point is start. Last point is end. + * Additional control points are optional. + * @method getPosition + * @param {Array} points An array containing Bezier points + * @param {Number} t A number between 0 and 1 which is the basis for determining current position + * @return {Array} An array containing int x and y member data + */ + this.getPosition = function(points, t) { + var n = points.length; + var tmp = []; + + for (var i = 0; i < n; ++i){ + tmp[i] = [points[i][0], points[i][1]]; // save input + } + + for (var j = 1; j < n; ++j) { + for (i = 0; i < n - j; ++i) { + tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; + tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; + } + } + + return [ tmp[0][0], tmp[0][1] ]; + + }; +}; +(function() { +/** + * Anim subclass for color transitions. + *

Usage: var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut); Color values can be specified with either 112233, #112233, + * [255,255,255], or rgb(255,255,255)

+ * @class ColorAnim + * @namespace YAHOO.util + * @requires YAHOO.util.Anim + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Bezier + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @constructor + * @extends YAHOO.util.Anim + * @param {HTMLElement | String} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + var ColorAnim = function(el, attributes, duration, method) { + ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); + }; + + ColorAnim.NAME = 'ColorAnim'; + + ColorAnim.DEFAULT_BGCOLOR = '#fff'; + // shorthand + var Y = YAHOO.util; + YAHOO.extend(ColorAnim, Y.Anim); + + var superclass = ColorAnim.superclass; + var proto = ColorAnim.prototype; + + proto.patterns.color = /color$/i; + proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i; + proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i; + proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i; + proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari + + /** + * Attempts to parse the given string and return a 3-tuple. + * @method parseColor + * @param {String} s The string to parse. + * @return {Array} The 3-tuple of rgb values. + */ + proto.parseColor = function(s) { + if (s.length == 3) { return s; } + + var c = this.patterns.hex.exec(s); + if (c && c.length == 4) { + return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ]; + } + + c = this.patterns.rgb.exec(s); + if (c && c.length == 4) { + return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ]; + } + + c = this.patterns.hex3.exec(s); + if (c && c.length == 4) { + return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ]; + } + + return null; + }; + + proto.getAttribute = function(attr) { + var el = this.getEl(); + if (this.patterns.color.test(attr) ) { + var val = YAHOO.util.Dom.getStyle(el, attr); + + var that = this; + if (this.patterns.transparent.test(val)) { // bgcolor default + var parent = YAHOO.util.Dom.getAncestorBy(el, function(node) { + return !that.patterns.transparent.test(val); + }); + + if (parent) { + val = Y.Dom.getStyle(parent, attr); + } else { + val = ColorAnim.DEFAULT_BGCOLOR; + } + } + } else { + val = superclass.getAttribute.call(this, attr); + } + + return val; + }; + + proto.doMethod = function(attr, start, end) { + var val; + + if ( this.patterns.color.test(attr) ) { + val = []; + for (var i = 0, len = start.length; i < len; ++i) { + val[i] = superclass.doMethod.call(this, attr, start[i], end[i]); + } + + val = 'rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')'; + } + else { + val = superclass.doMethod.call(this, attr, start, end); + } + + return val; + }; + + proto.setRuntimeAttribute = function(attr) { + superclass.setRuntimeAttribute.call(this, attr); + + if ( this.patterns.color.test(attr) ) { + var attributes = this.attributes; + var start = this.parseColor(this.runtimeAttributes[attr].start); + var end = this.parseColor(this.runtimeAttributes[attr].end); + // fix colors if going "by" + if ( typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined' ) { + end = this.parseColor(attributes[attr].by); + + for (var i = 0, len = start.length; i < len; ++i) { + end[i] = start[i] + end[i]; + } + } + + this.runtimeAttributes[attr].start = start; + this.runtimeAttributes[attr].end = end; + } + }; + + Y.ColorAnim = ColorAnim; +})(); +/*! +TERMS OF USE - EASING EQUATIONS +Open source under the BSD License. +Copyright 2001 Robert Penner All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Singleton that determines how an animation proceeds from start to end. + * @class Easing + * @namespace YAHOO.util +*/ + +YAHOO.util.Easing = { + + /** + * Uniform speed between points. + * @method easeNone + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeNone: function (t, b, c, d) { + return c*t/d + b; + }, + + /** + * Begins slowly and accelerates towards end. + * @method easeIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeIn: function (t, b, c, d) { + return c*(t/=d)*t + b; + }, + + /** + * Begins quickly and decelerates towards end. + * @method easeOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeOut: function (t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + + /** + * Begins slowly and decelerates towards end. + * @method easeBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeBoth: function (t, b, c, d) { + if ((t/=d/2) < 1) { + return c/2*t*t + b; + } + + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + + /** + * Begins slowly and accelerates towards end. + * @method easeInStrong + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeInStrong: function (t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + + /** + * Begins quickly and decelerates towards end. + * @method easeOutStrong + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeOutStrong: function (t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + + /** + * Begins slowly and decelerates towards end. + * @method easeBothStrong + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeBothStrong: function (t, b, c, d) { + if ((t/=d/2) < 1) { + return c/2*t*t*t*t + b; + } + + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + + /** + * Snap in elastic effect. + * @method elasticIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} a Amplitude (optional) + * @param {Number} p Period (optional) + * @return {Number} The computed value for the current animation frame + */ + + elasticIn: function (t, b, c, d, a, p) { + if (t == 0) { + return b; + } + if ( (t /= d) == 1 ) { + return b+c; + } + if (!p) { + p=d*.3; + } + + if (!a || a < Math.abs(c)) { + a = c; + var s = p/4; + } + else { + var s = p/(2*Math.PI) * Math.asin (c/a); + } + + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + + /** + * Snap out elastic effect. + * @method elasticOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} a Amplitude (optional) + * @param {Number} p Period (optional) + * @return {Number} The computed value for the current animation frame + */ + elasticOut: function (t, b, c, d, a, p) { + if (t == 0) { + return b; + } + if ( (t /= d) == 1 ) { + return b+c; + } + if (!p) { + p=d*.3; + } + + if (!a || a < Math.abs(c)) { + a = c; + var s = p / 4; + } + else { + var s = p/(2*Math.PI) * Math.asin (c/a); + } + + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + + /** + * Snap both elastic effect. + * @method elasticBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} a Amplitude (optional) + * @param {Number} p Period (optional) + * @return {Number} The computed value for the current animation frame + */ + elasticBoth: function (t, b, c, d, a, p) { + if (t == 0) { + return b; + } + + if ( (t /= d/2) == 2 ) { + return b+c; + } + + if (!p) { + p = d*(.3*1.5); + } + + if ( !a || a < Math.abs(c) ) { + a = c; + var s = p/4; + } + else { + var s = p/(2*Math.PI) * Math.asin (c/a); + } + + if (t < 1) { + return -.5*(a*Math.pow(2,10*(t-=1)) * + Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + } + return a*Math.pow(2,-10*(t-=1)) * + Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + + + /** + * Backtracks slightly, then reverses direction and moves to end. + * @method backIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} s Overshoot (optional) + * @return {Number} The computed value for the current animation frame + */ + backIn: function (t, b, c, d, s) { + if (typeof s == 'undefined') { + s = 1.70158; + } + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + + /** + * Overshoots end, then reverses and comes back to end. + * @method backOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} s Overshoot (optional) + * @return {Number} The computed value for the current animation frame + */ + backOut: function (t, b, c, d, s) { + if (typeof s == 'undefined') { + s = 1.70158; + } + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + + /** + * Backtracks slightly, then reverses direction, overshoots end, + * then reverses and comes back to end. + * @method backBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} s Overshoot (optional) + * @return {Number} The computed value for the current animation frame + */ + backBoth: function (t, b, c, d, s) { + if (typeof s == 'undefined') { + s = 1.70158; + } + + if ((t /= d/2 ) < 1) { + return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + } + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + + /** + * Bounce off of start. + * @method bounceIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + bounceIn: function (t, b, c, d) { + return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b; + }, + + /** + * Bounces off end. + * @method bounceOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + bounceOut: function (t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + }, + + /** + * Bounces off start and end. + * @method bounceBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + bounceBoth: function (t, b, c, d) { + if (t < d/2) { + return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b; + } + return YAHOO.util.Easing.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}; + +(function() { +/** + * Anim subclass for moving elements along a path defined by the "points" + * member of "attributes". All "points" are arrays with x, y coordinates. + *

Usage: var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);

+ * @class Motion + * @namespace YAHOO.util + * @requires YAHOO.util.Anim + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Bezier + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @requires YAHOO.util.CustomEvent + * @constructor + * @extends YAHOO.util.ColorAnim + * @param {String | HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + var Motion = function(el, attributes, duration, method) { + if (el) { // dont break existing subclasses not using YAHOO.extend + Motion.superclass.constructor.call(this, el, attributes, duration, method); + } + }; + + + Motion.NAME = 'Motion'; + + // shorthand + var Y = YAHOO.util; + YAHOO.extend(Motion, Y.ColorAnim); + + var superclass = Motion.superclass; + var proto = Motion.prototype; + + proto.patterns.points = /^points$/i; + + proto.setAttribute = function(attr, val, unit) { + if ( this.patterns.points.test(attr) ) { + unit = unit || 'px'; + superclass.setAttribute.call(this, 'left', val[0], unit); + superclass.setAttribute.call(this, 'top', val[1], unit); + } else { + superclass.setAttribute.call(this, attr, val, unit); + } + }; + + proto.getAttribute = function(attr) { + if ( this.patterns.points.test(attr) ) { + var val = [ + superclass.getAttribute.call(this, 'left'), + superclass.getAttribute.call(this, 'top') + ]; + } else { + val = superclass.getAttribute.call(this, attr); + } + + return val; + }; + + proto.doMethod = function(attr, start, end) { + var val = null; + + if ( this.patterns.points.test(attr) ) { + var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100; + val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t); + } else { + val = superclass.doMethod.call(this, attr, start, end); + } + return val; + }; + + proto.setRuntimeAttribute = function(attr) { + if ( this.patterns.points.test(attr) ) { + var el = this.getEl(); + var attributes = this.attributes; + var start; + var control = attributes['points']['control'] || []; + var end; + var i, len; + + if (control.length > 0 && !(control[0] instanceof Array) ) { // could be single point or array of points + control = [control]; + } else { // break reference to attributes.points.control + var tmp = []; + for (i = 0, len = control.length; i< len; ++i) { + tmp[i] = control[i]; + } + control = tmp; + } + + if (Y.Dom.getStyle(el, 'position') == 'static') { // default to relative + Y.Dom.setStyle(el, 'position', 'relative'); + } + + if ( isset(attributes['points']['from']) ) { + Y.Dom.setXY(el, attributes['points']['from']); // set position to from point + } + else { Y.Dom.setXY( el, Y.Dom.getXY(el) ); } // set it to current position + + start = this.getAttribute('points'); // get actual top & left + + // TO beats BY, per SMIL 2.1 spec + if ( isset(attributes['points']['to']) ) { + end = translateValues.call(this, attributes['points']['to'], start); + + var pageXY = Y.Dom.getXY(this.getEl()); + for (i = 0, len = control.length; i < len; ++i) { + control[i] = translateValues.call(this, control[i], start); + } + + + } else if ( isset(attributes['points']['by']) ) { + end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ]; + + for (i = 0, len = control.length; i < len; ++i) { + control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; + } + } + + this.runtimeAttributes[attr] = [start]; + + if (control.length > 0) { + this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control); + } + + this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end; + } + else { + superclass.setRuntimeAttribute.call(this, attr); + } + }; + + var translateValues = function(val, start) { + var pageXY = Y.Dom.getXY(this.getEl()); + val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ]; + + return val; + }; + + var isset = function(prop) { + return (typeof prop !== 'undefined'); + }; + + Y.Motion = Motion; +})(); +(function() { +/** + * Anim subclass for scrolling elements to a position defined by the "scroll" + * member of "attributes". All "scroll" members are arrays with x, y scroll positions. + *

Usage: var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);

+ * @class Scroll + * @namespace YAHOO.util + * @requires YAHOO.util.Anim + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Bezier + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @requires YAHOO.util.CustomEvent + * @extends YAHOO.util.ColorAnim + * @constructor + * @param {String or HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + var Scroll = function(el, attributes, duration, method) { + if (el) { // dont break existing subclasses not using YAHOO.extend + Scroll.superclass.constructor.call(this, el, attributes, duration, method); + } + }; + + Scroll.NAME = 'Scroll'; + + // shorthand + var Y = YAHOO.util; + YAHOO.extend(Scroll, Y.ColorAnim); + + var superclass = Scroll.superclass; + var proto = Scroll.prototype; + + proto.doMethod = function(attr, start, end) { + var val = null; + + if (attr == 'scroll') { + val = [ + this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames), + this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames) + ]; + + } else { + val = superclass.doMethod.call(this, attr, start, end); + } + return val; + }; + + proto.getAttribute = function(attr) { + var val = null; + var el = this.getEl(); + + if (attr == 'scroll') { + val = [ el.scrollLeft, el.scrollTop ]; + } else { + val = superclass.getAttribute.call(this, attr); + } + + return val; + }; + + proto.setAttribute = function(attr, val, unit) { + var el = this.getEl(); + + if (attr == 'scroll') { + el.scrollLeft = val[0]; + el.scrollTop = val[1]; + } else { + superclass.setAttribute.call(this, attr, val, unit); + } + }; + + Y.Scroll = Scroll; +})(); +YAHOO.register("animation", YAHOO.util.Anim, {version: "2.6.0", build: "1321"}); diff --git a/lib/yui/animation/animation-min.js b/lib/yui/animation/animation-min.js new file mode 100755 index 0000000000..47fa162342 --- /dev/null +++ b/lib/yui/animation/animation-min.js @@ -0,0 +1,23 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.6.0",build:"1321"}); \ No newline at end of file diff --git a/lib/yui/animation/animation.js b/lib/yui/animation/animation.js new file mode 100755 index 0000000000..a198559008 --- /dev/null +++ b/lib/yui/animation/animation.js @@ -0,0 +1,1381 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +(function() { + +var Y = YAHOO.util; + +/* +Copyright (c) 2006, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +*/ + +/** + * The animation module provides allows effects to be added to HTMLElements. + * @module animation + * @requires yahoo, event, dom + */ + +/** + * + * Base animation class that provides the interface for building animated effects. + *

Usage: var myAnim = new YAHOO.util.Anim(el, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut);

+ * @class Anim + * @namespace YAHOO.util + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @requires YAHOO.util.CustomEvent + * @constructor + * @param {String | HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + +var Anim = function(el, attributes, duration, method) { + if (!el) { + } + this.init(el, attributes, duration, method); +}; + +Anim.NAME = 'Anim'; + +Anim.prototype = { + /** + * Provides a readable name for the Anim instance. + * @method toString + * @return {String} + */ + toString: function() { + var el = this.getEl() || {}; + var id = el.id || el.tagName; + return (this.constructor.NAME + ': ' + id); + }, + + patterns: { // cached for performance + noNegatives: /width|height|opacity|padding/i, // keep at zero or above + offsetAttribute: /^((width|height)|(top|left))$/, // use offsetValue as default + defaultUnit: /width|height|top$|bottom$|left$|right$/i, // use 'px' by default + offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i // IE may return these, so convert these to offset + }, + + /** + * Returns the value computed by the animation's "method". + * @method doMethod + * @param {String} attr The name of the attribute. + * @param {Number} start The value this attribute should start from for this animation. + * @param {Number} end The value this attribute should end at for this animation. + * @return {Number} The Value to be applied to the attribute. + */ + doMethod: function(attr, start, end) { + return this.method(this.currentFrame, start, end - start, this.totalFrames); + }, + + /** + * Applies a value to an attribute. + * @method setAttribute + * @param {String} attr The name of the attribute. + * @param {Number} val The value to be applied to the attribute. + * @param {String} unit The unit ('px', '%', etc.) of the value. + */ + setAttribute: function(attr, val, unit) { + if ( this.patterns.noNegatives.test(attr) ) { + val = (val > 0) ? val : 0; + } + + Y.Dom.setStyle(this.getEl(), attr, val + unit); + }, + + /** + * Returns current value of the attribute. + * @method getAttribute + * @param {String} attr The name of the attribute. + * @return {Number} val The current value of the attribute. + */ + getAttribute: function(attr) { + var el = this.getEl(); + var val = Y.Dom.getStyle(el, attr); + + if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) { + return parseFloat(val); + } + + var a = this.patterns.offsetAttribute.exec(attr) || []; + var pos = !!( a[3] ); // top or left + var box = !!( a[2] ); // width or height + + // use offsets for width/height and abs pos top/left + if ( box || (Y.Dom.getStyle(el, 'position') == 'absolute' && pos) ) { + val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)]; + } else { // default to zero for other 'auto' + val = 0; + } + + return val; + }, + + /** + * Returns the unit to use when none is supplied. + * @method getDefaultUnit + * @param {attr} attr The name of the attribute. + * @return {String} The default unit to be used. + */ + getDefaultUnit: function(attr) { + if ( this.patterns.defaultUnit.test(attr) ) { + return 'px'; + } + + return ''; + }, + + /** + * Sets the actual values to be used during the animation. Should only be needed for subclass use. + * @method setRuntimeAttribute + * @param {Object} attr The attribute object + * @private + */ + setRuntimeAttribute: function(attr) { + var start; + var end; + var attributes = this.attributes; + + this.runtimeAttributes[attr] = {}; + + var isset = function(prop) { + return (typeof prop !== 'undefined'); + }; + + if ( !isset(attributes[attr]['to']) && !isset(attributes[attr]['by']) ) { + return false; // note return; nothing to animate to + } + + start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr); + + // To beats by, per SMIL 2.1 spec + if ( isset(attributes[attr]['to']) ) { + end = attributes[attr]['to']; + } else if ( isset(attributes[attr]['by']) ) { + if (start.constructor == Array) { + end = []; + for (var i = 0, len = start.length; i < len; ++i) { + end[i] = start[i] + attributes[attr]['by'][i] * 1; // times 1 to cast "by" + } + } else { + end = start + attributes[attr]['by'] * 1; + } + } + + this.runtimeAttributes[attr].start = start; + this.runtimeAttributes[attr].end = end; + + // set units if needed + this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? + attributes[attr]['unit'] : this.getDefaultUnit(attr); + return true; + }, + + /** + * Constructor for Anim instance. + * @method init + * @param {String | HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + init: function(el, attributes, duration, method) { + /** + * Whether or not the animation is running. + * @property isAnimated + * @private + * @type Boolean + */ + var isAnimated = false; + + /** + * A Date object that is created when the animation begins. + * @property startTime + * @private + * @type Date + */ + var startTime = null; + + /** + * The number of frames this animation was able to execute. + * @property actualFrames + * @private + * @type Int + */ + var actualFrames = 0; + + /** + * The element to be animated. + * @property el + * @private + * @type HTMLElement + */ + el = Y.Dom.get(el); + + /** + * The collection of attributes to be animated. + * Each attribute must have at least a "to" or "by" defined in order to animate. + * If "to" is supplied, the animation will end with the attribute at that value. + * If "by" is supplied, the animation will end at that value plus its starting value. + * If both are supplied, "to" is used, and "by" is ignored. + * Optional additional member include "from" (the value the attribute should start animating from, defaults to current value), and "unit" (the units to apply to the values). + * @property attributes + * @type Object + */ + this.attributes = attributes || {}; + + /** + * The length of the animation. Defaults to "1" (second). + * @property duration + * @type Number + */ + this.duration = !YAHOO.lang.isUndefined(duration) ? duration : 1; + + /** + * The method that will provide values to the attribute(s) during the animation. + * Defaults to "YAHOO.util.Easing.easeNone". + * @property method + * @type Function + */ + this.method = method || Y.Easing.easeNone; + + /** + * Whether or not the duration should be treated as seconds. + * Defaults to true. + * @property useSeconds + * @type Boolean + */ + this.useSeconds = true; // default to seconds + + /** + * The location of the current animation on the timeline. + * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. + * @property currentFrame + * @type Int + */ + this.currentFrame = 0; + + /** + * The total number of frames to be executed. + * In time-based animations, this is used by AnimMgr to ensure the animation finishes on time. + * @property totalFrames + * @type Int + */ + this.totalFrames = Y.AnimMgr.fps; + + /** + * Changes the animated element + * @method setEl + */ + this.setEl = function(element) { + el = Y.Dom.get(element); + }; + + /** + * Returns a reference to the animated element. + * @method getEl + * @return {HTMLElement} + */ + this.getEl = function() { return el; }; + + /** + * Checks whether the element is currently animated. + * @method isAnimated + * @return {Boolean} current value of isAnimated. + */ + this.isAnimated = function() { + return isAnimated; + }; + + /** + * Returns the animation start time. + * @method getStartTime + * @return {Date} current value of startTime. + */ + this.getStartTime = function() { + return startTime; + }; + + this.runtimeAttributes = {}; + + + + /** + * Starts the animation by registering it with the animation manager. + * @method animate + */ + this.animate = function() { + if ( this.isAnimated() ) { + return false; + } + + this.currentFrame = 0; + + this.totalFrames = ( this.useSeconds ) ? Math.ceil(Y.AnimMgr.fps * this.duration) : this.duration; + + if (this.duration === 0 && this.useSeconds) { // jump to last frame if zero second duration + this.totalFrames = 1; + } + Y.AnimMgr.registerElement(this); + return true; + }; + + /** + * Stops the animation. Normally called by AnimMgr when animation completes. + * @method stop + * @param {Boolean} finish (optional) If true, animation will jump to final frame. + */ + this.stop = function(finish) { + if (!this.isAnimated()) { // nothing to stop + return false; + } + + if (finish) { + this.currentFrame = this.totalFrames; + this._onTween.fire(); + } + Y.AnimMgr.stop(this); + }; + + var onStart = function() { + this.onStart.fire(); + + this.runtimeAttributes = {}; + for (var attr in this.attributes) { + this.setRuntimeAttribute(attr); + } + + isAnimated = true; + actualFrames = 0; + startTime = new Date(); + }; + + /** + * Feeds the starting and ending values for each animated attribute to doMethod once per frame, then applies the resulting value to the attribute(s). + * @private + */ + + var onTween = function() { + var data = { + duration: new Date() - this.getStartTime(), + currentFrame: this.currentFrame + }; + + data.toString = function() { + return ( + 'duration: ' + data.duration + + ', currentFrame: ' + data.currentFrame + ); + }; + + this.onTween.fire(data); + + var runtimeAttributes = this.runtimeAttributes; + + for (var attr in runtimeAttributes) { + this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit); + } + + actualFrames += 1; + }; + + var onComplete = function() { + var actual_duration = (new Date() - startTime) / 1000 ; + + var data = { + duration: actual_duration, + frames: actualFrames, + fps: actualFrames / actual_duration + }; + + data.toString = function() { + return ( + 'duration: ' + data.duration + + ', frames: ' + data.frames + + ', fps: ' + data.fps + ); + }; + + isAnimated = false; + actualFrames = 0; + this.onComplete.fire(data); + }; + + /** + * Custom event that fires after onStart, useful in subclassing + * @private + */ + this._onStart = new Y.CustomEvent('_start', this, true); + + /** + * Custom event that fires when animation begins + * Listen via subscribe method (e.g. myAnim.onStart.subscribe(someFunction) + * @event onStart + */ + this.onStart = new Y.CustomEvent('start', this); + + /** + * Custom event that fires between each frame + * Listen via subscribe method (e.g. myAnim.onTween.subscribe(someFunction) + * @event onTween + */ + this.onTween = new Y.CustomEvent('tween', this); + + /** + * Custom event that fires after onTween + * @private + */ + this._onTween = new Y.CustomEvent('_tween', this, true); + + /** + * Custom event that fires when animation ends + * Listen via subscribe method (e.g. myAnim.onComplete.subscribe(someFunction) + * @event onComplete + */ + this.onComplete = new Y.CustomEvent('complete', this); + /** + * Custom event that fires after onComplete + * @private + */ + this._onComplete = new Y.CustomEvent('_complete', this, true); + + this._onStart.subscribe(onStart); + this._onTween.subscribe(onTween); + this._onComplete.subscribe(onComplete); + } +}; + + Y.Anim = Anim; +})(); +/** + * Handles animation queueing and threading. + * Used by Anim and subclasses. + * @class AnimMgr + * @namespace YAHOO.util + */ +YAHOO.util.AnimMgr = new function() { + /** + * Reference to the animation Interval. + * @property thread + * @private + * @type Int + */ + var thread = null; + + /** + * The current queue of registered animation objects. + * @property queue + * @private + * @type Array + */ + var queue = []; + + /** + * The number of active animations. + * @property tweenCount + * @private + * @type Int + */ + var tweenCount = 0; + + /** + * Base frame rate (frames per second). + * Arbitrarily high for better x-browser calibration (slower browsers drop more frames). + * @property fps + * @type Int + * + */ + this.fps = 1000; + + /** + * Interval delay in milliseconds, defaults to fastest possible. + * @property delay + * @type Int + * + */ + this.delay = 1; + + /** + * Adds an animation instance to the animation queue. + * All animation instances must be registered in order to animate. + * @method registerElement + * @param {object} tween The Anim instance to be be registered + */ + this.registerElement = function(tween) { + queue[queue.length] = tween; + tweenCount += 1; + tween._onStart.fire(); + this.start(); + }; + + /** + * removes an animation instance from the animation queue. + * All animation instances must be registered in order to animate. + * @method unRegister + * @param {object} tween The Anim instance to be be registered + * @param {Int} index The index of the Anim instance + * @private + */ + this.unRegister = function(tween, index) { + index = index || getIndex(tween); + if (!tween.isAnimated() || index == -1) { + return false; + } + + tween._onComplete.fire(); + queue.splice(index, 1); + + tweenCount -= 1; + if (tweenCount <= 0) { + this.stop(); + } + + return true; + }; + + /** + * Starts the animation thread. + * Only one thread can run at a time. + * @method start + */ + this.start = function() { + if (thread === null) { + thread = setInterval(this.run, this.delay); + } + }; + + /** + * Stops the animation thread or a specific animation instance. + * @method stop + * @param {object} tween A specific Anim instance to stop (optional) + * If no instance given, Manager stops thread and all animations. + */ + this.stop = function(tween) { + if (!tween) { + clearInterval(thread); + + for (var i = 0, len = queue.length; i < len; ++i) { + this.unRegister(queue[0], 0); + } + + queue = []; + thread = null; + tweenCount = 0; + } + else { + this.unRegister(tween); + } + }; + + /** + * Called per Interval to handle each animation frame. + * @method run + */ + this.run = function() { + for (var i = 0, len = queue.length; i < len; ++i) { + var tween = queue[i]; + if ( !tween || !tween.isAnimated() ) { continue; } + + if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null) + { + tween.currentFrame += 1; + + if (tween.useSeconds) { + correctFrame(tween); + } + tween._onTween.fire(); + } + else { YAHOO.util.AnimMgr.stop(tween, i); } + } + }; + + var getIndex = function(anim) { + for (var i = 0, len = queue.length; i < len; ++i) { + if (queue[i] == anim) { + return i; // note return; + } + } + return -1; + }; + + /** + * On the fly frame correction to keep animation on time. + * @method correctFrame + * @private + * @param {Object} tween The Anim instance being corrected. + */ + var correctFrame = function(tween) { + var frames = tween.totalFrames; + var frame = tween.currentFrame; + var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames); + var elapsed = (new Date() - tween.getStartTime()); + var tweak = 0; + + if (elapsed < tween.duration * 1000) { // check if falling behind + tweak = Math.round((elapsed / expected - 1) * tween.currentFrame); + } else { // went over duration, so jump to end + tweak = frames - (frame + 1); + } + if (tweak > 0 && isFinite(tweak)) { // adjust if needed + if (tween.currentFrame + tweak >= frames) {// dont go past last frame + tweak = frames - (frame + 1); + } + + tween.currentFrame += tweak; + } + }; +}; +/** + * Used to calculate Bezier splines for any number of control points. + * @class Bezier + * @namespace YAHOO.util + * + */ +YAHOO.util.Bezier = new function() { + /** + * Get the current position of the animated element based on t. + * Each point is an array of "x" and "y" values (0 = x, 1 = y) + * At least 2 points are required (start and end). + * First point is start. Last point is end. + * Additional control points are optional. + * @method getPosition + * @param {Array} points An array containing Bezier points + * @param {Number} t A number between 0 and 1 which is the basis for determining current position + * @return {Array} An array containing int x and y member data + */ + this.getPosition = function(points, t) { + var n = points.length; + var tmp = []; + + for (var i = 0; i < n; ++i){ + tmp[i] = [points[i][0], points[i][1]]; // save input + } + + for (var j = 1; j < n; ++j) { + for (i = 0; i < n - j; ++i) { + tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; + tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; + } + } + + return [ tmp[0][0], tmp[0][1] ]; + + }; +}; +(function() { +/** + * Anim subclass for color transitions. + *

Usage: var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut); Color values can be specified with either 112233, #112233, + * [255,255,255], or rgb(255,255,255)

+ * @class ColorAnim + * @namespace YAHOO.util + * @requires YAHOO.util.Anim + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Bezier + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @constructor + * @extends YAHOO.util.Anim + * @param {HTMLElement | String} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + var ColorAnim = function(el, attributes, duration, method) { + ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); + }; + + ColorAnim.NAME = 'ColorAnim'; + + ColorAnim.DEFAULT_BGCOLOR = '#fff'; + // shorthand + var Y = YAHOO.util; + YAHOO.extend(ColorAnim, Y.Anim); + + var superclass = ColorAnim.superclass; + var proto = ColorAnim.prototype; + + proto.patterns.color = /color$/i; + proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i; + proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i; + proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i; + proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/; // need rgba for safari + + /** + * Attempts to parse the given string and return a 3-tuple. + * @method parseColor + * @param {String} s The string to parse. + * @return {Array} The 3-tuple of rgb values. + */ + proto.parseColor = function(s) { + if (s.length == 3) { return s; } + + var c = this.patterns.hex.exec(s); + if (c && c.length == 4) { + return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ]; + } + + c = this.patterns.rgb.exec(s); + if (c && c.length == 4) { + return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ]; + } + + c = this.patterns.hex3.exec(s); + if (c && c.length == 4) { + return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ]; + } + + return null; + }; + + proto.getAttribute = function(attr) { + var el = this.getEl(); + if (this.patterns.color.test(attr) ) { + var val = YAHOO.util.Dom.getStyle(el, attr); + + var that = this; + if (this.patterns.transparent.test(val)) { // bgcolor default + var parent = YAHOO.util.Dom.getAncestorBy(el, function(node) { + return !that.patterns.transparent.test(val); + }); + + if (parent) { + val = Y.Dom.getStyle(parent, attr); + } else { + val = ColorAnim.DEFAULT_BGCOLOR; + } + } + } else { + val = superclass.getAttribute.call(this, attr); + } + + return val; + }; + + proto.doMethod = function(attr, start, end) { + var val; + + if ( this.patterns.color.test(attr) ) { + val = []; + for (var i = 0, len = start.length; i < len; ++i) { + val[i] = superclass.doMethod.call(this, attr, start[i], end[i]); + } + + val = 'rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')'; + } + else { + val = superclass.doMethod.call(this, attr, start, end); + } + + return val; + }; + + proto.setRuntimeAttribute = function(attr) { + superclass.setRuntimeAttribute.call(this, attr); + + if ( this.patterns.color.test(attr) ) { + var attributes = this.attributes; + var start = this.parseColor(this.runtimeAttributes[attr].start); + var end = this.parseColor(this.runtimeAttributes[attr].end); + // fix colors if going "by" + if ( typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined' ) { + end = this.parseColor(attributes[attr].by); + + for (var i = 0, len = start.length; i < len; ++i) { + end[i] = start[i] + end[i]; + } + } + + this.runtimeAttributes[attr].start = start; + this.runtimeAttributes[attr].end = end; + } + }; + + Y.ColorAnim = ColorAnim; +})(); +/*! +TERMS OF USE - EASING EQUATIONS +Open source under the BSD License. +Copyright 2001 Robert Penner All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + * Singleton that determines how an animation proceeds from start to end. + * @class Easing + * @namespace YAHOO.util +*/ + +YAHOO.util.Easing = { + + /** + * Uniform speed between points. + * @method easeNone + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeNone: function (t, b, c, d) { + return c*t/d + b; + }, + + /** + * Begins slowly and accelerates towards end. + * @method easeIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeIn: function (t, b, c, d) { + return c*(t/=d)*t + b; + }, + + /** + * Begins quickly and decelerates towards end. + * @method easeOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeOut: function (t, b, c, d) { + return -c *(t/=d)*(t-2) + b; + }, + + /** + * Begins slowly and decelerates towards end. + * @method easeBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeBoth: function (t, b, c, d) { + if ((t/=d/2) < 1) { + return c/2*t*t + b; + } + + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + + /** + * Begins slowly and accelerates towards end. + * @method easeInStrong + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeInStrong: function (t, b, c, d) { + return c*(t/=d)*t*t*t + b; + }, + + /** + * Begins quickly and decelerates towards end. + * @method easeOutStrong + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeOutStrong: function (t, b, c, d) { + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + + /** + * Begins slowly and decelerates towards end. + * @method easeBothStrong + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + easeBothStrong: function (t, b, c, d) { + if ((t/=d/2) < 1) { + return c/2*t*t*t*t + b; + } + + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + + /** + * Snap in elastic effect. + * @method elasticIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} a Amplitude (optional) + * @param {Number} p Period (optional) + * @return {Number} The computed value for the current animation frame + */ + + elasticIn: function (t, b, c, d, a, p) { + if (t == 0) { + return b; + } + if ( (t /= d) == 1 ) { + return b+c; + } + if (!p) { + p=d*.3; + } + + if (!a || a < Math.abs(c)) { + a = c; + var s = p/4; + } + else { + var s = p/(2*Math.PI) * Math.asin (c/a); + } + + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + + /** + * Snap out elastic effect. + * @method elasticOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} a Amplitude (optional) + * @param {Number} p Period (optional) + * @return {Number} The computed value for the current animation frame + */ + elasticOut: function (t, b, c, d, a, p) { + if (t == 0) { + return b; + } + if ( (t /= d) == 1 ) { + return b+c; + } + if (!p) { + p=d*.3; + } + + if (!a || a < Math.abs(c)) { + a = c; + var s = p / 4; + } + else { + var s = p/(2*Math.PI) * Math.asin (c/a); + } + + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + + /** + * Snap both elastic effect. + * @method elasticBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} a Amplitude (optional) + * @param {Number} p Period (optional) + * @return {Number} The computed value for the current animation frame + */ + elasticBoth: function (t, b, c, d, a, p) { + if (t == 0) { + return b; + } + + if ( (t /= d/2) == 2 ) { + return b+c; + } + + if (!p) { + p = d*(.3*1.5); + } + + if ( !a || a < Math.abs(c) ) { + a = c; + var s = p/4; + } + else { + var s = p/(2*Math.PI) * Math.asin (c/a); + } + + if (t < 1) { + return -.5*(a*Math.pow(2,10*(t-=1)) * + Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + } + return a*Math.pow(2,-10*(t-=1)) * + Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + + + /** + * Backtracks slightly, then reverses direction and moves to end. + * @method backIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} s Overshoot (optional) + * @return {Number} The computed value for the current animation frame + */ + backIn: function (t, b, c, d, s) { + if (typeof s == 'undefined') { + s = 1.70158; + } + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + + /** + * Overshoots end, then reverses and comes back to end. + * @method backOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} s Overshoot (optional) + * @return {Number} The computed value for the current animation frame + */ + backOut: function (t, b, c, d, s) { + if (typeof s == 'undefined') { + s = 1.70158; + } + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + + /** + * Backtracks slightly, then reverses direction, overshoots end, + * then reverses and comes back to end. + * @method backBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @param {Number} s Overshoot (optional) + * @return {Number} The computed value for the current animation frame + */ + backBoth: function (t, b, c, d, s) { + if (typeof s == 'undefined') { + s = 1.70158; + } + + if ((t /= d/2 ) < 1) { + return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + } + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + + /** + * Bounce off of start. + * @method bounceIn + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + bounceIn: function (t, b, c, d) { + return c - YAHOO.util.Easing.bounceOut(d-t, 0, c, d) + b; + }, + + /** + * Bounces off end. + * @method bounceOut + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + bounceOut: function (t, b, c, d) { + if ((t/=d) < (1/2.75)) { + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)) { + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)) { + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + }, + + /** + * Bounces off start and end. + * @method bounceBoth + * @param {Number} t Time value used to compute current value + * @param {Number} b Starting value + * @param {Number} c Delta between start and end values + * @param {Number} d Total length of animation + * @return {Number} The computed value for the current animation frame + */ + bounceBoth: function (t, b, c, d) { + if (t < d/2) { + return YAHOO.util.Easing.bounceIn(t*2, 0, c, d) * .5 + b; + } + return YAHOO.util.Easing.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b; + } +}; + +(function() { +/** + * Anim subclass for moving elements along a path defined by the "points" + * member of "attributes". All "points" are arrays with x, y coordinates. + *

Usage: var myAnim = new YAHOO.util.Motion(el, { points: { to: [800, 800] } }, 1, YAHOO.util.Easing.easeOut);

+ * @class Motion + * @namespace YAHOO.util + * @requires YAHOO.util.Anim + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Bezier + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @requires YAHOO.util.CustomEvent + * @constructor + * @extends YAHOO.util.ColorAnim + * @param {String | HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + var Motion = function(el, attributes, duration, method) { + if (el) { // dont break existing subclasses not using YAHOO.extend + Motion.superclass.constructor.call(this, el, attributes, duration, method); + } + }; + + + Motion.NAME = 'Motion'; + + // shorthand + var Y = YAHOO.util; + YAHOO.extend(Motion, Y.ColorAnim); + + var superclass = Motion.superclass; + var proto = Motion.prototype; + + proto.patterns.points = /^points$/i; + + proto.setAttribute = function(attr, val, unit) { + if ( this.patterns.points.test(attr) ) { + unit = unit || 'px'; + superclass.setAttribute.call(this, 'left', val[0], unit); + superclass.setAttribute.call(this, 'top', val[1], unit); + } else { + superclass.setAttribute.call(this, attr, val, unit); + } + }; + + proto.getAttribute = function(attr) { + if ( this.patterns.points.test(attr) ) { + var val = [ + superclass.getAttribute.call(this, 'left'), + superclass.getAttribute.call(this, 'top') + ]; + } else { + val = superclass.getAttribute.call(this, attr); + } + + return val; + }; + + proto.doMethod = function(attr, start, end) { + var val = null; + + if ( this.patterns.points.test(attr) ) { + var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100; + val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t); + } else { + val = superclass.doMethod.call(this, attr, start, end); + } + return val; + }; + + proto.setRuntimeAttribute = function(attr) { + if ( this.patterns.points.test(attr) ) { + var el = this.getEl(); + var attributes = this.attributes; + var start; + var control = attributes['points']['control'] || []; + var end; + var i, len; + + if (control.length > 0 && !(control[0] instanceof Array) ) { // could be single point or array of points + control = [control]; + } else { // break reference to attributes.points.control + var tmp = []; + for (i = 0, len = control.length; i< len; ++i) { + tmp[i] = control[i]; + } + control = tmp; + } + + if (Y.Dom.getStyle(el, 'position') == 'static') { // default to relative + Y.Dom.setStyle(el, 'position', 'relative'); + } + + if ( isset(attributes['points']['from']) ) { + Y.Dom.setXY(el, attributes['points']['from']); // set position to from point + } + else { Y.Dom.setXY( el, Y.Dom.getXY(el) ); } // set it to current position + + start = this.getAttribute('points'); // get actual top & left + + // TO beats BY, per SMIL 2.1 spec + if ( isset(attributes['points']['to']) ) { + end = translateValues.call(this, attributes['points']['to'], start); + + var pageXY = Y.Dom.getXY(this.getEl()); + for (i = 0, len = control.length; i < len; ++i) { + control[i] = translateValues.call(this, control[i], start); + } + + + } else if ( isset(attributes['points']['by']) ) { + end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ]; + + for (i = 0, len = control.length; i < len; ++i) { + control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; + } + } + + this.runtimeAttributes[attr] = [start]; + + if (control.length > 0) { + this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control); + } + + this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end; + } + else { + superclass.setRuntimeAttribute.call(this, attr); + } + }; + + var translateValues = function(val, start) { + var pageXY = Y.Dom.getXY(this.getEl()); + val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ]; + + return val; + }; + + var isset = function(prop) { + return (typeof prop !== 'undefined'); + }; + + Y.Motion = Motion; +})(); +(function() { +/** + * Anim subclass for scrolling elements to a position defined by the "scroll" + * member of "attributes". All "scroll" members are arrays with x, y scroll positions. + *

Usage: var myAnim = new YAHOO.util.Scroll(el, { scroll: { to: [0, 800] } }, 1, YAHOO.util.Easing.easeOut);

+ * @class Scroll + * @namespace YAHOO.util + * @requires YAHOO.util.Anim + * @requires YAHOO.util.AnimMgr + * @requires YAHOO.util.Easing + * @requires YAHOO.util.Bezier + * @requires YAHOO.util.Dom + * @requires YAHOO.util.Event + * @requires YAHOO.util.CustomEvent + * @extends YAHOO.util.ColorAnim + * @constructor + * @param {String or HTMLElement} el Reference to the element that will be animated + * @param {Object} attributes The attribute(s) to be animated. + * Each attribute is an object with at minimum a "to" or "by" member defined. + * Additional optional members are "from" (defaults to current value), "units" (defaults to "px"). + * All attribute names use camelCase. + * @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based + * @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method) + */ + var Scroll = function(el, attributes, duration, method) { + if (el) { // dont break existing subclasses not using YAHOO.extend + Scroll.superclass.constructor.call(this, el, attributes, duration, method); + } + }; + + Scroll.NAME = 'Scroll'; + + // shorthand + var Y = YAHOO.util; + YAHOO.extend(Scroll, Y.ColorAnim); + + var superclass = Scroll.superclass; + var proto = Scroll.prototype; + + proto.doMethod = function(attr, start, end) { + var val = null; + + if (attr == 'scroll') { + val = [ + this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames), + this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames) + ]; + + } else { + val = superclass.doMethod.call(this, attr, start, end); + } + return val; + }; + + proto.getAttribute = function(attr) { + var val = null; + var el = this.getEl(); + + if (attr == 'scroll') { + val = [ el.scrollLeft, el.scrollTop ]; + } else { + val = superclass.getAttribute.call(this, attr); + } + + return val; + }; + + proto.setAttribute = function(attr, val, unit) { + var el = this.getEl(); + + if (attr == 'scroll') { + el.scrollLeft = val[0]; + el.scrollTop = val[1]; + } else { + superclass.setAttribute.call(this, attr, val, unit); + } + }; + + Y.Scroll = Scroll; +})(); +YAHOO.register("animation", YAHOO.util.Anim, {version: "2.6.0", build: "1321"}); diff --git a/lib/yui/assets/skins/sam/asc.gif b/lib/yui/assets/skins/sam/asc.gif new file mode 100644 index 0000000000000000000000000000000000000000..a1fe7385d5ac940629233f0dc4bbd61f20959c3b GIT binary patch literal 177 zcmZ?wbhEHbU}|FG@8_44nAqLjosyCg9vmZ){{V zVZwy=_I7V?@1UTd{Jgy0-d;-!i@3Nr8*A&jy1Ge|CjI~ap8*F@{K>+|z#z_`1Cj^X z$-t`jKsD}w@w|)+IvTGc!Y=lCF}Yu=Q8eH=%k0e0mLc1=fuZY=!y%64o~d4Qx%?Cv FtO0P~GlKvC literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/autocomplete.css b/lib/yui/assets/skins/sam/autocomplete.css new file mode 100755 index 0000000000..82cf7e50b7 --- /dev/null +++ b/lib/yui/assets/skins/sam/autocomplete.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac iframe{opacity:0;filter:alpha(opacity=0);padding-right:.3em;padding-bottom:.3em;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;list-style:none;zoom:1;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;} diff --git a/lib/yui/assets/skins/sam/blankimage.png b/lib/yui/assets/skins/sam/blankimage.png new file mode 100755 index 0000000000000000000000000000000000000000..b87bb2485015d12369549a8f88b4b4e6918da8a7 GIT binary patch literal 2314 zcmV+l3HA1gP)002t}0{{R350Hx300004XF*Lt007q5 z)K6G40000PbVXQnQ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Kb+-)^Zv0xdlz4EyieCK9N;l&1@?$nkRkI zSpY%x{7TzHPCj@rJzbDxabu|&{B_W>aAuQjDtG_l{MF3NbN(t6a;hq(proTr9lj3V zFq0r5Yr-dqvS?jj9=41o8G*_@Oz2l1W@es%^_*o@Cx4b`zeP~{jbE9ZeqdyJV#4Q> zcK=@cLS3bf(PX@q&t4#FW;+xLIh6BCDV)h*M_W5O-6I^ zL?8rB&V;tNuN?bn1f}hMwYen95?IsymMq;u*q~)LN$27Z%ZlT}hgTuT?)!Qs9B$j` zgJRKfeJYExuV7lxqE&?1e{`%aFGmI}i`gU@j)%|Al&f{!0waQoXeKxtSzcSc=lJLY zYXVg^ZH!*rXx>|0jYJ~1;VRVWv$_`xBA>}7|7fET?R99Lt{%b>#H8%gO_B=Uv2 zEZr;OVLH8+?g$J?!XH~++cT_UbLr`l3|9xAPn1NT3|sX&7z{>cA%k_9O)_L-@4W|< zR;$G@Dz;|L6tAUISrR2!1W~qb$W})LQ?s{UYyQtI+$4M+`FW=0_tP{y=53kUUc{s# zj)J%$iGRI26*pvgbU}c}Bv|dpn337yda&vH^B^dlvL7Yi z@mSG(V{GAdZNNf>0fr$@qv3(QOWMNm!`ZQ3CJP5+#k*3l*t}Kjy}A=0vY@brM-Tu) zpX+wmyQJ-?{;c0BBEdO{9*y-|@c|18>k#HI2%TyNO^>vt!|h)Na{HGz1Fvj_hb{D5 zJ%*wsV*087z%uTCq5yIDOd+dU>g5^AA;fan9>~#P zUFIDp*E^prm1K-f+YNrkz>AFelrhp8wtB(G0M676;-~cnG0H;6K!E*vgTNlL6VXu? z+HC^fZvPTp7aBxoqy?Xu1lqCx9<&{!C2rKcXsJrvG#yNhy03)|QoT{41~uw_oBM|R k{QsPv*4L~bm;VVc0HT!-jb!e$TmS$707*qoM6N<$g7zKgCjbBd literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/button.css b/lib/yui/assets/skins/sam/button.css new file mode 100755 index 0000000000..bfe84887d5 --- /dev/null +++ b/lib/yui/assets/skins/sam/button.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-button{display:-moz-inline-box;display:inline-block;vertical-align:text-bottom;}.yui-button .first-child{display:block;*display:inline-block;}.yui-button button,.yui-button a{display:block;*display:inline-block;border:none;margin:0;}.yui-button button{background-color:transparent;*overflow:visible;cursor:pointer;}.yui-button a{text-decoration:none;}.yui-skin-sam .yui-button{border-width:1px 0;border-style:solid;border-color:#808080;background:url(sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;_margin:0;_position:static;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{padding:0 10px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button a{*line-height:1.875;*padding-bottom:1px;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);} diff --git a/lib/yui/assets/skins/sam/calendar.css b/lib/yui/assets/skins/sam/calendar.css new file mode 100755 index 0000000000..aad17821a3 --- /dev/null +++ b/lib/yui/assets/skins/sam/calendar.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar .calnavright{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calcontainer .yui-cal-nav-mask{position:absolute;z-index:2;margin:0;padding:0;width:100%;height:100%;_width:0;_height:0;left:0;top:0;display:none;}.yui-calcontainer .yui-cal-nav{position:absolute;z-index:3;top:0;display:none;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{display:-moz-inline-box;display:inline-block;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{display:block;*display:inline-block;*overflow:visible;border:none;background-color:transparent;cursor:pointer;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;margin:0;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;padding:0;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdayrow th{padding:0;border:none;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;border:none;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding:0 2px 0 0;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding:0 0 0 2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}.yui-skin-sam .yui-calendar a.calnav{border:1px solid #f2f2f2;padding:0 4px;text-decoration:none;color:#000;zoom:1;}.yui-skin-sam .yui-calendar a.calnav:hover{background:url(sprite.png) repeat-x 0 0;border-color:#A0A0A0;cursor:pointer;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask{background-color:#000;opacity:0.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-calcontainer .yui-cal-nav{font-family:arial,helvetica,clean,sans-serif;font-size:93%;border:1px solid #808080;left:50%;margin-left:-7em;width:14em;padding:0;top:2.5em;background-color:#f2f2f2;}.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav{top:4.5em;}.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav{width:16em;margin-left:-8em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y,.yui-skin-sam .yui-calcontainer .yui-cal-nav-m,.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{padding:5px 10px 5px 10px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{text-align:center;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-e{margin-top:5px;padding:5px;background-color:#EDF5FF;border-top:1px solid black;display:none;}.yui-skin-sam .yui-calcontainer .yui-cal-nav label{display:block;font-weight:bold;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc{width:100%;_width:auto;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid{background-color:#FFEE69;border:1px solid #000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc{width:4em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{border:1px solid #808080;background:url(sprite.png) repeat-x 0 0;background-color:#ccc;margin:auto .15em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{padding:0 8px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default{border:1px solid #304369;background-color:#426fd9;background:url(sprite.png) repeat-x 0 -1400px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button{color:#fff;} diff --git a/lib/yui/assets/skins/sam/carousel.css b/lib/yui/assets/skins/sam/carousel.css new file mode 100644 index 0000000000..9d85d72e28 --- /dev/null +++ b/lib/yui/assets/skins/sam/carousel.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-carousel{visibility:hidden;overflow:hidden;position:relative;}.yui-carousel.yui-carousel-visible{visibility:visible;}.yui-carousel-content{overflow:hidden;position:relative;}.yui-carousel-element{margin:5px 0;overflow:hidden;padding:0;position:relative;width:32000px;z-index:1;}.yui-carousel-vertical .yui-carousel-element{margin:0 5px;}.yui-carousel-element li{border:1px solid #ccc;float:left;list-style:none;margin:1px;overflow:hidden;padding:0;text-align:center;*float:none;*display:inline-block;*zoom:1;*display:inline;}.yui-carousel .yui-carousel-item-selected{border:1px dashed #000;margin:1px;}.yui-carousel-vertical{height:32000px;margin:0 5px;width:auto;}.yui-carousel-vertical .yui-carousel-element li{display:block;float:none;}.yui-log .carousel{background:#f2e886;}.yui-carousel-nav{zoom:1;}.yui-carousel-nav:after{clear:both;content:"";display:block;}.yui-carousel-button-focus{outline:1px dotted #000;}.yui-skin-sam .yui-carousel,.yui-skin-sam .yui-carousel-vertical{border:1px solid #808080;}.yui-skin-sam .yui-carousel-nav{background:url(sprite.png) repeat-x 0 0;padding:3px;text-align:right;}.yui-skin-sam .yui-carousel-button{background:url(sprite.png) no-repeat 0 -600px;float:right;height:19px;margin:5px;overflow:hidden;width:40px;}.yui-skin-sam .yui-carousel-vertical .yui-carousel-button{background-position:0 -800px;}.yui-skin-sam .yui-carousel-button-disabled{background-position:0 -2000px;}.yui-skin-sam .yui-carousel-vertical .yui-carousel-button-disabled{background-position:0 -2100px;}.yui-skin-sam .yui-carousel-button input{background-color:transparent;border:0;cursor:pointer;display:block;height:44px;margin:-2px 0 0 -2px;padding:0 0 0 50px;}.yui-skin-sam span.yui-carousel-first-button{background-position:0px -550px;margin-left:-100px;margin-right:50px;*margin:5px 5px 5px -90px;}.yui-skin-sam .yui-carousel-vertical span.yui-carousel-first-button{background-position:0px -750px;}.yui-skin-sam span.yui-carousel-first-button-disabled{background-position:0 -1950px;}.yui-skin-sam .yui-carousel-vertical span.yui-carousel-first-button-disabled{background-position:0 -2050px;}.yui-skin-sam .yui-carousel-nav ul{float:right;margin:0;margin-left:-220px;margin-right:100px;*margin-left:-160px;*margin-right:0;padding:0;}.yui-skin-sam .yui-carousel-nav select{position:relative;*right:50px;top:4px;}.yui-skin-sam .yui-carousel-vertical .yui-carousel-nav ul,.yui-skin-sam .yui-carousel-vertical .yui-carousel-nav select{float:none;margin:0;*zoom:1;}.yui-skin-sam .yui-carousel-nav ul li{float:left;height:19px;list-style:none;}.yui-skin-sam .yui-carousel-nav ul:after{clear:both;content:"";display:block;}.yui-skin-sam .yui-carousel-nav ul li a{background:url(sprite.png) no-repeat 0 -650px;display:block;height:9px;margin:10px 0 0 5px;overflow:hidden;width:9px;}.yui-skin-sam .yui-carousel-nav ul li a em{left:-10000px;position:absolute;}.yui-skin-sam .yui-carousel-nav ul li.yui-carousel-nav-page-selected a{background-position:0 -700px;} diff --git a/lib/yui/assets/skins/sam/colorpicker.css b/lib/yui/assets/skins/sam/colorpicker.css new file mode 100755 index 0000000000..82c6cfd8c0 --- /dev/null +++ b/lib/yui/assets/skins/sam/colorpicker.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-picker-panel{background:#e3e3e3;border-color:#888;}.yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.yui-picker{position:relative;}.yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.yui-picker-hue-bg{-moz-outline:none;outline:0px none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.yui-picker-bg{-moz-outline:none;outline:0px none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../../build/colorpicker/assets/picker_mask.png',sizingMethod='scale');}.yui-picker-mask{position:absolute;z-index:1;top:0px;left:0px;}.yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.yui-picker-controls .hd{background:transparent;border-width:0px !important;}.yui-picker-controls .bd{height:100px;border-width:0px !important;}.yui-picker-controls ul{float:left;padding:0 2px 0 0;margin:0}.yui-picker-controls li{padding:2px;list-style:none;margin:0}.yui-picker-controls input{font-size:0.85em;width:2.4em;}.yui-picker-hex-controls{clear:both;padding:2px;}.yui-picker-hex-controls input{width:4.6em;}.yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;} diff --git a/lib/yui/assets/skins/sam/container.css b/lib/yui/assets/skins/sam/container.css new file mode 100755 index 0000000000..5023824c82 --- /dev/null +++ b/lib/yui/assets/skins/sam/container.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-overlay,.yui-panel-container{visibility:hidden;position:absolute;z-index:2;}.yui-panel-container form{margin:0;}.mask{z-index:1;display:none;position:absolute;top:0;left:0;right:0;bottom:0;}.mask.block-scrollbars{overflow:auto;}.masked select,.drag select,.hide-select select{_visibility:hidden;}.yui-panel-container select{_visibility:inherit;}.hide-scrollbars,.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.show-scrollbars{overflow:auto;}.yui-panel-container.show-scrollbars,.yui-tt.show-scrollbars{overflow:visible;}.yui-panel-container.show-scrollbars .underlay,.yui-tt.show-scrollbars .yui-tt-shadow{overflow:auto;}.yui-panel-container.shadow .underlay.yui-force-redraw{padding-bottom:1px;}.yui-effect-fade .underlay{display:none;}.yui-tt-shadow{position:absolute;}.yui-override-padding{padding:0 !important;}.yui-panel-container .container-close{overflow:hidden;text-indent:-10000em;text-decoration:none;}.yui-skin-sam .mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-panel-container{padding:0 1px;*padding:2px;}.yui-skin-sam .yui-panel{position:relative;left:0;top:0;border-style:solid;border-width:1px 0;border-color:#808080;z-index:1;*border-width:1px;*zoom:1;_zoom:normal;}.yui-skin-sam .yui-panel .hd,.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{border-style:solid;border-width:0 1px;border-color:#808080;margin:0 -1px;*margin:0;*border:0;}.yui-skin-sam .yui-panel .hd{border-bottom:solid 1px #ccc;}.yui-skin-sam .yui-panel .bd,.yui-skin-sam .yui-panel .ft{background-color:#F2F2F2;}.yui-skin-sam .yui-panel .hd{padding:0 10px;font-size:93%;line-height:2;*line-height:1.9;font-weight:bold;color:#000;background:url(sprite.png) repeat-x 0 -200px;}.yui-skin-sam .yui-panel .bd{padding:10px;}.yui-skin-sam .yui-panel .ft{border-top:solid 1px #808080;padding:5px 10px;font-size:77%;}.yui-skin-sam .yui-panel-container.focused .yui-panel .hd{}.yui-skin-sam .container-close{position:absolute;top:5px;right:6px;width:25px;height:15px;background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;}.yui-skin-sam .yui-panel-container .underlay{right:-1px;left:-1px;}.yui-skin-sam .yui-panel-container.matte{padding:9px 10px;background-color:#fff;}.yui-skin-sam .yui-panel-container.shadow{_padding:2px 4px 0 2px;}.yui-skin-sam .yui-panel-container.shadow .underlay{position:absolute;top:2px;left:-3px;right:-3px;bottom:-3px;*top:4px;*left:-1px;*right:-1px;*bottom:-1px;_top:0;_left:0;_right:0;_bottom:0;_margin-top:3px;_margin-left:-1px;background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yui-dialog .ft{border-top:none;padding:0 10px 10px 10px;font-size:100%;}.yui-skin-sam .yui-dialog .ft .button-group{display:block;text-align:right;}.yui-skin-sam .yui-dialog .ft button.default{font-weight:bold;}.yui-skin-sam .yui-dialog .ft span.default{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-dialog .ft span.default .first-child{border-color:#304369;}.yui-skin-sam .yui-dialog .ft span.default button{color:#fff;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled{background-position:0pt -1500px;border-color:#ccc;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-dialog .ft span.yui-button-disabled button{color:#a6a6a6;}.yui-skin-sam .yui-simple-dialog .bd .yui-icon{background:url(sprite.png) no-repeat 0 0;width:16px;height:16px;margin-right:10px;float:left;}.yui-skin-sam .yui-simple-dialog .bd span.blckicon{background-position:0 -1100px;}.yui-skin-sam .yui-simple-dialog .bd span.alrticon{background-position:0 -1050px;}.yui-skin-sam .yui-simple-dialog .bd span.hlpicon{background-position:0 -1150px;}.yui-skin-sam .yui-simple-dialog .bd span.infoicon{background-position:0 -1200px;}.yui-skin-sam .yui-simple-dialog .bd span.warnicon{background-position:0 -1900px;}.yui-skin-sam .yui-simple-dialog .bd span.tipicon{background-position:0 -1250px;}.yui-skin-sam .yui-tt .bd{position:relative;top:0;left:0;z-index:1;color:#000;padding:2px 5px;border-color:#D4C237 #A6982B #A6982B #A6982B;border-width:1px;border-style:solid;background-color:#FFEE69;}.yui-skin-sam .yui-tt.show-scrollbars .bd{overflow:auto;}.yui-skin-sam .yui-tt-shadow{top:2px;right:-3px;left:-3px;bottom:-3px;background-color:#000;}.yui-skin-sam .yui-tt-shadow-visible{opacity:.12;*filter:alpha(opacity=12);} diff --git a/lib/yui/assets/skins/sam/datatable.css b/lib/yui/assets/skins/sam/datatable.css new file mode 100755 index 0000000000..55dc58d493 --- /dev/null +++ b/lib/yui/assets/skins/sam/datatable.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-skin-sam .yui-dt-mask{position:absolute;z-index:9500;}.yui-dt-tmp{position:absolute;left:-9000px;}.yui-dt-scrollable .yui-dt-bd{overflow:auto;}.yui-dt-scrollable .yui-dt-hd{overflow:hidden;position:relative;}.yui-dt-scrollable .yui-dt-bd thead tr,.yui-dt-scrollable .yui-dt-bd thead th{position:absolute;left:-1500px;}.yui-dt-scrollable tbody{-moz-outline:none;}.yui-dt-draggable{cursor:move;}.yui-dt-coltarget{position:absolute;z-index:999;}.yui-dt-hd{zoom:1;}th.yui-dt-resizeable .yui-dt-resizerliner{position:relative;}.yui-dt-resizer{position:absolute;right:0;bottom:0;height:100%;cursor:e-resize;cursor:col-resize;background-color:#CCC;opacity:0;filter:alpha(opacity=0);}.yui-dt-resizerproxy{visibility:hidden;position:absolute;z-index:9000;}th.yui-dt-hidden .yui-dt-liner,td.yui-dt-hidden .yui-dt-liner,th.yui-dt-hidden .yui-dt-resizer{display:none;}.yui-dt-editor{position:absolute;z-index:9000;}.yui-skin-sam .yui-dt table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:separate;*border-collapse:collapse;border-spacing:0;border:1px solid #7F7F7F;}.yui-skin-sam .yui-dt thead{border-spacing:0;}.yui-skin-sam .yui-dt caption{color:#000000;font-size:85%;font-weight:normal;font-style:italic;line-height:1;padding:1em 0pt;text-align:center;}.yui-skin-sam .yui-dt th{background:#D8D8DA url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yui-dt th,.yui-skin-sam .yui-dt th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom;}.yui-skin-sam .yui-dt th{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;}.yui-skin-sam .yui-dt tr.yui-dt-first td{border-top:1px solid #7F7F7F;}.yui-skin-sam .yui-dt th .yui-dt-liner{white-space:nowrap;}.yui-skin-sam .yui-dt-liner{margin:0;padding:0;padding:4px 10px 4px 10px;}.yui-skin-sam .yui-dt-coltarget{width:5px;background-color:red;}.yui-skin-sam .yui-dt td{margin:0;padding:0;border:none;border-right:1px solid #CBCBCB;text-align:left;}.yui-skin-sam .yui-dt-list td{border-right:none;}.yui-skin-sam .yui-dt-resizer{width:6px;}.yui-skin-sam .yui-dt-mask{background-color:#000;opacity:.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-dt-message{background-color:#FFF;}.yui-skin-sam .yui-dt-scrollable table{border:none;}.yui-skin-sam .yui-dt-scrollable .yui-dt-hd{border-left:1px solid #7F7F7F;border-top:1px solid #7F7F7F;border-right:1px solid #7F7F7F;}.yui-skin-sam .yui-dt-scrollable .yui-dt-bd{border-left:1px solid #7F7F7F;border-bottom:1px solid #7F7F7F;border-right:1px solid #7F7F7F;background-color:#FFF;}.yui-skin-sam .yui-dt-scrollable .yui-dt-data tr.yui-dt-last td{border-bottom:1px solid #7F7F7F;}.yui-skin-sam thead .yui-dt-sortable{cursor:pointer;}.yui-skin-sam th.yui-dt-asc,.yui-skin-sam th.yui-dt-desc{background:url(sprite.png) repeat-x 0 -100px;}.yui-skin-sam th.yui-dt-sortable .yui-dt-label{margin-right:10px;}.yui-skin-sam th.yui-dt-asc .yui-dt-liner{background:url(dt-arrow-up.png) no-repeat right;}.yui-skin-sam th.yui-dt-desc .yui-dt-liner{background:url(dt-arrow-dn.png) no-repeat right;}tbody .yui-dt-editable{cursor:pointer;}.yui-dt-editor{text-align:left;background-color:#F2F2F2;border:1px solid #808080;padding:6px;}.yui-dt-editor label{padding-left:4px;padding-right:6px;}.yui-dt-editor .yui-dt-button{padding-top:6px;text-align:right;}.yui-dt-editor .yui-dt-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px;}.yui-dt-editor .yui-dt-button button.yui-dt-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584E0;border:1px solid #304369;color:#FFF}.yui-dt-editor .yui-dt-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000;}.yui-dt-editor .yui-dt-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000;}.yui-skin-sam tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam tr.yui-dt-odd{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam tr.yui-dt-odd td.yui-dt-desc{background-color:#DBEAFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd{background-color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-desc{background-color:#EDF5FF;}.yui-skin-sam th.yui-dt-highlighted,.yui-skin-sam th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam tr.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list th.yui-dt-highlighted,.yui-skin-sam .yui-dt-list th.yui-dt-highlighted a{background-color:#B2D2FF;}.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-highlighted td.yui-dt-desc,.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-highlighted,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-highlighted{cursor:pointer;background-color:#B2D2FF;}.yui-skin-sam th.yui-dt-selected,.yui-skin-sam th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam tr.yui-dt-selected td,.yui-skin-sam tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-list th.yui-dt-selected,.yui-skin-sam .yui-dt-list th.yui-dt-selected a{background-color:#446CD7;}.yui-skin-sam .yui-dt-list tr.yui-dt-selected td,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-asc,.yui-skin-sam .yui-dt-list tr.yui-dt-selected td.yui-dt-desc{background-color:#426FD9;color:#FFF;}.yui-skin-sam .yui-dt-list tr.yui-dt-even td.yui-dt-selected,.yui-skin-sam .yui-dt-list tr.yui-dt-odd td.yui-dt-selected{background-color:#446CD7;color:#FFF;}.yui-skin-sam .yui-dt-paginator{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-dt-paginator .yui-dt-first,.yui-skin-sam .yui-dt-paginator .yui-dt-last,.yui-skin-sam .yui-dt-paginator .yui-dt-selected{padding:2px 6px;}.yui-skin-sam .yui-dt-paginator a.yui-dt-first,.yui-skin-sam .yui-dt-paginator a.yui-dt-last{text-decoration:none;}.yui-skin-sam .yui-dt-paginator .yui-dt-previous,.yui-skin-sam .yui-dt-paginator .yui-dt-next{display:none;}.yui-skin-sam a.yui-dt-page{border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;background-color:#fff}.yui-skin-sam .yui-dt-selected{border:1px solid #fff;background-color:#fff;} diff --git a/lib/yui/assets/skins/sam/desc.gif b/lib/yui/assets/skins/sam/desc.gif new file mode 100644 index 0000000000000000000000000000000000000000..c114f290c8ba1ff4173e129b1ef7e4f3f5e2bb5d GIT binary patch literal 177 zcmZ?wbhEHbU}|FG@8_44nAqLjosyCg9vmZ){{V zVZwy=_I7V?@1UTd{Jgy0-d;-!i@3Nr8*A&jy1Ge|CjI~ap8*F@{K>+|z#z_`1Cj^X z$-t_&AfWe&MeGaLh@5Q0kS;d8>Ju6P(#(BMdM*5_og0L@6jvQ6(g^H!doZ(#VTvMy FH2`14Gspk{ literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/dt-arrow-dn.png b/lib/yui/assets/skins/sam/dt-arrow-dn.png new file mode 100755 index 0000000000000000000000000000000000000000..85fda0bbca21cefc6b8cf1726bc83e43bff993c4 GIT binary patch literal 116 zcmeAS@N?(olHy`uVBq!ia0vp@K+M9#3?wzWV%32ZXMj(L>;M1%fy~Ir2;r~IJAo|5 zk|4ie28U-i(tsREPZ!6Kid)Guq>ddput17Y#X`7&C779+nL(zFDdZjVkv^az22WQ% Jmvv4FO#tWt9i9LH literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/dt-arrow-up.png b/lib/yui/assets/skins/sam/dt-arrow-up.png new file mode 100755 index 0000000000000000000000000000000000000000..1c674316aed41943dae79b01583956db63c8be08 GIT binary patch literal 116 zcmeAS@N?(olHy`uVBq!ia0vp@K+M9#3?wzWV%32ZXMj(L>;M1%fy}VT__niwAVJ2G zAirP+hi5m^fE-Cr7srr_TgeGo2?+@gd>DjQ2|6TYNiZ`ri2h~@(drDS1}b9kboFyt I=akR{0KC>mi#>Q#WroDds`uzFx3^1VhlZBCift5iABmh#&!0aEf z>&{2rQ#+d!lrGr5WpF;$+r>U-p%#pf7j6C(;=#aR4FLK*IpF{R literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/editor-sprite-active.gif b/lib/yui/assets/skins/sam/editor-sprite-active.gif new file mode 100755 index 0000000000000000000000000000000000000000..3e9d4200b3e6b124354f12d6c5f90513587315d1 GIT binary patch literal 5614 zcmWlacRbXO1I9o1xjo!{lubD$*{)PZ%E{hmB%^eSjHD|nE1g~Dp{$g<5<)o*8pfR! zLZ>29I-@cghx!`H{rWxsKCkEXdj5IdkF~9pp^@JPz#q9J2HuV@E>Cw=KWalD5brf5 z7wc(%{`^^vGTB!-Q^43kwVXjh56;{r((;NP8t1yuEj})vselgDp zJdb?taWtcvjSfDm=L^V}ZaKLe+_P)9)^>Fo%@uYsXOf}WU+182uy=&5+)M5H!WD-ChUT{vHz`j|Ar-IaI6Ki=Ci-5_eN1`t zGqh`>W~8@LxVW^o{`Ze4xRy(OI#qR0ZT}u!^=kFkuV44|^-VW(Btz1iyzMM)obKr> z>@hSMnO{|4D;zrHm3QOF{rmP4zL>DnXU2Ik4*81aZ0)6&J^|4uvxY=&&B9M@S3dQW ziUtc7dFj7_X7>i-p#Fn&xWUm|4n#*PAbQtP4XXWN4UG`BF5d}9aGRG0^~ zpr!1S43WLO09;BRC&b4t#FN_%}!gCj3UT>=B=4=;^zgX%MjIHDJvZzd?tgq9xj6grWkcJ-Pm!MfLLe zLB-PMcU$GY14L+B-Bd(V_WFAfe6a+CrdtErg- zJ60cq6b0_jPrO9DvQy)e`N=NHS*(n`bM+-dRv|u(=E#jZ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17oGQc7TALI{Hrm#jPC}CV6j2UDjCTETQAx%$!C6-Vw9jUxX(xu~%?||1c zJdu)3**-1fiyR+yXt_Fh^?A$Ozk|3Q2PpC2-&&B3E$ECE>>39M1!!af3gV;41R5Qf z-41OaAmKthWWsNz0Mbf)IVHXlBcquI+t$ceBJ;N@@g+rkHxYlk_P+>pl+k9e)~Yyx zmt?jXgtqNpL*kfH`;^*2NsLWNdpsM!vDjycgq@m#`nNf}eZ1f3*h6f&@yCfKZ1trop_}aB&Hw!~#wUP{v$j*pA)z z4iDVB152V}6a+F6RE&fGNTQ+%E+{4s?#;pla3M)521(n)q+-sLKpMiEGh#I6E*p>K z!0u9D-n2J*O#>)1^xnS%x)K--7IDiFXp9AJ1Tah?2_}5YWDz$wLYqFmb=m~{CJ$=R z(Y88J0OgJA-+{xY&}_;-3pg$T`;P^NeIG*bVD!I3VHZg=*6*wx0WgOcc?0~9MvAH`;JfA9xZDO0c8ahywf2S^%-iCJ`B^Rh~qv==q;<0+CI6 z0wBWx#0LQJyzhc8^8<1>_yq!2X_-eNP+>wO_>zNNWun7v{++XCF$5OV!U#EVs%Yz} z9dH^8j=BX!Lqt4#44(rlVx7o7;%*2vVh5VmE<*MIf10VD@T8115_s7MT8>? zfpNh&2!ks@U_WC+2!Lo$hisT1TNYrC$s=Mi5WlQd%$r2yAS88L2=VY*HmafqdI%sV RDPx!cToE9&k%xf2{{!Lm*)sqD literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/editor-sprite.gif b/lib/yui/assets/skins/sam/editor-sprite.gif new file mode 100755 index 0000000000000000000000000000000000000000..02042fa1474cd62d7de63588ae536f5495d45be2 GIT binary patch literal 5690 zcmWlc`9D;R!-mf}b7mjrAf%KTkv*d#OKL2MR7O!K8KEpaHR35eVysz;lYJBhC87)o zNg7L8q9!etQe%sx3@ubL@Atiby8eOd^SSQb4tAzy-tvGic2Np^|NaAp;hCA4+S=M- zUAeFK4*dD^XDMRGFF)tw$9*iT2m8w%ty0T!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al 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/editor.css b/lib/yui/assets/skins/sam/editor.css new file mode 100755 index 0000000000..780c387185 --- /dev/null +++ b/lib/yui/assets/skins/sam/editor.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-busy{cursor:wait !important;}.yui-toolbar-container fieldset{padding:0;margin:0;border:0;}.yui-toolbar-container legend{display:none;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container .yui-toolbar-titlebar h2 a{text-decoration:none;color:#000;cursor:default;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;margin-right:.5em;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;padding:0;height:18px;margin:.2em 0 .2em .1em;display:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:45px;*height:50px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;display:block;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;font-size:0px;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd .gecko form{overflow:auto;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group{margin-bottom:0.75em;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:visible;}.yui-editor-panel .height-width span.info{font-size:70%;margin-top:3px;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;_top:-5px;width:24px;text-indent:52px;font-size:0%;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;text-indent:0px;font-size:75%;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-group-undoredo h3,.yui-toolbar-group-insertitem h3,.yui-toolbar-group-indentlist h3{width:68px;}.yui-toolbar-group-indentlist2 h3{width:122px;}.yui-toolbar-group-alignment h3{width:130px;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-editor-container .draggable .yui-toolbar-titlebar{cursor:move;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:0 .25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;_font-size:0;margin:0;border-color:#808080;color:#f2f2f2;border-style:solid;border-width:1px 0;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:0px;line-height:2;display:block;color:#000;overflow:hidden;white-space:nowrap;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-select a{font-size:12px;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam .yui-toolbar-container .yui-button-menu .yui-menu-body-scrolled{position:relative;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-strikethrough span.yui-toolbar-icon{background-position:0 -108px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-undo span.yui-toolbar-icon{background-position:0 -1326px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-redo span.yui-toolbar-icon{background-position:0 -1355px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;position:absolute;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel .createlink_target,.yui-skin-sam .yui-editor-panel .insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;_width:198px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}.yui-skin-sam .yui-editor-container .yui-resize-handle-br{height:11px;width:11px;background-position:-20px -60px;background-color:transparent;} diff --git a/lib/yui/assets/skins/sam/header_background.png b/lib/yui/assets/skins/sam/header_background.png new file mode 100644 index 0000000000000000000000000000000000000000..3ef7909d3ed04956a06c5d9017076ea30e0ced27 GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0vp^j6kf+!2~3434ebKq$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c6*+jiIEGZ*s_F9NI$*%V9Q*UX`TlF!Ldi}q7dA02yr`^X zu-PrN{%75tzwegsKk4J*;_R|w)xBe%IT`Nt9oJ`MW0-m*yz~E_s%D^B44$rjF6*2U FngH9xIDh~E literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/hue_bg.png b/lib/yui/assets/skins/sam/hue_bg.png new file mode 100755 index 0000000000000000000000000000000000000000..d9bcdeb5c49910d5c32c9ebbb134200bf138b7b4 GIT binary patch literal 1120 zcmWkuZA?>V6h6*nD|EKy_G>T#efd;-TcIEZRG=3KG$^eF2Q{FAMV4*KY}f{qh`QSV zerz}DmTbC_Y|fEr#w0P0=t#CW_qsTZ+oCcxM!nmzgkYx0y)F9Qv+IxZJb6w|&dGC5 zaz;Z<^@~z7QUPF5prJObvq_J$hJ`xXo5wcl^n8zhtsmg}%|C)|K3%8x)wT6C_ipWb zw=>oa{%CJkw=1x%v!^@U-5DL&ajAP1z;mggH7#{nz-rJ$faL=7qA45La$rShQh@N! zu%sTCvXE1t{K=eCf%*<$g}~m_lTbYf%#DuhOcn)}oyL+UY!^T)N0SIlg&q}p70^Bg z#v`A*ftBD@6%H#L*N*0!pas#aR&fdVH33r!@M?%V4H}RB^=Q5i+Cy}fVbYD}B4EjH z?P{0x>Acg883%Oa|AzJ?B#N%FVmw`fKNY;g=C3&BXB;Z@Kam~dpydSE;!)KoPs+}MGZ#35TL&dgu1t8ZJCOzunMR5)=3wB`6<04>Wd>fEGNt=fUO7S z2UdorB;0d<%}W2%DB8|}rj&7Bd@G600GiIAl}DfA(T~fGjEtPSpMM-+!RdW!t0gq&tGw>1(Ck!bL+QCwfHM zFSfg6C%J1(_sXrL%2?h=Gs#tB`jY5~^n-B4=5yiEV7#4=o|0Az*Nu@}Ih_Oz$pHOG zC`&0{EO(L#V`PcEmKepS-spt1Gd{>irzEF%o|nyJB4uhF{YR*@P1evnVor$^%6<|| znF`WIVUCMc(=ZuIiR8<#kjLU}uWTnbQf7F06KORJtfO9XHgzgQe;2kI(+lL6NRM$K zObK})t}2X5(vY~u9{XN8DGugG$E0mSB^Mi(>V!GlYlD8E#--~|}G|8JkdYdiH90fD-v+HZu-d;bSJ8}W_+ literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/imagecropper.css b/lib/yui/assets/skins/sam/imagecropper.css new file mode 100644 index 0000000000..73d3216f93 --- /dev/null +++ b/lib/yui/assets/skins/sam/imagecropper.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-crop{position:relative;}.yui-crop .yui-crop-mask{position:absolute;top:0;left:0;height:100%;width:100%;}.yui-crop .yui-resize{position:absolute;top:10px;left:10px;border:0;}.yui-crop .yui-crop-resize-mask{position:absolute;top:0;left:0;height:100%;width:100%;background-position:-10px -10px;overflow:hidden;}.yui-skin-sam .yui-crop .yui-crop-mask{background-color:#000;opacity:.5;filter:alpha(opacity=50);}.yui-skin-sam .yui-crop .yui-resize{border:1px dashed #fff;} diff --git a/lib/yui/assets/skins/sam/layout.css b/lib/yui/assets/skins/sam/layout.css new file mode 100644 index 0000000000..d4c1fe325b --- /dev/null +++ b/lib/yui/assets/skins/sam/layout.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-layout-loading{visibility:hidden;}body.yui-layout{overflow:hidden;position:relative;padding:0;margin:0;}.yui-layout-doc{position:relative;overflow:hidden;padding:0;margin:0;}.yui-layout-unit{height:50px;width:50px;padding:0;margin:0;float:none;z-index:0;}.yui-layout-unit-top{position:absolute;top:0;left:0;width:100%;}.yui-layout-unit-left{position:absolute;top:0;left:0;}.yui-layout-unit-right{position:absolute;top:0;right:0;}.yui-layout-unit-bottom{position:absolute;bottom:0;left:0;width:100%;}.yui-layout-unit-center{position:absolute;top:0;left:0;width:100%;}.yui-layout div.yui-layout-hd{position:absolute;top:0;left:0;zoom:1;width:100%;}.yui-layout div.yui-layout-bd{position:absolute;top:0;left:0;zoom:1;width:100%;}.yui-layout .yui-layout-noscroll div.yui-layout-bd{overflow:hidden;}.yui-layout .yui-layout-scroll div.yui-layout-bd{overflow:auto;}.yui-layout div.yui-layout-ft{position:absolute;bottom:0;left:0;width:100%;zoom:1;}.yui-layout .yui-layout-unit div.yui-layout-hd h2{text-align:left;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .close{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0;}.yui-layout .yui-layout-unit div.yui-layout-hd .collapse-close{right:25px;}.yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#c0c0c0;display:none;}.yui-layout .yui-layout-clip .collapse{cursor:pointer;height:13px;position:absolute;right:2px;top:2px;width:17px;font-size:0px;}.yui-layout .yui-layout-wrap{height:100%;width:100%;position:absolute;left:0;}.yui-skin-sam .yui-layout .yui-resize-proxy{border:none;font-size:0;margin:0;padding:0;}.yui-skin-sam .yui-layout .yui-resize-resizing .yui-resize-handle{visibility:hidden;}.yui-skin-sam .yui-layout .yui-resize-proxy div{position:absolute;border:1px solid #808080;background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-resize .yui-resize-handle-active{}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l{width:5px;height:100%;top:0;left:0;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-r{width:5px;top:0;right:0;height:100%;position:absolute;zoom:1;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-b{width:100%;bottom:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-t{width:100%;top:0;left:0;height:5px;}.yui-skin-sam .yui-layout .yui-layout-unit-left div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -160px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-left .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -140px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-right div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -200px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-right .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -120px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-top div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -220px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-top .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -240px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit-bottom div.yui-layout-hd .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -260px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip-bottom .collapse{background:transparent url(layout_sprite.png) no-repeat -20px -180px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd .close{background:transparent url(layout_sprite.png) no-repeat -20px -100px;border:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-hd{background:url(sprite.png) repeat-x 0 -1400px;border:1px solid #808080;}.yui-skin-sam .yui-layout{background-color:#EDF5FF;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd h2{font-weight:bold;color:#fff;padding:3px;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd{border:1px solid #808080;border-bottom:none;border-top:none;*border-bottom-width:0;*border-top-width:0;background-color:#f2f2f2;text-align:left;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-noft{border-bottom:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd{border-top:1px solid #808080;}.yui-skin-sam .yui-layout .yui-layout-clip{position:absolute;height:20px;background-color:#EDF5FF;display:none;border:1px solid #808080;}.yui-skin-sam .yui-layout div.yui-layout-ft{border:1px solid #808080;border-top:none;*border-top-width:0;background-color:#f2f2f2;}.yui-skin-sam .yui-layout-unit .yui-resize-handle{background-color:transparent;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-l{left:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-b{right:0;bottom:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t{right:0;top:0;background-image:none;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-l .yui-layout-resize-knob{position:absolute;height:16px;width:6px;top:45%;left:0px;background:transparent url(layout_sprite.png) no-repeat 0 -5px;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-t .yui-layout-resize-knob,.yui-skin-sam .yui-layout-unit .yui-resize-handle-b .yui-layout-resize-knob{position:absolute;height:6px;width:16px;left:45%;background:transparent url(layout_sprite.png) no-repeat -20px 0;} diff --git a/lib/yui/assets/skins/sam/layout_sprite.png b/lib/yui/assets/skins/sam/layout_sprite.png new file mode 100644 index 0000000000000000000000000000000000000000..d6fce3c7a5bec2e266531e2b921f6a3bc3572bcb GIT binary patch literal 1409 zcmV-{1%CR8P)Foc7fVkN9ZLH|iPzfUuN*G~E00Ia|@iPD+ScV@e5BCj%&595~Az9JYb1HE%fJ|lvg&G4W z6xqeu5wao}vOGw#oOoq zdC>F%1Q0?EEY*Rd3zq4SGax3LA2VLCrA$0(SkZGRe)Txn3^>fhp`Mk2G^wZ|DoEi^P%kHvUUm}of|3c`UUt&-f|52O4U_0*PV)UriM_~rMM%_(97pUF zgq4T@9=!koXf2}^3PBhQEBt~NN?sh$J8ydbXFQt)$8tiP<$_ov{Q4FXyL>Z8Y{z2V zkaSb@Mp@4L)cu~!F2?_5njt5??aV6VWbNsf=#lQ+PR7RWs~T&qO?1)0;8OP9mr&?_ zEd!{i70@B06_L@4$jDGFl7UgQB&=k~SS7Maj>slCBAcYPu^a+2hmVBJ&?9G-+}TBz zXWWq~l#nFk3zof330q|P#FdpMx?{=@e9y*0nRuG?)9dbIA?=7Zn<-7Ogy z%rLzw;Z+H4qs~_O26Js?Gu0GVXL}YV+@i`mTQ6efT|4_N8}^c}3;8Lx-qSp(>c5yP zv+!2uj`O5iUE1Gh?d8?|Hp~2qjUgL*#Kz|yu(3mIobhzo0%%W3w;50B)}I;aHsc}P zSeq@=3AQYoV9T-zwk(^Ikvv-Un*@E(FC%n|1lUfINU{yq26f#+*Q{GQ%4Xe0YxQpu zv2_#y8&Nz-w%~RHx=DSu0s3URv(}ru4{F`oY^bw)ANJd!RX0b`Dd=_+pdGVqaS#TA zaC#8o%*J|#2HI+&(EtA%Z`Y=G+9q~V=ogzs#Fs&WPiD*-y?Scqb$UUo8r5tsP!;V9 z+So;%!C1xB@h9l0TBW5A>O>nFRjUhLtI#SPHmr5mvtO=H#t?b%!g$d!L~pK&n|i}L z!&%^r^XATaJ(Q)5hg3QzAHz@KF_|6%p4ElhboHes%dnJo?C(gon^x1UVMu9>l+$EM zyYYBITTA&JYj=J;UeH!t2igzSu&1+}ENH*(>w~#T?}~D>R>)!8tQB$?H*0yv+zy3X zp5FpK#BWTE@nL>rYK#x`TfkSiVcaHeL%A7)bE^@*P25(v!8sWU;bx5QQEo#=#9l_Y z9jWsb&xxPHEyHgiDKT#F_ig65r+y1bS-53z`*yvmBxe`^)OW4foqs1^G=pWW+-Vx8O~1UE+HGF@F06NmG=W!zJbw P00000NkvXXu0mjf;Dg73 literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/loading.gif b/lib/yui/assets/skins/sam/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..0bbf3bc0c0e5e635553e8d1bf9ceddefbc402396 GIT binary patch literal 2673 zcmchY_gj;P7RTSb83YJ1>=8y5ONL=ZcEgk+C?FydumNNz8c=c6`n&|fmMu_HHG%^w zNLVjHyfy)hAgHK_Kxkz+0Ktm5M|X*?y?g!o_3yv`{_^F^wY9YuFJ3GxEUd1s-nnz<)vH(c?%i8n zUVirM+2rIT007UQKY#e};oRKZty{MqJa}MhYina;bNBAu-+udTYHDhBcJ|n@WA*j* z-+lL;iHS*OX6D|#dm|zu!o$ON?b=mbT)bh!26uP&kdP1u2Zx!N8486$B9X?&$DclZ zdgI28>FMdk#l`#g@Bj4EPc=0)2M!!4EG!%z9?s6rzI5r**|TSdhK8)HtXf)HHgDc+ zZEek9Fk)k4xm@nHZQC3j9o^jACMG6~jg9m3^EYnX2*Yq^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block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{*zoom:1;_zoom:normal;border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu .yuimenu .bd{*zoom:normal;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);} diff --git a/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png b/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png new file mode 100644 index 0000000000000000000000000000000000000000..030941c9cffc064276813d7eaab03d8c667ed700 GIT binary patch literal 3618 zcmV+-4&CvIP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z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7@dCU z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~ z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) z{QUg={r&#_{{R2~`6RjA00002bW%=J{{ZE;FiHRb03%66K~#9!Vqky(Mi^jVMCCIw oFfyX>85y7$4gdfE0RR6300puDFk literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png b/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..6c1612230550ef09678a38a2e3374585055a07eb GIT binary patch literal 3618 zcmV+-4&CvIP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0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}ZteprD|kp`oIpqNAguq@<*! zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk zwzs#pxVX5vxw*Q!y1To(yu7@dCU z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~ z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) z{QUg={r&#_{{R2~`6RjA00002bW%=J{{ZE;FiHRb03u05K~#9!VqjoI00ssI6b=Il nhXI!ivK}PU00000|NjF33?~3ZGNlzM00000NkvXXu0mjf(Ym^p literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png b/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..427d60a38af14ac7b530a266dc2e969555d287c7 GIT binary patch literal 3617 zcmV++4&L#JP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}e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FDZf|dIaBy&O zadC2Ta&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8 zf`fyDgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@ zl$4Z}m6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*! zrKP5(rl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dk zwzs#pxVX5vxw*Q!y1To(yu7@dCU z$jHda$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~ z>g((4?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF) z{QUg={r&#_{{R2~9(fUf00002bW%=J{{ZE;FiHRb03u05K~#9!VqjoI00ssI6b=Il nhXI!ivK}PU00000|NjF33?~3ZGNlzM00000NkvXXu0mjfMZ3C* literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/paginator.css b/lib/yui/assets/skins/sam/paginator.css new file mode 100644 index 0000000000..fab425875f --- /dev/null +++ b/lib/yui/assets/skins/sam/paginator.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-skin-sam .yui-pg-container{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-previous,.yui-skin-sam .yui-pg-next,.yui-skin-sam .yui-pg-last,.yui-skin-sam .yui-pg-current,.yui-skin-sam .yui-pg-pages,.yui-skin-sam .yui-pg-page{display:inline-block;font-family:arial,helvetica,clean,sans-serif;padding:3px 6px;zoom:1;}.yui-skin-sam .yui-pg-pages{padding:0;}.yui-skin-sam .yui-pg-current{padding:3px 0;}.yui-skin-sam a.yui-pg-first:link,.yui-skin-sam a.yui-pg-first:visited,.yui-skin-sam a.yui-pg-first:active,.yui-skin-sam a.yui-pg-first:hover,.yui-skin-sam a.yui-pg-previous:link,.yui-skin-sam a.yui-pg-previous:visited,.yui-skin-sam a.yui-pg-previous:active,.yui-skin-sam a.yui-pg-previous:hover,.yui-skin-sam a.yui-pg-next:link,.yui-skin-sam a.yui-pg-next:visited,.yui-skin-sam a.yui-pg-next:active,.yui-skin-sam a.yui-pg-next:hover,.yui-skin-sam a.yui-pg-last:link,.yui-skin-sam a.yui-pg-last:visited,.yui-skin-sam a.yui-pg-last:active,.yui-skin-sam a.yui-pg-last:hover,.yui-skin-sam a.yui-pg-page:link,.yui-skin-sam a.yui-pg-page:visited,.yui-skin-sam a.yui-pg-page:active,.yui-skin-sam a.yui-pg-page:hover{color:#06c;text-decoration:underline;outline:0;}.yui-skin-sam span.yui-pg-first,.yui-skin-sam span.yui-pg-previous,.yui-skin-sam span.yui-pg-next,.yui-skin-sam span.yui-pg-last{color:#a6a6a6;}.yui-skin-sam .yui-pg-page{background-color:#fff;border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}.yui-skin-sam .yui-pg-current-page{background-color:transparent;border:none;font-weight:bold;padding:3px 6px;}.yui-skin-sam .yui-pg-page{margin-left:1px;margin-right:1px;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-previous{padding-left:0;}.yui-skin-sam .yui-pg-next,.yui-skin-sam .yui-pg-last{padding-right:0;}.yui-skin-sam .yui-pg-current,.yui-skin-sam .yui-pg-rpp-options{margin-left:1em;margin-right:1em;} diff --git a/lib/yui/assets/skins/sam/picker_mask.png b/lib/yui/assets/skins/sam/picker_mask.png new file mode 100755 index 0000000000000000000000000000000000000000..f8d91932b376af76ccfac030c12eb9fec7ee4c63 GIT binary patch literal 12174 zcmV;9FLBU`P)_6|b&%Dfjpyv}j54LBIXFZqhE-_t{2r7|?ya1%Cs>h{sswI&ir4|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f)rHlFHin8at8 zf231nfja`;X`qjQ{TPtT2$-J+=#L;%GCuZM%zFe-GoTq|EqXG0J-rjFA!)YD@D%G+(%jVtWGl1QAU{d2%u&<<*Zbo86f4@e+txxnf@rS&tmU0L4FkI zvtVzu0H1hQIRnIJ0C_feJe#F6_kc5iO=q3M`0__VKFhGvjLYYO_Y5XJ1jJ{7c^Yep zHW&J!52nA`qtNH$?S3o4*oSLk&tTSPNrW?X?<5;9naK^$U}fVxx$Ap|$u2f@bg3gWkxHK%Fp4+8RMf$}i0&g=*$e&(C#qxaD0ZvpHl zv+I6`Mm!BUmxWOUFGBaUp^pXA9e5eL-vl3cNcl?@AS6vgTG5D@?CMq zTi=Sx2mN33JO2+a9~-FUJu&myl|RHap8Fr(82g7GfB2M~pO3%P.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{*zoom:1;_zoom:normal;border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu .yuimenu .bd{*zoom:normal;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);} +.yui-skin-sam .yui-pg-container{display:block;margin:6px 0;white-space:nowrap;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-previous,.yui-skin-sam .yui-pg-next,.yui-skin-sam .yui-pg-last,.yui-skin-sam .yui-pg-current,.yui-skin-sam .yui-pg-pages,.yui-skin-sam .yui-pg-page{display:inline-block;font-family:arial,helvetica,clean,sans-serif;padding:3px 6px;zoom:1;}.yui-skin-sam .yui-pg-pages{padding:0;}.yui-skin-sam .yui-pg-current{padding:3px 0;}.yui-skin-sam a.yui-pg-first:link,.yui-skin-sam a.yui-pg-first:visited,.yui-skin-sam a.yui-pg-first:active,.yui-skin-sam a.yui-pg-first:hover,.yui-skin-sam a.yui-pg-previous:link,.yui-skin-sam a.yui-pg-previous:visited,.yui-skin-sam a.yui-pg-previous:active,.yui-skin-sam a.yui-pg-previous:hover,.yui-skin-sam a.yui-pg-next:link,.yui-skin-sam a.yui-pg-next:visited,.yui-skin-sam a.yui-pg-next:active,.yui-skin-sam a.yui-pg-next:hover,.yui-skin-sam a.yui-pg-last:link,.yui-skin-sam a.yui-pg-last:visited,.yui-skin-sam a.yui-pg-last:active,.yui-skin-sam a.yui-pg-last:hover,.yui-skin-sam a.yui-pg-page:link,.yui-skin-sam a.yui-pg-page:visited,.yui-skin-sam a.yui-pg-page:active,.yui-skin-sam a.yui-pg-page:hover{color:#06c;text-decoration:underline;outline:0;}.yui-skin-sam span.yui-pg-first,.yui-skin-sam span.yui-pg-previous,.yui-skin-sam span.yui-pg-next,.yui-skin-sam span.yui-pg-last{color:#a6a6a6;}.yui-skin-sam .yui-pg-page{background-color:#fff;border:1px solid #CBCBCB;padding:2px 6px;text-decoration:none;}.yui-skin-sam .yui-pg-current-page{background-color:transparent;border:none;font-weight:bold;padding:3px 6px;}.yui-skin-sam .yui-pg-page{margin-left:1px;margin-right:1px;}.yui-skin-sam .yui-pg-first,.yui-skin-sam .yui-pg-previous{padding-left:0;}.yui-skin-sam .yui-pg-next,.yui-skin-sam .yui-pg-last{padding-right:0;}.yui-skin-sam .yui-pg-current,.yui-skin-sam .yui-pg-rpp-options{margin-left:1em;margin-right:1em;} +.yui-skin-sam .yui-pv{background-color:#4a4a4a;font:arial;position:relative;width:99%;z-index:1000;margin-bottom:1em;overflow:hidden;}.yui-skin-sam .yui-pv .hd{background:url(header_background.png) repeat-x;min-height:30px;overflow:hidden;zoom:1;padding:2px 0;}.yui-skin-sam .yui-pv .hd h4{padding:8px 10px;margin:0;font:bold 14px arial;color:#fff;}.yui-skin-sam .yui-pv .hd a{background:#3f6bc3;font:bold 11px arial;color:#fff;padding:4px;margin:3px 10px 0 0;border:1px solid #3f567d;cursor:pointer;display:block;float:right;}.yui-skin-sam .yui-pv .hd span{display:none;}.yui-skin-sam .yui-pv .hd span.yui-pv-busy{height:18px;width:18px;background:url(wait.gif) no-repeat;overflow:hidden;display:block;float:right;margin:4px 10px 0 0;}.yui-skin-sam .yui-pv .hd:after,.yui-pv .bd:after,.yui-skin-sam .yui-pv-chartlegend dl:after{content:'.';visibility:hidden;clear:left;height:0;display:block;}.yui-skin-sam .yui-pv .bd{position:relative;zoom:1;overflow-x:auto;overflow-y:hidden;}.yui-skin-sam .yui-pv .yui-pv-table{padding:0 10px;margin:5px 0 10px 0;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-bd td{color:#eeee5c;font:12px arial;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd{background:#929292;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even{background:#58637a;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-even td.yui-dt-desc{background:#384970;}.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table tr.yui-dt-odd td.yui-dt-desc{background:#6F6E6E;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th{background-image:none;background:#2E2D2D;}.yui-skin-sam .yui-pv th.yui-dt-asc .yui-dt-liner{background:transparent url(asc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv th.yui-dt-desc .yui-dt-liner{background:transparent url(desc.gif) no-repeat scroll right center;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th a{color:#fff;font:bold 12px arial;}.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-asc,.yui-skin-sam .yui-pv .yui-pv-table .yui-dt-hd th.yui-dt-desc{background:#333;}.yui-skin-sam .yui-pv-chartcontainer{padding:0 10px;}.yui-skin-sam .yui-pv-chart{height:250px;clear:right;margin:5px 0 0 0;color:#fff;}.yui-skin-sam .yui-pv-chartlegend div{float:right;margin:0 0 0 10px;_width:250px;}.yui-skin-sam .yui-pv-chartlegend dl{border:1px solid #999;padding:.2em 0 .2em .5em;zoom:1;margin:5px 0;}.yui-skin-sam .yui-pv-chartlegend dt{float:left;display:block;height:.7em;width:.7em;padding:0;}.yui-skin-sam .yui-pv-chartlegend dd{float:left;display:block;color:#fff;margin:0 1em 0 .5em;padding:0;font:11px arial;}.yui-skin-sam .yui-pv-minimized{height:35px;}.yui-skin-sam .yui-pv-minimized .bd{top:-3000px;}.yui-skin-sam .yui-pv-minimized .hd a.yui-pv-refresh{display:none;} +.yui-resize{position:relative;zoom:1;z-index:0;}.yui-resize-wrap{zoom:1;}.yui-draggable{cursor:move;}.yui-resize .yui-resize-handle{position:absolute;z-index:1;font-size:0;margin:0;padding:0;zoom:1;height:1px;width:1px;}.yui-resize .yui-resize-handle-br{height:5px;width:5px;bottom:0;right:0;cursor:se-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-bl{height:5px;width:5px;bottom:0;left:0;cursor:sw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tl{height:5px;width:5px;top:0;left:0;cursor:nw-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-tr{height:5px;width:5px;top:0;right:0;cursor:ne-resize;z-index:2;zoom:1;}.yui-resize .yui-resize-handle-r{width:5px;height:100%;top:0;right:0;cursor:e-resize;zoom:1;}.yui-resize .yui-resize-handle-l{height:100%;width:5px;top:0;left:0;cursor:w-resize;zoom:1;}.yui-resize .yui-resize-handle-b{width:100%;height:5px;bottom:0;right:0;cursor:s-resize;zoom:1;}.yui-resize .yui-resize-handle-t{width:100%;height:5px;top:0;right:0;cursor:n-resize;zoom:1;}.yui-resize-proxy{position:absolute;border:1px dashed #000;visibility:hidden;z-index:1000;}.yui-resize-hover .yui-resize-handle,.yui-resize-hidden .yui-resize-handle{opacity:0;filter:alpha(opacity=0);}.yui-resize-ghost{opacity:.5;filter:alpha(opacity=50);}.yui-resize-knob .yui-resize-handle{height:6px;width:6px;}.yui-resize-knob .yui-resize-handle-tr{right:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-tl{left:-3px;top:-3px;}.yui-resize-knob .yui-resize-handle-bl{left:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-br{right:-3px;bottom:-3px;}.yui-resize-knob .yui-resize-handle-t{left:45%;top:-3px;}.yui-resize-knob .yui-resize-handle-r{right:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-l{left:-3px;top:45%;}.yui-resize-knob .yui-resize-handle-b{left:45%;bottom:-3px;}.yui-resize-status{position:absolute;top:-999px;left:-999px;padding:2px;font-size:80%;display:none;zoom:1;z-index:9999;}.yui-resize-status strong,.yui-resize-status em{font-weight:normal;font-style:normal;padding:1px;zoom:1;}.yui-skin-sam .yui-resize .yui-resize-handle{background-color:#F2F2F2;}.yui-skin-sam .yui-resize .yui-resize-handle-active{background-color:#7D98B8;zoom:1;}.yui-skin-sam .yui-resize .yui-resize-handle-l,.yui-skin-sam .yui-resize .yui-resize-handle-r,.yui-skin-sam .yui-resize .yui-resize-handle-l-active,.yui-skin-sam .yui-resize .yui-resize-handle-r-active{height:100%;}.yui-skin-sam .yui-resize-knob .yui-resize-handle{border:1px solid #808080;}.yui-skin-sam .yui-resize-hover .yui-resize-handle-active{opacity:1;filter:alpha(opacity=100);}.yui-skin-sam .yui-resize-proxy{border:1px dashed #426FD9;}.yui-skin-sam .yui-resize-status{border:1px solid #A6982B;border-top:1px solid #D4C237;background-color:#FFEE69;color:#000;}.yui-skin-sam .yui-resize-status strong,.yui-skin-sam .yui-resize-status em{float:left;display:block;clear:both;padding:1px;text-align:center;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize .yui-resize-handle-inner-l{background:transparent url( layout_sprite.png) no-repeat 0 -5px;height:16px;width:5px;position:absolute;top:45%;}.yui-skin-sam .yui-resize .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize .yui-resize-handle-inner-b{background:transparent url(layout_sprite.png) no-repeat -20px 0;height:5px;width:16px;position:absolute;left:50%;}.yui-skin-sam .yui-resize .yui-resize-handle-br{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -62px;}.yui-skin-sam .yui-resize .yui-resize-handle-tr{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -42px;}.yui-skin-sam .yui-resize .yui-resize-handle-tl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -82px;}.yui-skin-sam .yui-resize .yui-resize-handle-bl{background-image:url( layout_sprite.png );background-repeat:no-repeat;background-position:-22px -23px;}.yui-skin-sam .yui-resize-knob .yui-resize-handle-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-br,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-t,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-b,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-tr,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-bl,.yui-skin-sam .yui-resize-knob .yui-resize-handle-inner-br{background-image:none;}.yui-skin-sam .yui-resize-knob .yui-resize-handle-l,.yui-skin-sam .yui-resize-knob .yui-resize-handle-r,.yui-skin-sam .yui-resize-knob .yui-resize-handle-l-active,.yui-skin-sam .yui-resize-knob .yui-resize-handle-r-active{height:6px;width:6px;} +.yui-busy{cursor:wait !important;}.yui-toolbar-container fieldset{padding:0;margin:0;border:0;}.yui-toolbar-container legend{display:none;}.yui-toolbar-container .yui-toolbar-subcont{padding:.25em 0;zoom:1;}.yui-toolbar-container-collapsed .yui-toolbar-subcont{display:none;}.yui-toolbar-container .yui-toolbar-subcont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container span.yui-toolbar-draghandle{cursor:move;border-left:1px solid #999;border-right:1px solid #999;overflow:hidden;text-indent:77777px;width:2px;height:20px;display:block;clear:none;float:left;margin:0 0 0 .2em;}.yui-toolbar-container .yui-toolbar-titlebar.draggable{cursor:move;}.yui-toolbar-container .yui-toolbar-titlebar{position:relative;}.yui-toolbar-container .yui-toolbar-titlebar h2{font-weight:bold;letter-spacing:0;border:none;color:#000;margin:0;padding:.2em;}.yui-toolbar-container .yui-toolbar-titlebar h2 a{text-decoration:none;color:#000;cursor:default;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-draghandle{height:40px;}.yui-toolbar-container .yui-toolbar-group{float:left;margin-right:.5em;zoom:1;}.yui-toolbar-container .yui-toolbar-group:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-container .yui-toolbar-group h3{font-size:75%;padding:0 0 0 .25em;margin:0;}.yui-toolbar-container span.yui-toolbar-separator{width:2px;padding:0;height:18px;margin:.2em 0 .2em .1em;display:none;float:left;}.yui-toolbar-container.yui-toolbar-grouped span.yui-toolbar-separator{height:45px;*height:50px;}.yui-toolbar-container.yui-toolbar-grouped .yui-toolbar-group span.yui-toolbar-separator{height:18px;display:block;}.yui-toolbar-container ul li{margin:0;padding:0;list-style-type:none;}.yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-toolbar-container .yui-push-button,.yui-toolbar-container .yui-color-button,.yui-toolbar-container .yui-menu-button{position:relative;cursor:pointer;}.yui-toolbar-container .yui-button .first-child,.yui-toolbar-container .yui-button .first-child a{height:100%;width:100%;overflow:hidden;font-size:0px;}.yui-toolbar-container .yui-button-disabled{cursor:default;}.yui-toolbar-container .yui-button-disabled .yui-toolbar-icon{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button-disabled .up,.yui-toolbar-container .yui-button-disabled .down{opacity:.5;filter:alpha(opacity=50);}.yui-toolbar-container .yui-button a{overflow:hidden;}.yui-toolbar-container .yui-toolbar-select .first-child a{cursor:pointer;}.yui-toolbar-fontname-arial{font-family:Arial;}.yui-toolbar-fontname-arial-black{font-family:Arial Black;}.yui-toolbar-fontname-comic-sans-ms{font-family:Comic Sans MS;}.yui-toolbar-fontname-courier-new{font-family:Courier New;}.yui-toolbar-fontname-times-new-roman{font-family:Times New Roman;}.yui-toolbar-fontname-verdana{font-family:Verdana;}.yui-toolbar-fontname-impact{font-family:Impact;}.yui-toolbar-fontname-lucida-console{font-family:Lucida Console;}.yui-toolbar-fontname-tahoma{font-family:Tahoma;}.yui-toolbar-fontname-trebuchet-ms{font-family:Trebuchet MS;}.yui-toolbar-container .yui-toolbar-spinbutton{position:relative;}.yui-toolbar-container .yui-toolbar-spinbutton .first-child a{z-index:0;opacity:1;}.yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-toolbar-container .yui-toolbar-spinbutton a.down{position:absolute;display:block right:0;cursor:pointer;z-index:1;padding:0;margin:0;}.yui-toolbar-container .yui-overlay{position:absolute;}.yui-toolbar-container .yui-overlay ul li{margin:0;list-style-type:none;}.yui-toolbar-container{z-index:1;}.yui-editor-container .yui-editor-editable-container{position:relative;z-index:0;width:100%;}.yui-editor-container .yui-editor-masked{background-color:#CCC;}.yui-editor-container iframe{border:0px;padding:0;margin:0;zoom:1;display:block;}.yui-editor-container .yui-editor-editable{padding:0;margin:0;}.yui-editor-container .dompath{font-size:85%;}.yui-editor-panel .hd{text-align:left;position:relative;}.yui-editor-panel .hd h3{font-weight:bold;padding:0.25em 0pt 0.25em 0.25em;margin:0;}.yui-editor-panel .bd{width:100%;zoom:1;position:relative;}.yui-editor-panel .bd div.yui-editor-body-cont{padding:.25em .1em;zoom:1;}.yui-editor-panel .bd .gecko form{overflow:auto;}.yui-editor-panel .bd div.yui-editor-body-cont:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-editor-panel .ft{text-align:right;width:99%;float:left;clear:both;}.yui-editor-panel .ft span.tip{display:block;position:relative;padding:.5em .5em .5em 23px;text-align:left;zoom:1;}.yui-editor-panel label{clear:both;float:left;padding:0;width:100%;text-align:left;zoom:1;}.yui-editor-panel .gecko label{overflow:auto;}.yui-editor-panel label strong{float:left;width:6em;}.yui-editor-panel .removeLink{width:80%;text-align:right;}.yui-editor-panel label input{margin-left:.25em;float:left;}.yui-editor-panel .yui-toolbar-group{margin-bottom:0.75em;}.yui-editor-panel .yui-toolbar-group-padding{}.yui-editor-panel .yui-toolbar-group-border{}.yui-editor-panel .yui-toolbar-group-textflow{}.yui-editor-panel .height-width{float:left;}.yui-editor-panel .height-width h3{}.yui-editor-panel .height-width span{font-style:italic;display:block;float:left;overflow:visible;}.yui-editor-panel .height-width span.info{font-size:70%;margin-top:3px;}.yui-editor-panel .yui-toolbar-bordersize,.yui-editor-panel .yui-toolbar-bordertype{font-size:75%;}.yui-editor-panel .yui-toolbar-container span.yui-toolbar-separator{border:none;}.yui-editor-panel .yui-toolbar-bordersize span a span,.yui-editor-panel .yui-toolbar-bordertype span a span{display:block;height:8px;left:4px;position:absolute;top:3px;_top:-5px;width:24px;text-indent:52px;font-size:0%;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-solid{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dotted{border-bottom:1px dotted black;}.yui-editor-panel .yui-toolbar-bordertype span a span.yui-toolbar-bordertype-dashed{border-bottom:1px dashed black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-0{*top:0px;text-indent:0px;font-size:75%;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-1{border-bottom:1px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-2{border-bottom:2px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-3{top:2px;*top:-5px;border-bottom:3px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-4{top:1px;*top:-5px;border-bottom:4px solid black;}.yui-editor-panel .yui-toolbar-bordersize span a span.yui-toolbar-bordersize-5{top:1px;*top:-5px;border-bottom:5px solid black;}.yui-toolbar-container .yui-toolbar-bordersize-menu,.yui-toolbar-container .yui-toolbar-bordertype-menu{width:95px !important;}.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel,.yui-toolbar-bordersize-menu .yuimenuitemlabel,.yui-toolbar-bordertype-menu .yuimenuitemlabel:hover{margin:0px 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-1 a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-2 a{border-bottom:2px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-3 a{border-bottom:3px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-4 a{border-bottom:4px solid black;height:14px;}.yui-toolbar-bordersize-menu li.yui-toolbar-bordersize-5 a{border-bottom:5px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-solid a{border-bottom:1px solid black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dashed a{border-bottom:1px dashed black;height:14px;}.yui-toolbar-bordertype-menu li.yui-toolbar-bordertype-dotted a{border-bottom:1px dotted black;height:14px;}h2.yui-editor-skipheader,h3.yui-editor-skipheader{height:0;margin:0;padding:0;border:none;width:0;overflow:hidden;position:absolute;}.yui-toolbar-colors{width:133px;zoom:1;display:none;z-index:100;overflow:hidden;}.yui-toolbar-colors:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors a{height:9px;width:9px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0;cursor:pointer;border:1px solid #F6F7EE;}.yui-toolbar-colors a:hover{border:1px solid black;}.yui-color-button-menu{overflow:visible;background-color:transparent;}.yui-toolbar-colors span{position:relative;display:block;padding:3px;overflow:hidden;float:left;width:100%;zoom:1;}.yui-toolbar-colors span:after{display:block;clear:both;visibility:hidden;content:'.';height:0;}.yui-toolbar-colors span em{height:35px;width:30px;float:left;display:block;overflow:hidden;text-indent:999px;margin:0.75px;border:1px solid black;}.yui-toolbar-colors span strong{font-weight:normal;padding-left:3px;display:block;font-size:85%;float:left;width:65%;}.yui-toolbar-group-undoredo h3,.yui-toolbar-group-insertitem h3,.yui-toolbar-group-indentlist h3{width:68px;}.yui-toolbar-group-indentlist2 h3{width:122px;}.yui-toolbar-group-alignment h3{width:130px;}.yui-skin-sam .yui-editor-container{border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container{zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar{background:url(sprite.png) repeat-x 0 -200px;position:relative;}.yui-skin-sam .yui-editor-container .draggable .yui-toolbar-titlebar{cursor:move;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar h2{color:#000000;font-weight:bold;margin:0;padding:0.3em 1em;font-size:100%;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-group h3{color:#808080;font-size:75%;margin:1em 0 0;padding-bottom:0;padding-left:0.25em;text-align:left;}.yui-toolbar-container span.yui-toolbar-separator{border:none;text-indent:33px;overflow:hidden;margin:0 .25em;}.yui-skin-sam .yui-toolbar-container{background-color:#F2F2F2;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subcont{padding:0 1em 0.35em;border-bottom:1px solid #808080;}.yui-skin-sam .yui-toolbar-container-collapsed .yui-toolbar-titlebar{border-bottom:1px solid #808080;}.yui-skin-sam .yui-editor-container .visible .yui-menu-shadow,.yui-skin-sam .yui-editor-panel .visible .yui-menu-shadow{display:none;}.yui-skin-sam .yui-editor-container ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-container ul li{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-toolbar-group ul li.yui-toolbar-groupitem{float:left;}.yui-skin-sam .yui-editor-container .dompath{background-color:#F2F2F2;border-top:1px solid #808080;color:#999;text-align:left;padding:0.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-titlebar span.collapse{cursor:pointer;position:absolute;top:4px;right:2px;display:block;overflow:hidden;height:15px;width:15px;text-indent:9999px;}.yui-skin-sam .yui-toolbar-container .yui-push-button,.yui-skin-sam .yui-toolbar-container .yui-color-button,.yui-skin-sam .yui-toolbar-container .yui-menu-button{background:url(sprite.png) repeat-x 0 0;position:relative;display:block;height:22px;width:30px;_font-size:0;margin:0;border-color:#808080;color:#f2f2f2;border-style:solid;border-width:1px 0;zoom:1;}.yui-skin-sam .yui-toolbar-container .yui-push-button a,.yui-skin-sam .yui-toolbar-container .yui-color-button a,.yui-skin-sam .yui-toolbar-container .yui-menu-button a{padding-left:35px;height:20px;text-decoration:none;font-size:0px;line-height:2;display:block;color:#000;overflow:hidden;white-space:nowrap;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-select a{font-size:12px;}.yui-skin-sam .yui-toolbar-container .yui-push-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button .first-child{border-color:#808080;border-style:solid;border-width:0 1px;margin:0 -1px;display:block;position:relative;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled .first-child,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled a,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-toolbar-container .yui-push-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-color-button-disabled,.yui-skin-sam .yui-toolbar-container .yui-menu-button-disabled{border-color:#ccc;}.yui-skin-sam .yui-toolbar-container .yui-button .first-child{*left:0px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-fontname{width:135px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-heading{width:92px;}.yui-skin-sam .yui-toolbar-container .yui-button-hover{background:url(sprite.png) repeat-x 0 -1300px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-button-selected{background:url(sprite.png) repeat-x 0 -1700px;border-color:#808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels h3{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-nogrouplabels .yui-toolbar-group{margin-top:.75em;}.yui-skin-sam .yui-toolbar-container .yui-push-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-color-button span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-menu-button span.yui-toolbar-icon{display:block;position:absolute;top:2px;height:18px;width:18px;overflow:hidden;background:url(editor-sprite.gif) no-repeat 30px 30px;}.yui-skin-sam .yui-toolbar-container .yui-button-selected span.yui-toolbar-icon,.yui-skin-sam .yui-toolbar-container .yui-button-hover span.yui-toolbar-icon{background-image:url(editor-sprite-active.gif);}.yui-skin-sam .yui-toolbar-container .visible .yuimenuitemlabel{cursor:pointer;color:#000;*position:relative;}.yui-skin-sam .yui-toolbar-container .yui-button-menu{background-color:#fff;}.yui-skin-sam .yui-toolbar-container .yui-button-menu .yui-menu-body-scrolled{position:relative;}.yui-skin-sam div.yuimenu li.selected{background-color:#B3D4FF;}.yui-skin-sam div.yuimenu li.selected a.selected{color:#000;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bold span.yui-toolbar-icon{background-position:0 0;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-strikethrough span.yui-toolbar-icon{background-position:0 -108px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-italic span.yui-toolbar-icon{background-position:0 -36px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-undo span.yui-toolbar-icon{background-position:0 -1326px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-redo span.yui-toolbar-icon{background-position:0 -1355px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-underline span.yui-toolbar-icon{background-position:0 -72px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-subscript span.yui-toolbar-icon{background-position:0 -180px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-superscript span.yui-toolbar-icon{background-position:0 -144px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-forecolor span.yui-toolbar-icon{background-position:0 -216px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-backcolor span.yui-toolbar-icon{background-position:0 -288px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyleft span.yui-toolbar-icon{background-position:0 -324px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifycenter span.yui-toolbar-icon{background-position:0 -360px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyright span.yui-toolbar-icon{background-position:0 -396px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-justifyfull span.yui-toolbar-icon{background-position:0 -432px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-indent span.yui-toolbar-icon{background-position:0 -720px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-outdent span.yui-toolbar-icon{background-position:0 -684px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-createlink span.yui-toolbar-icon{background-position:0 -792px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertimage span.yui-toolbar-icon{background-position:1px -756px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-left span.yui-toolbar-icon{background-position:0 -972px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-right span.yui-toolbar-icon{background-position:0 -936px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-inline span.yui-toolbar-icon{background-position:0 -900px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-block span.yui-toolbar-icon{background-position:0 -864px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-bordercolor span.yui-toolbar-icon{background-position:0 -252px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-removeformat span.yui-toolbar-icon{background-position:0 -1080px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-hiddenelements span.yui-toolbar-icon{background-position:0 -1044px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertunorderedlist span.yui-toolbar-icon{background-position:0 -468px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-insertorderedlist span.yui-toolbar-icon{background-position:0 -504px;left:5px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child{width:35px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton .first-child a{padding-left:2px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton span.yui-toolbar-icon{display:none;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{right:2px;background:url(editor-sprite.gif) no-repeat 0 -1222px;overflow:hidden;height:6px;width:7px;min-height:0;padding:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up{top:2px;background-position:0 -1222px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{bottom:2px;background-position:0 -1187px;}.yui-skin-sam .yui-toolbar-container select{height:22px;border:1px solid #808080;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select .first-child a{padding-left:5px;text-align:left;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select span.yui-toolbar-icon{background:url( editor-sprite.gif ) no-repeat 0 -1144px;overflow:hidden;right:-2px;top:0px;height:20px;}.yui-skin-sam .yui-editor-panel .yui-color-button-menu .bd{background-color:transparent;border:none;width:135px;}.yui-skin-sam .yui-color-button-menu .yui-toolbar-colors{border:1px solid #808080;}.yui-skin-sam .yui-editor-panel{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;position:absolute;}.yui-skin-sam .yui-editor-panel .hd{margin:10px 0 0;padding:0;border:none;}.yui-skin-sam .yui-editor-panel .hd h3{color:#000;border:1px solid #808080;background:url(sprite.png) repeat-x 0 -200px;width:99%;position:relative;margin:0;padding:3px 0 0 0;font-size:93%;text-indent:5px;height:20px;}.yui-skin-sam .yui-editor-panel .bd{background-color:#F2F2F2;border-left:1px solid #808080;border-right:1px solid #808080;width:99%;margin:0;padding:0;overflow:visible;}.yui-skin-sam .yui-editor-panel ul{list-style-type:none;margin:0;padding:0;}.yui-skin-sam .yui-editor-panel ul li{margin:0;padding:0;}.yui-skin-sam .yui-editor-panel .yuimenu{}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:0.35em;}.yui-skin-sam .yui-editor-panel .yui-toolbar-bordersize,.yui-skin-sam .yui-editor-panel .yui-toolbar-bordertype{width:50px;}.yui-skin-sam .yui-editor-panel label{display:block;float:none;padding:4px 0;margin-bottom:7px;}.yui-skin-sam .yui-editor-panel label strong{font-weight:normal;font-size:93%;text-align:right;padding-top:2px;}.yui-skin-sam .yui-editor-panel label input{width:75%;}.yui-skin-sam .yui-editor-panel .createlink_target,.yui-skin-sam .yui-editor-panel .insertimage_target{width:auto;margin-right:5px;}.yui-skin-sam .yui-editor-panel .removeLink{width:98%;}.yui-skin-sam .yui-editor-panel label input.warning{background-color:#FFEE69;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group h3{color:#000;float:left;font-weight:normal;font-size:93%;margin:5px 0 0 0;padding:0 3px 0 0;text-align:right;}.yui-skin-sam .yui-editor-panel .height-width h3{margin:3px 0 0 10px;}.yui-skin-sam .yui-editor-panel .height-width{margin:3px 0 0 35px;*margin-left:14px;width:42%;*width:44%;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-border{width:190px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-border{width:210px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding{width:203px;_width:198px;}.yui-skin-sam .yui-editor-panel .no-button .yui-toolbar-group-padding{width:172px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-padding h3{margin-left:25px;*margin-left:12px;}.yui-skin-sam .yui-editor-panel .yui-toolbar-group-textflow{width:182px;}.yui-skin-sam .yui-editor-panel .hd{background:none;}.yui-skin-sam .yui-editor-panel .ft{background-color:#F2F2F2;border:1px solid #808080;border-top:none;padding:0;margin:0 0 2px 0;}.yui-skin-sam .yui-editor-panel .hd span.close{background:url(sprite.png) no-repeat 0 -300px;cursor:pointer;display:block;height:16px;overflow:hidden;position:absolute;right:5px;text-indent:500px;top:2px;width:26px;}.yui-skin-sam .yui-editor-panel .ft span.tip{background-color:#EDF5FF;border-top:1px solid #808080;font-size:85%;}.yui-skin-sam .yui-editor-panel .ft span.tip strong{display:block;float:left;margin:0 2px 8px 0;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon{background:url( editor-sprite.gif ) no-repeat 0 -1260px;display:block;height:20px;left:2px;position:absolute;top:8px;width:20px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-info{background-position:2px -1260px;}.yui-skin-sam .yui-editor-panel .ft span.tip span.icon-warn{background-position:2px -1296px;}.yui-skin-sam .yui-editor-panel .hd span.knob{position:absolute;height:10px;width:28px;top:-10px;left:25px;text-indent:9999px;overflow:hidden;background:url( editor-knob.gif ) no-repeat 0 0;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container{float:left;width:100%;background-image:none;border:none;}.yui-skin-sam .yui-editor-panel .yui-toolbar-container .bd{background-color:#ffffff;}.yui-editor-blankimage{background-image:url( blankimage.png );}.yui-skin-sam .yui-editor-container .yui-resize-handle-br{height:11px;width:11px;background-position:-20px -60px;background-color:transparent;} +.yui-h-slider,.yui-v-slider{position:relative;}.yui-h-slider .yui-slider-thumb,.yui-v-slider .yui-slider-thumb{position:absolute;cursor:default;}.yui-skin-sam .yui-h-slider{background:url(../../bg-h.gif) no-repeat 5px 0;height:28px;width:228px;}.yui-skin-sam .yui-h-slider .yui-slider-thumb{top:4px;}.yui-skin-sam .yui-v-slider{background:url(../../bg-v.gif) no-repeat 12px 0;height:228px;width:48px;} +.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-content .yui-hidden{display:none;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{position:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;} +.ygtvitem{}.ygtvitem table{margin-bottom:0;border:none;}.ygtvrow td{border:none;padding:0;}.ygtvrow td a{text-decoration:none;}.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh,.ygtvtmhh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph,.ygtvtphh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh,.ygtvlmhh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph,.ygtvlphh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvchildren{}* html .ygtvchildren{height:2%;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;cursor:pointer;}.ygtvcontent{cursor:default;}.ygtvspacer{height:22px;width:12px;}.ygtvfocus{background-color:#c0e0e0;border:none;}.ygtvfocus .ygtvlabel,.ygtvfocus .ygtvlabel:link,.ygtvfocus .ygtvlabel:visited,.ygtvfocus .ygtvlabel:hover{background-color:#c0e0e0;}.ygtvfocus a,.ygtvrow td a{outline-style:none;}.ygtvok{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8800px no-repeat;}.ygtvok:hover{background:url(treeview-sprite.gif) 0 -8844px no-repeat;}.ygtvcancel{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8822px no-repeat;}.ygtvcancel:hover{background:url(treeview-sprite.gif) 0 -8866px no-repeat;}.ygtv-label-editor{background-color:#f2f2f2;border:1px solid silver;position:absolute;display:none;overflow:hidden;margin:auto;z-index:9000;}.ygtv-edit-TextNode{width:190px;}.ygtv-edit-TextNode .ygtvcancel,.ygtv-edit-TextNode .ygtvok{border:none;}.ygtv-edit-TextNode .ygtv-button-container{float:right;}.ygtv-edit-TextNode .ygtv-input input{width:140px;}.ygtv-edit-DateNode .ygtvcancel{border:none;}.ygtv-edit-DateNode .ygtvok{display:none;}.ygtv-edit-DateNode .ygtv-button-container{text-align:right;margin:auto;} + diff --git a/lib/yui/assets/skins/sam/slider.css b/lib/yui/assets/skins/sam/slider.css new file mode 100644 index 0000000000..073d43ea6d --- /dev/null +++ b/lib/yui/assets/skins/sam/slider.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-h-slider,.yui-v-slider{position:relative;}.yui-h-slider .yui-slider-thumb,.yui-v-slider .yui-slider-thumb{position:absolute;cursor:default;}.yui-skin-sam .yui-h-slider{background:url(../../bg-h.gif) no-repeat 5px 0;height:28px;width:228px;}.yui-skin-sam .yui-h-slider .yui-slider-thumb{top:4px;}.yui-skin-sam .yui-v-slider{background:url(../../bg-v.gif) no-repeat 12px 0;height:228px;width:48px;} diff --git a/lib/yui/assets/skins/sam/split-button-arrow-active.png b/lib/yui/assets/skins/sam/split-button-arrow-active.png new file mode 100755 index 0000000000000000000000000000000000000000..fa58c5030e76082c84e38342cf6722c723ad2fd2 GIT binary patch literal 280 zcmV+z0q6dSP)N~-|K;%i-0c73 z@c-iO|KRQa-|hd~QeFE1003M`L_t(|+U&?l5`sVg1i`WZK}Epr|6dhmytLs92=mel z9uoULP6;mwyM%qhIpHzkHQ|(SNO(*5TD8?y@wq9xG<+26t_AN^`$=39HtEMPCOjwP e%l`;(0R{kdKn;SADLBOd00006$Gh9E#3p9{H-P6S}q~camLV^=3&tj%#_Xa_x2_Xl57U&w-9pX85Q9;Im dv4Me^VIeE)+1pK9I)PdkJYD@<);T3K0RYcxInw|D literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/split-button-arrow-focus.png b/lib/yui/assets/skins/sam/split-button-arrow-focus.png new file mode 100755 index 0000000000000000000000000000000000000000..167d71eb721ba9b85c6601f9077d5c39faa4ebd2 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_Tx)0S05bpo|DSu#^)isf zToU9L{Qp10^;5h+0~ypkT^vIyZY3ooII;39W@>hC5M-JVa^Poyu7TYlo?{mkWE>b9 b7?>Frva+7N-L$0>sD;7P)z4*}Q$iB}D9ShR literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/split-button-arrow-hover.png b/lib/yui/assets/skins/sam/split-button-arrow-hover.png new file mode 100755 index 0000000000000000000000000000000000000000..167d71eb721ba9b85c6601f9077d5c39faa4ebd2 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_Tx)0S05bpo|DSu#^)isf zToU9L{Qp10^;5h+0~ypkT^vIyZY3ooII;39W@>hC5M-JVa^Poyu7TYlo?{mkWE>b9 b7?>Frva+7N-L$0>sD;7P)z4*}Q$iB}D9ShR literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/split-button-arrow.png b/lib/yui/assets/skins/sam/split-button-arrow.png new file mode 100755 index 0000000000000000000000000000000000000000..b33a93ff2dc2039bd24e4ea3b75ecf4bb3295f84 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_TpJo1fXx5@|JyBHuocK+ zE(!7r{{Nrh`YB$Zfeh-NE{-7;w~`VPoLG4lGc~(62r^9wIqgTe~DWM4f1sXSq literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/sprite.png b/lib/yui/assets/skins/sam/sprite.png new file mode 100755 index 0000000000000000000000000000000000000000..73634d6a22c4377060f49217b63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CD+xb}&h-L8E0VLVp&BkLc3gf)rhVVMP4XmN)97S<}B zV2{G}DV^_ok9}tVuG`_WuEv$$a*(WbCCgxV?IT%bdAG0IDT#4$#B#R^Ykb8OzG9iL zQQe?88+^NO<7m2HLW>&LR$&!!#}<}kQPtG}yA0$nXk0fc6dS3=^>c;SWX0!X05+RB z_SFS;GpWXPk75BXbx`b~8rKIVyb9lZcJO5e8rO|>0Sf?fP;8_c*Q<7%mpKG=7;bx& z3@YZ)!vh=~V2cF@#x|M^ho==@V;vk$zsfnt9#DKvG_Es;PX=GF2?Qf^g~1C*;2h)= zKHu{IH%#WhYy=JK%;DMxWI>>D9mdEU0k$0qu00#!F_Zy~tE)_=RWvgQy!xv5>py+# z^%|;jQVVmHyaK9LfXEsRbi4+1Q!r1-12^ds5#HTJH^na%>;nx|Z{@vBeJh!xFBbSiTGNb|PcQHhedG(#ze2@`_q!iIT9B0|9NQ28! zJ?sHy%+1H@Ep0>n?+qI6joP?3sDKg6fOduu4QFV(?KYf{Mz3wUFYE87jMmha1@3?2eUV-(P*8&8Bv(*FK-T3*2Cru7u0RY%uzVfCFi0F_ zdY@f~Dn8-v$i5vM2NeAx_GGBcQkf+!)*y;HRbU zR(NXx7UT1&@ulN)xgGkt#=($dDO70_zJ?lsb}i7+25*k$Pu_(7UqBpMi7z~_!LtqG z5c*1Vo~#bU`*+RJc#IZkBwTHTT1Th>xWYf{U^7#Fw=^6dlTXF?+`Ef`fe$4>MKkc> z7I38V&HM17dVXp_u&)}_jJl(v6Ry``cz{2?4K3&WQVs(?!b~;NCmb+LvhEkTx=+f{ z3M0rhVPp}z>% literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/tabview.css b/lib/yui/assets/skins/sam/tabview.css new file mode 100755 index 0000000000..ece4ebdfe4 --- /dev/null +++ b/lib/yui/assets/skins/sam/tabview.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 0.5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 0.5em;}.yui-navset .yui-content .yui-hidden{display:none;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{width:6em;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{width:auto;}.yui-navset .yui-navset-left,.yui-navset-left{padding:0 0 0 6em;}.yui-navset-right{padding:0 6em 0 0;}.yui-navset-top,.yui-navset-bottom{padding:auto;}.yui-nav,.yui-nav li{margin:0;padding:0;list-style:none;}.yui-navset li em{font-style:normal;}.yui-navset{position:relative;zoom:1;}.yui-navset .yui-content{zoom:1;}.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{display:inline-block;display:-moz-inline-stack;*display:inline;vertical-align:bottom;cursor:pointer;zoom:1;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{display:block;}.yui-navset .yui-nav a{position:relative;}.yui-navset .yui-nav li a,.yui-navset-top .yui-nav li a,.yui-navset-bottom .yui-nav li a{display:block;display:inline-block;vertical-align:bottom;zoom:1;}.yui-navset-left .yui-nav li a,.yui-navset-right .yui-nav li a{display:block;}.yui-navset-bottom .yui-nav li a{vertical-align:text-top;}.yui-navset .yui-nav li a em,.yui-navset-top .yui-nav li a em,.yui-navset-bottom .yui-nav li a em{display:block;}.yui-navset .yui-navset-left .yui-nav,.yui-navset .yui-navset-right .yui-nav,.yui-navset-left .yui-nav,.yui-navset-right .yui-nav{position:absolute;z-index:1;}.yui-navset-top .yui-nav,.yui-navset-bottom .yui-nav{position:static;}.yui-navset .yui-navset-left .yui-nav,.yui-navset-left .yui-nav{left:0;right:auto;}.yui-navset .yui-navset-right .yui-nav,.yui-navset-right .yui-nav{right:0;left:auto;}.yui-skin-sam .yui-navset .yui-nav,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav{border:solid #2647a0;border-width:0 0 5px;Xposition:relative;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin:0 0.16em 0 0;padding:1px 0 0;zoom:1;}.yui-skin-sam .yui-navset .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav .selected{margin:0 0.16em -1px 0;}.yui-skin-sam .yui-navset .yui-nav a,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:0 1px;color:#000;position:relative;text-decoration:none;}.yui-skin-sam .yui-navset .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a em{border:solid #a3a3a3;border-width:1px 0 0;cursor:hand;padding:0.25em .75em;left:0;right:0;bottom:0;top:-1px;position:relative;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a:focus,.yui-skin-sam .yui-navset .yui-nav .selected a:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff;}.yui-skin-sam .yui-navset .yui-nav a:hover,.yui-skin-sam .yui-navset .yui-nav a:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:0.35em 0.75em;}.yui-skin-sam .yui-navset .yui-nav .selected a,.yui-skin-sam .yui-navset .yui-nav .selected a em{border-color:#243356;}.yui-skin-sam .yui-navset .yui-content{background:#edf5ff;}.yui-skin-sam .yui-navset .yui-content,.yui-skin-sam .yui-navset .yui-navset-top .yui-content{border:1px solid #808080;border-top-color:#243356;padding:0.25em 0.5em;}.yui-skin-sam .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav,.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 5px 0 0;Xposition:absolute;top:0;bottom:0;}.yui-skin-sam .yui-navset .yui-navset-right .yui-nav,.yui-skin-sam .yui-navset-right .yui-nav{border-width:0 0 0 5px;}.yui-skin-sam .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav li,.yui-skin-sam .yui-navset-right .yui-nav li{margin:0 0 0.16em;padding:0 0 0 1px;}.yui-skin-sam .yui-navset-right .yui-nav li{padding:0 1px 0 0;}.yui-skin-sam .yui-navset-left .yui-nav .selected,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav .selected{margin:0 -1px 0.16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin:0 0 0.16em -1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav a{border-width:1px 0;}.yui-skin-sam .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset .yui-navset-left .yui-nav a em,.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 0 0 1px;padding:0.2em .75em;top:auto;left:-1px;}.yui-skin-sam .yui-navset-right .yui-nav a em{border-width:0 1px 0 0;left:auto;right:-1px;}.yui-skin-sam .yui-navset-left .yui-nav a,.yui-skin-sam .yui-navset-left .yui-nav .selected a,.yui-skin-sam .yui-navset-left .yui-nav a:hover,.yui-skin-sam .yui-navset-right .yui-nav a,.yui-skin-sam .yui-navset-right .yui-nav .selected a,.yui-skin-sam .yui-navset-right .yui-nav a:hover,.yui-skin-sam .yui-navset-bottom .yui-nav a,.yui-skin-sam .yui-navset-bottom .yui-nav .selected a,.yui-skin-sam .yui-navset-bottom .yui-nav a:hover{background-image:none;}.yui-skin-sam .yui-navset-left .yui-content{border:1px solid #808080;border-left-color:#243356;}.yui-skin-sam .yui-navset-bottom .yui-nav,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav{border-width:5px 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav .selected,.yui-skin-sam .yui-navset-bottom .yui-nav .selected{margin:-1px 0.16em 0 0;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li,.yui-skin-sam .yui-navset-bottom .yui-nav li{padding:0 0 1px 0;vertical-align:top;}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav li a,.yui-skin-sam .yui-navset-bottom .yui-nav li a{}.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav a em,.yui-skin-sam .yui-navset-bottom .yui-nav a em{border-width:0 0 1px;top:auto;bottom:-1px;}.yui-skin-sam .yui-navset-bottom .yui-content,.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content{border:1px solid #808080;border-bottom-color:#243356;} diff --git a/lib/yui/assets/skins/sam/treeview-loading.gif b/lib/yui/assets/skins/sam/treeview-loading.gif new file mode 100755 index 0000000000000000000000000000000000000000..0bbf3bc0c0e5e635553e8d1bf9ceddefbc402396 GIT binary patch literal 2673 zcmchY_gj;P7RTSb83YJ1>=8y5ONL=ZcEgk+C?FydumNNz8c=c6`n&|fmMu_HHG%^w zNLVjHyfy)hAgHK_Kxkz+0Ktm5M|X*?y?g!o_3yv`{_^F^wY9YuFJ3GxEUd1s-nnz<)vH(c?%i8n zUVirM+2rIT007UQKY#e};oRKZty{MqJa}MhYina;bNBAu-+udTYHDhBcJ|n@WA*j* z-+lL;iHS*OX6D|#dm|zu!o$ON?b=mbT)bh!26uP&kdP1u2Zx!N8486$B9X?&$DclZ zdgI28>FMdk#l`#g@Bj4EPc=0)2M!!4EG!%z9?s6rzI5r**|TSdhK8)HtXf)HHgDc+ zZEek9Fk)k4xm@nHZQC3j9o^jACMG6~jg9m3^EYnX2*Yq^XJ>6~?X_#y4jnqQbLUQp zM6z$+zMp^o*}}p?p-?n8H=jOzx~Zv&N~Km+RkgLX9X@>c=FOXxm6dsUd1NvZ zX=yul?BMZua=F~p)O7py?EwJ+w{PD*dGh2hzx?v((WCP6au$mb!vmnqSpF6-9Ona(JQT#e>!KODwxYzG5#S|?M#v6eD#mgO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hyVaJ;{f4%yNnRNx;qKlyS>6&z$H<@2AsUcy8+>=0}ZnS4a~p*U?abK z1mVjBz>C4yo4v{F1qJNE$veKm`?+M`zIG72rE9_ktTOaFzrPy@_B+4HYY4xazX0$D U{p-H~9KZ}Pzz8h7+YkZ(JNT^25dZ)H literal 0 HcmV?d00001 diff --git a/lib/yui/assets/skins/sam/treeview.css b/lib/yui/assets/skins/sam/treeview.css new file mode 100755 index 0000000000..5798ff70be --- /dev/null +++ b/lib/yui/assets/skins/sam/treeview.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.ygtvitem{}.ygtvitem table{margin-bottom:0;border:none;}.ygtvrow td{border:none;padding:0;}.ygtvrow td a{text-decoration:none;}.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;}.ygtvtm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4000px no-repeat;}.ygtvtmh,.ygtvtmhh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -4800px no-repeat;}.ygtvtp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -6400px no-repeat;}.ygtvtph,.ygtvtphh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -7200px no-repeat;}.ygtvln{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -1600px no-repeat;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0px no-repeat;}.ygtvlmh,.ygtvlmhh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -800px no-repeat;}.ygtvlp{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -2400px no-repeat;}.ygtvlph,.ygtvlphh{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 -3200px no-repeat;}.ygtvloading{width:18px;height:22px;background:url(treeview-loading.gif) 0 0 no-repeat;}.ygtvdepthcell{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8000px no-repeat;}.ygtvblankdepthcell{width:18px;height:22px;}.ygtvchildren{}* html .ygtvchildren{height:2%;}.ygtvlabel,.ygtvlabel:link,.ygtvlabel:visited,.ygtvlabel:hover{margin-left:2px;text-decoration:none;background-color:white;cursor:pointer;}.ygtvcontent{cursor:default;}.ygtvspacer{height:22px;width:12px;}.ygtvfocus{background-color:#c0e0e0;border:none;}.ygtvfocus .ygtvlabel,.ygtvfocus .ygtvlabel:link,.ygtvfocus .ygtvlabel:visited,.ygtvfocus .ygtvlabel:hover{background-color:#c0e0e0;}.ygtvfocus a,.ygtvrow td a{outline-style:none;}.ygtvok{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8800px no-repeat;}.ygtvok:hover{background:url(treeview-sprite.gif) 0 -8844px no-repeat;}.ygtvcancel{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -8822px no-repeat;}.ygtvcancel:hover{background:url(treeview-sprite.gif) 0 -8866px no-repeat;}.ygtv-label-editor{background-color:#f2f2f2;border:1px solid silver;position:absolute;display:none;overflow:hidden;margin:auto;z-index:9000;}.ygtv-edit-TextNode{width:190px;}.ygtv-edit-TextNode .ygtvcancel,.ygtv-edit-TextNode .ygtvok{border:none;}.ygtv-edit-TextNode .ygtv-button-container{float:right;}.ygtv-edit-TextNode .ygtv-input input{width:140px;}.ygtv-edit-DateNode .ygtvcancel{border:none;}.ygtv-edit-DateNode .ygtvok{display:none;}.ygtv-edit-DateNode .ygtv-button-container{text-align:right;margin:auto;} diff --git a/lib/yui/assets/skins/sam/wait.gif b/lib/yui/assets/skins/sam/wait.gif new file mode 100644 index 0000000000000000000000000000000000000000..471c1a4f93f2cabf0b3a85c3ff8e0a8aadefc548 GIT binary patch literal 1100 zcmZwFZA@EL90u^)S14;kcS~P51JcqXyBK7YjR|$m*3qt)1nqFnf*+(nyIT_zZIrbc zP70+hE$ePOAcE2K4FU;V;KM+=xUiQtnG(k(Qx;;(oQVNl47kM11c$9(j7iV=cuw*= z&;L26aeaM*8AVX!4nUmF3luezO5JukyN8Fbj*JY)E9#Hd|0*@ZIv{eO*Nb# z12yCIrOhLLJlbn33DTB}t(F_b2bV4~y*j=}%v9m90(t13QX1^b_==P$D+H{5*5Mu? z8gKY>BXXf^7@!+sCzFj+>XgJsqfc(1Ya(r=#J=3 zlZtj9{~(p*xA$9X2mMtN6e0bM#^36uHAhJ9Q&;+@HQ_ThCJ=yPPcaaStzMs1DHP_0 zvw_E92pgO+s83$0SnZp{u*pvQ$A3#Rftg(VD(=52XCTzUftd4T-22$PQrgIR*gHx4 z{43C_yk?5j?(i$Mual4dFf?{<9Wn}qfaB%>iNwkdu&q!m&h2IcZ$2Th!C8}<*_&Pr zyKl`OZw8N)3D^4?RK}UoD=o00gbKYHy=yv32mZ9Dl8aIS8x^Z$2?NwcBLzFmZOtoW zzN62&u*QDIz{Fy}^YAXY&Txmg7ATSAhAr8K5fZbFZ*SFa$_qE2L|VVFHOI{wKE8B_ zGXV2p-56OO`rc4Z7g3zbj)2_3YjK$((`OUqD%*mgvS`YELYsVW1or1)YW%;)D$oE>#r zQ3z|D(W$Eg`c?NY^+fD&+nctrc25@u47U__J8-QW7NqK!$T9C@*SpuaHyFRRpIGae rj_Lao#za}+eaj_<`F9!mRdtBiaY8;H + +
+ + +* The default queryDelay value has been changed to 0.2. In low-latency +implementations (e.g., when queryDelay is set to 0 against a local +JavaScript DataSource), typeAhead functionality may experience a race condition +when retrieving the value of the textbox. To avoid this problem, implementers +are advised not to set the queryDelay value too low. + +* Fixed runtime property value validation. + +* Implemented new method doBeforeSendQuery(). + +* Implemented new method destroy(). + +* Added support for latest JSON lib http://www.json.org/json.js. + +* Fixed forceSelection issues with matched selections and multiple selections. + +* No longer create var oAnim in global scope. + +* The properties alwaysShowContainer and useShadow should not be enabled together. + +* There is a known issue in Firefox where the native browser autocomplete +attribute cannot be disabled programmatically on input boxes that are in use. + + + + + +**** version 2.2.2 *** + +* No changes. + + + +*** version 2.2.1 *** + +* Fixed form submission in Safari bug. +* Fixed broken DS_JSArray support for minQueryLength=0. +* Improved type checking with YAHOO.lang. + + + +*** version 2.2.0 *** + +* No changes. + + + +*** version 0.12.2 *** + +* No changes. + + + +*** version 0.12.1 *** + +* No longer trigger typeAhead feature when user is backspacing on input text. + + + +*** version 0.12.0 *** + +* The following constants must be defined as static class properties and are no longer +available as instance properties: + +YAHOO.widget.DataSource.ERROR_DATANULL +YAHOO.widget.DataSource.ERROR_DATAPARSE +YAHOO.widget.DS_XHR.TYPE_JSON +YAHOO.widget.DS_XHR.TYPE_XML +YAHOO.widget.DS_XHR.TYPE_FLAT +YAHOO.widget.DS_XHR.ERROR_DATAXHR + +* The property minQueryLength now supports zero and negative number values for +DS_JSFunction and DS_XHR objects, to enable null or empty string queries and to disable +AutoComplete functionality altogether, respectively. + +* Enabling the alwaysShowContainer feature will no longer send containerExpandEvent or +containerCollapseEvent. + + + +**** version 0.11.3 *** + +* The iFrameSrc property has been deprecated. Implementers no longer need to +specify an https URL to avoid IE security warnings when working with sites over +SSL. + + + +*** version 0.11.0 *** + +* The method getListIds() has been deprecated for getListItems(), which returns +an array of DOM references. + +* All classnames have been prefixed with "yui-ac-". + +* Container elements should no longer have CSS property "display" set to "none". + +* The useIFrame property can now be set after instantiation. + +* On some browsers, the unmatchedItemSelectEvent may not be fired properly when +delimiter characters are defined. + +* On some browsers, defining delimiter characters while enabling forceSelection +may result in unexpected behavior. + + + +*** version 0.10.0 *** + +* Initial release + +* In order to enable the useIFrame property, it should be set in the +constructor. + +* On some browsers, defining delimiter characters while enabling forceSelection +may result in unexpected behavior. diff --git a/lib/yui/autocomplete/assets/autocomplete-core.css b/lib/yui/autocomplete/assets/autocomplete-core.css new file mode 100755 index 0000000000..017ea47e64 --- /dev/null +++ b/lib/yui/autocomplete/assets/autocomplete-core.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +/* This file intentionally left blank */ diff --git a/lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css b/lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css new file mode 100755 index 0000000000..b7f216e6b7 --- /dev/null +++ b/lib/yui/autocomplete/assets/skins/sam/autocomplete-skin.css @@ -0,0 +1,57 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +/* styles for entire widget */ +.yui-skin-sam .yui-ac { + position:relative;font-family:arial;font-size:100%; +} + +/* styles for input field */ +.yui-skin-sam .yui-ac-input { + position:absolute;width:100%; +} + +/* styles for results container */ +.yui-skin-sam .yui-ac-container { + position:absolute;top:1.6em;width:100%; +} + +/* styles for header/body/footer wrapper within container */ +.yui-skin-sam .yui-ac-content { + position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050; +} + +/* styles for container shadow */ +.yui-skin-sam .yui-ac-shadow { + position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity: 0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049; +} + +/* styles for container iframe */ +.yui-skin-sam .yui-ac iframe { + opacity:0;filter: alpha(opacity=0); + padding-right:.3em; padding-bottom:.3em; /* Bug 2026798: extend iframe to shim the shadow */ +} + +/* styles for results list */ +.yui-skin-sam .yui-ac-content ul{ + margin:0;padding:0;width:100%; +} + +/* styles for result item */ +.yui-skin-sam .yui-ac-content li { + margin:0;padding:2px 5px;cursor:default;white-space:nowrap;list-style:none; + zoom:1; /* For IE to trigger mouse events on LI */ +} + +/* styles for prehighlighted result item */ +.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight { + background:#B3D4FF; +} + +/* styles for highlighted result item */ +.yui-skin-sam .yui-ac-content li.yui-ac-highlight { + background:#426FD9;color:#FFF; +} diff --git a/lib/yui/autocomplete/assets/skins/sam/autocomplete.css b/lib/yui/autocomplete/assets/skins/sam/autocomplete.css new file mode 100755 index 0000000000..82cf7e50b7 --- /dev/null +++ b/lib/yui/autocomplete/assets/skins/sam/autocomplete.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-skin-sam .yui-ac{position:relative;font-family:arial;font-size:100%;}.yui-skin-sam .yui-ac-input{position:absolute;width:100%;}.yui-skin-sam .yui-ac-container{position:absolute;top:1.6em;width:100%;}.yui-skin-sam .yui-ac-content{position:absolute;width:100%;border:1px solid #808080;background:#fff;overflow:hidden;z-index:9050;}.yui-skin-sam .yui-ac-shadow{position:absolute;margin:.3em;width:100%;background:#000;-moz-opacity:0.10;opacity:.10;filter:alpha(opacity=10);z-index:9049;}.yui-skin-sam .yui-ac iframe{opacity:0;filter:alpha(opacity=0);padding-right:.3em;padding-bottom:.3em;}.yui-skin-sam .yui-ac-content ul{margin:0;padding:0;width:100%;}.yui-skin-sam .yui-ac-content li{margin:0;padding:2px 5px;cursor:default;white-space:nowrap;list-style:none;zoom:1;}.yui-skin-sam .yui-ac-content li.yui-ac-prehighlight{background:#B3D4FF;}.yui-skin-sam .yui-ac-content li.yui-ac-highlight{background:#426FD9;color:#FFF;} diff --git a/lib/yui/autocomplete/autocomplete-debug.js b/lib/yui/autocomplete/autocomplete-debug.js new file mode 100755 index 0000000000..56e2ace688 --- /dev/null +++ b/lib/yui/autocomplete/autocomplete-debug.js @@ -0,0 +1,2917 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +///////////////////////////////////////////////////////////////////////////// +// +// YAHOO.widget.DataSource Backwards Compatibility +// +///////////////////////////////////////////////////////////////////////////// + +YAHOO.widget.DS_JSArray = YAHOO.util.LocalDataSource; + +YAHOO.widget.DS_JSFunction = YAHOO.util.FunctionDataSource; + +YAHOO.widget.DS_XHR = function(sScriptURI, aSchema, oConfigs) { + var DS = new YAHOO.util.XHRDataSource(sScriptURI, oConfigs); + DS._aDeprecatedSchema = aSchema; + return DS; +}; + +YAHOO.widget.DS_ScriptNode = function(sScriptURI, aSchema, oConfigs) { + var DS = new YAHOO.util.ScriptNodeDataSource(sScriptURI, oConfigs); + DS._aDeprecatedSchema = aSchema; + return DS; +}; + +YAHOO.widget.DS_XHR.TYPE_JSON = YAHOO.util.DataSourceBase.TYPE_JSON; +YAHOO.widget.DS_XHR.TYPE_XML = YAHOO.util.DataSourceBase.TYPE_XML; +YAHOO.widget.DS_XHR.TYPE_FLAT = YAHOO.util.DataSourceBase.TYPE_TEXT; + +// TODO: widget.DS_ScriptNode.scriptCallbackParam + + + + /** + * The AutoComplete control provides the front-end logic for text-entry suggestion and + * completion functionality. + * + * @module autocomplete + * @requires yahoo, dom, event, datasource + * @optional animation + * @namespace YAHOO.widget + * @title AutoComplete Widget + */ + +/****************************************************************************/ +/****************************************************************************/ +/****************************************************************************/ + +/** + * The AutoComplete class provides the customizable functionality of a plug-and-play DHTML + * auto completion widget. Some key features: + *
    + *
  • Navigate with up/down arrow keys and/or mouse to pick a selection
  • + *
  • The drop down container can "roll down" or "fly out" via configurable + * animation
  • + *
  • UI look-and-feel customizable through CSS, including container + * attributes, borders, position, fonts, etc
  • + *
+ * + * @class AutoComplete + * @constructor + * @param elInput {HTMLElement} DOM element reference of an input field. + * @param elInput {String} String ID of an input field. + * @param elContainer {HTMLElement} DOM element reference of an existing DIV. + * @param elContainer {String} String ID of an existing DIV. + * @param oDataSource {YAHOO.widget.DataSource} DataSource instance. + * @param oConfigs {Object} (optional) Object literal of configuration params. + */ +YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) { + if(elInput && elContainer && oDataSource) { + // Validate DataSource + if(oDataSource instanceof YAHOO.util.DataSourceBase) { + this.dataSource = oDataSource; + } + else { + YAHOO.log("Could not instantiate AutoComplete due to an invalid DataSource", "error", this.toString()); + return; + } + + // YAHOO.widget.DataSource schema backwards compatibility + // Converted deprecated schema into supported schema + // First assume key data is held in position 0 of results array + this.key = 0; + var schema = oDataSource.responseSchema; + // An old school schema has been defined in the deprecated DataSource constructor + if(oDataSource._aDeprecatedSchema) { + var aDeprecatedSchema = oDataSource._aDeprecatedSchema; + if(YAHOO.lang.isArray(aDeprecatedSchema)) { + + if((oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_JSON) || + (oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_UNKNOWN)) { // Used to default to unknown + // Store the resultsList + schema.resultsList = aDeprecatedSchema[0]; + // Store the key + this.key = aDeprecatedSchema[1]; + // Only resultsList and key are defined, so grab all the data + schema.fields = (aDeprecatedSchema.length < 3) ? null : aDeprecatedSchema.slice(1); + } + else if(oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_XML) { + schema.resultNode = aDeprecatedSchema[0]; + this.key = aDeprecatedSchema[1]; + schema.fields = aDeprecatedSchema.slice(1); + } + else if(oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_TEXT) { + schema.recordDelim = aDeprecatedSchema[0]; + schema.fieldDelim = aDeprecatedSchema[1]; + } + oDataSource.responseSchema = schema; + } + } + + // Validate input element + if(YAHOO.util.Dom.inDocument(elInput)) { + if(YAHOO.lang.isString(elInput)) { + this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput; + this._elTextbox = document.getElementById(elInput); + } + else { + this._sName = (elInput.id) ? + "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id: + "instance" + YAHOO.widget.AutoComplete._nIndex; + this._elTextbox = elInput; + } + YAHOO.util.Dom.addClass(this._elTextbox, "yui-ac-input"); + } + else { + YAHOO.log("Could not instantiate AutoComplete due to an invalid input element", "error", this.toString()); + return; + } + + // Validate container element + if(YAHOO.util.Dom.inDocument(elContainer)) { + if(YAHOO.lang.isString(elContainer)) { + this._elContainer = document.getElementById(elContainer); + } + else { + this._elContainer = elContainer; + } + if(this._elContainer.style.display == "none") { + YAHOO.log("The container may not display properly if display is set to \"none\" in CSS", "warn", this.toString()); + } + + // For skinning + var elParent = this._elContainer.parentNode; + var elTag = elParent.tagName.toLowerCase(); + if(elTag == "div") { + YAHOO.util.Dom.addClass(elParent, "yui-ac"); + } + else { + YAHOO.log("Could not find the wrapper element for skinning", "warn", this.toString()); + } + } + else { + YAHOO.log("Could not instantiate AutoComplete due to an invalid container element", "error", this.toString()); + return; + } + + // Default applyLocalFilter setting is to enable for local sources + if(this.dataSource.dataType === YAHOO.util.DataSourceBase.TYPE_LOCAL) { + this.applyLocalFilter = true; + } + + // Set any config params passed in to override defaults + if(oConfigs && (oConfigs.constructor == Object)) { + for(var sConfig in oConfigs) { + if(sConfig) { + this[sConfig] = oConfigs[sConfig]; + } + } + } + + // Initialization sequence + this._initContainerEl(); + this._initProps(); + this._initListEl(); + this._initContainerHelperEls(); + + // Set up events + var oSelf = this; + var elTextbox = this._elTextbox; + + // Dom events + YAHOO.util.Event.addListener(elTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf); + YAHOO.util.Event.addListener(elTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf); + YAHOO.util.Event.addListener(elTextbox,"focus",oSelf._onTextboxFocus,oSelf); + YAHOO.util.Event.addListener(elTextbox,"blur",oSelf._onTextboxBlur,oSelf); + YAHOO.util.Event.addListener(elContainer,"mouseover",oSelf._onContainerMouseover,oSelf); + YAHOO.util.Event.addListener(elContainer,"mouseout",oSelf._onContainerMouseout,oSelf); + YAHOO.util.Event.addListener(elContainer,"click",oSelf._onContainerClick,oSelf); + YAHOO.util.Event.addListener(elContainer,"scroll",oSelf._onContainerScroll,oSelf); + YAHOO.util.Event.addListener(elContainer,"resize",oSelf._onContainerResize,oSelf); + YAHOO.util.Event.addListener(elTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf); + YAHOO.util.Event.addListener(window,"unload",oSelf._onWindowUnload,oSelf); + + // Custom events + this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this); + this.textboxKeyEvent = new YAHOO.util.CustomEvent("textboxKey", this); + this.dataRequestEvent = new YAHOO.util.CustomEvent("dataRequest", this); + this.dataReturnEvent = new YAHOO.util.CustomEvent("dataReturn", this); + this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this); + this.containerPopulateEvent = new YAHOO.util.CustomEvent("containerPopulate", this); + this.containerExpandEvent = new YAHOO.util.CustomEvent("containerExpand", this); + this.typeAheadEvent = new YAHOO.util.CustomEvent("typeAhead", this); + this.itemMouseOverEvent = new YAHOO.util.CustomEvent("itemMouseOver", this); + this.itemMouseOutEvent = new YAHOO.util.CustomEvent("itemMouseOut", this); + this.itemArrowToEvent = new YAHOO.util.CustomEvent("itemArrowTo", this); + this.itemArrowFromEvent = new YAHOO.util.CustomEvent("itemArrowFrom", this); + this.itemSelectEvent = new YAHOO.util.CustomEvent("itemSelect", this); + this.unmatchedItemSelectEvent = new YAHOO.util.CustomEvent("unmatchedItemSelect", this); + this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this); + this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this); + this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this); + this.textboxChangeEvent = new YAHOO.util.CustomEvent("textboxChange", this); + + // Finish up + elTextbox.setAttribute("autocomplete","off"); + YAHOO.widget.AutoComplete._nIndex++; + YAHOO.log("AutoComplete initialized","info",this.toString()); + } + // Required arguments were not found + else { + YAHOO.log("Could not instantiate AutoComplete due invalid arguments", "error", this.toString()); + } +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Public member variables +// +///////////////////////////////////////////////////////////////////////////// + +/** + * The DataSource object that encapsulates the data used for auto completion. + * This object should be an inherited object from YAHOO.widget.DataSource. + * + * @property dataSource + * @type YAHOO.widget.DataSource + */ +YAHOO.widget.AutoComplete.prototype.dataSource = null; + +/** + * By default, results from local DataSources will pass through the filterResults + * method to apply a client-side matching algorithm. + * + * @property applyLocalFilter + * @type Boolean + * @default true for local arrays and json, otherwise false + */ +YAHOO.widget.AutoComplete.prototype.applyLocalFilter = null; + +/** + * When applyLocalFilter is true, the local filtering algorthim can have case sensitivity + * enabled. + * + * @property queryMatchCase + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.queryMatchCase = false; + +/** + * When applyLocalFilter is true, results can be locally filtered to return + * matching strings that "contain" the query string rather than simply "start with" + * the query string. + * + * @property queryMatchContains + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.queryMatchContains = false; + +/** + * Enables query subset matching. When the DataSource's cache is enabled and queryMatchSubset is + * true, substrings of queries will return matching cached results. For + * instance, if the first query is for "abc" susequent queries that start with + * "abc", like "abcd", will be queried against the cache, and not the live data + * source. Recommended only for DataSources that return comprehensive results + * for queries with very few characters. + * + * @property queryMatchSubset + * @type Boolean + * @default false + * + */ +YAHOO.widget.AutoComplete.prototype.queryMatchSubset = false; + +/** + * Number of characters that must be entered before querying for results. A negative value + * effectively turns off the widget. A value of 0 allows queries of null or empty string + * values. + * + * @property minQueryLength + * @type Number + * @default 1 + */ +YAHOO.widget.AutoComplete.prototype.minQueryLength = 1; + +/** + * Maximum number of results to display in results container. + * + * @property maxResultsDisplayed + * @type Number + * @default 10 + */ +YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10; + +/** + * Number of seconds to delay before submitting a query request. If a query + * request is received before a previous one has completed its delay, the + * previous request is cancelled and the new request is set to the delay. If + * typeAhead is also enabled, this value must always be less than the typeAheadDelay + * in order to avoid certain race conditions. + * + * @property queryDelay + * @type Number + * @default 0.2 + */ +YAHOO.widget.AutoComplete.prototype.queryDelay = 0.2; + +/** + * If typeAhead is true, number of seconds to delay before updating input with + * typeAhead value. In order to prevent certain race conditions, this value must + * always be greater than the queryDelay. + * + * @property typeAheadDelay + * @type Number + * @default 0.5 + */ +YAHOO.widget.AutoComplete.prototype.typeAheadDelay = 0.5; + +/** + * When IME usage is detected, AutoComplete will switch to querying the input + * value at the given interval rather than per key event. + * + * @property queryInterval + * @type Number + * @default 500 + */ +YAHOO.widget.AutoComplete.prototype.queryInterval = 500; + +/** + * Class name of a highlighted item within results container. + * + * @property highlightClassName + * @type String + * @default "yui-ac-highlight" + */ +YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight"; + +/** + * Class name of a pre-highlighted item within results container. + * + * @property prehighlightClassName + * @type String + */ +YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null; + +/** + * Query delimiter. A single character separator for multiple delimited + * selections. Multiple delimiter characteres may be defined as an array of + * strings. A null value or empty string indicates that query results cannot + * be delimited. This feature is not recommended if you need forceSelection to + * be true. + * + * @property delimChar + * @type String | String[] + */ +YAHOO.widget.AutoComplete.prototype.delimChar = null; + +/** + * Whether or not the first item in results container should be automatically highlighted + * on expand. + * + * @property autoHighlight + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.autoHighlight = true; + +/** + * If autohighlight is enabled, whether or not the input field should be automatically updated + * with the first query result as the user types, auto-selecting the substring portion + * of the first result that the user has not yet typed. + * + * @property typeAhead + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.typeAhead = false; + +/** + * Whether or not to animate the expansion/collapse of the results container in the + * horizontal direction. + * + * @property animHoriz + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.animHoriz = false; + +/** + * Whether or not to animate the expansion/collapse of the results container in the + * vertical direction. + * + * @property animVert + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.animVert = true; + +/** + * Speed of container expand/collapse animation, in seconds.. + * + * @property animSpeed + * @type Number + * @default 0.3 + */ +YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3; + +/** + * Whether or not to force the user's selection to match one of the query + * results. Enabling this feature essentially transforms the input field into a + * <select> field. This feature is not recommended with delimiter character(s) + * defined. + * + * @property forceSelection + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.forceSelection = false; + +/** + * Whether or not to allow browsers to cache user-typed input in the input + * field. Disabling this feature will prevent the widget from setting the + * autocomplete="off" on the input field. When autocomplete="off" + * and users click the back button after form submission, user-typed input can + * be prefilled by the browser from its cache. This caching of user input may + * not be desired for sensitive data, such as credit card numbers, in which + * case, implementers should consider setting allowBrowserAutocomplete to false. + * + * @property allowBrowserAutocomplete + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true; + +/** + * Enabling this feature prevents the toggling of the container to a collapsed state. + * Setting to true does not automatically trigger the opening of the container. + * Implementers are advised to pre-load the container with an explicit "sendQuery()" call. + * + * @property alwaysShowContainer + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false; + +/** + * Whether or not to use an iFrame to layer over Windows form elements in + * IE. Set to true only when the results container will be on top of a + * <select> field in IE and thus exposed to the IE z-index bug (i.e., + * 5.5 < IE < 7). + * + * @property useIFrame + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.useIFrame = false; + +/** + * Whether or not the results container should have a shadow. + * + * @property useShadow + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.useShadow = false; + +/** + * Whether or not the input field should be updated with selections. + * + * @property supressInputUpdate + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.suppressInputUpdate = false; + +/** + * For backward compatibility to pre-2.6.0 formatResults() signatures, setting + * resultsTypeList to true will take each object literal result returned by + * DataSource and flatten into an array. + * + * @property resultTypeList + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.resultTypeList = true; + +/** + * For XHR DataSources, AutoComplete will automatically insert a "?" between the server URI and + * the "query" param/value pair. To prevent this behavior, implementers should + * set this value to false. To more fully customize the query syntax, implementers + * should override the generateRequest() method. + * + * @property queryQuestionMark + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.queryQuestionMark = true; + +///////////////////////////////////////////////////////////////////////////// +// +// Public methods +// +///////////////////////////////////////////////////////////////////////////// + + /** + * Public accessor to the unique name of the AutoComplete instance. + * + * @method toString + * @return {String} Unique name of the AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.toString = function() { + return "AutoComplete " + this._sName; +}; + + /** + * Returns DOM reference to input element. + * + * @method getInputEl + * @return {HTMLELement} DOM reference to input element. + */ +YAHOO.widget.AutoComplete.prototype.getInputEl = function() { + return this._elTextbox; +}; + + /** + * Returns DOM reference to container element. + * + * @method getContainerEl + * @return {HTMLELement} DOM reference to container element. + */ +YAHOO.widget.AutoComplete.prototype.getContainerEl = function() { + return this._elContainer; +}; + + /** + * Returns true if widget instance is currently focused. + * + * @method isFocused + * @return {Boolean} Returns true if widget instance is currently focused. + */ +YAHOO.widget.AutoComplete.prototype.isFocused = function() { + return (this._bFocused === null) ? false : this._bFocused; +}; + + /** + * Returns true if container is in an expanded state, false otherwise. + * + * @method isContainerOpen + * @return {Boolean} Returns true if container is in an expanded state, false otherwise. + */ +YAHOO.widget.AutoComplete.prototype.isContainerOpen = function() { + return this._bContainerOpen; +}; + +/** + * Public accessor to the <ul> element that displays query results within the results container. + * + * @method getListEl + * @return {HTMLElement[]} Reference to <ul> element within the results container. + */ +YAHOO.widget.AutoComplete.prototype.getListEl = function() { + return this._elList; +}; + +/** + * Public accessor to the matching string associated with a given <li> result. + * + * @method getListItemMatch + * @param elListItem {HTMLElement} Reference to <LI> element. + * @return {String} Matching string. + */ +YAHOO.widget.AutoComplete.prototype.getListItemMatch = function(elListItem) { + if(elListItem._sResultMatch) { + return elListItem._sResultMatch; + } + else { + return null; + } +}; + +/** + * Public accessor to the result data associated with a given <li> result. + * + * @method getListItemData + * @param elListItem {HTMLElement} Reference to <LI> element. + * @return {Object} Result data. + */ +YAHOO.widget.AutoComplete.prototype.getListItemData = function(elListItem) { + if(elListItem._oResultData) { + return elListItem._oResultData; + } + else { + return null; + } +}; + +/** + * Public accessor to the index of the associated with a given <li> result. + * + * @method getListItemIndex + * @param elListItem {HTMLElement} Reference to <LI> element. + * @return {Number} Index. + */ +YAHOO.widget.AutoComplete.prototype.getListItemIndex = function(elListItem) { + if(YAHOO.lang.isNumber(elListItem._nItemIndex)) { + return elListItem._nItemIndex; + } + else { + return null; + } +}; + +/** + * Sets HTML markup for the results container header. This markup will be + * inserted within a <div> tag with a class of "yui-ac-hd". + * + * @method setHeader + * @param sHeader {String} HTML markup for results container header. + */ +YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) { + if(this._elHeader) { + var elHeader = this._elHeader; + if(sHeader) { + elHeader.innerHTML = sHeader; + elHeader.style.display = "block"; + } + else { + elHeader.innerHTML = ""; + elHeader.style.display = "none"; + } + } +}; + +/** + * Sets HTML markup for the results container footer. This markup will be + * inserted within a <div> tag with a class of "yui-ac-ft". + * + * @method setFooter + * @param sFooter {String} HTML markup for results container footer. + */ +YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) { + if(this._elFooter) { + var elFooter = this._elFooter; + if(sFooter) { + elFooter.innerHTML = sFooter; + elFooter.style.display = "block"; + } + else { + elFooter.innerHTML = ""; + elFooter.style.display = "none"; + } + } +}; + +/** + * Sets HTML markup for the results container body. This markup will be + * inserted within a <div> tag with a class of "yui-ac-bd". + * + * @method setBody + * @param sBody {String} HTML markup for results container body. + */ +YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) { + if(this._elBody) { + var elBody = this._elBody; + YAHOO.util.Event.purgeElement(elBody, true); + if(sBody) { + elBody.innerHTML = sBody; + elBody.style.display = "block"; + } + else { + elBody.innerHTML = ""; + elBody.style.display = "none"; + } + this._elList = null; + } +}; + +/** +* A function that converts an AutoComplete query into a request value which is then +* passed to the DataSource's sendRequest method in order to retrieve data for +* the query. By default, returns a String with the syntax: "query={query}" +* Implementers can customize this method for custom request syntaxes. +* +* @method generateRequest +* @param sQuery {String} Query string +*/ +YAHOO.widget.AutoComplete.prototype.generateRequest = function(sQuery) { + var dataType = this.dataSource.dataType; + + // Transform query string in to a request for remote data + // By default, local data doesn't need a transformation, just passes along the query as is. + if(dataType === YAHOO.util.DataSourceBase.TYPE_XHR) { + // By default, XHR GET requests look like "{scriptURI}?{scriptQueryParam}={sQuery}&{scriptQueryAppend}" + if(!this.dataSource.connMethodPost) { + sQuery = (this.queryQuestionMark ? "?" : "") + (this.dataSource.scriptQueryParam || "query") + "=" + sQuery + + (this.dataSource.scriptQueryAppend ? ("&" + this.dataSource.scriptQueryAppend) : ""); + } + // By default, XHR POST bodies are sent to the {scriptURI} like "{scriptQueryParam}={sQuery}&{scriptQueryAppend}" + else { + sQuery = (this.dataSource.scriptQueryParam || "query") + "=" + sQuery + + (this.dataSource.scriptQueryAppend ? ("&" + this.dataSource.scriptQueryAppend) : ""); + } + } + // By default, remote script node requests look like "{scriptURI}&{scriptCallbackParam}={callbackString}&{scriptQueryParam}={sQuery}&{scriptQueryAppend}" + else if(dataType === YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE) { + sQuery = "&" + (this.dataSource.scriptQueryParam || "query") + "=" + sQuery + + (this.dataSource.scriptQueryAppend ? ("&" + this.dataSource.scriptQueryAppend) : ""); + } + + return sQuery; +}; + +/** + * Makes query request to the DataSource. + * + * @method sendQuery + * @param sQuery {String} Query string. + */ +YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) { + // Adjust programatically sent queries to look like they input by user + // when delimiters are enabled + var newQuery = (this.delimChar) ? this._elTextbox.value + sQuery : sQuery; + this._sendQuery(newQuery); +}; + +/** + * Collapses container. + * + * @method collapseContainer + */ +YAHOO.widget.AutoComplete.prototype.collapseContainer = function() { + this._toggleContainer(false); +}; + +/** + * Handles subset matching for when queryMatchSubset is enabled. + * + * @method getSubsetMatches + * @param sQuery {String} Query string. + * @return {Object} oParsedResponse or null. + */ +YAHOO.widget.AutoComplete.prototype.getSubsetMatches = function(sQuery) { + var subQuery, oCachedResponse, subRequest; + // Loop through substrings of each cached element's query property... + for(var i = sQuery.length; i >= this.minQueryLength ; i--) { + subRequest = this.generateRequest(sQuery.substr(0,i)); + this.dataRequestEvent.fire(this, subQuery, subRequest); + YAHOO.log("Searching for query subset \"" + subQuery + "\" in cache", "info", this.toString()); + + // If a substring of the query is found in the cache + oCachedResponse = this.dataSource.getCachedResponse(subRequest); + if(oCachedResponse) { + YAHOO.log("Found match for query subset \"" + subQuery + "\": " + YAHOO.lang.dump(oCachedResponse), "info", this.toString()); + return this.filterResults.apply(this.dataSource, [sQuery, oCachedResponse, oCachedResponse, {scope:this}]); + } + } + YAHOO.log("Did not find subset match for query subset \"" + sQuery + "\"" , "info", this.toString()); + return null; +}; + +/** + * Executed by DataSource (within DataSource scope via doBeforeParseData()) to + * handle responseStripAfter cleanup. + * + * @method preparseRawResponse + * @param sQuery {String} Query string. + * @return {Object} oParsedResponse or null. + */ +YAHOO.widget.AutoComplete.prototype.preparseRawResponse = function(oRequest, oFullResponse, oCallback) { + var nEnd = ((this.responseStripAfter !== "") && (oFullResponse.indexOf)) ? + oFullResponse.indexOf(this.responseStripAfter) : -1; + if(nEnd != -1) { + oFullResponse = oFullResponse.substring(0,nEnd); + } + return oFullResponse; +}; + +/** + * Executed by DataSource (within DataSource scope via doBeforeCallback()) to + * filter results through a simple client-side matching algorithm. + * + * @method filterResults + * @param sQuery {String} Original request. + * @param oFullResponse {Object} Full response object. + * @param oParsedResponse {Object} Parsed response object. + * @param oCallback {Object} Callback object. + * @return {Object} Filtered response object. + */ + +YAHOO.widget.AutoComplete.prototype.filterResults = function(sQuery, oFullResponse, oParsedResponse, oCallback) { + // Only if a query string is available to match against + if(sQuery && sQuery !== "") { + // First make a copy of the oParseResponse + oParsedResponse = YAHOO.widget.AutoComplete._cloneObject(oParsedResponse); + + var oAC = oCallback.scope, + oDS = this, + allResults = oParsedResponse.results, // the array of results + filteredResults = [], // container for filtered results + bMatchFound = false, + bMatchCase = (oDS.queryMatchCase || oAC.queryMatchCase), // backward compat + bMatchContains = (oDS.queryMatchContains || oAC.queryMatchContains); // backward compat + + // Loop through each result object... + for(var i = allResults.length-1; i >= 0; i--) { + var oResult = allResults[i]; + + // Grab the data to match against from the result object... + var sResult = null; + + // Result object is a simple string already + if(YAHOO.lang.isString(oResult)) { + sResult = oResult; + } + // Result object is an array of strings + else if(YAHOO.lang.isArray(oResult)) { + sResult = oResult[0]; + + } + // Result object is an object literal of strings + else if(this.responseSchema.fields) { + var key = this.responseSchema.fields[0].key || this.responseSchema.fields[0]; + sResult = oResult[key]; + } + // Backwards compatibility + else if(this.key) { + sResult = oResult[this.key]; + } + + if(YAHOO.lang.isString(sResult)) { + + var sKeyIndex = (bMatchCase) ? + sResult.indexOf(decodeURIComponent(sQuery)) : + sResult.toLowerCase().indexOf(decodeURIComponent(sQuery).toLowerCase()); + + // A STARTSWITH match is when the query is found at the beginning of the key string... + if((!bMatchContains && (sKeyIndex === 0)) || + // A CONTAINS match is when the query is found anywhere within the key string... + (bMatchContains && (sKeyIndex > -1))) { + // Stash the match + filteredResults.unshift(oResult); + } + } + } + oParsedResponse.results = filteredResults; + YAHOO.log("Filtered " + filteredResults.length + " results against query \"" + sQuery + "\": " + YAHOO.lang.dump(filteredResults), "info", this.toString()); + } + else { + YAHOO.log("Did not filter results against query", "info", this.toString()); + } + + return oParsedResponse; +}; + +/** + * Handles response for display. This is the callback function method passed to + * YAHOO.util.DataSourceBase#sendRequest so results from the DataSource are + * returned to the AutoComplete instance. + * + * @method handleResponse + * @param sQuery {String} Original request. + * @param oResponse {Object} Response object. + * @param oPayload {MIXED} (optional) Additional argument(s) + */ +YAHOO.widget.AutoComplete.prototype.handleResponse = function(sQuery, oResponse, oPayload) { + if((this instanceof YAHOO.widget.AutoComplete) && this._sName) { + this._populateList(sQuery, oResponse, oPayload); + } +}; + +/** + * Overridable method called before container is loaded with result data. + * + * @method doBeforeLoadData + * @param sQuery {String} Original request. + * @param oResponse {Object} Response object. + * @param oPayload {MIXED} (optional) Additional argument(s) + * @return {Boolean} Return true to continue loading data, false to cancel. + */ +YAHOO.widget.AutoComplete.prototype.doBeforeLoadData = function(sQuery, oResponse, oPayload) { + return true; +}; + +/** + * Overridable method that returns HTML markup for one result to be populated + * as innerHTML of an <LI> element. + * + * @method formatResult + * @param oResultData {Object} Result data object. + * @param sQuery {String} The corresponding query string. + * @param sResultMatch {HTMLElement} The current query string. + * @return {String} HTML markup of formatted result data. + */ +YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultData, sQuery, sResultMatch) { + var sMarkup = (sResultMatch) ? sResultMatch : ""; + return sMarkup; +}; + +/** + * Overridable method called before container expands allows implementers to access data + * and DOM elements. + * + * @method doBeforeExpandContainer + * @param elTextbox {HTMLElement} The text input box. + * @param elContainer {HTMLElement} The container element. + * @param sQuery {String} The query string. + * @param aResults {Object[]} An array of query results. + * @return {Boolean} Return true to continue expanding container, false to cancel the expand. + */ +YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(elTextbox, elContainer, sQuery, aResults) { + return true; +}; + + +/** + * Nulls out the entire AutoComplete instance and related objects, removes attached + * event listeners, and clears out DOM elements inside the container. After + * calling this method, the instance reference should be expliclitly nulled by + * implementer, as in myDataTable = null. Use with caution! + * + * @method destroy + */ +YAHOO.widget.AutoComplete.prototype.destroy = function() { + var instanceName = this.toString(); + var elInput = this._elTextbox; + var elContainer = this._elContainer; + + // Unhook custom events + this.textboxFocusEvent.unsubscribeAll(); + this.textboxKeyEvent.unsubscribeAll(); + this.dataRequestEvent.unsubscribeAll(); + this.dataReturnEvent.unsubscribeAll(); + this.dataErrorEvent.unsubscribeAll(); + this.containerPopulateEvent.unsubscribeAll(); + this.containerExpandEvent.unsubscribeAll(); + this.typeAheadEvent.unsubscribeAll(); + this.itemMouseOverEvent.unsubscribeAll(); + this.itemMouseOutEvent.unsubscribeAll(); + this.itemArrowToEvent.unsubscribeAll(); + this.itemArrowFromEvent.unsubscribeAll(); + this.itemSelectEvent.unsubscribeAll(); + this.unmatchedItemSelectEvent.unsubscribeAll(); + this.selectionEnforceEvent.unsubscribeAll(); + this.containerCollapseEvent.unsubscribeAll(); + this.textboxBlurEvent.unsubscribeAll(); + this.textboxChangeEvent.unsubscribeAll(); + + // Unhook DOM events + YAHOO.util.Event.purgeElement(elInput, true); + YAHOO.util.Event.purgeElement(elContainer, true); + + // Remove DOM elements + elContainer.innerHTML = ""; + + // Null out objects + for(var key in this) { + if(YAHOO.lang.hasOwnProperty(this, key)) { + this[key] = null; + } + } + + YAHOO.log("AutoComplete instance destroyed: " + instanceName); +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Public events +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Fired when the input field receives focus. + * + * @event textboxFocusEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null; + +/** + * Fired when the input field receives key input. + * + * @event textboxKeyEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param nKeycode {Number} The keycode number. + */ +YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null; + +/** + * Fired when the AutoComplete instance makes a request to the DataSource. + * + * @event dataRequestEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param oRequest {Object} The request. + */ +YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null; + +/** + * Fired when the AutoComplete instance receives query results from the data + * source. + * + * @event dataReturnEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param aResults {Object[]} Results array. + */ +YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null; + +/** + * Fired when the AutoComplete instance does not receive query results from the + * DataSource due to an error. + * + * @event dataErrorEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + */ +YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null; + +/** + * Fired when the results container is populated. + * + * @event containerPopulateEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.containerPopulateEvent = null; + +/** + * Fired when the results container is expanded. + * + * @event containerExpandEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param aResults {Object[]} Results array. + */ +YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null; + +/** + * Fired when the input field has been prefilled by the type-ahead + * feature. + * + * @event typeAheadEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param sPrefill {String} The prefill string. + */ +YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null; + +/** + * Fired when result item has been moused over. + * + * @event itemMouseOverEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item moused to. + */ +YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null; + +/** + * Fired when result item has been moused out. + * + * @event itemMouseOutEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item moused from. + */ +YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null; + +/** + * Fired when result item has been arrowed to. + * + * @event itemArrowToEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item arrowed to. + */ +YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null; + +/** + * Fired when result item has been arrowed away from. + * + * @event itemArrowFromEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item arrowed from. + */ +YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null; + +/** + * Fired when an item is selected via mouse click, ENTER key, or TAB key. + * + * @event itemSelectEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The selected <li> element item. + * @param oData {Object} The data returned for the item, either as an object, + * or mapped from the schema into an array. + */ +YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null; + +/** + * Fired when a user selection does not match any of the displayed result items. + * + * @event unmatchedItemSelectEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sSelection {String} The selected string. + */ +YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null; + +/** + * Fired if forceSelection is enabled and the user's input has been cleared + * because it did not match one of the returned query results. + * + * @event selectionEnforceEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null; + +/** + * Fired when the results container is collapsed. + * + * @event containerCollapseEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null; + +/** + * Fired when the input field loses focus. + * + * @event textboxBlurEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null; + +/** + * Fired when the input field value has changed when it loses focus. + * + * @event textboxChangeEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.textboxChangeEvent = null; + +///////////////////////////////////////////////////////////////////////////// +// +// Private member variables +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Internal class variable to index multiple AutoComplete instances. + * + * @property _nIndex + * @type Number + * @default 0 + * @private + */ +YAHOO.widget.AutoComplete._nIndex = 0; + +/** + * Name of AutoComplete instance. + * + * @property _sName + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sName = null; + +/** + * Text input field DOM element. + * + * @property _elTextbox + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elTextbox = null; + +/** + * Container DOM element. + * + * @property _elContainer + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elContainer = null; + +/** + * Reference to content element within container element. + * + * @property _elContent + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elContent = null; + +/** + * Reference to header element within content element. + * + * @property _elHeader + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elHeader = null; + +/** + * Reference to body element within content element. + * + * @property _elBody + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elBody = null; + +/** + * Reference to footer element within content element. + * + * @property _elFooter + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elFooter = null; + +/** + * Reference to shadow element within container element. + * + * @property _elShadow + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elShadow = null; + +/** + * Reference to iframe element within container element. + * + * @property _elIFrame + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elIFrame = null; + +/** + * Whether or not the input field is currently in focus. If query results come back + * but the user has already moved on, do not proceed with auto complete behavior. + * + * @property _bFocused + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bFocused = null; + +/** + * Animation instance for container expand/collapse. + * + * @property _oAnim + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._oAnim = null; + +/** + * Whether or not the results container is currently open. + * + * @property _bContainerOpen + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bContainerOpen = false; + +/** + * Whether or not the mouse is currently over the results + * container. This is necessary in order to prevent clicks on container items + * from being text input field blur events. + * + * @property _bOverContainer + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bOverContainer = false; + +/** + * Internal reference to <ul> elements that contains query results within the + * results container. + * + * @property _elList + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elList = null; + +/* + * Array of <li> elements references that contain query results within the + * results container. + * + * @property _aListItemEls + * @type HTMLElement[] + * @private + */ +//YAHOO.widget.AutoComplete.prototype._aListItemEls = null; + +/** + * Number of <li> elements currently displayed in results container. + * + * @property _nDisplayedItems + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0; + +/* + * Internal count of <li> elements displayed and hidden in results container. + * + * @property _maxResultsDisplayed + * @type Number + * @private + */ +//YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0; + +/** + * Current query string + * + * @property _sCurQuery + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sCurQuery = null; + +/** + * Selections from previous queries (for saving delimited queries). + * + * @property _sPastSelections + * @type String + * @default "" + * @private + */ +YAHOO.widget.AutoComplete.prototype._sPastSelections = ""; + +/** + * Stores initial input value used to determine if textboxChangeEvent should be fired. + * + * @property _sInitInputValue + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sInitInputValue = null; + +/** + * Pointer to the currently highlighted <li> element in the container. + * + * @property _elCurListItem + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elCurListItem = null; + +/** + * Whether or not an item has been selected since the container was populated + * with results. Reset to false by _populateList, and set to true when item is + * selected. + * + * @property _bItemSelected + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bItemSelected = false; + +/** + * Key code of the last key pressed in textbox. + * + * @property _nKeyCode + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nKeyCode = null; + +/** + * Delay timeout ID. + * + * @property _nDelayID + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nDelayID = -1; + +/** + * TypeAhead delay timeout ID. + * + * @property _nTypeAheadDelayID + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID = -1; + +/** + * Src to iFrame used when useIFrame = true. Supports implementations over SSL + * as well. + * + * @property _iFrameSrc + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._iFrameSrc = "javascript:false;"; + +/** + * For users typing via certain IMEs, queries must be triggered by intervals, + * since key events yet supported across all browsers for all IMEs. + * + * @property _queryInterval + * @type Object + * @private + */ +YAHOO.widget.AutoComplete.prototype._queryInterval = null; + +/** + * Internal tracker to last known textbox value, used to determine whether or not + * to trigger a query via interval for certain IME users. + * + * @event _sLastTextboxValue + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sLastTextboxValue = null; + +///////////////////////////////////////////////////////////////////////////// +// +// Private methods +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Updates and validates latest public config properties. + * + * @method __initProps + * @private + */ +YAHOO.widget.AutoComplete.prototype._initProps = function() { + // Correct any invalid values + var minQueryLength = this.minQueryLength; + if(!YAHOO.lang.isNumber(minQueryLength)) { + this.minQueryLength = 1; + } + var maxResultsDisplayed = this.maxResultsDisplayed; + if(!YAHOO.lang.isNumber(maxResultsDisplayed) || (maxResultsDisplayed < 1)) { + this.maxResultsDisplayed = 10; + } + var queryDelay = this.queryDelay; + if(!YAHOO.lang.isNumber(queryDelay) || (queryDelay < 0)) { + this.queryDelay = 0.2; + } + var typeAheadDelay = this.typeAheadDelay; + if(!YAHOO.lang.isNumber(typeAheadDelay) || (typeAheadDelay < 0)) { + this.typeAheadDelay = 0.2; + } + var delimChar = this.delimChar; + if(YAHOO.lang.isString(delimChar) && (delimChar.length > 0)) { + this.delimChar = [delimChar]; + } + else if(!YAHOO.lang.isArray(delimChar)) { + this.delimChar = null; + } + var animSpeed = this.animSpeed; + if((this.animHoriz || this.animVert) && YAHOO.util.Anim) { + if(!YAHOO.lang.isNumber(animSpeed) || (animSpeed < 0)) { + this.animSpeed = 0.3; + } + if(!this._oAnim ) { + this._oAnim = new YAHOO.util.Anim(this._elContent, {}, this.animSpeed); + } + else { + this._oAnim.duration = this.animSpeed; + } + } + if(this.forceSelection && delimChar) { + YAHOO.log("The forceSelection feature has been enabled with delimChar defined.","warn", this.toString()); + } +}; + +/** + * Initializes the results container helpers if they are enabled and do + * not exist + * + * @method _initContainerHelperEls + * @private + */ +YAHOO.widget.AutoComplete.prototype._initContainerHelperEls = function() { + if(this.useShadow && !this._elShadow) { + var elShadow = document.createElement("div"); + elShadow.className = "yui-ac-shadow"; + elShadow.style.width = 0; + elShadow.style.height = 0; + this._elShadow = this._elContainer.appendChild(elShadow); + } + if(this.useIFrame && !this._elIFrame) { + var elIFrame = document.createElement("iframe"); + elIFrame.src = this._iFrameSrc; + elIFrame.frameBorder = 0; + elIFrame.scrolling = "no"; + elIFrame.style.position = "absolute"; + elIFrame.style.width = 0; + elIFrame.style.height = 0; + elIFrame.tabIndex = -1; + elIFrame.style.padding = 0; + this._elIFrame = this._elContainer.appendChild(elIFrame); + } +}; + +/** + * Initializes the results container once at object creation + * + * @method _initContainerEl + * @private + */ +YAHOO.widget.AutoComplete.prototype._initContainerEl = function() { + YAHOO.util.Dom.addClass(this._elContainer, "yui-ac-container"); + + if(!this._elContent) { + // The elContent div is assigned DOM listeners and + // helps size the iframe and shadow properly + var elContent = document.createElement("div"); + elContent.className = "yui-ac-content"; + elContent.style.display = "none"; + + this._elContent = this._elContainer.appendChild(elContent); + + var elHeader = document.createElement("div"); + elHeader.className = "yui-ac-hd"; + elHeader.style.display = "none"; + this._elHeader = this._elContent.appendChild(elHeader); + + var elBody = document.createElement("div"); + elBody.className = "yui-ac-bd"; + this._elBody = this._elContent.appendChild(elBody); + + var elFooter = document.createElement("div"); + elFooter.className = "yui-ac-ft"; + elFooter.style.display = "none"; + this._elFooter = this._elContent.appendChild(elFooter); + } + else { + YAHOO.log("Could not initialize the container","warn",this.toString()); + } +}; + +/** + * Clears out contents of container body and creates up to + * YAHOO.widget.AutoComplete#maxResultsDisplayed <li> elements in an + * <ul> element. + * + * @method _initListEl + * @private + */ +YAHOO.widget.AutoComplete.prototype._initListEl = function() { + var nListLength = this.maxResultsDisplayed; + + var elList = this._elList || document.createElement("ul"); + var elListItem; + while(elList.childNodes.length < nListLength) { + elListItem = document.createElement("li"); + elListItem.style.display = "none"; + elListItem._nItemIndex = elList.childNodes.length; + elList.appendChild(elListItem); + } + if(!this._elList) { + var elBody = this._elBody; + YAHOO.util.Event.purgeElement(elBody, true); + elBody.innerHTML = ""; + this._elList = elBody.appendChild(elList); + } + +}; + +/** + * Enables interval detection for IME support. + * + * @method _enableIntervalDetection + * @re + * @private + */ +YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() { + var oSelf = this; + if(!oSelf._queryInterval && oSelf.queryInterval) { + oSelf._queryInterval = setInterval(function() { oSelf._onInterval(); }, oSelf.queryInterval); + YAHOO.log("Interval set", "info", this.toString()); + } +}; + +/** + * Enables query triggers based on text input detection by intervals (rather + * than by key events). + * + * @method _onInterval + * @private + */ +YAHOO.widget.AutoComplete.prototype._onInterval = function() { + var currValue = this._elTextbox.value; + var lastValue = this._sLastTextboxValue; + if(currValue != lastValue) { + this._sLastTextboxValue = currValue; + this._sendQuery(currValue); + } +}; + +/** + * Cancels text input detection by intervals. + * + * @method _clearInterval + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._clearInterval = function() { + if(this._queryInterval) { + clearInterval(this._queryInterval); + this._queryInterval = null; + YAHOO.log("Interval cleared", "info", this.toString()); + } +}; + +/** + * Whether or not key is functional or should be ignored. Note that the right + * arrow key is NOT an ignored key since it triggers queries for certain intl + * charsets. + * + * @method _isIgnoreKey + * @param nKeycode {Number} Code of key pressed. + * @return {Boolean} True if key should be ignored, false otherwise. + * @private + */ +YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) { + if((nKeyCode == 9) || (nKeyCode == 13) || // tab, enter + (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl + (nKeyCode >= 18 && nKeyCode <= 20) || // alt, pause/break,caps lock + (nKeyCode == 27) || // esc + (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end + /*(nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up + (nKeyCode == 40) || // down*/ + (nKeyCode >= 36 && nKeyCode <= 40) || // home,left,up, right, down + (nKeyCode >= 44 && nKeyCode <= 45) || // print screen,insert + (nKeyCode == 229) // Bug 2041973: Korean XP fires 2 keyup events, the key and 229 + ) { + return true; + } + return false; +}; + +/** + * Makes query request to the DataSource. + * + * @method _sendQuery + * @param sQuery {String} Query string. + * @private + */ +YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) { + // Widget has been effectively turned off + if(this.minQueryLength < 0) { + this._toggleContainer(false); + YAHOO.log("Property minQueryLength is less than 0", "info", this.toString()); + return; + } + // Delimiter has been enabled + var aDelimChar = (this.delimChar) ? this.delimChar : null; + if(aDelimChar) { + // Loop through all possible delimiters and find the rightmost one in the query + // A " " may be a false positive if they are defined as delimiters AND + // are used to separate delimited queries + var nDelimIndex = -1; + for(var i = aDelimChar.length-1; i >= 0; i--) { + var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]); + if(nNewIndex > nDelimIndex) { + nDelimIndex = nNewIndex; + } + } + // If we think the last delimiter is a space (" "), make sure it is NOT + // a false positive by also checking the char directly before it + if(aDelimChar[i] == " ") { + for (var j = aDelimChar.length-1; j >= 0; j--) { + if(sQuery[nDelimIndex - 1] == aDelimChar[j]) { + nDelimIndex--; + break; + } + } + } + // A delimiter has been found in the query so extract the latest query from past selections + if(nDelimIndex > -1) { + var nQueryStart = nDelimIndex + 1; + // Trim any white space from the beginning... + while(sQuery.charAt(nQueryStart) == " ") { + nQueryStart += 1; + } + // ...and save the rest of the string for later + this._sPastSelections = sQuery.substring(0,nQueryStart); + // Here is the query itself + sQuery = sQuery.substr(nQueryStart); + } + // No delimiter found in the query, so there are no selections from past queries + else { + this._sPastSelections = ""; + } + } + + // Don't search queries that are too short + if((sQuery && (sQuery.length < this.minQueryLength)) || (!sQuery && this.minQueryLength > 0)) { + if(this._nDelayID != -1) { + clearTimeout(this._nDelayID); + } + this._toggleContainer(false); + YAHOO.log("Query \"" + sQuery + "\" is too short", "info", this.toString()); + return; + } + + sQuery = encodeURIComponent(sQuery); + this._nDelayID = -1; // Reset timeout ID because request is being made + + // Subset matching + if(this.dataSource.queryMatchSubset || this.queryMatchSubset) { // backward compat + var oResponse = this.getSubsetMatches(sQuery); + if(oResponse) { + this.handleResponse(sQuery, oResponse, {query: sQuery}); + return; + } + } + + if(this.responseStripAfter) { + this.dataSource.doBeforeParseData = this.preparseRawResponse; + } + if(this.applyLocalFilter) { + this.dataSource.doBeforeCallback = this.filterResults; + } + + var sRequest = this.generateRequest(sQuery); + this.dataRequestEvent.fire(this, sQuery, sRequest); + YAHOO.log("Sending query \"" + sRequest + "\"", "info", this.toString()); + + this.dataSource.sendRequest(sRequest, { + success : this.handleResponse, + failure : this.handleResponse, + scope : this, + argument: { + query: sQuery + } + }); +}; + +/** + * Populates the array of <li> elements in the container with query + * results. + * + * @method _populateList + * @param sQuery {String} Original request. + * @param oResponse {Object} Response object. + * @param oPayload {MIXED} (optional) Additional argument(s) + * @private + */ +YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, oResponse, oPayload) { + // Clear previous timeout + if(this._nTypeAheadDelayID != -1) { + clearTimeout(this._nTypeAheadDelayID); + } + + sQuery = (oPayload && oPayload.query) ? oPayload.query : sQuery; + + // Pass data through abstract method for any transformations + var ok = this.doBeforeLoadData(sQuery, oResponse, oPayload); + + // Data is ok + if(ok && !oResponse.error) { + this.dataReturnEvent.fire(this, sQuery, oResponse.results); + + // Continue only if instance is still focused (i.e., user hasn't already moved on) + // Null indicates initialized state, which is ok too + if(this._bFocused || (this._bFocused === null)) { + + //TODO: is this still necessary? + /*var isOpera = (YAHOO.env.ua.opera); + var contentStyle = this._elContent.style; + contentStyle.width = (!isOpera) ? null : ""; + contentStyle.height = (!isOpera) ? null : "";*/ + + // Store state for this interaction + var sCurQuery = decodeURIComponent(sQuery); + this._sCurQuery = sCurQuery; + this._bItemSelected = false; + + var allResults = oResponse.results, + nItemsToShow = Math.min(allResults.length,this.maxResultsDisplayed), + sMatchKey = (this.dataSource.responseSchema.fields) ? + (this.dataSource.responseSchema.fields[0].key || this.dataSource.responseSchema.fields[0]) : 0; + + if(nItemsToShow > 0) { + // Make sure container and helpers are ready to go + if(!this._elList || (this._elList.childNodes.length < nItemsToShow)) { + this._initListEl(); + } + this._initContainerHelperEls(); + + var allListItemEls = this._elList.childNodes; + // Fill items with data from the bottom up + for(var i = nItemsToShow-1; i >= 0; i--) { + var elListItem = allListItemEls[i], + oResult = allResults[i]; + + // Backward compatibility + if(this.resultTypeList) { + // Results need to be converted back to an array + var aResult = []; + // Match key is first + aResult[0] = (YAHOO.lang.isString(oResult)) ? oResult : oResult[sMatchKey] || oResult[this.key]; + // Add additional data to the result array + var fields = this.dataSource.responseSchema.fields; + if(YAHOO.lang.isArray(fields) && (fields.length > 1)) { + for(var k=1, len=fields.length; k= nItemsToShow; j--) { + extraListItem = allListItemEls[j]; + extraListItem.style.display = "none"; + } + } + + this._nDisplayedItems = nItemsToShow; + + this.containerPopulateEvent.fire(this, sQuery, allResults); + + // Highlight the first item + if(this.autoHighlight) { + var elFirstListItem = this._elList.firstChild; + this._toggleHighlight(elFirstListItem,"to"); + this.itemArrowToEvent.fire(this, elFirstListItem); + YAHOO.log("Arrowed to first item", "info", this.toString()); + this._typeAhead(elFirstListItem,sQuery); + } + // Unhighlight any previous time + else { + this._toggleHighlight(this._elCurListItem,"from"); + } + + // Expand the container + ok = this.doBeforeExpandContainer(this._elTextbox, this._elContainer, sQuery, allResults); + this._toggleContainer(ok); + } + else { + this._toggleContainer(false); + } + + YAHOO.log("Container populated with " + nItemsToShow + " list items", "info", this.toString()); + return; + } + } + // Error + else { + this.dataErrorEvent.fire(this, sQuery); + } + + YAHOO.log("Could not populate list", "info", this.toString()); +}; + +/** + * When forceSelection is true and the user attempts + * leave the text input box without selecting an item from the query results, + * the user selection is cleared. + * + * @method _clearSelection + * @private + */ +YAHOO.widget.AutoComplete.prototype._clearSelection = function() { + var sValue = this._elTextbox.value; + //TODO: need to check against all delimChars? + var sChar = (this.delimChar) ? this.delimChar[0] : null; + var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1; + if(nIndex > -1) { + this._elTextbox.value = sValue.substring(0,nIndex); + } + else { + this._elTextbox.value = ""; + } + this._sPastSelections = this._elTextbox.value; + + // Fire custom event + this.selectionEnforceEvent.fire(this); + YAHOO.log("Selection enforced", "info", this.toString()); +}; + +/** + * Whether or not user-typed value in the text input box matches any of the + * query results. + * + * @method _textMatchesOption + * @return {HTMLElement} Matching list item element if user-input text matches + * a result, null otherwise. + * @private + */ +YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() { + var elMatch = null; + + for(var i = this._nDisplayedItems-1; i >= 0 ; i--) { + var elListItem = this._elList.childNodes[i]; + var sMatch = ("" + elListItem._sResultMatch).toLowerCase(); + if(sMatch == this._sCurQuery.toLowerCase()) { + elMatch = elListItem; + break; + } + } + return(elMatch); +}; + +/** + * Updates in the text input box with the first query result as the user types, + * selecting the substring that the user has not typed. + * + * @method _typeAhead + * @param elListItem {HTMLElement} The <li> element item whose data populates the input field. + * @param sQuery {String} Query string. + * @private + */ +YAHOO.widget.AutoComplete.prototype._typeAhead = function(elListItem, sQuery) { + // Don't typeAhead if turned off or is backspace + if(!this.typeAhead || (this._nKeyCode == 8)) { + return; + } + + var oSelf = this, + elTextbox = this._elTextbox; + + // Only if text selection is supported + if(elTextbox.setSelectionRange || elTextbox.createTextRange) { + // Set and store timeout for this typeahead + this._nTypeAheadDelayID = setTimeout(function() { + // Select the portion of text that the user has not typed + var nStart = elTextbox.value.length; // any saved queries plus what user has typed + oSelf._updateValue(elListItem); + var nEnd = elTextbox.value.length; + oSelf._selectText(elTextbox,nStart,nEnd); + var sPrefill = elTextbox.value.substr(nStart,nEnd); + oSelf.typeAheadEvent.fire(oSelf,sQuery,sPrefill); + YAHOO.log("Typeahead occured with prefill string \"" + sPrefill + "\"", "info", oSelf.toString()); + },(this.typeAheadDelay*1000)); + } +}; + +/** + * Selects text in the input field. + * + * @method _selectText + * @param elTextbox {HTMLElement} Text input box element in which to select text. + * @param nStart {Number} Starting index of text string to select. + * @param nEnd {Number} Ending index of text selection. + * @private + */ +YAHOO.widget.AutoComplete.prototype._selectText = function(elTextbox, nStart, nEnd) { + if(elTextbox.setSelectionRange) { // For Mozilla + elTextbox.setSelectionRange(nStart,nEnd); + } + else if(elTextbox.createTextRange) { // For IE + var oTextRange = elTextbox.createTextRange(); + oTextRange.moveStart("character", nStart); + oTextRange.moveEnd("character", nEnd-elTextbox.value.length); + oTextRange.select(); + } + else { + elTextbox.select(); + } +}; + +/** + * Syncs results container with its helpers. + * + * @method _toggleContainerHelpers + * @param bShow {Boolean} True if container is expanded, false if collapsed + * @private + */ +YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) { + var width = this._elContent.offsetWidth + "px"; + var height = this._elContent.offsetHeight + "px"; + + if(this.useIFrame && this._elIFrame) { + var elIFrame = this._elIFrame; + if(bShow) { + elIFrame.style.width = width; + elIFrame.style.height = height; + elIFrame.style.padding = ""; + YAHOO.log("Iframe expanded", "info", this.toString()); + } + else { + elIFrame.style.width = 0; + elIFrame.style.height = 0; + elIFrame.style.padding = 0; + YAHOO.log("Iframe collapsed", "info", this.toString()); + } + } + if(this.useShadow && this._elShadow) { + var elShadow = this._elShadow; + if(bShow) { + elShadow.style.width = width; + elShadow.style.height = height; + YAHOO.log("Shadow expanded", "info", this.toString()); + } + else { + elShadow.style.width = 0; + elShadow.style.height = 0; + YAHOO.log("Shadow collapsed", "info", this.toString()); + } + } +}; + +/** + * Animates expansion or collapse of the container. + * + * @method _toggleContainer + * @param bShow {Boolean} True if container should be expanded, false if container should be collapsed + * @private + */ +YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) { + var elContainer = this._elContainer; + + // If implementer has container always open and it's already open, don't mess with it + // Container is initialized with display "none" so it may need to be shown first time through + if(this.alwaysShowContainer && this._bContainerOpen) { + return; + } + + // Reset states + if(!bShow) { + this._toggleHighlight(this._elCurListItem,"from"); + this._nDisplayedItems = 0; + this._sCurQuery = null; + + // Container is already closed, so don't bother with changing the UI + if(!this._bContainerOpen) { + this._elContent.style.display = "none"; + return; + } + } + + // If animation is enabled... + var oAnim = this._oAnim; + if(oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) { + if(oAnim.isAnimated()) { + oAnim.stop(true); + } + + // Clone container to grab current size offscreen + var oClone = this._elContent.cloneNode(true); + elContainer.appendChild(oClone); + oClone.style.top = "-9000px"; + oClone.style.width = ""; + oClone.style.height = ""; + oClone.style.display = ""; + + // Current size of the container is the EXPANDED size + var wExp = oClone.offsetWidth; + var hExp = oClone.offsetHeight; + + // Calculate COLLAPSED sizes based on horiz and vert anim + var wColl = (this.animHoriz) ? 0 : wExp; + var hColl = (this.animVert) ? 0 : hExp; + + // Set animation sizes + oAnim.attributes = (bShow) ? + {width: { to: wExp }, height: { to: hExp }} : + {width: { to: wColl}, height: { to: hColl }}; + + // If opening anew, set to a collapsed size... + if(bShow && !this._bContainerOpen) { + this._elContent.style.width = wColl+"px"; + this._elContent.style.height = hColl+"px"; + } + // Else, set it to its last known size. + else { + this._elContent.style.width = wExp+"px"; + this._elContent.style.height = hExp+"px"; + } + + elContainer.removeChild(oClone); + oClone = null; + + var oSelf = this; + var onAnimComplete = function() { + // Finish the collapse + oAnim.onComplete.unsubscribeAll(); + + if(bShow) { + oSelf._toggleContainerHelpers(true); + oSelf._bContainerOpen = bShow; + oSelf.containerExpandEvent.fire(oSelf); + YAHOO.log("Container expanded", "info", oSelf.toString()); + } + else { + oSelf._elContent.style.display = "none"; + oSelf._bContainerOpen = bShow; + oSelf.containerCollapseEvent.fire(oSelf); + YAHOO.log("Container collapsed", "info", oSelf.toString()); + } + }; + + // Display container and animate it + this._toggleContainerHelpers(false); // Bug 1424486: Be early to hide, late to show; + this._elContent.style.display = ""; + oAnim.onComplete.subscribe(onAnimComplete); + oAnim.animate(); + } + // Else don't animate, just show or hide + else { + if(bShow) { + this._elContent.style.display = ""; + this._toggleContainerHelpers(true); + this._bContainerOpen = bShow; + this.containerExpandEvent.fire(this); + YAHOO.log("Container expanded", "info", this.toString()); + } + else { + this._toggleContainerHelpers(false); + this._elContent.style.display = "none"; + this._bContainerOpen = bShow; + this.containerCollapseEvent.fire(this); + YAHOO.log("Container collapsed", "info", this.toString()); + } + } + +}; + +/** + * Toggles the highlight on or off for an item in the container, and also cleans + * up highlighting of any previous item. + * + * @method _toggleHighlight + * @param elNewListItem {HTMLElement} The <li> element item to receive highlight behavior. + * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off. + * @private + */ +YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(elNewListItem, sType) { + if(elNewListItem) { + var sHighlight = this.highlightClassName; + if(this._elCurListItem) { + // Remove highlight from old item + YAHOO.util.Dom.removeClass(this._elCurListItem, sHighlight); + this._elCurListItem = null; + } + + if((sType == "to") && sHighlight) { + // Apply highlight to new item + YAHOO.util.Dom.addClass(elNewListItem, sHighlight); + this._elCurListItem = elNewListItem; + } + } +}; + +/** + * Toggles the pre-highlight on or off for an item in the container. + * + * @method _togglePrehighlight + * @param elNewListItem {HTMLElement} The <li> element item to receive highlight behavior. + * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off. + * @private + */ +YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(elNewListItem, sType) { + if(elNewListItem == this._elCurListItem) { + return; + } + + var sPrehighlight = this.prehighlightClassName; + if((sType == "mouseover") && sPrehighlight) { + // Apply prehighlight to new item + YAHOO.util.Dom.addClass(elNewListItem, sPrehighlight); + } + else { + // Remove prehighlight from old item + YAHOO.util.Dom.removeClass(elNewListItem, sPrehighlight); + } +}; + +/** + * Updates the text input box value with selected query result. If a delimiter + * has been defined, then the value gets appended with the delimiter. + * + * @method _updateValue + * @param elListItem {HTMLElement} The <li> element item with which to update the value. + * @private + */ +YAHOO.widget.AutoComplete.prototype._updateValue = function(elListItem) { + if(!this.suppressInputUpdate) { + var elTextbox = this._elTextbox; + var sDelimChar = (this.delimChar) ? (this.delimChar[0] || this.delimChar) : null; + var sResultMatch = elListItem._sResultMatch; + + // Calculate the new value + var sNewValue = ""; + if(sDelimChar) { + // Preserve selections from past queries + sNewValue = this._sPastSelections; + // Add new selection plus delimiter + sNewValue += sResultMatch + sDelimChar; + if(sDelimChar != " ") { + sNewValue += " "; + } + } + else { + sNewValue = sResultMatch; + } + + // Update input field + elTextbox.value = sNewValue; + + // Scroll to bottom of textarea if necessary + if(elTextbox.type == "textarea") { + elTextbox.scrollTop = elTextbox.scrollHeight; + } + + // Move cursor to end + var end = elTextbox.value.length; + this._selectText(elTextbox,end,end); + + this._elCurListItem = elListItem; + } +}; + +/** + * Selects a result item from the container + * + * @method _selectItem + * @param elListItem {HTMLElement} The selected <li> element item. + * @private + */ +YAHOO.widget.AutoComplete.prototype._selectItem = function(elListItem) { + this._bItemSelected = true; + this._updateValue(elListItem); + this._sPastSelections = this._elTextbox.value; + this._clearInterval(); + this.itemSelectEvent.fire(this, elListItem, elListItem._oResultData); + YAHOO.log("Item selected: " + YAHOO.lang.dump(elListItem._oResultData), "info", this.toString()); + this._toggleContainer(false); +}; + +/** + * If an item is highlighted in the container, the right arrow key jumps to the + * end of the textbox and selects the highlighted item, otherwise the container + * is closed. + * + * @method _jumpSelection + * @private + */ +YAHOO.widget.AutoComplete.prototype._jumpSelection = function() { + if(this._elCurListItem) { + this._selectItem(this._elCurListItem); + } + else { + this._toggleContainer(false); + } +}; + +/** + * Triggered by up and down arrow keys, changes the current highlighted + * <li> element item. Scrolls container if necessary. + * + * @method _moveSelection + * @param nKeyCode {Number} Code of key pressed. + * @private + */ +YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) { + if(this._bContainerOpen) { + // Determine current item's id number + var elCurListItem = this._elCurListItem; + var nCurItemIndex = -1; + + if(elCurListItem) { + nCurItemIndex = elCurListItem._nItemIndex; + } + + var nNewItemIndex = (nKeyCode == 40) ? + (nCurItemIndex + 1) : (nCurItemIndex - 1); + + // Out of bounds + if(nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) { + return; + } + + if(elCurListItem) { + // Unhighlight current item + this._toggleHighlight(elCurListItem, "from"); + this.itemArrowFromEvent.fire(this, elCurListItem); + YAHOO.log("Item arrowed from: " + elCurListItem._nItemIndex, "info", this.toString()); + } + if(nNewItemIndex == -1) { + // Go back to query (remove type-ahead string) + if(this.delimChar) { + this._elTextbox.value = this._sPastSelections + this._sCurQuery; + } + else { + this._elTextbox.value = this._sCurQuery; + } + return; + } + if(nNewItemIndex == -2) { + // Close container + this._toggleContainer(false); + return; + } + + var elNewListItem = this._elList.childNodes[nNewItemIndex]; + + // Scroll the container if necessary + var elContent = this._elContent; + var scrollOn = ((YAHOO.util.Dom.getStyle(elContent,"overflow") == "auto") || + (YAHOO.util.Dom.getStyle(elContent,"overflowY") == "auto")); + if(scrollOn && (nNewItemIndex > -1) && + (nNewItemIndex < this._nDisplayedItems)) { + // User is keying down + if(nKeyCode == 40) { + // Bottom of selected item is below scroll area... + if((elNewListItem.offsetTop+elNewListItem.offsetHeight) > (elContent.scrollTop + elContent.offsetHeight)) { + // Set bottom of scroll area to bottom of selected item + elContent.scrollTop = (elNewListItem.offsetTop+elNewListItem.offsetHeight) - elContent.offsetHeight; + } + // Bottom of selected item is above scroll area... + else if((elNewListItem.offsetTop+elNewListItem.offsetHeight) < elContent.scrollTop) { + // Set top of selected item to top of scroll area + elContent.scrollTop = elNewListItem.offsetTop; + + } + } + // User is keying up + else { + // Top of selected item is above scroll area + if(elNewListItem.offsetTop < elContent.scrollTop) { + // Set top of scroll area to top of selected item + this._elContent.scrollTop = elNewListItem.offsetTop; + } + // Top of selected item is below scroll area + else if(elNewListItem.offsetTop > (elContent.scrollTop + elContent.offsetHeight)) { + // Set bottom of selected item to bottom of scroll area + this._elContent.scrollTop = (elNewListItem.offsetTop+elNewListItem.offsetHeight) - elContent.offsetHeight; + } + } + } + + this._toggleHighlight(elNewListItem, "to"); + this.itemArrowToEvent.fire(this, elNewListItem); + YAHOO.log("Item arrowed to " + elNewListItem._nItemIndex, "info", this.toString()); + if(this.typeAhead) { + this._updateValue(elNewListItem); + } + } +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Private event handlers +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Handles <li> element mouseover events in the container. + * + * @method _onItemMouseover + * @param v {HTMLEvent} The mouseover event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +/*YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) { + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(this,"mouseover"); + } + else { + oSelf._toggleHighlight(this,"to"); + } + + oSelf.itemMouseOverEvent.fire(oSelf, this); + YAHOO.log("Item moused over", "info", oSelf.toString()); +};*/ + +/** + * Handles <li> element mouseout events in the container. + * + * @method _onItemMouseout + * @param v {HTMLEvent} The mouseout event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +/*YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) { + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(this,"mouseout"); + } + else { + oSelf._toggleHighlight(this,"from"); + } + + oSelf.itemMouseOutEvent.fire(oSelf, this); + YAHOO.log("Item moused out", "info", oSelf.toString()); +};*/ + +/** + * Handles <li> element click events in the container. + * + * @method _onItemMouseclick + * @param v {HTMLEvent} The click event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +/*YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) { + // In case item has not been moused over + oSelf._toggleHighlight(this,"to"); + oSelf._selectItem(this); +};*/ + +/** + * Handles container mouseover events. + * + * @method _onContainerMouseover + * @param v {HTMLEvent} The mouseover event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) { + var elTarget = YAHOO.util.Event.getTarget(v); + var elTag = elTarget.nodeName.toLowerCase(); + while(elTarget && (elTag != "table")) { + switch(elTag) { + case "body": + return; + case "li": + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(elTarget,"mouseover"); + } + else { + oSelf._toggleHighlight(elTarget,"to"); + } + + oSelf.itemMouseOverEvent.fire(oSelf, elTarget); + YAHOO.log("Item moused over " + elTarget._nItemIndex, "info", oSelf.toString()); + break; + case "div": + if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")) { + oSelf._bOverContainer = true; + return; + } + break; + default: + break; + } + + elTarget = elTarget.parentNode; + if(elTarget) { + elTag = elTarget.nodeName.toLowerCase(); + } + } +}; + +/** + * Handles container mouseout events. + * + * @method _onContainerMouseout + * @param v {HTMLEvent} The mouseout event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) { + var elTarget = YAHOO.util.Event.getTarget(v); + var elTag = elTarget.nodeName.toLowerCase(); + while(elTarget && (elTag != "table")) { + switch(elTag) { + case "body": + return; + case "li": + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(elTarget,"mouseout"); + } + else { + oSelf._toggleHighlight(elTarget,"from"); + } + + oSelf.itemMouseOutEvent.fire(oSelf, elTarget); + YAHOO.log("Item moused out " + elTarget._nItemIndex, "info", oSelf.toString()); + break; + case "ul": + oSelf._toggleHighlight(oSelf._elCurListItem,"to"); + break; + case "div": + if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")) { + oSelf._bOverContainer = false; + return; + } + break; + default: + break; + } + + elTarget = elTarget.parentNode; + if(elTarget) { + elTag = elTarget.nodeName.toLowerCase(); + } + } +}; + +/** + * Handles container click events. + * + * @method _onContainerClick + * @param v {HTMLEvent} The click event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerClick = function(v,oSelf) { + var elTarget = YAHOO.util.Event.getTarget(v); + var elTag = elTarget.nodeName.toLowerCase(); + while(elTarget && (elTag != "table")) { + switch(elTag) { + case "body": + return; + case "li": + // In case item has not been moused over + oSelf._toggleHighlight(elTarget,"to"); + oSelf._selectItem(elTarget); + return; + default: + break; + } + + elTarget = elTarget.parentNode; + if(elTarget) { + elTag = elTarget.nodeName.toLowerCase(); + } + } +}; + + +/** + * Handles container scroll events. + * + * @method _onContainerScroll + * @param v {HTMLEvent} The scroll event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) { + oSelf._elTextbox.focus(); +}; + +/** + * Handles container resize events. + * + * @method _onContainerResize + * @param v {HTMLEvent} The resize event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) { + oSelf._toggleContainerHelpers(oSelf._bContainerOpen); +}; + + +/** + * Handles textbox keydown events of functional keys, mainly for UI behavior. + * + * @method _onTextboxKeyDown + * @param v {HTMLEvent} The keydown event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) { + var nKeyCode = v.keyCode; + + // Clear timeout + if(oSelf._nTypeAheadDelayID != -1) { + clearTimeout(oSelf._nTypeAheadDelayID); + } + + switch (nKeyCode) { + case 9: // tab + if(!YAHOO.env.ua.opera && (navigator.userAgent.toLowerCase().indexOf("mac") == -1) || (YAHOO.env.ua.webkit>420)) { + // select an item or clear out + if(oSelf._elCurListItem) { + if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) { + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + } + } + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + case 13: // enter + if(!YAHOO.env.ua.opera && (navigator.userAgent.toLowerCase().indexOf("mac") == -1) || (YAHOO.env.ua.webkit>420)) { + if(oSelf._elCurListItem) { + if(oSelf._nKeyCode != nKeyCode) { + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + } + } + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + case 27: // esc + oSelf._toggleContainer(false); + return; + case 39: // right + oSelf._jumpSelection(); + break; + case 38: // up + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + oSelf._moveSelection(nKeyCode); + } + break; + case 40: // down + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + oSelf._moveSelection(nKeyCode); + } + break; + default: + oSelf._bItemSelected = false; + oSelf._toggleHighlight(oSelf._elCurListItem, "from"); + + oSelf.textboxKeyEvent.fire(oSelf, nKeyCode); + YAHOO.log("Textbox keyed", "info", oSelf.toString()); + break; + } + + if(nKeyCode === 18){ + oSelf._enableIntervalDetection(); + } + oSelf._nKeyCode = nKeyCode; +}; + +/** + * Handles textbox keypress events. + * @method _onTextboxKeyPress + * @param v {HTMLEvent} The keypress event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) { + var nKeyCode = v.keyCode; + + // Expose only to non SF3 (bug 1978549) Mac browsers (bug 790337) and Opera browsers (bug 583531), + // where stopEvent is ineffective on keydown events + if(YAHOO.env.ua.opera || (navigator.userAgent.toLowerCase().indexOf("mac") != -1) && (YAHOO.env.ua.webkit < 420)) { + switch (nKeyCode) { + case 9: // tab + // select an item or clear out + if(oSelf._bContainerOpen) { + if(oSelf.delimChar) { + YAHOO.util.Event.stopEvent(v); + } + if(oSelf._elCurListItem) { + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + case 13: // enter + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + if(oSelf._elCurListItem) { + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + default: + break; + } + } + + //TODO: (?) limit only to non-IE, non-Mac-FF for Korean IME support (bug 811948) + // Korean IME detected + else if(nKeyCode == 229) { + oSelf._enableIntervalDetection(); + } +}; + +/** + * Handles textbox keyup events to trigger queries. + * + * @method _onTextboxKeyUp + * @param v {HTMLEvent} The keyup event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) { + var sText = this.value; //string in textbox + + // Check to see if any of the public properties have been updated + oSelf._initProps(); + + // Filter out chars that don't trigger queries + var nKeyCode = v.keyCode; + if(oSelf._isIgnoreKey(nKeyCode)) { + return; + } + + // Clear previous timeout + /*if(oSelf._nTypeAheadDelayID != -1) { + clearTimeout(oSelf._nTypeAheadDelayID); + }*/ + if(oSelf._nDelayID != -1) { + clearTimeout(oSelf._nDelayID); + } + + // Set new timeout + oSelf._nDelayID = setTimeout(function(){ + oSelf._sendQuery(sText); + },(oSelf.queryDelay * 1000)); + + //= nDelayID; + //else { + // No delay so send request immediately + //oSelf._sendQuery(sText); + //} +}; + +/** + * Handles text input box receiving focus. + * + * @method _onTextboxFocus + * @param v {HTMLEvent} The focus event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) { + // Start of a new interaction + if(!oSelf._bFocused) { + oSelf._elTextbox.setAttribute("autocomplete","off"); + oSelf._bFocused = true; + oSelf._sInitInputValue = oSelf._elTextbox.value; + oSelf.textboxFocusEvent.fire(oSelf); + YAHOO.log("Textbox focused", "info", oSelf.toString()); + } +}; + +/** + * Handles text input box losing focus. + * + * @method _onTextboxBlur + * @param v {HTMLEvent} The focus event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) { + // Don't treat as a blur if it was a selection via mouse click + if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) { + // Current query needs to be validated as a selection + if(!oSelf._bItemSelected) { + var elMatchListItem = oSelf._textMatchesOption(); + // Container is closed or current query doesn't match any result + if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && (elMatchListItem === null))) { + // Force selection is enabled so clear the current query + if(oSelf.forceSelection) { + oSelf._clearSelection(); + } + // Treat current query as a valid selection + else { + oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery); + YAHOO.log("Unmatched item selected: " + oSelf._sCurQuery, "info", oSelf.toString()); + } + } + // Container is open and current query matches a result + else { + // Force a selection when textbox is blurred with a match + if(oSelf.forceSelection) { + oSelf._selectItem(elMatchListItem); + } + } + } + + if(oSelf._bContainerOpen) { + oSelf._toggleContainer(false); + } + oSelf._clearInterval(); + oSelf._bFocused = false; + if(oSelf._sInitInputValue !== oSelf._elTextbox.value) { + oSelf.textboxChangeEvent.fire(oSelf); + } + oSelf.textboxBlurEvent.fire(oSelf); + YAHOO.log("Textbox blurred", "info", oSelf.toString()); + } +}; + +/** + * Handles window unload event. + * + * @method _onWindowUnload + * @param v {HTMLEvent} The unload event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onWindowUnload = function(v,oSelf) { + if(oSelf && oSelf._elTextbox && oSelf.allowBrowserAutocomplete) { + oSelf._elTextbox.setAttribute("autocomplete","on"); + } +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Deprecated for Backwards Compatibility +// +///////////////////////////////////////////////////////////////////////////// +/** + * @method doBeforeSendQuery + * @deprecated Use generateRequest. + */ +YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery = function(sQuery) { + return this.generateRequest(sQuery); +}; + +/** + * @method getListItems + * @deprecated Use getListEl().childNodes. + */ +YAHOO.widget.AutoComplete.prototype.getListItems = function() { + var allListItemEls = [], + els = this._elList.childNodes; + for(var i=els.length-1; i>=0; i--) { + allListItemEls[i] = els[i]; + } + return allListItemEls; +}; + +///////////////////////////////////////////////////////////////////////// +// +// Private static methods +// +///////////////////////////////////////////////////////////////////////// + +/** + * Clones object literal or array of object literals. + * + * @method AutoComplete._cloneObject + * @param o {Object} Object. + * @private + * @static + */ +YAHOO.widget.AutoComplete._cloneObject = function(o) { + if(!YAHOO.lang.isValue(o)) { + return o; + } + + var copy = {}; + + if(YAHOO.lang.isFunction(o)) { + copy = o; + } + else if(YAHOO.lang.isArray(o)) { + var array = []; + for(var i=0,len=o.length;i=this.minQueryLength;B--){A=this.generateRequest(E.substr(0,B));this.dataRequestEvent.fire(this,D,A);C=this.dataSource.getCachedResponse(A);if(C){return this.filterResults.apply(this.dataSource,[E,C,C,{scope:this}]);}}return null;};YAHOO.widget.AutoComplete.prototype.preparseRawResponse=function(C,B,A){var D=((this.responseStripAfter!=="")&&(B.indexOf))?B.indexOf(this.responseStripAfter):-1;if(D!=-1){B=B.substring(0,D);}return B;};YAHOO.widget.AutoComplete.prototype.filterResults=function(J,L,P,K){if(J&&J!==""){P=YAHOO.widget.AutoComplete._cloneObject(P);var H=K.scope,O=this,B=P.results,M=[],D=false,I=(O.queryMatchCase||H.queryMatchCase),A=(O.queryMatchContains||H.queryMatchContains);for(var C=B.length-1;C>=0;C--){var F=B[C];var E=null;if(YAHOO.lang.isString(F)){E=F;}else{if(YAHOO.lang.isArray(F)){E=F[0];}else{if(this.responseSchema.fields){var N=this.responseSchema.fields[0].key||this.responseSchema.fields[0];E=F[N];}else{if(this.key){E=F[this.key];}}}}if(YAHOO.lang.isString(E)){var G=(I)?E.indexOf(decodeURIComponent(J)):E.toLowerCase().indexOf(decodeURIComponent(J).toLowerCase());if((!A&&(G===0))||(A&&(G>-1))){M.unshift(F);}}}P.results=M;}else{}return P;};YAHOO.widget.AutoComplete.prototype.handleResponse=function(C,A,B){if((this instanceof YAHOO.widget.AutoComplete)&&this._sName){this._populateList(C,A,B);}};YAHOO.widget.AutoComplete.prototype.doBeforeLoadData=function(C,A,B){return true;};YAHOO.widget.AutoComplete.prototype.formatResult=function(B,D,A){var C=(A)?A:"";return C;};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(D,A,C,B){return true;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var B=this.toString();var A=this._elTextbox;var D=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerPopulateEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();this.textboxChangeEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(A,true);YAHOO.util.Event.purgeElement(D,true);D.innerHTML="";for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerPopulateEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete.prototype.textboxChangeEvent=null;YAHOO.widget.AutoComplete._nIndex=0; +YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=null;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._elList=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sPastSelections="";YAHOO.widget.AutoComplete.prototype._sInitInputValue=null;YAHOO.widget.AutoComplete.prototype._elCurListItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var B=this.minQueryLength;if(!YAHOO.lang.isNumber(B)){this.minQueryLength=1;}var E=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(E)||(E<1)){this.maxResultsDisplayed=10;}var F=this.queryDelay;if(!YAHOO.lang.isNumber(F)||(F<0)){this.queryDelay=0.2;}var C=this.typeAheadDelay;if(!YAHOO.lang.isNumber(C)||(C<0)){this.typeAheadDelay=0.2;}var A=this.delimChar;if(YAHOO.lang.isString(A)&&(A.length>0)){this.delimChar=[A];}else{if(!YAHOO.lang.isArray(A)){this.delimChar=null;}}var D=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(D)||(D<0)){this.animSpeed=0.3;}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed);}else{this._oAnim.duration=this.animSpeed;}}if(this.forceSelection&&A){}};YAHOO.widget.AutoComplete.prototype._initContainerHelperEls=function(){if(this.useShadow&&!this._elShadow){var A=document.createElement("div");A.className="yui-ac-shadow";A.style.width=0;A.style.height=0;this._elShadow=this._elContainer.appendChild(A);}if(this.useIFrame&&!this._elIFrame){var B=document.createElement("iframe");B.src=this._iFrameSrc;B.frameBorder=0;B.scrolling="no";B.style.position="absolute";B.style.width=0;B.style.height=0;B.tabIndex=-1;B.style.padding=0;this._elIFrame=this._elContainer.appendChild(B);}};YAHOO.widget.AutoComplete.prototype._initContainerEl=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var C=document.createElement("div");C.className="yui-ac-content";C.style.display="none";this._elContent=this._elContainer.appendChild(C);var B=document.createElement("div");B.className="yui-ac-hd";B.style.display="none";this._elHeader=this._elContent.appendChild(B);var D=document.createElement("div");D.className="yui-ac-bd";this._elBody=this._elContent.appendChild(D);var A=document.createElement("div");A.className="yui-ac-ft";A.style.display="none";this._elFooter=this._elContent.appendChild(A);}else{}};YAHOO.widget.AutoComplete.prototype._initListEl=function(){var C=this.maxResultsDisplayed;var A=this._elList||document.createElement("ul");var B;while(A.childNodes.length=18&&A<=20)||(A==27)||(A>=33&&A<=35)||(A>=36&&A<=40)||(A>=44&&A<=45)||(A==229)){return true;}return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(G){if(this.minQueryLength<0){this._toggleContainer(false);return ;}var I=(this.delimChar)?this.delimChar:null;if(I){var B=-1;for(var F=I.length-1;F>=0;F--){var D=G.lastIndexOf(I[F]);if(D>B){B=D;}}if(I[F]==" "){for(var E=I.length-1;E>=0;E--){if(G[B-1]==I[E]){B--;break;}}}if(B>-1){var H=B+1;while(G.charAt(H)==" "){H+=1;}this._sPastSelections=G.substring(0,H);G=G.substr(H);}else{this._sPastSelections="";}}if((G&&(G.length0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}this._toggleContainer(false);return ;}G=encodeURIComponent(G);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var A=this.getSubsetMatches(G);if(A){this.handleResponse(G,A,{query:G});return ;}}if(this.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse;}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults;}var C=this.generateRequest(G);this.dataRequestEvent.fire(this,G,C);this.dataSource.sendRequest(C,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:G}});};YAHOO.widget.AutoComplete.prototype._populateList=function(K,F,C){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID);}K=(C&&C.query)?C.query:K;var H=this.doBeforeLoadData(K,F,C);if(H&&!F.error){this.dataReturnEvent.fire(this,K,F.results);if(this._bFocused||(this._bFocused===null)){var M=decodeURIComponent(K); +this._sCurQuery=M;this._bItemSelected=false;var R=F.results,A=Math.min(R.length,this.maxResultsDisplayed),J=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(A>0){if(!this._elList||(this._elList.childNodes.length=0;Q--){var P=I[Q],E=R[Q];if(this.resultTypeList){var B=[];B[0]=(YAHOO.lang.isString(E))?E:E[J]||E[this.key];var L=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(L)&&(L.length>1)){for(var N=1,S=L.length;N=A;O--){G=I[O];G.style.display="none";}}this._nDisplayedItems=A;this.containerPopulateEvent.fire(this,K,R);if(this.autoHighlight){var D=this._elList.firstChild;this._toggleHighlight(D,"to");this.itemArrowToEvent.fire(this,D);this._typeAhead(D,K);}else{this._toggleHighlight(this._elCurListItem,"from");}H=this.doBeforeExpandContainer(this._elTextbox,this._elContainer,K,R);this._toggleContainer(H);}else{this._toggleContainer(false);}return ;}}else{this.dataErrorEvent.fire(this,K);}};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var C=this._elTextbox.value;var B=(this.delimChar)?this.delimChar[0]:null;var A=(B)?C.lastIndexOf(B,C.length-2):-1;if(A>-1){this._elTextbox.value=C.substring(0,A);}else{this._elTextbox.value="";}this._sPastSelections=this._elTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var A=null;for(var B=this._nDisplayedItems-1;B>=0;B--){var C=this._elList.childNodes[B];var D=(""+C._sResultMatch).toLowerCase();if(D==this._sCurQuery.toLowerCase()){A=C;break;}}return(A);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(B,D){if(!this.typeAhead||(this._nKeyCode==8)){return ;}var A=this,C=this._elTextbox;if(C.setSelectionRange||C.createTextRange){this._nTypeAheadDelayID=setTimeout(function(){var F=C.value.length;A._updateValue(B);var G=C.value.length;A._selectText(C,F,G);var E=C.value.substr(F,G);A.typeAheadEvent.fire(A,D,E);},(this.typeAheadDelay*1000));}};YAHOO.widget.AutoComplete.prototype._selectText=function(D,A,B){if(D.setSelectionRange){D.setSelectionRange(A,B);}else{if(D.createTextRange){var C=D.createTextRange();C.moveStart("character",A);C.moveEnd("character",B-D.value.length);C.select();}else{D.select();}}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(D){var E=this._elContent.offsetWidth+"px";var B=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){var C=this._elIFrame;if(D){C.style.width=E;C.style.height=B;C.style.padding="";}else{C.style.width=0;C.style.height=0;C.style.padding=0;}}if(this.useShadow&&this._elShadow){var A=this._elShadow;if(D){A.style.width=E;A.style.height=B;}else{A.style.width=0;A.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(I){var D=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return ;}if(!I){this._toggleHighlight(this._elCurListItem,"from");this._nDisplayedItems=0;this._sCurQuery=null;if(!this._bContainerOpen){this._elContent.style.display="none";return ;}}var A=this._oAnim;if(A&&A.getEl()&&(this.animHoriz||this.animVert)){if(A.isAnimated()){A.stop(true);}var G=this._elContent.cloneNode(true);D.appendChild(G);G.style.top="-9000px";G.style.width="";G.style.height="";G.style.display="";var F=G.offsetWidth;var C=G.offsetHeight;var B=(this.animHoriz)?0:F;var E=(this.animVert)?0:C;A.attributes=(I)?{width:{to:F},height:{to:C}}:{width:{to:B},height:{to:E}};if(I&&!this._bContainerOpen){this._elContent.style.width=B+"px";this._elContent.style.height=E+"px";}else{this._elContent.style.width=F+"px";this._elContent.style.height=C+"px";}D.removeChild(G);G=null;var H=this;var J=function(){A.onComplete.unsubscribeAll();if(I){H._toggleContainerHelpers(true);H._bContainerOpen=I;H.containerExpandEvent.fire(H);}else{H._elContent.style.display="none";H._bContainerOpen=I;H.containerCollapseEvent.fire(H);}};this._toggleContainerHelpers(false);this._elContent.style.display="";A.onComplete.subscribe(J);A.animate();}else{if(I){this._elContent.style.display="";this._toggleContainerHelpers(true);this._bContainerOpen=I;this.containerExpandEvent.fire(this);}else{this._toggleContainerHelpers(false);this._elContent.style.display="none";this._bContainerOpen=I;this.containerCollapseEvent.fire(this);}}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(A,C){if(A){var B=this.highlightClassName;if(this._elCurListItem){YAHOO.util.Dom.removeClass(this._elCurListItem,B);this._elCurListItem=null;}if((C=="to")&&B){YAHOO.util.Dom.addClass(A,B);this._elCurListItem=A;}}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(B,C){if(B==this._elCurListItem){return ;}var A=this.prehighlightClassName;if((C=="mouseover")&&A){YAHOO.util.Dom.addClass(B,A);}else{YAHOO.util.Dom.removeClass(B,A);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(C){if(!this.suppressInputUpdate){var F=this._elTextbox;var E=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var B=C._sResultMatch;var D="";if(E){D=this._sPastSelections;D+=B+E;if(E!=" "){D+=" ";}}else{D=B;}F.value=D;if(F.type=="textarea"){F.scrollTop=F.scrollHeight;}var A=F.value.length;this._selectText(F,A,A);this._elCurListItem=C;}};YAHOO.widget.AutoComplete.prototype._selectItem=function(A){this._bItemSelected=true;this._updateValue(A);this._sPastSelections=this._elTextbox.value;this._clearInterval();this.itemSelectEvent.fire(this,A,A._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._elCurListItem){this._selectItem(this._elCurListItem); +}else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(G){if(this._bContainerOpen){var F=this._elCurListItem;var E=-1;if(F){E=F._nItemIndex;}var C=(G==40)?(E+1):(E-1);if(C<-2||C>=this._nDisplayedItems){return ;}if(F){this._toggleHighlight(F,"from");this.itemArrowFromEvent.fire(this,F);}if(C==-1){if(this.delimChar){this._elTextbox.value=this._sPastSelections+this._sCurQuery;}else{this._elTextbox.value=this._sCurQuery;}return ;}if(C==-2){this._toggleContainer(false);return ;}var D=this._elList.childNodes[C];var A=this._elContent;var B=((YAHOO.util.Dom.getStyle(A,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(A,"overflowY")=="auto"));if(B&&(C>-1)&&(C(A.scrollTop+A.offsetHeight)){A.scrollTop=(D.offsetTop+D.offsetHeight)-A.offsetHeight;}else{if((D.offsetTop+D.offsetHeight)(A.scrollTop+A.offsetHeight)){this._elContent.scrollTop=(D.offsetTop+D.offsetHeight)-A.offsetHeight;}}}}this._toggleHighlight(D,"to");this.itemArrowToEvent.fire(this,D);if(this.typeAhead){this._updateValue(D);}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":if(C.prehighlightClassName){C._togglePrehighlight(D,"mouseover");}else{C._toggleHighlight(D,"to");}C.itemMouseOverEvent.fire(C,D);break;case"div":if(YAHOO.util.Dom.hasClass(D,"yui-ac-container")){C._bOverContainer=true;return ;}break;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":if(C.prehighlightClassName){C._togglePrehighlight(D,"mouseout");}else{C._toggleHighlight(D,"from");}C.itemMouseOutEvent.fire(C,D);break;case"ul":C._toggleHighlight(C._elCurListItem,"to");break;case"div":if(YAHOO.util.Dom.hasClass(D,"yui-ac-container")){C._bOverContainer=false;return ;}break;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerClick=function(A,C){var D=YAHOO.util.Event.getTarget(A);var B=D.nodeName.toLowerCase();while(D&&(B!="table")){switch(B){case"body":return ;case"li":C._toggleHighlight(D,"to");C._selectItem(D);return ;default:break;}D=D.parentNode;if(D){B=D.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(A,B){B._elTextbox.focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(A,B){B._toggleContainerHelpers(B._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(A,B){var C=A.keyCode;if(B._nTypeAheadDelayID!=-1){clearTimeout(B._nTypeAheadDelayID);}switch(C){case 9:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(B._elCurListItem){if(B.delimChar&&(B._nKeyCode!=C)){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 13:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(B._elCurListItem){if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);}}B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 27:B._toggleContainer(false);return ;case 39:B._jumpSelection();break;case 38:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);B._moveSelection(C);}break;case 40:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);B._moveSelection(C);}break;default:B._bItemSelected=false;B._toggleHighlight(B._elCurListItem,"from");B.textboxKeyEvent.fire(B,C);break;}if(C===18){B._enableIntervalDetection();}B._nKeyCode=C;};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(A,B){var C=A.keyCode;if(YAHOO.env.ua.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&(YAHOO.env.ua.webkit<420)){switch(C){case 9:if(B._bContainerOpen){if(B.delimChar){YAHOO.util.Event.stopEvent(A);}if(B._elCurListItem){B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;case 13:if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A);if(B._elCurListItem){B._selectItem(B._elCurListItem);}else{B._toggleContainer(false);}}break;default:break;}}else{if(C==229){B._enableIntervalDetection();}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(A,C){var B=this.value;C._initProps();var D=A.keyCode;if(C._isIgnoreKey(D)){return ;}if(C._nDelayID!=-1){clearTimeout(C._nDelayID);}C._nDelayID=setTimeout(function(){C._sendQuery(B);},(C.queryDelay*1000));};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(A,B){if(!B._bFocused){B._elTextbox.setAttribute("autocomplete","off");B._bFocused=true;B._sInitInputValue=B._elTextbox.value;B.textboxFocusEvent.fire(B);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(A,C){if(!C._bOverContainer||(C._nKeyCode==9)){if(!C._bItemSelected){var B=C._textMatchesOption();if(!C._bContainerOpen||(C._bContainerOpen&&(B===null))){if(C.forceSelection){C._clearSelection();}else{C.unmatchedItemSelectEvent.fire(C,C._sCurQuery);}}else{if(C.forceSelection){C._selectItem(B);}}}if(C._bContainerOpen){C._toggleContainer(false);}C._clearInterval();C._bFocused=false;if(C._sInitInputValue!==C._elTextbox.value){C.textboxChangeEvent.fire(C);}C.textboxBlurEvent.fire(C);}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(A,B){if(B&&B._elTextbox&&B.allowBrowserAutocomplete){B._elTextbox.setAttribute("autocomplete","on");}};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(A){return this.generateRequest(A);};YAHOO.widget.AutoComplete.prototype.getListItems=function(){var C=[],B=this._elList.childNodes;for(var A=B.length-1;A>=0;A--){C[A]=B[A];}return C;};YAHOO.widget.AutoComplete._cloneObject=function(D){if(!YAHOO.lang.isValue(D)){return D; +}var F={};if(YAHOO.lang.isFunction(D)){F=D;}else{if(YAHOO.lang.isArray(D)){var E=[];for(var C=0,B=D.length;C + *
  • Navigate with up/down arrow keys and/or mouse to pick a selection
  • + *
  • The drop down container can "roll down" or "fly out" via configurable + * animation
  • + *
  • UI look-and-feel customizable through CSS, including container + * attributes, borders, position, fonts, etc
  • + * + * + * @class AutoComplete + * @constructor + * @param elInput {HTMLElement} DOM element reference of an input field. + * @param elInput {String} String ID of an input field. + * @param elContainer {HTMLElement} DOM element reference of an existing DIV. + * @param elContainer {String} String ID of an existing DIV. + * @param oDataSource {YAHOO.widget.DataSource} DataSource instance. + * @param oConfigs {Object} (optional) Object literal of configuration params. + */ +YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) { + if(elInput && elContainer && oDataSource) { + // Validate DataSource + if(oDataSource instanceof YAHOO.util.DataSourceBase) { + this.dataSource = oDataSource; + } + else { + return; + } + + // YAHOO.widget.DataSource schema backwards compatibility + // Converted deprecated schema into supported schema + // First assume key data is held in position 0 of results array + this.key = 0; + var schema = oDataSource.responseSchema; + // An old school schema has been defined in the deprecated DataSource constructor + if(oDataSource._aDeprecatedSchema) { + var aDeprecatedSchema = oDataSource._aDeprecatedSchema; + if(YAHOO.lang.isArray(aDeprecatedSchema)) { + + if((oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_JSON) || + (oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_UNKNOWN)) { // Used to default to unknown + // Store the resultsList + schema.resultsList = aDeprecatedSchema[0]; + // Store the key + this.key = aDeprecatedSchema[1]; + // Only resultsList and key are defined, so grab all the data + schema.fields = (aDeprecatedSchema.length < 3) ? null : aDeprecatedSchema.slice(1); + } + else if(oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_XML) { + schema.resultNode = aDeprecatedSchema[0]; + this.key = aDeprecatedSchema[1]; + schema.fields = aDeprecatedSchema.slice(1); + } + else if(oDataSource.responseType === YAHOO.util.DataSourceBase.TYPE_TEXT) { + schema.recordDelim = aDeprecatedSchema[0]; + schema.fieldDelim = aDeprecatedSchema[1]; + } + oDataSource.responseSchema = schema; + } + } + + // Validate input element + if(YAHOO.util.Dom.inDocument(elInput)) { + if(YAHOO.lang.isString(elInput)) { + this._sName = "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput; + this._elTextbox = document.getElementById(elInput); + } + else { + this._sName = (elInput.id) ? + "instance" + YAHOO.widget.AutoComplete._nIndex + " " + elInput.id: + "instance" + YAHOO.widget.AutoComplete._nIndex; + this._elTextbox = elInput; + } + YAHOO.util.Dom.addClass(this._elTextbox, "yui-ac-input"); + } + else { + return; + } + + // Validate container element + if(YAHOO.util.Dom.inDocument(elContainer)) { + if(YAHOO.lang.isString(elContainer)) { + this._elContainer = document.getElementById(elContainer); + } + else { + this._elContainer = elContainer; + } + if(this._elContainer.style.display == "none") { + } + + // For skinning + var elParent = this._elContainer.parentNode; + var elTag = elParent.tagName.toLowerCase(); + if(elTag == "div") { + YAHOO.util.Dom.addClass(elParent, "yui-ac"); + } + else { + } + } + else { + return; + } + + // Default applyLocalFilter setting is to enable for local sources + if(this.dataSource.dataType === YAHOO.util.DataSourceBase.TYPE_LOCAL) { + this.applyLocalFilter = true; + } + + // Set any config params passed in to override defaults + if(oConfigs && (oConfigs.constructor == Object)) { + for(var sConfig in oConfigs) { + if(sConfig) { + this[sConfig] = oConfigs[sConfig]; + } + } + } + + // Initialization sequence + this._initContainerEl(); + this._initProps(); + this._initListEl(); + this._initContainerHelperEls(); + + // Set up events + var oSelf = this; + var elTextbox = this._elTextbox; + + // Dom events + YAHOO.util.Event.addListener(elTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf); + YAHOO.util.Event.addListener(elTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf); + YAHOO.util.Event.addListener(elTextbox,"focus",oSelf._onTextboxFocus,oSelf); + YAHOO.util.Event.addListener(elTextbox,"blur",oSelf._onTextboxBlur,oSelf); + YAHOO.util.Event.addListener(elContainer,"mouseover",oSelf._onContainerMouseover,oSelf); + YAHOO.util.Event.addListener(elContainer,"mouseout",oSelf._onContainerMouseout,oSelf); + YAHOO.util.Event.addListener(elContainer,"click",oSelf._onContainerClick,oSelf); + YAHOO.util.Event.addListener(elContainer,"scroll",oSelf._onContainerScroll,oSelf); + YAHOO.util.Event.addListener(elContainer,"resize",oSelf._onContainerResize,oSelf); + YAHOO.util.Event.addListener(elTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf); + YAHOO.util.Event.addListener(window,"unload",oSelf._onWindowUnload,oSelf); + + // Custom events + this.textboxFocusEvent = new YAHOO.util.CustomEvent("textboxFocus", this); + this.textboxKeyEvent = new YAHOO.util.CustomEvent("textboxKey", this); + this.dataRequestEvent = new YAHOO.util.CustomEvent("dataRequest", this); + this.dataReturnEvent = new YAHOO.util.CustomEvent("dataReturn", this); + this.dataErrorEvent = new YAHOO.util.CustomEvent("dataError", this); + this.containerPopulateEvent = new YAHOO.util.CustomEvent("containerPopulate", this); + this.containerExpandEvent = new YAHOO.util.CustomEvent("containerExpand", this); + this.typeAheadEvent = new YAHOO.util.CustomEvent("typeAhead", this); + this.itemMouseOverEvent = new YAHOO.util.CustomEvent("itemMouseOver", this); + this.itemMouseOutEvent = new YAHOO.util.CustomEvent("itemMouseOut", this); + this.itemArrowToEvent = new YAHOO.util.CustomEvent("itemArrowTo", this); + this.itemArrowFromEvent = new YAHOO.util.CustomEvent("itemArrowFrom", this); + this.itemSelectEvent = new YAHOO.util.CustomEvent("itemSelect", this); + this.unmatchedItemSelectEvent = new YAHOO.util.CustomEvent("unmatchedItemSelect", this); + this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this); + this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this); + this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this); + this.textboxChangeEvent = new YAHOO.util.CustomEvent("textboxChange", this); + + // Finish up + elTextbox.setAttribute("autocomplete","off"); + YAHOO.widget.AutoComplete._nIndex++; + } + // Required arguments were not found + else { + } +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Public member variables +// +///////////////////////////////////////////////////////////////////////////// + +/** + * The DataSource object that encapsulates the data used for auto completion. + * This object should be an inherited object from YAHOO.widget.DataSource. + * + * @property dataSource + * @type YAHOO.widget.DataSource + */ +YAHOO.widget.AutoComplete.prototype.dataSource = null; + +/** + * By default, results from local DataSources will pass through the filterResults + * method to apply a client-side matching algorithm. + * + * @property applyLocalFilter + * @type Boolean + * @default true for local arrays and json, otherwise false + */ +YAHOO.widget.AutoComplete.prototype.applyLocalFilter = null; + +/** + * When applyLocalFilter is true, the local filtering algorthim can have case sensitivity + * enabled. + * + * @property queryMatchCase + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.queryMatchCase = false; + +/** + * When applyLocalFilter is true, results can be locally filtered to return + * matching strings that "contain" the query string rather than simply "start with" + * the query string. + * + * @property queryMatchContains + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.queryMatchContains = false; + +/** + * Enables query subset matching. When the DataSource's cache is enabled and queryMatchSubset is + * true, substrings of queries will return matching cached results. For + * instance, if the first query is for "abc" susequent queries that start with + * "abc", like "abcd", will be queried against the cache, and not the live data + * source. Recommended only for DataSources that return comprehensive results + * for queries with very few characters. + * + * @property queryMatchSubset + * @type Boolean + * @default false + * + */ +YAHOO.widget.AutoComplete.prototype.queryMatchSubset = false; + +/** + * Number of characters that must be entered before querying for results. A negative value + * effectively turns off the widget. A value of 0 allows queries of null or empty string + * values. + * + * @property minQueryLength + * @type Number + * @default 1 + */ +YAHOO.widget.AutoComplete.prototype.minQueryLength = 1; + +/** + * Maximum number of results to display in results container. + * + * @property maxResultsDisplayed + * @type Number + * @default 10 + */ +YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed = 10; + +/** + * Number of seconds to delay before submitting a query request. If a query + * request is received before a previous one has completed its delay, the + * previous request is cancelled and the new request is set to the delay. If + * typeAhead is also enabled, this value must always be less than the typeAheadDelay + * in order to avoid certain race conditions. + * + * @property queryDelay + * @type Number + * @default 0.2 + */ +YAHOO.widget.AutoComplete.prototype.queryDelay = 0.2; + +/** + * If typeAhead is true, number of seconds to delay before updating input with + * typeAhead value. In order to prevent certain race conditions, this value must + * always be greater than the queryDelay. + * + * @property typeAheadDelay + * @type Number + * @default 0.5 + */ +YAHOO.widget.AutoComplete.prototype.typeAheadDelay = 0.5; + +/** + * When IME usage is detected, AutoComplete will switch to querying the input + * value at the given interval rather than per key event. + * + * @property queryInterval + * @type Number + * @default 500 + */ +YAHOO.widget.AutoComplete.prototype.queryInterval = 500; + +/** + * Class name of a highlighted item within results container. + * + * @property highlightClassName + * @type String + * @default "yui-ac-highlight" + */ +YAHOO.widget.AutoComplete.prototype.highlightClassName = "yui-ac-highlight"; + +/** + * Class name of a pre-highlighted item within results container. + * + * @property prehighlightClassName + * @type String + */ +YAHOO.widget.AutoComplete.prototype.prehighlightClassName = null; + +/** + * Query delimiter. A single character separator for multiple delimited + * selections. Multiple delimiter characteres may be defined as an array of + * strings. A null value or empty string indicates that query results cannot + * be delimited. This feature is not recommended if you need forceSelection to + * be true. + * + * @property delimChar + * @type String | String[] + */ +YAHOO.widget.AutoComplete.prototype.delimChar = null; + +/** + * Whether or not the first item in results container should be automatically highlighted + * on expand. + * + * @property autoHighlight + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.autoHighlight = true; + +/** + * If autohighlight is enabled, whether or not the input field should be automatically updated + * with the first query result as the user types, auto-selecting the substring portion + * of the first result that the user has not yet typed. + * + * @property typeAhead + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.typeAhead = false; + +/** + * Whether or not to animate the expansion/collapse of the results container in the + * horizontal direction. + * + * @property animHoriz + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.animHoriz = false; + +/** + * Whether or not to animate the expansion/collapse of the results container in the + * vertical direction. + * + * @property animVert + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.animVert = true; + +/** + * Speed of container expand/collapse animation, in seconds.. + * + * @property animSpeed + * @type Number + * @default 0.3 + */ +YAHOO.widget.AutoComplete.prototype.animSpeed = 0.3; + +/** + * Whether or not to force the user's selection to match one of the query + * results. Enabling this feature essentially transforms the input field into a + * <select> field. This feature is not recommended with delimiter character(s) + * defined. + * + * @property forceSelection + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.forceSelection = false; + +/** + * Whether or not to allow browsers to cache user-typed input in the input + * field. Disabling this feature will prevent the widget from setting the + * autocomplete="off" on the input field. When autocomplete="off" + * and users click the back button after form submission, user-typed input can + * be prefilled by the browser from its cache. This caching of user input may + * not be desired for sensitive data, such as credit card numbers, in which + * case, implementers should consider setting allowBrowserAutocomplete to false. + * + * @property allowBrowserAutocomplete + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete = true; + +/** + * Enabling this feature prevents the toggling of the container to a collapsed state. + * Setting to true does not automatically trigger the opening of the container. + * Implementers are advised to pre-load the container with an explicit "sendQuery()" call. + * + * @property alwaysShowContainer + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.alwaysShowContainer = false; + +/** + * Whether or not to use an iFrame to layer over Windows form elements in + * IE. Set to true only when the results container will be on top of a + * <select> field in IE and thus exposed to the IE z-index bug (i.e., + * 5.5 < IE < 7). + * + * @property useIFrame + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.useIFrame = false; + +/** + * Whether or not the results container should have a shadow. + * + * @property useShadow + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.useShadow = false; + +/** + * Whether or not the input field should be updated with selections. + * + * @property supressInputUpdate + * @type Boolean + * @default false + */ +YAHOO.widget.AutoComplete.prototype.suppressInputUpdate = false; + +/** + * For backward compatibility to pre-2.6.0 formatResults() signatures, setting + * resultsTypeList to true will take each object literal result returned by + * DataSource and flatten into an array. + * + * @property resultTypeList + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.resultTypeList = true; + +/** + * For XHR DataSources, AutoComplete will automatically insert a "?" between the server URI and + * the "query" param/value pair. To prevent this behavior, implementers should + * set this value to false. To more fully customize the query syntax, implementers + * should override the generateRequest() method. + * + * @property queryQuestionMark + * @type Boolean + * @default true + */ +YAHOO.widget.AutoComplete.prototype.queryQuestionMark = true; + +///////////////////////////////////////////////////////////////////////////// +// +// Public methods +// +///////////////////////////////////////////////////////////////////////////// + + /** + * Public accessor to the unique name of the AutoComplete instance. + * + * @method toString + * @return {String} Unique name of the AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.toString = function() { + return "AutoComplete " + this._sName; +}; + + /** + * Returns DOM reference to input element. + * + * @method getInputEl + * @return {HTMLELement} DOM reference to input element. + */ +YAHOO.widget.AutoComplete.prototype.getInputEl = function() { + return this._elTextbox; +}; + + /** + * Returns DOM reference to container element. + * + * @method getContainerEl + * @return {HTMLELement} DOM reference to container element. + */ +YAHOO.widget.AutoComplete.prototype.getContainerEl = function() { + return this._elContainer; +}; + + /** + * Returns true if widget instance is currently focused. + * + * @method isFocused + * @return {Boolean} Returns true if widget instance is currently focused. + */ +YAHOO.widget.AutoComplete.prototype.isFocused = function() { + return (this._bFocused === null) ? false : this._bFocused; +}; + + /** + * Returns true if container is in an expanded state, false otherwise. + * + * @method isContainerOpen + * @return {Boolean} Returns true if container is in an expanded state, false otherwise. + */ +YAHOO.widget.AutoComplete.prototype.isContainerOpen = function() { + return this._bContainerOpen; +}; + +/** + * Public accessor to the <ul> element that displays query results within the results container. + * + * @method getListEl + * @return {HTMLElement[]} Reference to <ul> element within the results container. + */ +YAHOO.widget.AutoComplete.prototype.getListEl = function() { + return this._elList; +}; + +/** + * Public accessor to the matching string associated with a given <li> result. + * + * @method getListItemMatch + * @param elListItem {HTMLElement} Reference to <LI> element. + * @return {String} Matching string. + */ +YAHOO.widget.AutoComplete.prototype.getListItemMatch = function(elListItem) { + if(elListItem._sResultMatch) { + return elListItem._sResultMatch; + } + else { + return null; + } +}; + +/** + * Public accessor to the result data associated with a given <li> result. + * + * @method getListItemData + * @param elListItem {HTMLElement} Reference to <LI> element. + * @return {Object} Result data. + */ +YAHOO.widget.AutoComplete.prototype.getListItemData = function(elListItem) { + if(elListItem._oResultData) { + return elListItem._oResultData; + } + else { + return null; + } +}; + +/** + * Public accessor to the index of the associated with a given <li> result. + * + * @method getListItemIndex + * @param elListItem {HTMLElement} Reference to <LI> element. + * @return {Number} Index. + */ +YAHOO.widget.AutoComplete.prototype.getListItemIndex = function(elListItem) { + if(YAHOO.lang.isNumber(elListItem._nItemIndex)) { + return elListItem._nItemIndex; + } + else { + return null; + } +}; + +/** + * Sets HTML markup for the results container header. This markup will be + * inserted within a <div> tag with a class of "yui-ac-hd". + * + * @method setHeader + * @param sHeader {String} HTML markup for results container header. + */ +YAHOO.widget.AutoComplete.prototype.setHeader = function(sHeader) { + if(this._elHeader) { + var elHeader = this._elHeader; + if(sHeader) { + elHeader.innerHTML = sHeader; + elHeader.style.display = "block"; + } + else { + elHeader.innerHTML = ""; + elHeader.style.display = "none"; + } + } +}; + +/** + * Sets HTML markup for the results container footer. This markup will be + * inserted within a <div> tag with a class of "yui-ac-ft". + * + * @method setFooter + * @param sFooter {String} HTML markup for results container footer. + */ +YAHOO.widget.AutoComplete.prototype.setFooter = function(sFooter) { + if(this._elFooter) { + var elFooter = this._elFooter; + if(sFooter) { + elFooter.innerHTML = sFooter; + elFooter.style.display = "block"; + } + else { + elFooter.innerHTML = ""; + elFooter.style.display = "none"; + } + } +}; + +/** + * Sets HTML markup for the results container body. This markup will be + * inserted within a <div> tag with a class of "yui-ac-bd". + * + * @method setBody + * @param sBody {String} HTML markup for results container body. + */ +YAHOO.widget.AutoComplete.prototype.setBody = function(sBody) { + if(this._elBody) { + var elBody = this._elBody; + YAHOO.util.Event.purgeElement(elBody, true); + if(sBody) { + elBody.innerHTML = sBody; + elBody.style.display = "block"; + } + else { + elBody.innerHTML = ""; + elBody.style.display = "none"; + } + this._elList = null; + } +}; + +/** +* A function that converts an AutoComplete query into a request value which is then +* passed to the DataSource's sendRequest method in order to retrieve data for +* the query. By default, returns a String with the syntax: "query={query}" +* Implementers can customize this method for custom request syntaxes. +* +* @method generateRequest +* @param sQuery {String} Query string +*/ +YAHOO.widget.AutoComplete.prototype.generateRequest = function(sQuery) { + var dataType = this.dataSource.dataType; + + // Transform query string in to a request for remote data + // By default, local data doesn't need a transformation, just passes along the query as is. + if(dataType === YAHOO.util.DataSourceBase.TYPE_XHR) { + // By default, XHR GET requests look like "{scriptURI}?{scriptQueryParam}={sQuery}&{scriptQueryAppend}" + if(!this.dataSource.connMethodPost) { + sQuery = (this.queryQuestionMark ? "?" : "") + (this.dataSource.scriptQueryParam || "query") + "=" + sQuery + + (this.dataSource.scriptQueryAppend ? ("&" + this.dataSource.scriptQueryAppend) : ""); + } + // By default, XHR POST bodies are sent to the {scriptURI} like "{scriptQueryParam}={sQuery}&{scriptQueryAppend}" + else { + sQuery = (this.dataSource.scriptQueryParam || "query") + "=" + sQuery + + (this.dataSource.scriptQueryAppend ? ("&" + this.dataSource.scriptQueryAppend) : ""); + } + } + // By default, remote script node requests look like "{scriptURI}&{scriptCallbackParam}={callbackString}&{scriptQueryParam}={sQuery}&{scriptQueryAppend}" + else if(dataType === YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE) { + sQuery = "&" + (this.dataSource.scriptQueryParam || "query") + "=" + sQuery + + (this.dataSource.scriptQueryAppend ? ("&" + this.dataSource.scriptQueryAppend) : ""); + } + + return sQuery; +}; + +/** + * Makes query request to the DataSource. + * + * @method sendQuery + * @param sQuery {String} Query string. + */ +YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) { + // Adjust programatically sent queries to look like they input by user + // when delimiters are enabled + var newQuery = (this.delimChar) ? this._elTextbox.value + sQuery : sQuery; + this._sendQuery(newQuery); +}; + +/** + * Collapses container. + * + * @method collapseContainer + */ +YAHOO.widget.AutoComplete.prototype.collapseContainer = function() { + this._toggleContainer(false); +}; + +/** + * Handles subset matching for when queryMatchSubset is enabled. + * + * @method getSubsetMatches + * @param sQuery {String} Query string. + * @return {Object} oParsedResponse or null. + */ +YAHOO.widget.AutoComplete.prototype.getSubsetMatches = function(sQuery) { + var subQuery, oCachedResponse, subRequest; + // Loop through substrings of each cached element's query property... + for(var i = sQuery.length; i >= this.minQueryLength ; i--) { + subRequest = this.generateRequest(sQuery.substr(0,i)); + this.dataRequestEvent.fire(this, subQuery, subRequest); + + // If a substring of the query is found in the cache + oCachedResponse = this.dataSource.getCachedResponse(subRequest); + if(oCachedResponse) { + return this.filterResults.apply(this.dataSource, [sQuery, oCachedResponse, oCachedResponse, {scope:this}]); + } + } + return null; +}; + +/** + * Executed by DataSource (within DataSource scope via doBeforeParseData()) to + * handle responseStripAfter cleanup. + * + * @method preparseRawResponse + * @param sQuery {String} Query string. + * @return {Object} oParsedResponse or null. + */ +YAHOO.widget.AutoComplete.prototype.preparseRawResponse = function(oRequest, oFullResponse, oCallback) { + var nEnd = ((this.responseStripAfter !== "") && (oFullResponse.indexOf)) ? + oFullResponse.indexOf(this.responseStripAfter) : -1; + if(nEnd != -1) { + oFullResponse = oFullResponse.substring(0,nEnd); + } + return oFullResponse; +}; + +/** + * Executed by DataSource (within DataSource scope via doBeforeCallback()) to + * filter results through a simple client-side matching algorithm. + * + * @method filterResults + * @param sQuery {String} Original request. + * @param oFullResponse {Object} Full response object. + * @param oParsedResponse {Object} Parsed response object. + * @param oCallback {Object} Callback object. + * @return {Object} Filtered response object. + */ + +YAHOO.widget.AutoComplete.prototype.filterResults = function(sQuery, oFullResponse, oParsedResponse, oCallback) { + // Only if a query string is available to match against + if(sQuery && sQuery !== "") { + // First make a copy of the oParseResponse + oParsedResponse = YAHOO.widget.AutoComplete._cloneObject(oParsedResponse); + + var oAC = oCallback.scope, + oDS = this, + allResults = oParsedResponse.results, // the array of results + filteredResults = [], // container for filtered results + bMatchFound = false, + bMatchCase = (oDS.queryMatchCase || oAC.queryMatchCase), // backward compat + bMatchContains = (oDS.queryMatchContains || oAC.queryMatchContains); // backward compat + + // Loop through each result object... + for(var i = allResults.length-1; i >= 0; i--) { + var oResult = allResults[i]; + + // Grab the data to match against from the result object... + var sResult = null; + + // Result object is a simple string already + if(YAHOO.lang.isString(oResult)) { + sResult = oResult; + } + // Result object is an array of strings + else if(YAHOO.lang.isArray(oResult)) { + sResult = oResult[0]; + + } + // Result object is an object literal of strings + else if(this.responseSchema.fields) { + var key = this.responseSchema.fields[0].key || this.responseSchema.fields[0]; + sResult = oResult[key]; + } + // Backwards compatibility + else if(this.key) { + sResult = oResult[this.key]; + } + + if(YAHOO.lang.isString(sResult)) { + + var sKeyIndex = (bMatchCase) ? + sResult.indexOf(decodeURIComponent(sQuery)) : + sResult.toLowerCase().indexOf(decodeURIComponent(sQuery).toLowerCase()); + + // A STARTSWITH match is when the query is found at the beginning of the key string... + if((!bMatchContains && (sKeyIndex === 0)) || + // A CONTAINS match is when the query is found anywhere within the key string... + (bMatchContains && (sKeyIndex > -1))) { + // Stash the match + filteredResults.unshift(oResult); + } + } + } + oParsedResponse.results = filteredResults; + } + else { + } + + return oParsedResponse; +}; + +/** + * Handles response for display. This is the callback function method passed to + * YAHOO.util.DataSourceBase#sendRequest so results from the DataSource are + * returned to the AutoComplete instance. + * + * @method handleResponse + * @param sQuery {String} Original request. + * @param oResponse {Object} Response object. + * @param oPayload {MIXED} (optional) Additional argument(s) + */ +YAHOO.widget.AutoComplete.prototype.handleResponse = function(sQuery, oResponse, oPayload) { + if((this instanceof YAHOO.widget.AutoComplete) && this._sName) { + this._populateList(sQuery, oResponse, oPayload); + } +}; + +/** + * Overridable method called before container is loaded with result data. + * + * @method doBeforeLoadData + * @param sQuery {String} Original request. + * @param oResponse {Object} Response object. + * @param oPayload {MIXED} (optional) Additional argument(s) + * @return {Boolean} Return true to continue loading data, false to cancel. + */ +YAHOO.widget.AutoComplete.prototype.doBeforeLoadData = function(sQuery, oResponse, oPayload) { + return true; +}; + +/** + * Overridable method that returns HTML markup for one result to be populated + * as innerHTML of an <LI> element. + * + * @method formatResult + * @param oResultData {Object} Result data object. + * @param sQuery {String} The corresponding query string. + * @param sResultMatch {HTMLElement} The current query string. + * @return {String} HTML markup of formatted result data. + */ +YAHOO.widget.AutoComplete.prototype.formatResult = function(oResultData, sQuery, sResultMatch) { + var sMarkup = (sResultMatch) ? sResultMatch : ""; + return sMarkup; +}; + +/** + * Overridable method called before container expands allows implementers to access data + * and DOM elements. + * + * @method doBeforeExpandContainer + * @param elTextbox {HTMLElement} The text input box. + * @param elContainer {HTMLElement} The container element. + * @param sQuery {String} The query string. + * @param aResults {Object[]} An array of query results. + * @return {Boolean} Return true to continue expanding container, false to cancel the expand. + */ +YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer = function(elTextbox, elContainer, sQuery, aResults) { + return true; +}; + + +/** + * Nulls out the entire AutoComplete instance and related objects, removes attached + * event listeners, and clears out DOM elements inside the container. After + * calling this method, the instance reference should be expliclitly nulled by + * implementer, as in myDataTable = null. Use with caution! + * + * @method destroy + */ +YAHOO.widget.AutoComplete.prototype.destroy = function() { + var instanceName = this.toString(); + var elInput = this._elTextbox; + var elContainer = this._elContainer; + + // Unhook custom events + this.textboxFocusEvent.unsubscribeAll(); + this.textboxKeyEvent.unsubscribeAll(); + this.dataRequestEvent.unsubscribeAll(); + this.dataReturnEvent.unsubscribeAll(); + this.dataErrorEvent.unsubscribeAll(); + this.containerPopulateEvent.unsubscribeAll(); + this.containerExpandEvent.unsubscribeAll(); + this.typeAheadEvent.unsubscribeAll(); + this.itemMouseOverEvent.unsubscribeAll(); + this.itemMouseOutEvent.unsubscribeAll(); + this.itemArrowToEvent.unsubscribeAll(); + this.itemArrowFromEvent.unsubscribeAll(); + this.itemSelectEvent.unsubscribeAll(); + this.unmatchedItemSelectEvent.unsubscribeAll(); + this.selectionEnforceEvent.unsubscribeAll(); + this.containerCollapseEvent.unsubscribeAll(); + this.textboxBlurEvent.unsubscribeAll(); + this.textboxChangeEvent.unsubscribeAll(); + + // Unhook DOM events + YAHOO.util.Event.purgeElement(elInput, true); + YAHOO.util.Event.purgeElement(elContainer, true); + + // Remove DOM elements + elContainer.innerHTML = ""; + + // Null out objects + for(var key in this) { + if(YAHOO.lang.hasOwnProperty(this, key)) { + this[key] = null; + } + } + +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Public events +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Fired when the input field receives focus. + * + * @event textboxFocusEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.textboxFocusEvent = null; + +/** + * Fired when the input field receives key input. + * + * @event textboxKeyEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param nKeycode {Number} The keycode number. + */ +YAHOO.widget.AutoComplete.prototype.textboxKeyEvent = null; + +/** + * Fired when the AutoComplete instance makes a request to the DataSource. + * + * @event dataRequestEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param oRequest {Object} The request. + */ +YAHOO.widget.AutoComplete.prototype.dataRequestEvent = null; + +/** + * Fired when the AutoComplete instance receives query results from the data + * source. + * + * @event dataReturnEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param aResults {Object[]} Results array. + */ +YAHOO.widget.AutoComplete.prototype.dataReturnEvent = null; + +/** + * Fired when the AutoComplete instance does not receive query results from the + * DataSource due to an error. + * + * @event dataErrorEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + */ +YAHOO.widget.AutoComplete.prototype.dataErrorEvent = null; + +/** + * Fired when the results container is populated. + * + * @event containerPopulateEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.containerPopulateEvent = null; + +/** + * Fired when the results container is expanded. + * + * @event containerExpandEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param aResults {Object[]} Results array. + */ +YAHOO.widget.AutoComplete.prototype.containerExpandEvent = null; + +/** + * Fired when the input field has been prefilled by the type-ahead + * feature. + * + * @event typeAheadEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sQuery {String} The query string. + * @param sPrefill {String} The prefill string. + */ +YAHOO.widget.AutoComplete.prototype.typeAheadEvent = null; + +/** + * Fired when result item has been moused over. + * + * @event itemMouseOverEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item moused to. + */ +YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent = null; + +/** + * Fired when result item has been moused out. + * + * @event itemMouseOutEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item moused from. + */ +YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null; + +/** + * Fired when result item has been arrowed to. + * + * @event itemArrowToEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item arrowed to. + */ +YAHOO.widget.AutoComplete.prototype.itemArrowToEvent = null; + +/** + * Fired when result item has been arrowed away from. + * + * @event itemArrowFromEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The <li> element item arrowed from. + */ +YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent = null; + +/** + * Fired when an item is selected via mouse click, ENTER key, or TAB key. + * + * @event itemSelectEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param elItem {HTMLElement} The selected <li> element item. + * @param oData {Object} The data returned for the item, either as an object, + * or mapped from the schema into an array. + */ +YAHOO.widget.AutoComplete.prototype.itemSelectEvent = null; + +/** + * Fired when a user selection does not match any of the displayed result items. + * + * @event unmatchedItemSelectEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @param sSelection {String} The selected string. + */ +YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent = null; + +/** + * Fired if forceSelection is enabled and the user's input has been cleared + * because it did not match one of the returned query results. + * + * @event selectionEnforceEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent = null; + +/** + * Fired when the results container is collapsed. + * + * @event containerCollapseEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.containerCollapseEvent = null; + +/** + * Fired when the input field loses focus. + * + * @event textboxBlurEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.textboxBlurEvent = null; + +/** + * Fired when the input field value has changed when it loses focus. + * + * @event textboxChangeEvent + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + */ +YAHOO.widget.AutoComplete.prototype.textboxChangeEvent = null; + +///////////////////////////////////////////////////////////////////////////// +// +// Private member variables +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Internal class variable to index multiple AutoComplete instances. + * + * @property _nIndex + * @type Number + * @default 0 + * @private + */ +YAHOO.widget.AutoComplete._nIndex = 0; + +/** + * Name of AutoComplete instance. + * + * @property _sName + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sName = null; + +/** + * Text input field DOM element. + * + * @property _elTextbox + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elTextbox = null; + +/** + * Container DOM element. + * + * @property _elContainer + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elContainer = null; + +/** + * Reference to content element within container element. + * + * @property _elContent + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elContent = null; + +/** + * Reference to header element within content element. + * + * @property _elHeader + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elHeader = null; + +/** + * Reference to body element within content element. + * + * @property _elBody + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elBody = null; + +/** + * Reference to footer element within content element. + * + * @property _elFooter + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elFooter = null; + +/** + * Reference to shadow element within container element. + * + * @property _elShadow + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elShadow = null; + +/** + * Reference to iframe element within container element. + * + * @property _elIFrame + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elIFrame = null; + +/** + * Whether or not the input field is currently in focus. If query results come back + * but the user has already moved on, do not proceed with auto complete behavior. + * + * @property _bFocused + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bFocused = null; + +/** + * Animation instance for container expand/collapse. + * + * @property _oAnim + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._oAnim = null; + +/** + * Whether or not the results container is currently open. + * + * @property _bContainerOpen + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bContainerOpen = false; + +/** + * Whether or not the mouse is currently over the results + * container. This is necessary in order to prevent clicks on container items + * from being text input field blur events. + * + * @property _bOverContainer + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bOverContainer = false; + +/** + * Internal reference to <ul> elements that contains query results within the + * results container. + * + * @property _elList + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elList = null; + +/* + * Array of <li> elements references that contain query results within the + * results container. + * + * @property _aListItemEls + * @type HTMLElement[] + * @private + */ +//YAHOO.widget.AutoComplete.prototype._aListItemEls = null; + +/** + * Number of <li> elements currently displayed in results container. + * + * @property _nDisplayedItems + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nDisplayedItems = 0; + +/* + * Internal count of <li> elements displayed and hidden in results container. + * + * @property _maxResultsDisplayed + * @type Number + * @private + */ +//YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed = 0; + +/** + * Current query string + * + * @property _sCurQuery + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sCurQuery = null; + +/** + * Selections from previous queries (for saving delimited queries). + * + * @property _sPastSelections + * @type String + * @default "" + * @private + */ +YAHOO.widget.AutoComplete.prototype._sPastSelections = ""; + +/** + * Stores initial input value used to determine if textboxChangeEvent should be fired. + * + * @property _sInitInputValue + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sInitInputValue = null; + +/** + * Pointer to the currently highlighted <li> element in the container. + * + * @property _elCurListItem + * @type HTMLElement + * @private + */ +YAHOO.widget.AutoComplete.prototype._elCurListItem = null; + +/** + * Whether or not an item has been selected since the container was populated + * with results. Reset to false by _populateList, and set to true when item is + * selected. + * + * @property _bItemSelected + * @type Boolean + * @private + */ +YAHOO.widget.AutoComplete.prototype._bItemSelected = false; + +/** + * Key code of the last key pressed in textbox. + * + * @property _nKeyCode + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nKeyCode = null; + +/** + * Delay timeout ID. + * + * @property _nDelayID + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nDelayID = -1; + +/** + * TypeAhead delay timeout ID. + * + * @property _nTypeAheadDelayID + * @type Number + * @private + */ +YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID = -1; + +/** + * Src to iFrame used when useIFrame = true. Supports implementations over SSL + * as well. + * + * @property _iFrameSrc + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._iFrameSrc = "javascript:false;"; + +/** + * For users typing via certain IMEs, queries must be triggered by intervals, + * since key events yet supported across all browsers for all IMEs. + * + * @property _queryInterval + * @type Object + * @private + */ +YAHOO.widget.AutoComplete.prototype._queryInterval = null; + +/** + * Internal tracker to last known textbox value, used to determine whether or not + * to trigger a query via interval for certain IME users. + * + * @event _sLastTextboxValue + * @type String + * @private + */ +YAHOO.widget.AutoComplete.prototype._sLastTextboxValue = null; + +///////////////////////////////////////////////////////////////////////////// +// +// Private methods +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Updates and validates latest public config properties. + * + * @method __initProps + * @private + */ +YAHOO.widget.AutoComplete.prototype._initProps = function() { + // Correct any invalid values + var minQueryLength = this.minQueryLength; + if(!YAHOO.lang.isNumber(minQueryLength)) { + this.minQueryLength = 1; + } + var maxResultsDisplayed = this.maxResultsDisplayed; + if(!YAHOO.lang.isNumber(maxResultsDisplayed) || (maxResultsDisplayed < 1)) { + this.maxResultsDisplayed = 10; + } + var queryDelay = this.queryDelay; + if(!YAHOO.lang.isNumber(queryDelay) || (queryDelay < 0)) { + this.queryDelay = 0.2; + } + var typeAheadDelay = this.typeAheadDelay; + if(!YAHOO.lang.isNumber(typeAheadDelay) || (typeAheadDelay < 0)) { + this.typeAheadDelay = 0.2; + } + var delimChar = this.delimChar; + if(YAHOO.lang.isString(delimChar) && (delimChar.length > 0)) { + this.delimChar = [delimChar]; + } + else if(!YAHOO.lang.isArray(delimChar)) { + this.delimChar = null; + } + var animSpeed = this.animSpeed; + if((this.animHoriz || this.animVert) && YAHOO.util.Anim) { + if(!YAHOO.lang.isNumber(animSpeed) || (animSpeed < 0)) { + this.animSpeed = 0.3; + } + if(!this._oAnim ) { + this._oAnim = new YAHOO.util.Anim(this._elContent, {}, this.animSpeed); + } + else { + this._oAnim.duration = this.animSpeed; + } + } + if(this.forceSelection && delimChar) { + } +}; + +/** + * Initializes the results container helpers if they are enabled and do + * not exist + * + * @method _initContainerHelperEls + * @private + */ +YAHOO.widget.AutoComplete.prototype._initContainerHelperEls = function() { + if(this.useShadow && !this._elShadow) { + var elShadow = document.createElement("div"); + elShadow.className = "yui-ac-shadow"; + elShadow.style.width = 0; + elShadow.style.height = 0; + this._elShadow = this._elContainer.appendChild(elShadow); + } + if(this.useIFrame && !this._elIFrame) { + var elIFrame = document.createElement("iframe"); + elIFrame.src = this._iFrameSrc; + elIFrame.frameBorder = 0; + elIFrame.scrolling = "no"; + elIFrame.style.position = "absolute"; + elIFrame.style.width = 0; + elIFrame.style.height = 0; + elIFrame.tabIndex = -1; + elIFrame.style.padding = 0; + this._elIFrame = this._elContainer.appendChild(elIFrame); + } +}; + +/** + * Initializes the results container once at object creation + * + * @method _initContainerEl + * @private + */ +YAHOO.widget.AutoComplete.prototype._initContainerEl = function() { + YAHOO.util.Dom.addClass(this._elContainer, "yui-ac-container"); + + if(!this._elContent) { + // The elContent div is assigned DOM listeners and + // helps size the iframe and shadow properly + var elContent = document.createElement("div"); + elContent.className = "yui-ac-content"; + elContent.style.display = "none"; + + this._elContent = this._elContainer.appendChild(elContent); + + var elHeader = document.createElement("div"); + elHeader.className = "yui-ac-hd"; + elHeader.style.display = "none"; + this._elHeader = this._elContent.appendChild(elHeader); + + var elBody = document.createElement("div"); + elBody.className = "yui-ac-bd"; + this._elBody = this._elContent.appendChild(elBody); + + var elFooter = document.createElement("div"); + elFooter.className = "yui-ac-ft"; + elFooter.style.display = "none"; + this._elFooter = this._elContent.appendChild(elFooter); + } + else { + } +}; + +/** + * Clears out contents of container body and creates up to + * YAHOO.widget.AutoComplete#maxResultsDisplayed <li> elements in an + * <ul> element. + * + * @method _initListEl + * @private + */ +YAHOO.widget.AutoComplete.prototype._initListEl = function() { + var nListLength = this.maxResultsDisplayed; + + var elList = this._elList || document.createElement("ul"); + var elListItem; + while(elList.childNodes.length < nListLength) { + elListItem = document.createElement("li"); + elListItem.style.display = "none"; + elListItem._nItemIndex = elList.childNodes.length; + elList.appendChild(elListItem); + } + if(!this._elList) { + var elBody = this._elBody; + YAHOO.util.Event.purgeElement(elBody, true); + elBody.innerHTML = ""; + this._elList = elBody.appendChild(elList); + } + +}; + +/** + * Enables interval detection for IME support. + * + * @method _enableIntervalDetection + * @re + * @private + */ +YAHOO.widget.AutoComplete.prototype._enableIntervalDetection = function() { + var oSelf = this; + if(!oSelf._queryInterval && oSelf.queryInterval) { + oSelf._queryInterval = setInterval(function() { oSelf._onInterval(); }, oSelf.queryInterval); + } +}; + +/** + * Enables query triggers based on text input detection by intervals (rather + * than by key events). + * + * @method _onInterval + * @private + */ +YAHOO.widget.AutoComplete.prototype._onInterval = function() { + var currValue = this._elTextbox.value; + var lastValue = this._sLastTextboxValue; + if(currValue != lastValue) { + this._sLastTextboxValue = currValue; + this._sendQuery(currValue); + } +}; + +/** + * Cancels text input detection by intervals. + * + * @method _clearInterval + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._clearInterval = function() { + if(this._queryInterval) { + clearInterval(this._queryInterval); + this._queryInterval = null; + } +}; + +/** + * Whether or not key is functional or should be ignored. Note that the right + * arrow key is NOT an ignored key since it triggers queries for certain intl + * charsets. + * + * @method _isIgnoreKey + * @param nKeycode {Number} Code of key pressed. + * @return {Boolean} True if key should be ignored, false otherwise. + * @private + */ +YAHOO.widget.AutoComplete.prototype._isIgnoreKey = function(nKeyCode) { + if((nKeyCode == 9) || (nKeyCode == 13) || // tab, enter + (nKeyCode == 16) || (nKeyCode == 17) || // shift, ctl + (nKeyCode >= 18 && nKeyCode <= 20) || // alt, pause/break,caps lock + (nKeyCode == 27) || // esc + (nKeyCode >= 33 && nKeyCode <= 35) || // page up,page down,end + /*(nKeyCode >= 36 && nKeyCode <= 38) || // home,left,up + (nKeyCode == 40) || // down*/ + (nKeyCode >= 36 && nKeyCode <= 40) || // home,left,up, right, down + (nKeyCode >= 44 && nKeyCode <= 45) || // print screen,insert + (nKeyCode == 229) // Bug 2041973: Korean XP fires 2 keyup events, the key and 229 + ) { + return true; + } + return false; +}; + +/** + * Makes query request to the DataSource. + * + * @method _sendQuery + * @param sQuery {String} Query string. + * @private + */ +YAHOO.widget.AutoComplete.prototype._sendQuery = function(sQuery) { + // Widget has been effectively turned off + if(this.minQueryLength < 0) { + this._toggleContainer(false); + return; + } + // Delimiter has been enabled + var aDelimChar = (this.delimChar) ? this.delimChar : null; + if(aDelimChar) { + // Loop through all possible delimiters and find the rightmost one in the query + // A " " may be a false positive if they are defined as delimiters AND + // are used to separate delimited queries + var nDelimIndex = -1; + for(var i = aDelimChar.length-1; i >= 0; i--) { + var nNewIndex = sQuery.lastIndexOf(aDelimChar[i]); + if(nNewIndex > nDelimIndex) { + nDelimIndex = nNewIndex; + } + } + // If we think the last delimiter is a space (" "), make sure it is NOT + // a false positive by also checking the char directly before it + if(aDelimChar[i] == " ") { + for (var j = aDelimChar.length-1; j >= 0; j--) { + if(sQuery[nDelimIndex - 1] == aDelimChar[j]) { + nDelimIndex--; + break; + } + } + } + // A delimiter has been found in the query so extract the latest query from past selections + if(nDelimIndex > -1) { + var nQueryStart = nDelimIndex + 1; + // Trim any white space from the beginning... + while(sQuery.charAt(nQueryStart) == " ") { + nQueryStart += 1; + } + // ...and save the rest of the string for later + this._sPastSelections = sQuery.substring(0,nQueryStart); + // Here is the query itself + sQuery = sQuery.substr(nQueryStart); + } + // No delimiter found in the query, so there are no selections from past queries + else { + this._sPastSelections = ""; + } + } + + // Don't search queries that are too short + if((sQuery && (sQuery.length < this.minQueryLength)) || (!sQuery && this.minQueryLength > 0)) { + if(this._nDelayID != -1) { + clearTimeout(this._nDelayID); + } + this._toggleContainer(false); + return; + } + + sQuery = encodeURIComponent(sQuery); + this._nDelayID = -1; // Reset timeout ID because request is being made + + // Subset matching + if(this.dataSource.queryMatchSubset || this.queryMatchSubset) { // backward compat + var oResponse = this.getSubsetMatches(sQuery); + if(oResponse) { + this.handleResponse(sQuery, oResponse, {query: sQuery}); + return; + } + } + + if(this.responseStripAfter) { + this.dataSource.doBeforeParseData = this.preparseRawResponse; + } + if(this.applyLocalFilter) { + this.dataSource.doBeforeCallback = this.filterResults; + } + + var sRequest = this.generateRequest(sQuery); + this.dataRequestEvent.fire(this, sQuery, sRequest); + + this.dataSource.sendRequest(sRequest, { + success : this.handleResponse, + failure : this.handleResponse, + scope : this, + argument: { + query: sQuery + } + }); +}; + +/** + * Populates the array of <li> elements in the container with query + * results. + * + * @method _populateList + * @param sQuery {String} Original request. + * @param oResponse {Object} Response object. + * @param oPayload {MIXED} (optional) Additional argument(s) + * @private + */ +YAHOO.widget.AutoComplete.prototype._populateList = function(sQuery, oResponse, oPayload) { + // Clear previous timeout + if(this._nTypeAheadDelayID != -1) { + clearTimeout(this._nTypeAheadDelayID); + } + + sQuery = (oPayload && oPayload.query) ? oPayload.query : sQuery; + + // Pass data through abstract method for any transformations + var ok = this.doBeforeLoadData(sQuery, oResponse, oPayload); + + // Data is ok + if(ok && !oResponse.error) { + this.dataReturnEvent.fire(this, sQuery, oResponse.results); + + // Continue only if instance is still focused (i.e., user hasn't already moved on) + // Null indicates initialized state, which is ok too + if(this._bFocused || (this._bFocused === null)) { + + //TODO: is this still necessary? + /*var isOpera = (YAHOO.env.ua.opera); + var contentStyle = this._elContent.style; + contentStyle.width = (!isOpera) ? null : ""; + contentStyle.height = (!isOpera) ? null : "";*/ + + // Store state for this interaction + var sCurQuery = decodeURIComponent(sQuery); + this._sCurQuery = sCurQuery; + this._bItemSelected = false; + + var allResults = oResponse.results, + nItemsToShow = Math.min(allResults.length,this.maxResultsDisplayed), + sMatchKey = (this.dataSource.responseSchema.fields) ? + (this.dataSource.responseSchema.fields[0].key || this.dataSource.responseSchema.fields[0]) : 0; + + if(nItemsToShow > 0) { + // Make sure container and helpers are ready to go + if(!this._elList || (this._elList.childNodes.length < nItemsToShow)) { + this._initListEl(); + } + this._initContainerHelperEls(); + + var allListItemEls = this._elList.childNodes; + // Fill items with data from the bottom up + for(var i = nItemsToShow-1; i >= 0; i--) { + var elListItem = allListItemEls[i], + oResult = allResults[i]; + + // Backward compatibility + if(this.resultTypeList) { + // Results need to be converted back to an array + var aResult = []; + // Match key is first + aResult[0] = (YAHOO.lang.isString(oResult)) ? oResult : oResult[sMatchKey] || oResult[this.key]; + // Add additional data to the result array + var fields = this.dataSource.responseSchema.fields; + if(YAHOO.lang.isArray(fields) && (fields.length > 1)) { + for(var k=1, len=fields.length; k= nItemsToShow; j--) { + extraListItem = allListItemEls[j]; + extraListItem.style.display = "none"; + } + } + + this._nDisplayedItems = nItemsToShow; + + this.containerPopulateEvent.fire(this, sQuery, allResults); + + // Highlight the first item + if(this.autoHighlight) { + var elFirstListItem = this._elList.firstChild; + this._toggleHighlight(elFirstListItem,"to"); + this.itemArrowToEvent.fire(this, elFirstListItem); + this._typeAhead(elFirstListItem,sQuery); + } + // Unhighlight any previous time + else { + this._toggleHighlight(this._elCurListItem,"from"); + } + + // Expand the container + ok = this.doBeforeExpandContainer(this._elTextbox, this._elContainer, sQuery, allResults); + this._toggleContainer(ok); + } + else { + this._toggleContainer(false); + } + + return; + } + } + // Error + else { + this.dataErrorEvent.fire(this, sQuery); + } + +}; + +/** + * When forceSelection is true and the user attempts + * leave the text input box without selecting an item from the query results, + * the user selection is cleared. + * + * @method _clearSelection + * @private + */ +YAHOO.widget.AutoComplete.prototype._clearSelection = function() { + var sValue = this._elTextbox.value; + //TODO: need to check against all delimChars? + var sChar = (this.delimChar) ? this.delimChar[0] : null; + var nIndex = (sChar) ? sValue.lastIndexOf(sChar, sValue.length-2) : -1; + if(nIndex > -1) { + this._elTextbox.value = sValue.substring(0,nIndex); + } + else { + this._elTextbox.value = ""; + } + this._sPastSelections = this._elTextbox.value; + + // Fire custom event + this.selectionEnforceEvent.fire(this); +}; + +/** + * Whether or not user-typed value in the text input box matches any of the + * query results. + * + * @method _textMatchesOption + * @return {HTMLElement} Matching list item element if user-input text matches + * a result, null otherwise. + * @private + */ +YAHOO.widget.AutoComplete.prototype._textMatchesOption = function() { + var elMatch = null; + + for(var i = this._nDisplayedItems-1; i >= 0 ; i--) { + var elListItem = this._elList.childNodes[i]; + var sMatch = ("" + elListItem._sResultMatch).toLowerCase(); + if(sMatch == this._sCurQuery.toLowerCase()) { + elMatch = elListItem; + break; + } + } + return(elMatch); +}; + +/** + * Updates in the text input box with the first query result as the user types, + * selecting the substring that the user has not typed. + * + * @method _typeAhead + * @param elListItem {HTMLElement} The <li> element item whose data populates the input field. + * @param sQuery {String} Query string. + * @private + */ +YAHOO.widget.AutoComplete.prototype._typeAhead = function(elListItem, sQuery) { + // Don't typeAhead if turned off or is backspace + if(!this.typeAhead || (this._nKeyCode == 8)) { + return; + } + + var oSelf = this, + elTextbox = this._elTextbox; + + // Only if text selection is supported + if(elTextbox.setSelectionRange || elTextbox.createTextRange) { + // Set and store timeout for this typeahead + this._nTypeAheadDelayID = setTimeout(function() { + // Select the portion of text that the user has not typed + var nStart = elTextbox.value.length; // any saved queries plus what user has typed + oSelf._updateValue(elListItem); + var nEnd = elTextbox.value.length; + oSelf._selectText(elTextbox,nStart,nEnd); + var sPrefill = elTextbox.value.substr(nStart,nEnd); + oSelf.typeAheadEvent.fire(oSelf,sQuery,sPrefill); + },(this.typeAheadDelay*1000)); + } +}; + +/** + * Selects text in the input field. + * + * @method _selectText + * @param elTextbox {HTMLElement} Text input box element in which to select text. + * @param nStart {Number} Starting index of text string to select. + * @param nEnd {Number} Ending index of text selection. + * @private + */ +YAHOO.widget.AutoComplete.prototype._selectText = function(elTextbox, nStart, nEnd) { + if(elTextbox.setSelectionRange) { // For Mozilla + elTextbox.setSelectionRange(nStart,nEnd); + } + else if(elTextbox.createTextRange) { // For IE + var oTextRange = elTextbox.createTextRange(); + oTextRange.moveStart("character", nStart); + oTextRange.moveEnd("character", nEnd-elTextbox.value.length); + oTextRange.select(); + } + else { + elTextbox.select(); + } +}; + +/** + * Syncs results container with its helpers. + * + * @method _toggleContainerHelpers + * @param bShow {Boolean} True if container is expanded, false if collapsed + * @private + */ +YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers = function(bShow) { + var width = this._elContent.offsetWidth + "px"; + var height = this._elContent.offsetHeight + "px"; + + if(this.useIFrame && this._elIFrame) { + var elIFrame = this._elIFrame; + if(bShow) { + elIFrame.style.width = width; + elIFrame.style.height = height; + elIFrame.style.padding = ""; + } + else { + elIFrame.style.width = 0; + elIFrame.style.height = 0; + elIFrame.style.padding = 0; + } + } + if(this.useShadow && this._elShadow) { + var elShadow = this._elShadow; + if(bShow) { + elShadow.style.width = width; + elShadow.style.height = height; + } + else { + elShadow.style.width = 0; + elShadow.style.height = 0; + } + } +}; + +/** + * Animates expansion or collapse of the container. + * + * @method _toggleContainer + * @param bShow {Boolean} True if container should be expanded, false if container should be collapsed + * @private + */ +YAHOO.widget.AutoComplete.prototype._toggleContainer = function(bShow) { + var elContainer = this._elContainer; + + // If implementer has container always open and it's already open, don't mess with it + // Container is initialized with display "none" so it may need to be shown first time through + if(this.alwaysShowContainer && this._bContainerOpen) { + return; + } + + // Reset states + if(!bShow) { + this._toggleHighlight(this._elCurListItem,"from"); + this._nDisplayedItems = 0; + this._sCurQuery = null; + + // Container is already closed, so don't bother with changing the UI + if(!this._bContainerOpen) { + this._elContent.style.display = "none"; + return; + } + } + + // If animation is enabled... + var oAnim = this._oAnim; + if(oAnim && oAnim.getEl() && (this.animHoriz || this.animVert)) { + if(oAnim.isAnimated()) { + oAnim.stop(true); + } + + // Clone container to grab current size offscreen + var oClone = this._elContent.cloneNode(true); + elContainer.appendChild(oClone); + oClone.style.top = "-9000px"; + oClone.style.width = ""; + oClone.style.height = ""; + oClone.style.display = ""; + + // Current size of the container is the EXPANDED size + var wExp = oClone.offsetWidth; + var hExp = oClone.offsetHeight; + + // Calculate COLLAPSED sizes based on horiz and vert anim + var wColl = (this.animHoriz) ? 0 : wExp; + var hColl = (this.animVert) ? 0 : hExp; + + // Set animation sizes + oAnim.attributes = (bShow) ? + {width: { to: wExp }, height: { to: hExp }} : + {width: { to: wColl}, height: { to: hColl }}; + + // If opening anew, set to a collapsed size... + if(bShow && !this._bContainerOpen) { + this._elContent.style.width = wColl+"px"; + this._elContent.style.height = hColl+"px"; + } + // Else, set it to its last known size. + else { + this._elContent.style.width = wExp+"px"; + this._elContent.style.height = hExp+"px"; + } + + elContainer.removeChild(oClone); + oClone = null; + + var oSelf = this; + var onAnimComplete = function() { + // Finish the collapse + oAnim.onComplete.unsubscribeAll(); + + if(bShow) { + oSelf._toggleContainerHelpers(true); + oSelf._bContainerOpen = bShow; + oSelf.containerExpandEvent.fire(oSelf); + } + else { + oSelf._elContent.style.display = "none"; + oSelf._bContainerOpen = bShow; + oSelf.containerCollapseEvent.fire(oSelf); + } + }; + + // Display container and animate it + this._toggleContainerHelpers(false); // Bug 1424486: Be early to hide, late to show; + this._elContent.style.display = ""; + oAnim.onComplete.subscribe(onAnimComplete); + oAnim.animate(); + } + // Else don't animate, just show or hide + else { + if(bShow) { + this._elContent.style.display = ""; + this._toggleContainerHelpers(true); + this._bContainerOpen = bShow; + this.containerExpandEvent.fire(this); + } + else { + this._toggleContainerHelpers(false); + this._elContent.style.display = "none"; + this._bContainerOpen = bShow; + this.containerCollapseEvent.fire(this); + } + } + +}; + +/** + * Toggles the highlight on or off for an item in the container, and also cleans + * up highlighting of any previous item. + * + * @method _toggleHighlight + * @param elNewListItem {HTMLElement} The <li> element item to receive highlight behavior. + * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off. + * @private + */ +YAHOO.widget.AutoComplete.prototype._toggleHighlight = function(elNewListItem, sType) { + if(elNewListItem) { + var sHighlight = this.highlightClassName; + if(this._elCurListItem) { + // Remove highlight from old item + YAHOO.util.Dom.removeClass(this._elCurListItem, sHighlight); + this._elCurListItem = null; + } + + if((sType == "to") && sHighlight) { + // Apply highlight to new item + YAHOO.util.Dom.addClass(elNewListItem, sHighlight); + this._elCurListItem = elNewListItem; + } + } +}; + +/** + * Toggles the pre-highlight on or off for an item in the container. + * + * @method _togglePrehighlight + * @param elNewListItem {HTMLElement} The <li> element item to receive highlight behavior. + * @param sType {String} Type "mouseover" will toggle highlight on, and "mouseout" will toggle highlight off. + * @private + */ +YAHOO.widget.AutoComplete.prototype._togglePrehighlight = function(elNewListItem, sType) { + if(elNewListItem == this._elCurListItem) { + return; + } + + var sPrehighlight = this.prehighlightClassName; + if((sType == "mouseover") && sPrehighlight) { + // Apply prehighlight to new item + YAHOO.util.Dom.addClass(elNewListItem, sPrehighlight); + } + else { + // Remove prehighlight from old item + YAHOO.util.Dom.removeClass(elNewListItem, sPrehighlight); + } +}; + +/** + * Updates the text input box value with selected query result. If a delimiter + * has been defined, then the value gets appended with the delimiter. + * + * @method _updateValue + * @param elListItem {HTMLElement} The <li> element item with which to update the value. + * @private + */ +YAHOO.widget.AutoComplete.prototype._updateValue = function(elListItem) { + if(!this.suppressInputUpdate) { + var elTextbox = this._elTextbox; + var sDelimChar = (this.delimChar) ? (this.delimChar[0] || this.delimChar) : null; + var sResultMatch = elListItem._sResultMatch; + + // Calculate the new value + var sNewValue = ""; + if(sDelimChar) { + // Preserve selections from past queries + sNewValue = this._sPastSelections; + // Add new selection plus delimiter + sNewValue += sResultMatch + sDelimChar; + if(sDelimChar != " ") { + sNewValue += " "; + } + } + else { + sNewValue = sResultMatch; + } + + // Update input field + elTextbox.value = sNewValue; + + // Scroll to bottom of textarea if necessary + if(elTextbox.type == "textarea") { + elTextbox.scrollTop = elTextbox.scrollHeight; + } + + // Move cursor to end + var end = elTextbox.value.length; + this._selectText(elTextbox,end,end); + + this._elCurListItem = elListItem; + } +}; + +/** + * Selects a result item from the container + * + * @method _selectItem + * @param elListItem {HTMLElement} The selected <li> element item. + * @private + */ +YAHOO.widget.AutoComplete.prototype._selectItem = function(elListItem) { + this._bItemSelected = true; + this._updateValue(elListItem); + this._sPastSelections = this._elTextbox.value; + this._clearInterval(); + this.itemSelectEvent.fire(this, elListItem, elListItem._oResultData); + this._toggleContainer(false); +}; + +/** + * If an item is highlighted in the container, the right arrow key jumps to the + * end of the textbox and selects the highlighted item, otherwise the container + * is closed. + * + * @method _jumpSelection + * @private + */ +YAHOO.widget.AutoComplete.prototype._jumpSelection = function() { + if(this._elCurListItem) { + this._selectItem(this._elCurListItem); + } + else { + this._toggleContainer(false); + } +}; + +/** + * Triggered by up and down arrow keys, changes the current highlighted + * <li> element item. Scrolls container if necessary. + * + * @method _moveSelection + * @param nKeyCode {Number} Code of key pressed. + * @private + */ +YAHOO.widget.AutoComplete.prototype._moveSelection = function(nKeyCode) { + if(this._bContainerOpen) { + // Determine current item's id number + var elCurListItem = this._elCurListItem; + var nCurItemIndex = -1; + + if(elCurListItem) { + nCurItemIndex = elCurListItem._nItemIndex; + } + + var nNewItemIndex = (nKeyCode == 40) ? + (nCurItemIndex + 1) : (nCurItemIndex - 1); + + // Out of bounds + if(nNewItemIndex < -2 || nNewItemIndex >= this._nDisplayedItems) { + return; + } + + if(elCurListItem) { + // Unhighlight current item + this._toggleHighlight(elCurListItem, "from"); + this.itemArrowFromEvent.fire(this, elCurListItem); + } + if(nNewItemIndex == -1) { + // Go back to query (remove type-ahead string) + if(this.delimChar) { + this._elTextbox.value = this._sPastSelections + this._sCurQuery; + } + else { + this._elTextbox.value = this._sCurQuery; + } + return; + } + if(nNewItemIndex == -2) { + // Close container + this._toggleContainer(false); + return; + } + + var elNewListItem = this._elList.childNodes[nNewItemIndex]; + + // Scroll the container if necessary + var elContent = this._elContent; + var scrollOn = ((YAHOO.util.Dom.getStyle(elContent,"overflow") == "auto") || + (YAHOO.util.Dom.getStyle(elContent,"overflowY") == "auto")); + if(scrollOn && (nNewItemIndex > -1) && + (nNewItemIndex < this._nDisplayedItems)) { + // User is keying down + if(nKeyCode == 40) { + // Bottom of selected item is below scroll area... + if((elNewListItem.offsetTop+elNewListItem.offsetHeight) > (elContent.scrollTop + elContent.offsetHeight)) { + // Set bottom of scroll area to bottom of selected item + elContent.scrollTop = (elNewListItem.offsetTop+elNewListItem.offsetHeight) - elContent.offsetHeight; + } + // Bottom of selected item is above scroll area... + else if((elNewListItem.offsetTop+elNewListItem.offsetHeight) < elContent.scrollTop) { + // Set top of selected item to top of scroll area + elContent.scrollTop = elNewListItem.offsetTop; + + } + } + // User is keying up + else { + // Top of selected item is above scroll area + if(elNewListItem.offsetTop < elContent.scrollTop) { + // Set top of scroll area to top of selected item + this._elContent.scrollTop = elNewListItem.offsetTop; + } + // Top of selected item is below scroll area + else if(elNewListItem.offsetTop > (elContent.scrollTop + elContent.offsetHeight)) { + // Set bottom of selected item to bottom of scroll area + this._elContent.scrollTop = (elNewListItem.offsetTop+elNewListItem.offsetHeight) - elContent.offsetHeight; + } + } + } + + this._toggleHighlight(elNewListItem, "to"); + this.itemArrowToEvent.fire(this, elNewListItem); + if(this.typeAhead) { + this._updateValue(elNewListItem); + } + } +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Private event handlers +// +///////////////////////////////////////////////////////////////////////////// + +/** + * Handles <li> element mouseover events in the container. + * + * @method _onItemMouseover + * @param v {HTMLEvent} The mouseover event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +/*YAHOO.widget.AutoComplete.prototype._onItemMouseover = function(v,oSelf) { + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(this,"mouseover"); + } + else { + oSelf._toggleHighlight(this,"to"); + } + + oSelf.itemMouseOverEvent.fire(oSelf, this); +};*/ + +/** + * Handles <li> element mouseout events in the container. + * + * @method _onItemMouseout + * @param v {HTMLEvent} The mouseout event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +/*YAHOO.widget.AutoComplete.prototype._onItemMouseout = function(v,oSelf) { + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(this,"mouseout"); + } + else { + oSelf._toggleHighlight(this,"from"); + } + + oSelf.itemMouseOutEvent.fire(oSelf, this); +};*/ + +/** + * Handles <li> element click events in the container. + * + * @method _onItemMouseclick + * @param v {HTMLEvent} The click event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +/*YAHOO.widget.AutoComplete.prototype._onItemMouseclick = function(v,oSelf) { + // In case item has not been moused over + oSelf._toggleHighlight(this,"to"); + oSelf._selectItem(this); +};*/ + +/** + * Handles container mouseover events. + * + * @method _onContainerMouseover + * @param v {HTMLEvent} The mouseover event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerMouseover = function(v,oSelf) { + var elTarget = YAHOO.util.Event.getTarget(v); + var elTag = elTarget.nodeName.toLowerCase(); + while(elTarget && (elTag != "table")) { + switch(elTag) { + case "body": + return; + case "li": + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(elTarget,"mouseover"); + } + else { + oSelf._toggleHighlight(elTarget,"to"); + } + + oSelf.itemMouseOverEvent.fire(oSelf, elTarget); + break; + case "div": + if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")) { + oSelf._bOverContainer = true; + return; + } + break; + default: + break; + } + + elTarget = elTarget.parentNode; + if(elTarget) { + elTag = elTarget.nodeName.toLowerCase(); + } + } +}; + +/** + * Handles container mouseout events. + * + * @method _onContainerMouseout + * @param v {HTMLEvent} The mouseout event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerMouseout = function(v,oSelf) { + var elTarget = YAHOO.util.Event.getTarget(v); + var elTag = elTarget.nodeName.toLowerCase(); + while(elTarget && (elTag != "table")) { + switch(elTag) { + case "body": + return; + case "li": + if(oSelf.prehighlightClassName) { + oSelf._togglePrehighlight(elTarget,"mouseout"); + } + else { + oSelf._toggleHighlight(elTarget,"from"); + } + + oSelf.itemMouseOutEvent.fire(oSelf, elTarget); + break; + case "ul": + oSelf._toggleHighlight(oSelf._elCurListItem,"to"); + break; + case "div": + if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")) { + oSelf._bOverContainer = false; + return; + } + break; + default: + break; + } + + elTarget = elTarget.parentNode; + if(elTarget) { + elTag = elTarget.nodeName.toLowerCase(); + } + } +}; + +/** + * Handles container click events. + * + * @method _onContainerClick + * @param v {HTMLEvent} The click event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerClick = function(v,oSelf) { + var elTarget = YAHOO.util.Event.getTarget(v); + var elTag = elTarget.nodeName.toLowerCase(); + while(elTarget && (elTag != "table")) { + switch(elTag) { + case "body": + return; + case "li": + // In case item has not been moused over + oSelf._toggleHighlight(elTarget,"to"); + oSelf._selectItem(elTarget); + return; + default: + break; + } + + elTarget = elTarget.parentNode; + if(elTarget) { + elTag = elTarget.nodeName.toLowerCase(); + } + } +}; + + +/** + * Handles container scroll events. + * + * @method _onContainerScroll + * @param v {HTMLEvent} The scroll event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerScroll = function(v,oSelf) { + oSelf._elTextbox.focus(); +}; + +/** + * Handles container resize events. + * + * @method _onContainerResize + * @param v {HTMLEvent} The resize event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onContainerResize = function(v,oSelf) { + oSelf._toggleContainerHelpers(oSelf._bContainerOpen); +}; + + +/** + * Handles textbox keydown events of functional keys, mainly for UI behavior. + * + * @method _onTextboxKeyDown + * @param v {HTMLEvent} The keydown event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown = function(v,oSelf) { + var nKeyCode = v.keyCode; + + // Clear timeout + if(oSelf._nTypeAheadDelayID != -1) { + clearTimeout(oSelf._nTypeAheadDelayID); + } + + switch (nKeyCode) { + case 9: // tab + if(!YAHOO.env.ua.opera && (navigator.userAgent.toLowerCase().indexOf("mac") == -1) || (YAHOO.env.ua.webkit>420)) { + // select an item or clear out + if(oSelf._elCurListItem) { + if(oSelf.delimChar && (oSelf._nKeyCode != nKeyCode)) { + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + } + } + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + case 13: // enter + if(!YAHOO.env.ua.opera && (navigator.userAgent.toLowerCase().indexOf("mac") == -1) || (YAHOO.env.ua.webkit>420)) { + if(oSelf._elCurListItem) { + if(oSelf._nKeyCode != nKeyCode) { + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + } + } + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + case 27: // esc + oSelf._toggleContainer(false); + return; + case 39: // right + oSelf._jumpSelection(); + break; + case 38: // up + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + oSelf._moveSelection(nKeyCode); + } + break; + case 40: // down + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + oSelf._moveSelection(nKeyCode); + } + break; + default: + oSelf._bItemSelected = false; + oSelf._toggleHighlight(oSelf._elCurListItem, "from"); + + oSelf.textboxKeyEvent.fire(oSelf, nKeyCode); + break; + } + + if(nKeyCode === 18){ + oSelf._enableIntervalDetection(); + } + oSelf._nKeyCode = nKeyCode; +}; + +/** + * Handles textbox keypress events. + * @method _onTextboxKeyPress + * @param v {HTMLEvent} The keypress event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress = function(v,oSelf) { + var nKeyCode = v.keyCode; + + // Expose only to non SF3 (bug 1978549) Mac browsers (bug 790337) and Opera browsers (bug 583531), + // where stopEvent is ineffective on keydown events + if(YAHOO.env.ua.opera || (navigator.userAgent.toLowerCase().indexOf("mac") != -1) && (YAHOO.env.ua.webkit < 420)) { + switch (nKeyCode) { + case 9: // tab + // select an item or clear out + if(oSelf._bContainerOpen) { + if(oSelf.delimChar) { + YAHOO.util.Event.stopEvent(v); + } + if(oSelf._elCurListItem) { + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + case 13: // enter + if(oSelf._bContainerOpen) { + YAHOO.util.Event.stopEvent(v); + if(oSelf._elCurListItem) { + oSelf._selectItem(oSelf._elCurListItem); + } + else { + oSelf._toggleContainer(false); + } + } + break; + default: + break; + } + } + + //TODO: (?) limit only to non-IE, non-Mac-FF for Korean IME support (bug 811948) + // Korean IME detected + else if(nKeyCode == 229) { + oSelf._enableIntervalDetection(); + } +}; + +/** + * Handles textbox keyup events to trigger queries. + * + * @method _onTextboxKeyUp + * @param v {HTMLEvent} The keyup event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp = function(v,oSelf) { + var sText = this.value; //string in textbox + + // Check to see if any of the public properties have been updated + oSelf._initProps(); + + // Filter out chars that don't trigger queries + var nKeyCode = v.keyCode; + if(oSelf._isIgnoreKey(nKeyCode)) { + return; + } + + // Clear previous timeout + /*if(oSelf._nTypeAheadDelayID != -1) { + clearTimeout(oSelf._nTypeAheadDelayID); + }*/ + if(oSelf._nDelayID != -1) { + clearTimeout(oSelf._nDelayID); + } + + // Set new timeout + oSelf._nDelayID = setTimeout(function(){ + oSelf._sendQuery(sText); + },(oSelf.queryDelay * 1000)); + + //= nDelayID; + //else { + // No delay so send request immediately + //oSelf._sendQuery(sText); + //} +}; + +/** + * Handles text input box receiving focus. + * + * @method _onTextboxFocus + * @param v {HTMLEvent} The focus event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxFocus = function (v,oSelf) { + // Start of a new interaction + if(!oSelf._bFocused) { + oSelf._elTextbox.setAttribute("autocomplete","off"); + oSelf._bFocused = true; + oSelf._sInitInputValue = oSelf._elTextbox.value; + oSelf.textboxFocusEvent.fire(oSelf); + } +}; + +/** + * Handles text input box losing focus. + * + * @method _onTextboxBlur + * @param v {HTMLEvent} The focus event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onTextboxBlur = function (v,oSelf) { + // Don't treat as a blur if it was a selection via mouse click + if(!oSelf._bOverContainer || (oSelf._nKeyCode == 9)) { + // Current query needs to be validated as a selection + if(!oSelf._bItemSelected) { + var elMatchListItem = oSelf._textMatchesOption(); + // Container is closed or current query doesn't match any result + if(!oSelf._bContainerOpen || (oSelf._bContainerOpen && (elMatchListItem === null))) { + // Force selection is enabled so clear the current query + if(oSelf.forceSelection) { + oSelf._clearSelection(); + } + // Treat current query as a valid selection + else { + oSelf.unmatchedItemSelectEvent.fire(oSelf, oSelf._sCurQuery); + } + } + // Container is open and current query matches a result + else { + // Force a selection when textbox is blurred with a match + if(oSelf.forceSelection) { + oSelf._selectItem(elMatchListItem); + } + } + } + + if(oSelf._bContainerOpen) { + oSelf._toggleContainer(false); + } + oSelf._clearInterval(); + oSelf._bFocused = false; + if(oSelf._sInitInputValue !== oSelf._elTextbox.value) { + oSelf.textboxChangeEvent.fire(oSelf); + } + oSelf.textboxBlurEvent.fire(oSelf); + } +}; + +/** + * Handles window unload event. + * + * @method _onWindowUnload + * @param v {HTMLEvent} The unload event. + * @param oSelf {YAHOO.widget.AutoComplete} The AutoComplete instance. + * @private + */ +YAHOO.widget.AutoComplete.prototype._onWindowUnload = function(v,oSelf) { + if(oSelf && oSelf._elTextbox && oSelf.allowBrowserAutocomplete) { + oSelf._elTextbox.setAttribute("autocomplete","on"); + } +}; + +///////////////////////////////////////////////////////////////////////////// +// +// Deprecated for Backwards Compatibility +// +///////////////////////////////////////////////////////////////////////////// +/** + * @method doBeforeSendQuery + * @deprecated Use generateRequest. + */ +YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery = function(sQuery) { + return this.generateRequest(sQuery); +}; + +/** + * @method getListItems + * @deprecated Use getListEl().childNodes. + */ +YAHOO.widget.AutoComplete.prototype.getListItems = function() { + var allListItemEls = [], + els = this._elList.childNodes; + for(var i=els.length-1; i>=0; i--) { + allListItemEls[i] = els[i]; + } + return allListItemEls; +}; + +///////////////////////////////////////////////////////////////////////// +// +// Private static methods +// +///////////////////////////////////////////////////////////////////////// + +/** + * Clones object literal or array of object literals. + * + * @method AutoComplete._cloneObject + * @param o {Object} Object. + * @private + * @static + */ +YAHOO.widget.AutoComplete._cloneObject = function(o) { + if(!YAHOO.lang.isValue(o)) { + return o; + } + + var copy = {}; + + if(YAHOO.lang.isFunction(o)) { + copy = o; + } + else if(YAHOO.lang.isArray(o)) { + var array = []; + for(var i=0,len=o.length;i is clicked. + ++ The name and value of selected MenuItems in submenus of a Button's Menu are now part of their + parent form's data when the form is submitted. + ++ For Button's of type "menu" and "split" created using an existing or + - + - ... TEXT/HTML ... + - ... ... + - ... ... + ++ The id of a Button instance can now match that of its source element. + ++ CSS changes: + + 1) All Buttons have a "yui-" prefix as opposed to "yui": + + 2.2.2 | 2.3 + ------------------------- + .yuibutton | .yui-button + + + 2) Each Button type has its own class name with a "yui-" prefix and + "-button" suffix IN ADDITION TO the default "yui-button" class name: + + 2.2.2 | 2.3 + ------------------------------------------ + .yuibutton.splitbutton | .yui-split-button + .yuibutton.menubutton | .yui-menu-button + + * Allows for the definition of generic styles that apply to all buttons, + while providing a means for uniquely styling buttons of a specific type. + + + 3) For states that are common to all Buttons, two classes are applied: a + generic class name (i.e. yui-button-[state]) and a type-specific state class + name (yui-[type]-button-[state]): + + 2.2.2 | 2.3 + ------------------------------------------- + .yuibutton.focus | .yui-button-focus + .yuibutton.radio.focus | .yui-radio-button-focus + + * States common to all Button types are: + + focus + + hover + + active + + disabled + + ** Allows for the definition of generic styles that apply to all states of + all buttons, while providing a means for uniquely styling states for + buttons of a specific type. + + + 4) Buttons of type "radio" and "checkbox" have two classes applied to + represent their "checked" state: a generic class name + (i.e. yui-button-checked) and a type-specific class + name (yui-[type]-button-checked): + + 2.2.2 | 2.3 + ------------------------------------------- + .yuibutton.checked | .yui-button-checked + .yuibutton.radio.checked | .yui-radio-button-checked + .yuibutton.checkbox.checked | .yui-checkbox-button-checked + + ** This allows for the definition of a universal style for all Buttons that + have a "checked" state or the ability to define a type-specific style for + the "checked" state. + + + 5) States that are specific to a particular type only get a type-specific + state class name. Currently this only applies to the "splitbutton" type: + + 2.2.2 | 2.3 + ------------------------------------------- + .yuibutton.activeoption | .yui-split-button-activeoption + + + 6) The "ie6" class name is removed. + + +*** Version 2.2.2 *** + ++ No changes + + +*** Version 2.2.1 *** + +Added the following features: +----------------------------- + ++ Added "getHiddenField" method to YAHOO.widget.Button. + + +Fixed the following bugs: +------------------------- + ++ Removed built-in use of the Event utility's "onAvailable" method from the + constructor of Button and ButtonGroup as it was preventing the addition of + event listeners on instances created from existing markup. Going forward + Button and ButtonGroup instances created from existing markup can only be + instantiated once their source HTML element is available in the DOM. The + Button examples illustrate how this can be accomplished. + ++ Modified code so that disabled Button instances no longer fire DOM events. + ++ Pressing the enter key while focused on a form field whose parent form + contains a Button instance of type "submit" will now automatically submit + the form using the first Button instance of type "submit". + ++ Clicking a Button instance of type="submit" will now cause the Button's + parent form's "submit" event to fire. + ++ Modified Button CSS so that the filter used to apply alpha transparency to + a Button's background PNG is only used by IE 6. The previous code was + enabling IE's Alpha image loader for IE 7 in Quirks mode. + ++ Fixed documentation error for "getForm" method. + + +Changes: +-------- + ++ Made the "submitForm" method of YAHOO.widget.Button public (was + previously protected). + ++ Removed "init" event and corresponding "oninit" configuration attribute + from YAHOO.widget.Button and YAHOO.widget.ButtonGroup. + ++ Added the CSS class "ie6" to button.css. This classname is append to root + DOM element of Button instances created with IE 6. By default this class + is used to apply a filter that gives alpha transparency to a Button's + background PNG. + + + +*** Version 2.2.0 *** + +* Button Control introduced diff --git a/lib/yui/button/assets/button-core.css b/lib/yui/button/assets/button-core.css new file mode 100755 index 0000000000..13048869a5 --- /dev/null +++ b/lib/yui/button/assets/button-core.css @@ -0,0 +1,44 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-button { + + display: -moz-inline-box; /* Gecko */ + display: inline-block; /* IE, Opera and Safari */ + vertical-align: text-bottom; + +} + +.yui-button .first-child { + + display: block; + *display: inline-block; /* IE */ + +} + +.yui-button button, +.yui-button a { + + display: block; + *display: inline-block; /* IE */ + border: none; + margin: 0; + +} + +.yui-button button { + + background-color: transparent; + *overflow: visible; /* Remove superfluous padding for IE */ + cursor: pointer; + +} + +.yui-button a { + + text-decoration: none; + +} \ No newline at end of file diff --git a/lib/yui/button/assets/skins/sam/button-skin.css b/lib/yui/button/assets/skins/sam/button-skin.css new file mode 100755 index 0000000000..721d5ff4fd --- /dev/null +++ b/lib/yui/button/assets/skins/sam/button-skin.css @@ -0,0 +1,240 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-skin-sam .yui-button { + + border-width: 1px 0; + border-style: solid; + border-color: #808080; + background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; + margin: auto .25em; + +} + +.yui-skin-sam .yui-button .first-child { + + border-width: 0 1px; + border-style: solid; + border-color: #808080; + margin: 0 -1px; + *position: relative; /* Necessary to get negative margins working in IE */ + *left: -1px; + + /* + Don't apply rounded corners for IE 6 (Quirks and Standards Mode) and IE 7 Quirks Mode + since it causes more problems than its worth. + */ + _margin: 0; + _position: static; + +} + +.yui-skin-sam .yui-button button, +.yui-skin-sam .yui-button a { + + padding: 0 10px; + font-size: 93%; /* 12px */ + line-height: 2; /* ~24px */ + *line-height: 1.7; /* For IE */ + min-height: 2em; /* For Gecko */ + *min-height: auto; /* For IE */ + color: #000; + +} + +.yui-skin-sam .yui-button a { + + /* + Necessary to get Buttons of type "link" to be the correct + height in IE. + */ + *line-height: 1.875; + *padding-bottom: 1px; + +} + +.yui-skin-sam .yui-split-button button, +.yui-skin-sam .yui-menu-button button { + + padding-right: 20px; + background-position: right center; + background-repeat: no-repeat; + +} + +.yui-skin-sam .yui-menu-button button { + + background-image: url(menu-button-arrow.png); + +} + +.yui-skin-sam .yui-split-button button { + + background-image: url(split-button-arrow.png); + +} + + +/* Focus state */ + + +.yui-skin-sam .yui-button-focus { + + border-color: #7D98B8; + background-position: 0 -1300px; + +} + +.yui-skin-sam .yui-button-focus .first-child { + + border-color: #7D98B8; + +} + +.yui-skin-sam .yui-button-focus button, +.yui-skin-sam .yui-button-focus a { + + color: #000; + +} + +.yui-skin-sam .yui-split-button-focus button { + + background-image: url(split-button-arrow-focus.png); + +} + + +/* Hover state */ + +.yui-skin-sam .yui-button-hover { + + border-color: #7D98B8; + background-position: 0 -1300px; + +} + +.yui-skin-sam .yui-button-hover .first-child { + + border-color: #7D98B8; + +} + +.yui-skin-sam .yui-button-hover button, +.yui-skin-sam .yui-button-hover a { + + color: #000; + +} + +.yui-skin-sam .yui-split-button-hover button { + + background-image: url(split-button-arrow-hover.png); + +} + + +/* Active state */ + +.yui-skin-sam .yui-button-active { + + border-color: #7D98B8; + background-position: 0 -1700px; + +} + +.yui-skin-sam .yui-button-active .first-child { + + border-color: #7D98B8; + +} + +.yui-skin-sam .yui-button-active button, +.yui-skin-sam .yui-button-active a { + + color: #000; + +} + +.yui-skin-sam .yui-split-button-activeoption { + + border-color: #808080; + background-position: 0 0; + +} + +.yui-skin-sam .yui-split-button-activeoption .first-child { + + border-color: #808080; + +} + +.yui-skin-sam .yui-split-button-activeoption button { + + background-image: url(split-button-arrow-active.png); + +} + + +/* Checked state */ + +.yui-skin-sam .yui-radio-button-checked, +.yui-skin-sam .yui-checkbox-button-checked { + + border-color: #304369; + background-position: 0 -1400px; + +} + +.yui-skin-sam .yui-radio-button-checked .first-child, +.yui-skin-sam .yui-checkbox-button-checked .first-child { + + border-color: #304369; + +} + +.yui-skin-sam .yui-radio-button-checked button, +.yui-skin-sam .yui-checkbox-button-checked button { + + color: #fff; + +} + + +/* Disabled state */ + +.yui-skin-sam .yui-button-disabled { + + border-color: #ccc; + background-position: 0 -1500px; + +} + +.yui-skin-sam .yui-button-disabled .first-child { + + border-color: #ccc; + +} + +.yui-skin-sam .yui-button-disabled button, +.yui-skin-sam .yui-button-disabled a { + + color: #A6A6A6; + cursor: default; + +} + +.yui-skin-sam .yui-menu-button-disabled button { + + background-image: url(menu-button-arrow-disabled.png); + +} + +.yui-skin-sam .yui-split-button-disabled button { + + background-image: url(split-button-arrow-disabled.png); + +} \ No newline at end of file diff --git a/lib/yui/button/assets/skins/sam/button.css b/lib/yui/button/assets/skins/sam/button.css new file mode 100755 index 0000000000..96033e22e5 --- /dev/null +++ b/lib/yui/button/assets/skins/sam/button.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-button{display:-moz-inline-box;display:inline-block;vertical-align:text-bottom;}.yui-button .first-child{display:block;*display:inline-block;}.yui-button button,.yui-button a{display:block;*display:inline-block;border:none;margin:0;}.yui-button button{background-color:transparent;*overflow:visible;cursor:pointer;}.yui-button a{text-decoration:none;}.yui-skin-sam .yui-button{border-width:1px 0;border-style:solid;border-color:#808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;margin:auto .25em;}.yui-skin-sam .yui-button .first-child{border-width:0 1px;border-style:solid;border-color:#808080;margin:0 -1px;*position:relative;*left:-1px;_margin:0;_position:static;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a{padding:0 10px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-button a{*line-height:1.875;*padding-bottom:1px;}.yui-skin-sam .yui-split-button button,.yui-skin-sam .yui-menu-button button{padding-right:20px;background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-button button{background-image:url(menu-button-arrow.png);}.yui-skin-sam .yui-split-button button{background-image:url(split-button-arrow.png);}.yui-skin-sam .yui-button-focus{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-focus .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-focus button,.yui-skin-sam .yui-button-focus a{color:#000;}.yui-skin-sam .yui-split-button-focus button{background-image:url(split-button-arrow-focus.png);}.yui-skin-sam .yui-button-hover{border-color:#7D98B8;background-position:0 -1300px;}.yui-skin-sam .yui-button-hover .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-hover button,.yui-skin-sam .yui-button-hover a{color:#000;}.yui-skin-sam .yui-split-button-hover button{background-image:url(split-button-arrow-hover.png);}.yui-skin-sam .yui-button-active{border-color:#7D98B8;background-position:0 -1700px;}.yui-skin-sam .yui-button-active .first-child{border-color:#7D98B8;}.yui-skin-sam .yui-button-active button,.yui-skin-sam .yui-button-active a{color:#000;}.yui-skin-sam .yui-split-button-activeoption{border-color:#808080;background-position:0 0;}.yui-skin-sam .yui-split-button-activeoption .first-child{border-color:#808080;}.yui-skin-sam .yui-split-button-activeoption button{background-image:url(split-button-arrow-active.png);}.yui-skin-sam .yui-radio-button-checked,.yui-skin-sam .yui-checkbox-button-checked{border-color:#304369;background-position:0 -1400px;}.yui-skin-sam .yui-radio-button-checked .first-child,.yui-skin-sam .yui-checkbox-button-checked .first-child{border-color:#304369;}.yui-skin-sam .yui-radio-button-checked button,.yui-skin-sam .yui-checkbox-button-checked button{color:#fff;}.yui-skin-sam .yui-button-disabled{border-color:#ccc;background-position:0 -1500px;}.yui-skin-sam .yui-button-disabled .first-child{border-color:#ccc;}.yui-skin-sam .yui-button-disabled button,.yui-skin-sam .yui-button-disabled a{color:#A6A6A6;cursor:default;}.yui-skin-sam .yui-menu-button-disabled button{background-image:url(menu-button-arrow-disabled.png);}.yui-skin-sam .yui-split-button-disabled button{background-image:url(split-button-arrow-disabled.png);} diff --git a/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png b/lib/yui/button/assets/skins/sam/menu-button-arrow-disabled.png new file mode 100755 index 0000000000000000000000000000000000000000..8cef2abb31170a370c7062c839ea9d5e9de18948 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~d!3-ofWcl9%anc=q9T^y|-MHc(VFct$mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$(3-AeXt*@{D|Np;u@pDC#5QQ<|d}62BjvZR2H60wE-$(3-AeX1=9cj|6h7@{#_u8sU*lR z_&>wb?FL>zp1h}vV@SoVq=W_rH;IGN~-|K;%i-0c73 z@c-iO|KRQa-|hd~QeFE1003M`L_t(|+U&?l5`sVg1i`WZK}Epr|6dhmytLs92=mel z9uoULP6;mwyM%qhIpHzkHQ|(SNO(*5TD8?y@wq9xG<+26t_AN^`$=39HtEMPCOjwP e%l`;(0R{kdKn;SADLBOd00006$Gh9E#3p9{H-P6S}q~camLV^=3&tj%#_Xa_x2_Xl57U&w-9pX85Q9;Im dv4Me^VIeE)+1pK9I)PdkJYD@<);T3K0RYcxInw|D literal 0 HcmV?d00001 diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png b/lib/yui/button/assets/skins/sam/split-button-arrow-focus.png new file mode 100755 index 0000000000000000000000000000000000000000..167d71eb721ba9b85c6601f9077d5c39faa4ebd2 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_Tx)0S05bpo|DSu#^)isf zToU9L{Qp10^;5h+0~ypkT^vIyZY3ooII;39W@>hC5M-JVa^Poyu7TYlo?{mkWE>b9 b7?>Frva+7N-L$0>sD;7P)z4*}Q$iB}D9ShR literal 0 HcmV?d00001 diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png b/lib/yui/button/assets/skins/sam/split-button-arrow-hover.png new file mode 100755 index 0000000000000000000000000000000000000000..167d71eb721ba9b85c6601f9077d5c39faa4ebd2 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_Tx)0S05bpo|DSu#^)isf zToU9L{Qp10^;5h+0~ypkT^vIyZY3ooII;39W@>hC5M-JVa^Poyu7TYlo?{mkWE>b9 b7?>Frva+7N-L$0>sD;7P)z4*}Q$iB}D9ShR literal 0 HcmV?d00001 diff --git a/lib/yui/button/assets/skins/sam/split-button-arrow.png b/lib/yui/button/assets/skins/sam/split-button-arrow.png new file mode 100755 index 0000000000000000000000000000000000000000..b33a93ff2dc2039bd24e4ea3b75ecf4bb3295f84 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoU!3-pmJXhxdDVB6cUq=RpYd5a=M;HP5k|nMY zCBgY=CFO}lsSJ)O`AMk?p1FzXsX?iUDV2pMQ*D5XI0Jk_TpJo1fXx5@|JyBHuocK+ zE(!7r{{Nrh`YB$Zfeh-NE{-7;w~`VPoLG4lGc~(62r^9wIqgTe~DWM4f1sXSq literal 0 HcmV?d00001 diff --git a/lib/yui/button/button-debug.js b/lib/yui/button/button-debug.js new file mode 100644 index 0000000000..d96ebb450b --- /dev/null +++ b/lib/yui/button/button-debug.js @@ -0,0 +1,4859 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +/** +* @module button +* @description

    The Button Control enables the creation of rich, graphical +* buttons that function like traditional HTML form buttons. Unlike +* tradition HTML form buttons, buttons created with the Button Control can have +* a label that is different from its value. With the inclusion of the optional +* Menu Control, the Button Control can also be +* used to create menu buttons and split buttons, controls that are not +* available natively in HTML. The Button Control can also be thought of as a +* way to create more visually engaging implementations of the browser's +* default radio-button and check-box controls.

    +*

    The Button Control supports the following types:

    +*
    +*
    push
    +*
    Basic push button that can execute a user-specified command when +* pressed.
    +*
    link
    +*
    Navigates to a specified url when pressed.
    +*
    submit
    +*
    Submits the parent form when pressed.
    +*
    reset
    +*
    Resets the parent form when pressed.
    +*
    checkbox
    +*
    Maintains a "checked" state that can be toggled on and off.
    +*
    radio
    +*
    Maintains a "checked" state that can be toggled on and off. Use with +* the ButtonGroup class to create a set of controls that are mutually +* exclusive; checking one button in the set will uncheck all others in +* the group.
    +*
    menu
    +*
    When pressed will show/hide a menu.
    +*
    split
    +*
    Can execute a user-specified command or display a menu when pressed.
    +*
    +* @title Button +* @namespace YAHOO.widget +* @requires yahoo, dom, element, event +* @optional container, menu +*/ + + +(function () { + + + /** + * The Button class creates a rich, graphical button. + * @param {String} p_oElement String specifying the id attribute of the + * <input>, <button>, + * <a>, or <span> element to + * be used to create the button. + * @param {HTMLInputElement| + * HTMLButtonElement|HTMLElement} p_oElement Object reference for the + * <input>, <button>, + * <a>, or <span> element to be + * used to create the button. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button. + * @param {Object} p_oAttributes Optional. Object literal specifying a set + * of configuration attributes used to create the button. + * @namespace YAHOO.widget + * @class Button + * @constructor + * @extends YAHOO.util.Element + */ + + + + // Shorthard for utilities + + var Dom = YAHOO.util.Dom, + Event = YAHOO.util.Event, + Lang = YAHOO.lang, + UA = YAHOO.env.ua, + Overlay = YAHOO.widget.Overlay, + Menu = YAHOO.widget.Menu, + + + // Private member variables + + m_oButtons = {}, // Collection of all Button instances + m_oOverlayManager = null, // YAHOO.widget.OverlayManager instance + m_oSubmitTrigger = null, // The button that submitted the form + m_oFocusedButton = null; // The button that has focus + + + + // Private methods + + + + /** + * @method createInputElement + * @description Creates an <input> element of the + * specified type. + * @private + * @param {String} p_sType String specifying the type of + * <input> element to create. + * @param {String} p_sName String specifying the name of + * <input> element to create. + * @param {String} p_sValue String specifying the value of + * <input> element to create. + * @param {String} p_bChecked Boolean specifying if the + * <input> element is to be checked. + * @return {HTMLInputElement} + */ + function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) { + + var oInput, + sInput; + + if (Lang.isString(p_sType) && Lang.isString(p_sName)) { + + if (UA.ie) { + + /* + For IE it is necessary to create the element with the + "type," "name," "value," and "checked" properties set all + at once. + */ + + sInput = "<input> or <a>) that + * map to Button configuration attributes and sets them into a collection + * that is passed to the Button constructor. + * @private + * @param {HTMLInputElement|HTMLAnchorElement} p_oElement Object reference to the HTML + * element (either <input> or <span> + * ) used to create the button. + * @param {Object} p_oAttributes Object reference for the collection of + * configuration attributes used to create the button. + */ + function setAttributesFromSrcElement(p_oElement, p_oAttributes) { + + var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(), + me = this, + oAttribute, + oRootNode, + sText; + + + /** + * @method setAttributeFromDOMAttribute + * @description Gets the value of the specified DOM attribute and sets it + * into the collection of configuration attributes used to configure + * the button. + * @private + * @param {String} p_sAttribute String representing the name of the + * attribute to retrieve from the DOM element. + */ + function setAttributeFromDOMAttribute(p_sAttribute) { + + if (!(p_sAttribute in p_oAttributes)) { + + /* + Need to use "getAttributeNode" instead of "getAttribute" + because using "getAttribute," IE will return the innerText + of a <button> for the value attribute + rather than the value of the "value" attribute. + */ + + oAttribute = p_oElement.getAttributeNode(p_sAttribute); + + + if (oAttribute && ("value" in oAttribute)) { + + YAHOO.log("Setting attribute \"" + p_sAttribute + + "\" using source element's attribute value of \"" + + oAttribute.value + "\"", "info", me.toString()); + + p_oAttributes[p_sAttribute] = oAttribute.value; + + } + + } + + } + + + /** + * @method setFormElementProperties + * @description Gets the value of the attributes from the form element + * and sets them into the collection of configuration attributes used to + * configure the button. + * @private + */ + function setFormElementProperties() { + + setAttributeFromDOMAttribute("type"); + + if (p_oAttributes.type == "button") { + + p_oAttributes.type = "push"; + + } + + if (!("disabled" in p_oAttributes)) { + + p_oAttributes.disabled = p_oElement.disabled; + + } + + setAttributeFromDOMAttribute("name"); + setAttributeFromDOMAttribute("value"); + setAttributeFromDOMAttribute("title"); + + } + + + switch (sSrcElementNodeName) { + + case "A": + + p_oAttributes.type = "link"; + + setAttributeFromDOMAttribute("href"); + setAttributeFromDOMAttribute("target"); + + break; + + case "INPUT": + + setFormElementProperties(); + + if (!("checked" in p_oAttributes)) { + + p_oAttributes.checked = p_oElement.checked; + + } + + break; + + case "BUTTON": + + setFormElementProperties(); + + oRootNode = p_oElement.parentNode.parentNode; + + if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-checked")) { + + p_oAttributes.checked = true; + + } + + if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-disabled")) { + + p_oAttributes.disabled = true; + + } + + p_oElement.removeAttribute("value"); + + p_oElement.setAttribute("type", "button"); + + break; + + } + + p_oElement.removeAttribute("id"); + p_oElement.removeAttribute("name"); + + if (!("tabindex" in p_oAttributes)) { + + p_oAttributes.tabindex = p_oElement.tabIndex; + + } + + if (!("label" in p_oAttributes)) { + + // Set the "label" property + + sText = sSrcElementNodeName == "INPUT" ? + p_oElement.value : p_oElement.innerHTML; + + + if (sText && sText.length > 0) { + + p_oAttributes.label = sText; + + } + + } + + } + + + /** + * @method initConfig + * @description Initializes the set of configuration attributes that are + * used to instantiate the button. + * @private + * @param {Object} Object representing the button's set of + * configuration attributes. + */ + function initConfig(p_oConfig) { + + var oAttributes = p_oConfig.attributes, + oSrcElement = oAttributes.srcelement, + sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(), + me = this; + + + if (sSrcElementNodeName == this.NODE_NAME) { + + p_oConfig.element = oSrcElement; + p_oConfig.id = oSrcElement.id; + + Dom.getElementsBy(function (p_oElement) { + + switch (p_oElement.nodeName.toUpperCase()) { + + case "BUTTON": + case "A": + case "INPUT": + + setAttributesFromSrcElement.call(me, p_oElement, + oAttributes); + + break; + + } + + }, "*", oSrcElement); + + } + else { + + switch (sSrcElementNodeName) { + + case "BUTTON": + case "A": + case "INPUT": + + setAttributesFromSrcElement.call(this, oSrcElement, + oAttributes); + + break; + + } + + } + + } + + + + // Constructor + + YAHOO.widget.Button = function (p_oElement, p_oAttributes) { + + if (!Overlay && YAHOO.widget.Overlay) { + + Overlay = YAHOO.widget.Overlay; + + } + + + if (!Menu && YAHOO.widget.Menu) { + + Menu = YAHOO.widget.Menu; + + } + + + var fnSuperClass = YAHOO.widget.Button.superclass.constructor, + oConfig, + oElement; + + + if (arguments.length == 1 && !Lang.isString(p_oElement) && !p_oElement.nodeName) { + + if (!p_oElement.id) { + + p_oElement.id = Dom.generateId(); + + YAHOO.log("No value specified for the button's \"id\" " + + "attribute. Setting button id to \"" + p_oElement.id + + "\".", "info", this.toString()); + + } + + YAHOO.log("No source HTML element. Building the button " + + "using the set of configuration attributes.", "info", this.toString()); + + fnSuperClass.call(this, (this.createButtonElement(p_oElement.type)), p_oElement); + + } + else { + + oConfig = { element: null, attributes: (p_oAttributes || {}) }; + + + if (Lang.isString(p_oElement)) { + + oElement = Dom.get(p_oElement); + + if (oElement) { + + if (!oConfig.attributes.id) { + + oConfig.attributes.id = p_oElement; + + } + + YAHOO.log("Building the button using an existing " + + "HTML element as a source element.", "info", this.toString()); + + + oConfig.attributes.srcelement = oElement; + + initConfig.call(this, oConfig); + + + if (!oConfig.element) { + + YAHOO.log("Source element could not be used " + + "as is. Creating a new HTML element for " + + "the button.", "info", this.toString()); + + oConfig.element = this.createButtonElement(oConfig.attributes.type); + + } + + fnSuperClass.call(this, oConfig.element, oConfig.attributes); + + } + + } + else if (p_oElement.nodeName) { + + if (!oConfig.attributes.id) { + + if (p_oElement.id) { + + oConfig.attributes.id = p_oElement.id; + + } + else { + + oConfig.attributes.id = Dom.generateId(); + + YAHOO.log("No value specified for the button's " + + "\"id\" attribute. Setting button id to \"" + + oConfig.attributes.id + "\".", "info", this.toString()); + + } + + } + + YAHOO.log("Building the button using an existing HTML " + + "element as a source element.", "info", this.toString()); + + + oConfig.attributes.srcelement = p_oElement; + + initConfig.call(this, oConfig); + + + if (!oConfig.element) { + + YAHOO.log("Source element could not be used as is." + + " Creating a new HTML element for the button.", + "info", this.toString()); + + oConfig.element = this.createButtonElement(oConfig.attributes.type); + + } + + fnSuperClass.call(this, oConfig.element, oConfig.attributes); + + } + + } + + }; + + + + YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, { + + + // Protected properties + + + /** + * @property _button + * @description Object reference to the button's internal + * <a> or <button> element. + * @default null + * @protected + * @type HTMLAnchorElement|HTMLButtonElement + */ + _button: null, + + + /** + * @property _menu + * @description Object reference to the button's menu. + * @default null + * @protected + * @type {YAHOO.widget.Overlay| + * YAHOO.widget.Menu} + */ + _menu: null, + + + /** + * @property _hiddenFields + * @description Object reference to the <input> + * element, or array of HTML form elements used to represent the button + * when its parent form is submitted. + * @default null + * @protected + * @type HTMLInputElement|Array + */ + _hiddenFields: null, + + + /** + * @property _onclickAttributeValue + * @description Object reference to the button's current value for the + * "onclick" configuration attribute. + * @default null + * @protected + * @type Object + */ + _onclickAttributeValue: null, + + + /** + * @property _activationKeyPressed + * @description Boolean indicating if the key(s) that toggle the button's + * "active" state have been pressed. + * @default false + * @protected + * @type Boolean + */ + _activationKeyPressed: false, + + + /** + * @property _activationButtonPressed + * @description Boolean indicating if the mouse button that toggles + * the button's "active" state has been pressed. + * @default false + * @protected + * @type Boolean + */ + _activationButtonPressed: false, + + + /** + * @property _hasKeyEventHandlers + * @description Boolean indicating if the button's "blur", "keydown" and + * "keyup" event handlers are assigned + * @default false + * @protected + * @type Boolean + */ + _hasKeyEventHandlers: false, + + + /** + * @property _hasMouseEventHandlers + * @description Boolean indicating if the button's "mouseout," + * "mousedown," and "mouseup" event handlers are assigned + * @default false + * @protected + * @type Boolean + */ + _hasMouseEventHandlers: false, + + + /** + * @property _nOptionRegionX + * @description Number representing the X coordinate of the leftmost edge of the Button's + * option region. Applies only to Buttons of type "split". + * @default 0 + * @protected + * @type Number + */ + _nOptionRegionX: 0, + + + + // Constants + + + /** + * @property NODE_NAME + * @description The name of the node to be used for the button's + * root element. + * @default "SPAN" + * @final + * @type String + */ + NODE_NAME: "SPAN", + + + /** + * @property CHECK_ACTIVATION_KEYS + * @description Array of numbers representing keys that (when pressed) + * toggle the button's "checked" attribute. + * @default [32] + * @final + * @type Array + */ + CHECK_ACTIVATION_KEYS: [32], + + + /** + * @property ACTIVATION_KEYS + * @description Array of numbers representing keys that (when presed) + * toggle the button's "active" state. + * @default [13, 32] + * @final + * @type Array + */ + ACTIVATION_KEYS: [13, 32], + + + /** + * @property OPTION_AREA_WIDTH + * @description Width (in pixels) of the area of a split button that + * when pressed will display a menu. + * @default 20 + * @final + * @type Number + */ + OPTION_AREA_WIDTH: 20, + + + /** + * @property CSS_CLASS_NAME + * @description String representing the CSS class(es) to be applied to + * the button's root element. + * @default "yui-button" + * @final + * @type String + */ + CSS_CLASS_NAME: "yui-button", + + + /** + * @property RADIO_DEFAULT_TITLE + * @description String representing the default title applied to buttons + * of type "radio." + * @default "Unchecked. Click to check." + * @final + * @type String + */ + RADIO_DEFAULT_TITLE: "Unchecked. Click to check.", + + + /** + * @property RADIO_CHECKED_TITLE + * @description String representing the title applied to buttons of + * type "radio" when checked. + * @default "Checked. Click another button to uncheck" + * @final + * @type String + */ + RADIO_CHECKED_TITLE: "Checked. Click another button to uncheck", + + + /** + * @property CHECKBOX_DEFAULT_TITLE + * @description String representing the default title applied to + * buttons of type "checkbox." + * @default "Unchecked. Click to check." + * @final + * @type String + */ + CHECKBOX_DEFAULT_TITLE: "Unchecked. Click to check.", + + + /** + * @property CHECKBOX_CHECKED_TITLE + * @description String representing the title applied to buttons of type + * "checkbox" when checked. + * @default "Checked. Click to uncheck." + * @final + * @type String + */ + CHECKBOX_CHECKED_TITLE: "Checked. Click to uncheck.", + + + /** + * @property MENUBUTTON_DEFAULT_TITLE + * @description String representing the default title applied to + * buttons of type "menu." + * @default "Menu collapsed. Click to expand." + * @final + * @type String + */ + MENUBUTTON_DEFAULT_TITLE: "Menu collapsed. Click to expand.", + + + /** + * @property MENUBUTTON_MENU_VISIBLE_TITLE + * @description String representing the title applied to buttons of type + * "menu" when the button's menu is visible. + * @default "Menu expanded. Click or press Esc to collapse." + * @final + * @type String + */ + MENUBUTTON_MENU_VISIBLE_TITLE: + "Menu expanded. Click or press Esc to collapse.", + + + /** + * @property SPLITBUTTON_DEFAULT_TITLE + * @description String representing the default title applied to + * buttons of type "split." + * @default "Menu collapsed. Click inside option region or press + * Ctrl + Shift + M to show the menu." + * @final + * @type String + */ + SPLITBUTTON_DEFAULT_TITLE: ("Menu collapsed. Click inside option " + + "region or press down arrow key to show the menu."), + + + /** + * @property SPLITBUTTON_OPTION_VISIBLE_TITLE + * @description String representing the title applied to buttons of type + * "split" when the button's menu is visible. + * @default "Menu expanded. Press Esc or Ctrl + Shift + M to hide + * the menu." + * @final + * @type String + */ + SPLITBUTTON_OPTION_VISIBLE_TITLE: + "Menu expanded. Press Esc to hide the menu.", + + + /** + * @property SUBMIT_TITLE + * @description String representing the title applied to buttons of + * type "submit." + * @default "Click to submit form." + * @final + * @type String + */ + SUBMIT_TITLE: "Click to submit form.", + + + + // Protected attribute setter methods + + + /** + * @method _setType + * @description Sets the value of the button's "type" attribute. + * @protected + * @param {String} p_sType String indicating the value for the button's + * "type" attribute. + */ + _setType: function (p_sType) { + + if (p_sType == "split") { + + this.on("option", this._onOption); + + } + + }, + + + /** + * @method _setLabel + * @description Sets the value of the button's "label" attribute. + * @protected + * @param {String} p_sLabel String indicating the value for the button's + * "label" attribute. + */ + _setLabel: function (p_sLabel) { + + this._button.innerHTML = p_sLabel; + + + /* + Remove and add the default class name from the root element + for Gecko to ensure that the button shrinkwraps to the label. + Without this the button will not be rendered at the correct + width when the label changes. The most likely cause for this + bug is button's use of the Gecko-specific CSS display type of + "-moz-inline-box" to simulate "inline-block" supported by IE, + Safari and Opera. + */ + + var sClass, + nGeckoVersion = UA.gecko; + + + if (nGeckoVersion && nGeckoVersion < 1.9 && Dom.inDocument(this.get("element"))) { + + sClass = this.CSS_CLASS_NAME; + + this.removeClass(sClass); + + Lang.later(0, this, this.addClass, sClass); + + } + + }, + + + /** + * @method _setTabIndex + * @description Sets the value of the button's "tabindex" attribute. + * @protected + * @param {Number} p_nTabIndex Number indicating the value for the + * button's "tabindex" attribute. + */ + _setTabIndex: function (p_nTabIndex) { + + this._button.tabIndex = p_nTabIndex; + + }, + + + /** + * @method _setTitle + * @description Sets the value of the button's "title" attribute. + * @protected + * @param {String} p_nTabIndex Number indicating the value for + * the button's "title" attribute. + */ + _setTitle: function (p_sTitle) { + + var sTitle = p_sTitle; + + if (this.get("type") != "link") { + + if (!sTitle) { + + switch (this.get("type")) { + + case "radio": + + sTitle = this.RADIO_DEFAULT_TITLE; + + break; + + case "checkbox": + + sTitle = this.CHECKBOX_DEFAULT_TITLE; + + break; + + case "menu": + + sTitle = this.MENUBUTTON_DEFAULT_TITLE; + + break; + + case "split": + + sTitle = this.SPLITBUTTON_DEFAULT_TITLE; + + break; + + case "submit": + + sTitle = this.SUBMIT_TITLE; + + break; + + } + + } + + this._button.title = sTitle; + + } + + }, + + + /** + * @method _setDisabled + * @description Sets the value of the button's "disabled" attribute. + * @protected + * @param {Boolean} p_bDisabled Boolean indicating the value for + * the button's "disabled" attribute. + */ + _setDisabled: function (p_bDisabled) { + + if (this.get("type") != "link") { + + if (p_bDisabled) { + + if (this._menu) { + + this._menu.hide(); + + } + + if (this.hasFocus()) { + + this.blur(); + + } + + this._button.setAttribute("disabled", "disabled"); + + this.addStateCSSClasses("disabled"); + + this.removeStateCSSClasses("hover"); + this.removeStateCSSClasses("active"); + this.removeStateCSSClasses("focus"); + + } + else { + + this._button.removeAttribute("disabled"); + + this.removeStateCSSClasses("disabled"); + + } + + } + + }, + + + /** + * @method _setHref + * @description Sets the value of the button's "href" attribute. + * @protected + * @param {String} p_sHref String indicating the value for the button's + * "href" attribute. + */ + _setHref: function (p_sHref) { + + if (this.get("type") == "link") { + + this._button.href = p_sHref; + + } + + }, + + + /** + * @method _setTarget + * @description Sets the value of the button's "target" attribute. + * @protected + * @param {String} p_sTarget String indicating the value for the button's + * "target" attribute. + */ + _setTarget: function (p_sTarget) { + + if (this.get("type") == "link") { + + this._button.setAttribute("target", p_sTarget); + + } + + }, + + + /** + * @method _setChecked + * @description Sets the value of the button's "target" attribute. + * @protected + * @param {Boolean} p_bChecked Boolean indicating the value for + * the button's "checked" attribute. + */ + _setChecked: function (p_bChecked) { + + var sType = this.get("type"), + sTitle; + + if (sType == "checkbox" || sType == "radio") { + + if (p_bChecked) { + + this.addStateCSSClasses("checked"); + + sTitle = (sType == "radio") ? + this.RADIO_CHECKED_TITLE : + this.CHECKBOX_CHECKED_TITLE; + + } + else { + + this.removeStateCSSClasses("checked"); + + sTitle = (sType == "radio") ? + this.RADIO_DEFAULT_TITLE : + this.CHECKBOX_DEFAULT_TITLE; + + } + + + if (!this._hasDefaultTitle) { + + this.set("title", sTitle); + + } + + } + + }, + + + /** + * @method _setMenu + * @description Sets the value of the button's "menu" attribute. + * @protected + * @param {Object} p_oMenu Object indicating the value for the button's + * "menu" attribute. + */ + _setMenu: function (p_oMenu) { + + var bLazyLoad = this.get("lazyloadmenu"), + oButtonElement = this.get("element"), + sMenuCSSClassName, + + /* + Boolean indicating if the value of p_oMenu is an instance + of YAHOO.widget.Menu or YAHOO.widget.Overlay. + */ + + bInstance = false, + + + oMenu, + oMenuElement, + oSrcElement, + aItems, + nItems, + oItem, + i; + + + function onAppendTo() { + + oMenu.render(oButtonElement.parentNode); + + this.removeListener("appendTo", onAppendTo); + + } + + + function setMenuContainer() { + + oMenu.cfg.queueProperty("container", oButtonElement.parentNode); + + this.removeListener("appendTo", setMenuContainer); + + } + + + function initMenu() { + + var oContainer; + + if (oMenu) { + + Dom.addClass(oMenu.element, this.get("menuclassname")); + Dom.addClass(oMenu.element, "yui-" + this.get("type") + "-button-menu"); + + oMenu.showEvent.subscribe(this._onMenuShow, null, this); + oMenu.hideEvent.subscribe(this._onMenuHide, null, this); + oMenu.renderEvent.subscribe(this._onMenuRender, null, this); + + + if (Menu && oMenu instanceof Menu) { + + if (bLazyLoad) { + + oContainer = this.get("container"); + + if (oContainer) { + + oMenu.cfg.queueProperty("container", oContainer); + + } + else { + + this.on("appendTo", setMenuContainer); + + } + + } + + oMenu.cfg.queueProperty("clicktohide", false); + + oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, this, true); + oMenu.subscribe("click", this._onMenuClick, this, true); + oMenu.itemAddedEvent.subscribe(this._onMenuItemAdded, this, true); + + oSrcElement = oMenu.srcElement; + + if (oSrcElement && oSrcElement.nodeName.toUpperCase() == "SELECT") { + + oSrcElement.style.display = "none"; + oSrcElement.parentNode.removeChild(oSrcElement); + + } + + } + else if (Overlay && oMenu instanceof Overlay) { + + if (!m_oOverlayManager) { + + m_oOverlayManager = new YAHOO.widget.OverlayManager(); + + } + + m_oOverlayManager.register(oMenu); + + } + + + this._menu = oMenu; + + + if (!bInstance && !bLazyLoad) { + + if (Dom.inDocument(oButtonElement)) { + + oMenu.render(oButtonElement.parentNode); + + } + else { + + this.on("appendTo", onAppendTo); + + } + + } + + } + + } + + + if (Overlay) { + + if (Menu) { + + sMenuCSSClassName = Menu.prototype.CSS_CLASS_NAME; + + } + + if (p_oMenu && Menu && (p_oMenu instanceof Menu)) { + + oMenu = p_oMenu; + aItems = oMenu.getItems(); + nItems = aItems.length; + bInstance = true; + + + if (nItems > 0) { + + i = nItems - 1; + + do { + + oItem = aItems[i]; + + if (oItem) { + + oItem.cfg.subscribeToConfigEvent("selected", + this._onMenuItemSelected, oItem, this); + + } + + } + while (i--); + + } + + initMenu.call(this); + + } + else if (Overlay && p_oMenu && (p_oMenu instanceof Overlay)) { + + oMenu = p_oMenu; + bInstance = true; + + oMenu.cfg.queueProperty("visible", false); + + initMenu.call(this); + + } + else if (Menu && Lang.isArray(p_oMenu)) { + + oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, itemdata: p_oMenu }); + + this._menu = oMenu; + + this.on("appendTo", initMenu); + + } + else if (Lang.isString(p_oMenu)) { + + oMenuElement = Dom.get(p_oMenu); + + if (oMenuElement) { + + if (Menu && Dom.hasClass(oMenuElement, sMenuCSSClassName) || + oMenuElement.nodeName.toUpperCase() == "SELECT") { + + oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); + + initMenu.call(this); + + } + else if (Overlay) { + + oMenu = new Overlay(p_oMenu, { visible: false }); + + initMenu.call(this); + + } + + } + + } + else if (p_oMenu && p_oMenu.nodeName) { + + if (Menu && Dom.hasClass(p_oMenu, sMenuCSSClassName) || + p_oMenu.nodeName.toUpperCase() == "SELECT") { + + oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); + + initMenu.call(this); + + } + else if (Overlay) { + + if (!p_oMenu.id) { + + Dom.generateId(p_oMenu); + + } + + oMenu = new Overlay(p_oMenu, { visible: false }); + + initMenu.call(this); + + } + + } + + } + + }, + + + /** + * @method _setOnClick + * @description Sets the value of the button's "onclick" attribute. + * @protected + * @param {Object} p_oObject Object indicating the value for the button's + * "onclick" attribute. + */ + _setOnClick: function (p_oObject) { + + /* + Remove any existing listeners if a "click" event handler + has already been specified. + */ + + if (this._onclickAttributeValue && + (this._onclickAttributeValue != p_oObject)) { + + this.removeListener("click", this._onclickAttributeValue.fn); + + this._onclickAttributeValue = null; + + } + + + if (!this._onclickAttributeValue && + Lang.isObject(p_oObject) && + Lang.isFunction(p_oObject.fn)) { + + this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope); + + this._onclickAttributeValue = p_oObject; + + } + + }, + + + /** + * @method _setSelectedMenuItem + * @description Sets the value of the button's + * "selectedMenuItem" attribute. + * @protected + * @param {Number} p_nIndex Number representing the index of the item + * in the button's menu that is currently selected. + */ + _setSelectedMenuItem: function (p_nIndex) { + + var oMenu = this._menu, + oMenuItem; + + + if (Menu && oMenu && oMenu instanceof Menu) { + + oMenuItem = oMenu.getItem(p_nIndex); + + + if (oMenuItem && !oMenuItem.cfg.getProperty("selected")) { + + oMenuItem.cfg.setProperty("selected", true); + + } + + } + + }, + + + // Protected methods + + + + /** + * @method _isActivationKey + * @description Determines if the specified keycode is one that toggles + * the button's "active" state. + * @protected + * @param {Number} p_nKeyCode Number representing the keycode to + * be evaluated. + * @return {Boolean} + */ + _isActivationKey: function (p_nKeyCode) { + + var sType = this.get("type"), + aKeyCodes = (sType == "checkbox" || sType == "radio") ? + this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS, + + nKeyCodes = aKeyCodes.length, + bReturnVal = false, + i; + + + if (nKeyCodes > 0) { + + i = nKeyCodes - 1; + + do { + + if (p_nKeyCode == aKeyCodes[i]) { + + bReturnVal = true; + break; + + } + + } + while (i--); + + } + + return bReturnVal; + + }, + + + /** + * @method _isSplitButtonOptionKey + * @description Determines if the specified keycode is one that toggles + * the display of the split button's menu. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + * @return {Boolean} + */ + _isSplitButtonOptionKey: function (p_oEvent) { + + var bShowMenu = (Event.getCharCode(p_oEvent) == 40); + + + var onKeyPress = function (p_oEvent) { + + Event.preventDefault(p_oEvent); + + this.removeListener("keypress", onKeyPress); + + }; + + + // Prevent the browser from scrolling the window + if (bShowMenu) { + + if (UA.opera) { + + this.on("keypress", onKeyPress); + + } + + Event.preventDefault(p_oEvent); + } + + return bShowMenu; + + }, + + + /** + * @method _addListenersToForm + * @description Adds event handlers to the button's form. + * @protected + */ + _addListenersToForm: function () { + + var oForm = this.getForm(), + onFormKeyPress = YAHOO.widget.Button.onFormKeyPress, + bHasKeyPressListener, + oSrcElement, + aListeners, + nListeners, + i; + + + if (oForm) { + + Event.on(oForm, "reset", this._onFormReset, null, this); + Event.on(oForm, "submit", this._onFormSubmit, null, this); + + oSrcElement = this.get("srcelement"); + + + if (this.get("type") == "submit" || + (oSrcElement && oSrcElement.type == "submit")) + { + + aListeners = Event.getListeners(oForm, "keypress"); + bHasKeyPressListener = false; + + if (aListeners) { + + nListeners = aListeners.length; + + if (nListeners > 0) { + + i = nListeners - 1; + + do { + + if (aListeners[i].fn == onFormKeyPress) { + + bHasKeyPressListener = true; + break; + + } + + } + while (i--); + + } + + } + + + if (!bHasKeyPressListener) { + + Event.on(oForm, "keypress", onFormKeyPress); + + } + + } + + } + + }, + + + + /** + * @method _showMenu + * @description Shows the button's menu. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event) that triggered + * the display of the menu. + */ + _showMenu: function (p_oEvent) { + + if (YAHOO.widget.MenuManager) { + YAHOO.widget.MenuManager.hideVisible(); + } + + + if (m_oOverlayManager) { + m_oOverlayManager.hideAll(); + } + + + var oMenu = this._menu, + aMenuAlignment = this.get("menualignment"), + bFocusMenu = this.get("focusmenu"), + fnFocusMethod; + + + if (this._renderedMenu) { + + oMenu.cfg.setProperty("context", + [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); + + oMenu.cfg.setProperty("preventcontextoverlap", true); + oMenu.cfg.setProperty("constraintoviewport", true); + + } + else { + + oMenu.cfg.queueProperty("context", + [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); + + oMenu.cfg.queueProperty("preventcontextoverlap", true); + oMenu.cfg.queueProperty("constraintoviewport", true); + + } + + + /* + Refocus the Button before showing its Menu in case the call to + YAHOO.widget.MenuManager.hideVisible() resulted in another element in the + DOM being focused after another Menu was hidden. + */ + + this.focus(); + + + if (Menu && oMenu && (oMenu instanceof Menu)) { + + // Since Menus automatically focus themselves when made visible, temporarily + // replace the Menu focus method so that the value of the Button's "focusmenu" + // attribute determines if the Menu should be focus when made visible. + + fnFocusMethod = oMenu.focus; + + oMenu.focus = function () {}; + + if (this._renderedMenu) { + + oMenu.cfg.setProperty("minscrollheight", this.get("menuminscrollheight")); + oMenu.cfg.setProperty("maxheight", this.get("menumaxheight")); + + } + else { + + oMenu.cfg.queueProperty("minscrollheight", this.get("menuminscrollheight")); + oMenu.cfg.queueProperty("maxheight", this.get("menumaxheight")); + + } + + + oMenu.show(); + + oMenu.focus = fnFocusMethod; + + oMenu.align(); + + + /* + Stop the propagation of the event so that the MenuManager + doesn't blur the menu after it gets focus. + */ + + if (p_oEvent.type == "mousedown") { + Event.stopPropagation(p_oEvent); + } + + + if (bFocusMenu) { + oMenu.focus(); + } + + } + else if (Overlay && oMenu && (oMenu instanceof Overlay)) { + + if (!this._renderedMenu) { + oMenu.render(this.get("element").parentNode); + } + + oMenu.show(); + oMenu.align(); + + } + + }, + + + /** + * @method _hideMenu + * @description Hides the button's menu. + * @protected + */ + _hideMenu: function () { + + var oMenu = this._menu; + + if (oMenu) { + + oMenu.hide(); + + } + + }, + + + + + // Protected event handlers + + + /** + * @method _onMouseOver + * @description "mouseover" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseOver: function (p_oEvent) { + + var sType = this.get("type"), + oElement, + nOptionRegionX; + + + if (sType === "split") { + + oElement = this.get("element"); + nOptionRegionX = + (Dom.getX(oElement) + (oElement.offsetWidth - this.OPTION_AREA_WIDTH)); + + this._nOptionRegionX = nOptionRegionX; + + } + + + if (!this._hasMouseEventHandlers) { + + if (sType === "split") { + + this.on("mousemove", this._onMouseMove); + + } + + this.on("mouseout", this._onMouseOut); + + this._hasMouseEventHandlers = true; + + } + + + this.addStateCSSClasses("hover"); + + + if (sType === "split" && (Event.getPageX(p_oEvent) > nOptionRegionX)) { + + this.addStateCSSClasses("hoveroption"); + + } + + + if (this._activationButtonPressed) { + + this.addStateCSSClasses("active"); + + } + + + if (this._bOptionPressed) { + + this.addStateCSSClasses("activeoption"); + + } + + + if (this._activationButtonPressed || this._bOptionPressed) { + + Event.removeListener(document, "mouseup", this._onDocumentMouseUp); + + } + + }, + + + /** + * @method _onMouseMove + * @description "mousemove" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseMove: function (p_oEvent) { + + var nOptionRegionX = this._nOptionRegionX; + + if (nOptionRegionX) { + + if (Event.getPageX(p_oEvent) > nOptionRegionX) { + + this.addStateCSSClasses("hoveroption"); + + } + else { + + this.removeStateCSSClasses("hoveroption"); + + } + + } + + }, + + /** + * @method _onMouseOut + * @description "mouseout" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseOut: function (p_oEvent) { + + var sType = this.get("type"); + + this.removeStateCSSClasses("hover"); + + + if (sType != "menu") { + + this.removeStateCSSClasses("active"); + + } + + + if (this._activationButtonPressed || this._bOptionPressed) { + + Event.on(document, "mouseup", this._onDocumentMouseUp, null, this); + + } + + + if (sType === "split" && (Event.getPageX(p_oEvent) > this._nOptionRegionX)) { + + this.removeStateCSSClasses("hoveroption"); + + } + + }, + + + /** + * @method _onDocumentMouseUp + * @description "mouseup" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDocumentMouseUp: function (p_oEvent) { + + this._activationButtonPressed = false; + this._bOptionPressed = false; + + var sType = this.get("type"), + oTarget, + oMenuElement; + + if (sType == "menu" || sType == "split") { + + oTarget = Event.getTarget(p_oEvent); + oMenuElement = this._menu.element; + + if (oTarget != oMenuElement && + !Dom.isAncestor(oMenuElement, oTarget)) { + + this.removeStateCSSClasses((sType == "menu" ? + "active" : "activeoption")); + + this._hideMenu(); + + } + + } + + Event.removeListener(document, "mouseup", this._onDocumentMouseUp); + + }, + + + /** + * @method _onMouseDown + * @description "mousedown" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseDown: function (p_oEvent) { + + var sType, + bReturnVal = true; + + + function onMouseUp() { + + this._hideMenu(); + this.removeListener("mouseup", onMouseUp); + + } + + + if ((p_oEvent.which || p_oEvent.button) == 1) { + + + if (!this.hasFocus()) { + + this.focus(); + + } + + + sType = this.get("type"); + + + if (sType == "split") { + + if (Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + this.fireEvent("option", p_oEvent); + bReturnVal = false; + + } + else { + + this.addStateCSSClasses("active"); + + this._activationButtonPressed = true; + + } + + } + else if (sType == "menu") { + + if (this.isActive()) { + + this._hideMenu(); + + this._activationButtonPressed = false; + + } + else { + + this._showMenu(p_oEvent); + + this._activationButtonPressed = true; + + } + + } + else { + + this.addStateCSSClasses("active"); + + this._activationButtonPressed = true; + + } + + + + if (sType == "split" || sType == "menu") { + + this._hideMenuTimer = Lang.later(250, this, this.on, ["mouseup", onMouseUp]); + + } + + } + + return bReturnVal; + + }, + + + /** + * @method _onMouseUp + * @description "mouseup" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseUp: function (p_oEvent) { + + var sType = this.get("type"), + oHideMenuTimer = this._hideMenuTimer, + bReturnVal = true; + + + if (oHideMenuTimer) { + + oHideMenuTimer.cancel(); + + } + + + if (sType == "checkbox" || sType == "radio") { + + this.set("checked", !(this.get("checked"))); + + } + + + this._activationButtonPressed = false; + + + if (sType != "menu") { + + this.removeStateCSSClasses("active"); + + } + + + if (sType == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + bReturnVal = false; + + } + + return bReturnVal; + + }, + + + /** + * @method _onFocus + * @description "focus" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onFocus: function (p_oEvent) { + + var oElement; + + this.addStateCSSClasses("focus"); + + if (this._activationKeyPressed) { + + this.addStateCSSClasses("active"); + + } + + m_oFocusedButton = this; + + + if (!this._hasKeyEventHandlers) { + + oElement = this._button; + + Event.on(oElement, "blur", this._onBlur, null, this); + Event.on(oElement, "keydown", this._onKeyDown, null, this); + Event.on(oElement, "keyup", this._onKeyUp, null, this); + + this._hasKeyEventHandlers = true; + + } + + + this.fireEvent("focus", p_oEvent); + + }, + + + /** + * @method _onBlur + * @description "blur" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onBlur: function (p_oEvent) { + + this.removeStateCSSClasses("focus"); + + if (this.get("type") != "menu") { + + this.removeStateCSSClasses("active"); + + } + + if (this._activationKeyPressed) { + + Event.on(document, "keyup", this._onDocumentKeyUp, null, this); + + } + + + m_oFocusedButton = null; + + this.fireEvent("blur", p_oEvent); + + }, + + + /** + * @method _onDocumentKeyUp + * @description "keyup" event handler for the document. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDocumentKeyUp: function (p_oEvent) { + + if (this._isActivationKey(Event.getCharCode(p_oEvent))) { + + this._activationKeyPressed = false; + + Event.removeListener(document, "keyup", this._onDocumentKeyUp); + + } + + }, + + + /** + * @method _onKeyDown + * @description "keydown" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onKeyDown: function (p_oEvent) { + + var oMenu = this._menu; + + + if (this.get("type") == "split" && + this._isSplitButtonOptionKey(p_oEvent)) { + + this.fireEvent("option", p_oEvent); + + } + else if (this._isActivationKey(Event.getCharCode(p_oEvent))) { + + if (this.get("type") == "menu") { + + this._showMenu(p_oEvent); + + } + else { + + this._activationKeyPressed = true; + + this.addStateCSSClasses("active"); + + } + + } + + + if (oMenu && oMenu.cfg.getProperty("visible") && + Event.getCharCode(p_oEvent) == 27) { + + oMenu.hide(); + this.focus(); + + } + + }, + + + /** + * @method _onKeyUp + * @description "keyup" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onKeyUp: function (p_oEvent) { + + var sType; + + if (this._isActivationKey(Event.getCharCode(p_oEvent))) { + + sType = this.get("type"); + + if (sType == "checkbox" || sType == "radio") { + + this.set("checked", !(this.get("checked"))); + + } + + this._activationKeyPressed = false; + + if (this.get("type") != "menu") { + + this.removeStateCSSClasses("active"); + + } + + } + + }, + + + /** + * @method _onClick + * @description "click" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onClick: function (p_oEvent) { + + var sType = this.get("type"), + sTitle, + oForm, + oSrcElement, + bReturnVal; + + + switch (sType) { + + case "radio": + case "checkbox": + + if (!this._hasDefaultTitle) { + + if (this.get("checked")) { + + sTitle = (sType == "radio") ? + this.RADIO_CHECKED_TITLE : + this.CHECKBOX_CHECKED_TITLE; + + } + else { + + sTitle = (sType == "radio") ? + this.RADIO_DEFAULT_TITLE : + this.CHECKBOX_DEFAULT_TITLE; + + } + + this.set("title", sTitle); + + } + + break; + + case "submit": + + if (p_oEvent.returnValue !== false) { + + this.submitForm(); + + } + + break; + + case "reset": + + oForm = this.getForm(); + + if (oForm) { + + oForm.reset(); + + } + + break; + + case "menu": + + sTitle = this._menu.cfg.getProperty("visible") ? + this.MENUBUTTON_MENU_VISIBLE_TITLE : + this.MENUBUTTON_DEFAULT_TITLE; + + this.set("title", sTitle); + + break; + + case "split": + + if (Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + bReturnVal = false; + + } + else { + + this._hideMenu(); + + oSrcElement = this.get("srcelement"); + + if (oSrcElement && oSrcElement.type == "submit") { + + this.submitForm(); + + } + + } + + sTitle = this._menu.cfg.getProperty("visible") ? + this.SPLITBUTTON_OPTION_VISIBLE_TITLE : + this.SPLITBUTTON_DEFAULT_TITLE; + + this.set("title", sTitle); + + break; + + } + + return bReturnVal; + + }, + + + /** + * @method _onDblClick + * @description "dblclick" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDblClick: function (p_oEvent) { + + var bReturnVal = true; + + if (this.get("type") == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + bReturnVal = false; + + } + + return bReturnVal; + + }, + + + /** + * @method _onAppendTo + * @description "appendTo" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onAppendTo: function (p_oEvent) { + + /* + It is necessary to call "_addListenersToForm" using + "setTimeout" to make sure that the button's "form" property + returns a node reference. Sometimes, if you try to get the + reference immediately after appending the field, it is null. + */ + + Lang.later(0, this, this._addListenersToForm); + + }, + + + /** + * @method _onFormReset + * @description "reset" event handler for the button's form. + * @protected + * @param {Event} p_oEvent Object representing the DOM event + * object passed back by the event utility (YAHOO.util.Event). + */ + _onFormReset: function (p_oEvent) { + + var sType = this.get("type"), + oMenu = this._menu; + + if (sType == "checkbox" || sType == "radio") { + + this.resetValue("checked"); + + } + + + if (Menu && oMenu && (oMenu instanceof Menu)) { + + this.resetValue("selectedMenuItem"); + + } + + }, + + + /** + * @method _onFormSubmit + * @description "submit" event handler for the button's form. + * @protected + * @param {Event} p_oEvent Object representing the DOM event + * object passed back by the event utility (YAHOO.util.Event). + */ + _onFormSubmit: function (p_oEvent) { + + this.createHiddenFields(); + + }, + + + /** + * @method _onDocumentMouseDown + * @description "mousedown" event handler for the document. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDocumentMouseDown: function (p_oEvent) { + + var oTarget = Event.getTarget(p_oEvent), + oButtonElement = this.get("element"), + oMenuElement = this._menu.element; + + + if (oTarget != oButtonElement && + !Dom.isAncestor(oButtonElement, oTarget) && + oTarget != oMenuElement && + !Dom.isAncestor(oMenuElement, oTarget)) { + + this._hideMenu(); + + Event.removeListener(document, "mousedown", + this._onDocumentMouseDown); + + } + + }, + + + /** + * @method _onOption + * @description "option" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onOption: function (p_oEvent) { + + if (this.hasClass("yui-split-button-activeoption")) { + + this._hideMenu(); + + this._bOptionPressed = false; + + } + else { + + this._showMenu(p_oEvent); + + this._bOptionPressed = true; + + } + + }, + + + /** + * @method _onMenuShow + * @description "show" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + */ + _onMenuShow: function (p_sType) { + + Event.on(document, "mousedown", this._onDocumentMouseDown, + null, this); + + var sTitle, + sState; + + if (this.get("type") == "split") { + + sTitle = this.SPLITBUTTON_OPTION_VISIBLE_TITLE; + sState = "activeoption"; + + } + else { + + sTitle = this.MENUBUTTON_MENU_VISIBLE_TITLE; + sState = "active"; + + } + + this.addStateCSSClasses(sState); + this.set("title", sTitle); + + }, + + + /** + * @method _onMenuHide + * @description "hide" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + */ + _onMenuHide: function (p_sType) { + + var oMenu = this._menu, + sTitle, + sState; + + + if (this.get("type") == "split") { + + sTitle = this.SPLITBUTTON_DEFAULT_TITLE; + sState = "activeoption"; + + } + else { + + sTitle = this.MENUBUTTON_DEFAULT_TITLE; + sState = "active"; + } + + + this.removeStateCSSClasses(sState); + this.set("title", sTitle); + + + if (this.get("type") == "split") { + + this._bOptionPressed = false; + + } + + }, + + + /** + * @method _onMenuKeyDown + * @description "keydown" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + */ + _onMenuKeyDown: function (p_sType, p_aArgs) { + + var oEvent = p_aArgs[0]; + + if (Event.getCharCode(oEvent) == 27) { + + this.focus(); + + if (this.get("type") == "split") { + + this._bOptionPressed = false; + + } + + } + + }, + + + /** + * @method _onMenuRender + * @description "render" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the + * event thatwas fired. + */ + _onMenuRender: function (p_sType) { + + var oButtonElement = this.get("element"), + oButtonParent = oButtonElement.parentNode, + oMenuElement = this._menu.element; + + + if (oButtonParent != oMenuElement.parentNode) { + + oButtonParent.appendChild(oMenuElement); + + } + + this._renderedMenu = true; + + this.set("selectedMenuItem", this.get("selectedMenuItem")); + + }, + + + /** + * @method _onMenuItemSelected + * @description "selectedchange" event handler for each item in the + * button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + * @param {MenuItem} p_oItem Object representing the menu item that + * subscribed to the event. + */ + _onMenuItemSelected: function (p_sType, p_aArgs, p_oItem) { + + var bSelected = p_aArgs[0]; + + if (bSelected) { + + this.set("selectedMenuItem", p_oItem); + + } + + }, + + + /** + * @method _onMenuItemAdded + * @description "itemadded" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + * @param { + * YAHOO.widget.MenuItem} p_oItem Object representing the menu + * item that subscribed to the event. + */ + _onMenuItemAdded: function (p_sType, p_aArgs, p_oItem) { + + var oItem = p_aArgs[0]; + + oItem.cfg.subscribeToConfigEvent("selected", this._onMenuItemSelected, oItem, this); + + }, + + + /** + * @method _onMenuClick + * @description "click" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + */ + _onMenuClick: function (p_sType, p_aArgs) { + + var oItem = p_aArgs[1], + oSrcElement; + + if (oItem) { + + this.set("selectedMenuItem", oItem); + + oSrcElement = this.get("srcelement"); + + if (oSrcElement && oSrcElement.type == "submit") { + + this.submitForm(); + + } + + this._hideMenu(); + + } + + }, + + + + // Public methods + + + /** + * @method createButtonElement + * @description Creates the button's HTML elements. + * @param {String} p_sType String indicating the type of element + * to create. + * @return {HTMLElement} + */ + createButtonElement: function (p_sType) { + + var sNodeName = this.NODE_NAME, + oElement = document.createElement(sNodeName); + + oElement.innerHTML = "<" + sNodeName + " class=\"first-child\">" + + (p_sType == "link" ? "" : + "") + ""; + + return oElement; + + }, + + + /** + * @method addStateCSSClasses + * @description Appends state-specific CSS classes to the button's root + * DOM element. + */ + addStateCSSClasses: function (p_sState) { + + var sType = this.get("type"); + + if (Lang.isString(p_sState)) { + + if (p_sState != "activeoption" && p_sState != "hoveroption") { + + this.addClass(this.CSS_CLASS_NAME + ("-" + p_sState)); + + } + + this.addClass("yui-" + sType + ("-button-" + p_sState)); + + } + + }, + + + /** + * @method removeStateCSSClasses + * @description Removes state-specific CSS classes to the button's root + * DOM element. + */ + removeStateCSSClasses: function (p_sState) { + + var sType = this.get("type"); + + if (Lang.isString(p_sState)) { + + this.removeClass(this.CSS_CLASS_NAME + ("-" + p_sState)); + this.removeClass("yui-" + sType + ("-button-" + p_sState)); + + } + + }, + + + /** + * @method createHiddenFields + * @description Creates the button's hidden form field and appends it + * to its parent form. + * @return {HTMLInputElement|Array} + */ + createHiddenFields: function () { + + this.removeHiddenFields(); + + var oForm = this.getForm(), + oButtonField, + sType, + bCheckable, + oMenu, + oMenuItem, + sButtonName, + oValue, + oMenuField, + oReturnVal, + sMenuFieldName, + oMenuSrcElement, + bMenuSrcElementIsSelect = false; + + + if (oForm && !this.get("disabled")) { + + sType = this.get("type"); + bCheckable = (sType == "checkbox" || sType == "radio"); + + + if ((bCheckable && this.get("checked")) || (m_oSubmitTrigger == this)) { + + YAHOO.log("Creating hidden field.", "info", this.toString()); + + oButtonField = createInputElement((bCheckable ? sType : "hidden"), + this.get("name"), this.get("value"), this.get("checked")); + + + if (oButtonField) { + + if (bCheckable) { + + oButtonField.style.display = "none"; + + } + + oForm.appendChild(oButtonField); + + } + + } + + + oMenu = this._menu; + + + if (Menu && oMenu && (oMenu instanceof Menu)) { + + YAHOO.log("Creating hidden field for menu.", "info", this.toString()); + + oMenuItem = this.get("selectedMenuItem"); + oMenuSrcElement = oMenu.srcElement; + bMenuSrcElementIsSelect = (oMenuSrcElement && + oMenuSrcElement.nodeName.toUpperCase() == "SELECT"); + + if (oMenuItem) { + + oValue = (oMenuItem.value === null || oMenuItem.value === "") ? + oMenuItem.cfg.getProperty("text") : oMenuItem.value; + + sButtonName = this.get("name"); + + + if (bMenuSrcElementIsSelect) { + + sMenuFieldName = oMenuSrcElement.name; + + } + else if (sButtonName) { + + sMenuFieldName = (sButtonName + "_options"); + + } + + + if (oValue && sMenuFieldName) { + + oMenuField = createInputElement("hidden", sMenuFieldName, oValue); + oForm.appendChild(oMenuField); + + } + + } + else if (bMenuSrcElementIsSelect) { + + oForm.appendChild(oMenuSrcElement); + + } + + } + + + if (oButtonField && oMenuField) { + + this._hiddenFields = [oButtonField, oMenuField]; + + } + else if (!oButtonField && oMenuField) { + + this._hiddenFields = oMenuField; + + } + else if (oButtonField && !oMenuField) { + + this._hiddenFields = oButtonField; + + } + + oReturnVal = this._hiddenFields; + + } + + return oReturnVal; + + }, + + + /** + * @method removeHiddenFields + * @description Removes the button's hidden form field(s) from its + * parent form. + */ + removeHiddenFields: function () { + + var oField = this._hiddenFields, + nFields, + i; + + function removeChild(p_oElement) { + + if (Dom.inDocument(p_oElement)) { + + p_oElement.parentNode.removeChild(p_oElement); + + } + + } + + + if (oField) { + + if (Lang.isArray(oField)) { + + nFields = oField.length; + + if (nFields > 0) { + + i = nFields - 1; + + do { + + removeChild(oField[i]); + + } + while (i--); + + } + + } + else { + + removeChild(oField); + + } + + this._hiddenFields = null; + + } + + }, + + + /** + * @method submitForm + * @description Submits the form to which the button belongs. Returns + * true if the form was submitted successfully, false if the submission + * was cancelled. + * @protected + * @return {Boolean} + */ + submitForm: function () { + + var oForm = this.getForm(), + + oSrcElement = this.get("srcelement"), + + /* + Boolean indicating if the event fired successfully + (was not cancelled by any handlers) + */ + + bSubmitForm = false, + + oEvent; + + + if (oForm) { + + if (this.get("type") == "submit" || (oSrcElement && oSrcElement.type == "submit")) { + + m_oSubmitTrigger = this; + + } + + + if (UA.ie) { + + bSubmitForm = oForm.fireEvent("onsubmit"); + + } + else { // Gecko, Opera, and Safari + + oEvent = document.createEvent("HTMLEvents"); + oEvent.initEvent("submit", true, true); + + bSubmitForm = oForm.dispatchEvent(oEvent); + + } + + + /* + In IE and Safari, dispatching a "submit" event to a form + WILL cause the form's "submit" event to fire, but WILL NOT + submit the form. Therefore, we need to call the "submit" + method as well. + */ + + if ((UA.ie || UA.webkit) && bSubmitForm) { + + oForm.submit(); + + } + + } + + return bSubmitForm; + + }, + + + /** + * @method init + * @description The Button class's initialization method. + * @param {String} p_oElement String specifying the id attribute of the + * <input>, <button>, + * <a>, or <span> element to + * be used to create the button. + * @param {HTMLInputElement|HTMLButtonElement| + * HTMLElement} p_oElement Object reference for the + * <input>, <button>, + * <a>, or <span> element to be + * used to create the button. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button. + * @param {Object} p_oAttributes Optional. Object literal specifying a + * set of configuration attributes used to create the button. + */ + init: function (p_oElement, p_oAttributes) { + + var sNodeName = p_oAttributes.type == "link" ? "a" : "button", + oSrcElement = p_oAttributes.srcelement, + oButton = p_oElement.getElementsByTagName(sNodeName)[0], + oInput; + + + if (!oButton) { + + oInput = p_oElement.getElementsByTagName("input")[0]; + + + if (oInput) { + + oButton = document.createElement("button"); + oButton.setAttribute("type", "button"); + + oInput.parentNode.replaceChild(oButton, oInput); + + } + + } + + this._button = oButton; + + /* + Capture if the button has a value for the title attribute. If so, we won't + override it for type of "checkbox" or "radio". + */ + + this._hasDefaultTitle = (p_oAttributes.title && p_oAttributes.title.length > 0); + + YAHOO.widget.Button.superclass.init.call(this, p_oElement, p_oAttributes); + + + var sId = this.get("id"), + sButtonId = sId + "-button"; + + + oButton.id = sButtonId; + + + var aLabels, + oLabel; + + + var hasLabel = function (element) { + + return (element.htmlFor === sId); + + }; + + + var setLabel = function () { + + oLabel.setAttribute((UA.ie ? "htmlFor" : "for"), sButtonId); + + }; + + + if (oSrcElement && this.get("type") != "link") { + + aLabels = Dom.getElementsBy(hasLabel, "label"); + + if (Lang.isArray(aLabels) && aLabels.length > 0) { + + oLabel = aLabels[0]; + + } + + } + + + m_oButtons[sId] = this; + + + this.addClass(this.CSS_CLASS_NAME); + this.addClass("yui-" + this.get("type") + "-button"); + + Event.on(this._button, "focus", this._onFocus, null, this); + this.on("mouseover", this._onMouseOver); + this.on("mousedown", this._onMouseDown); + this.on("mouseup", this._onMouseUp); + this.on("click", this._onClick); + this.on("dblclick", this._onDblClick); + + if (oLabel) { + + this.on("appendTo", setLabel); + + } + + this.on("appendTo", this._onAppendTo); + + + + var oContainer = this.get("container"), + oElement = this.get("element"), + bElInDoc = Dom.inDocument(oElement), + oParentNode; + + + if (oContainer) { + + if (oSrcElement && oSrcElement != oElement) { + + oParentNode = oSrcElement.parentNode; + + if (oParentNode) { + + oParentNode.removeChild(oSrcElement); + + } + + } + + if (Lang.isString(oContainer)) { + + Event.onContentReady(oContainer, this.appendTo, oContainer, this); + + } + else { + + this.on("init", function () { + + Lang.later(0, this, this.appendTo, oContainer); + + }); + + } + + } + else if (!bElInDoc && oSrcElement && oSrcElement != oElement) { + + oParentNode = oSrcElement.parentNode; + + if (oParentNode) { + + this.fireEvent("beforeAppendTo", { + type: "beforeAppendTo", + target: oParentNode + }); + + oParentNode.replaceChild(oElement, oSrcElement); + + this.fireEvent("appendTo", { + type: "appendTo", + target: oParentNode + }); + + } + + } + else if (this.get("type") != "link" && bElInDoc && oSrcElement && + oSrcElement == oElement) { + + this._addListenersToForm(); + + } + + YAHOO.log("Initialization completed.", "info", this.toString()); + + + this.fireEvent("init", { + type: "init", + target: this + }); + + }, + + + /** + * @method initAttributes + * @description Initializes all of the configuration attributes used to + * create the button. + * @param {Object} p_oAttributes Object literal specifying a set of + * configuration attributes used to create the button. + */ + initAttributes: function (p_oAttributes) { + + var oAttributes = p_oAttributes || {}; + + YAHOO.widget.Button.superclass.initAttributes.call(this, + oAttributes); + + + /** + * @attribute type + * @description String specifying the button's type. Possible + * values are: "push," "link," "submit," "reset," "checkbox," + * "radio," "menu," and "split." + * @default "push" + * @type String + */ + this.setAttributeConfig("type", { + + value: (oAttributes.type || "push"), + validator: Lang.isString, + writeOnce: true, + method: this._setType + + }); + + + /** + * @attribute label + * @description String specifying the button's text label + * or innerHTML. + * @default null + * @type String + */ + this.setAttributeConfig("label", { + + value: oAttributes.label, + validator: Lang.isString, + method: this._setLabel + + }); + + + /** + * @attribute value + * @description Object specifying the value for the button. + * @default null + * @type Object + */ + this.setAttributeConfig("value", { + + value: oAttributes.value + + }); + + + /** + * @attribute name + * @description String specifying the name for the button. + * @default null + * @type String + */ + this.setAttributeConfig("name", { + + value: oAttributes.name, + validator: Lang.isString + + }); + + + /** + * @attribute tabindex + * @description Number specifying the tabindex for the button. + * @default null + * @type Number + */ + this.setAttributeConfig("tabindex", { + + value: oAttributes.tabindex, + validator: Lang.isNumber, + method: this._setTabIndex + + }); + + + /** + * @attribute title + * @description String specifying the title for the button. + * @default null + * @type String + */ + this.configureAttribute("title", { + + value: oAttributes.title, + validator: Lang.isString, + method: this._setTitle + + }); + + + /** + * @attribute disabled + * @description Boolean indicating if the button should be disabled. + * (Disabled buttons are dimmed and will not respond to user input + * or fire events. Does not apply to button's of type "link.") + * @default false + * @type Boolean + */ + this.setAttributeConfig("disabled", { + + value: (oAttributes.disabled || false), + validator: Lang.isBoolean, + method: this._setDisabled + + }); + + + /** + * @attribute href + * @description String specifying the href for the button. Applies + * only to buttons of type "link." + * @type String + */ + this.setAttributeConfig("href", { + + value: oAttributes.href, + validator: Lang.isString, + method: this._setHref + + }); + + + /** + * @attribute target + * @description String specifying the target for the button. + * Applies only to buttons of type "link." + * @type String + */ + this.setAttributeConfig("target", { + + value: oAttributes.target, + validator: Lang.isString, + method: this._setTarget + + }); + + + /** + * @attribute checked + * @description Boolean indicating if the button is checked. + * Applies only to buttons of type "radio" and "checkbox." + * @default false + * @type Boolean + */ + this.setAttributeConfig("checked", { + + value: (oAttributes.checked || false), + validator: Lang.isBoolean, + method: this._setChecked + + }); + + + /** + * @attribute container + * @description HTML element reference or string specifying the id + * attribute of the HTML element that the button's markup should be + * rendered into. + * @type HTMLElement|String + * @default null + */ + this.setAttributeConfig("container", { + + value: oAttributes.container, + writeOnce: true + + }); + + + /** + * @attribute srcelement + * @description Object reference to the HTML element (either + * <input> or <span>) + * used to create the button. + * @type HTMLElement|String + * @default null + */ + this.setAttributeConfig("srcelement", { + + value: oAttributes.srcelement, + writeOnce: true + + }); + + + /** + * @attribute menu + * @description Object specifying the menu for the button. + * The value can be one of the following: + *
      + *
    • Object specifying a + * YAHOO.widget.Menu instance.
    • + *
    • Object specifying a + * YAHOO.widget.Overlay instance.
    • + *
    • String specifying the id attribute of the <div> + * element used to create the menu. By default the menu + * will be created as an instance of + * YAHOO.widget.Overlay. + * If the + * default CSS class name for YAHOO.widget.Menu is applied to + * the <div> element, it will be created as an + * instance of YAHOO.widget.Menu + * .
    • String specifying the id attribute of the + * <select> element used to create the menu. + *
    • Object specifying the <div> element + * used to create the menu.
    • + *
    • Object specifying the <select> element + * used to create the menu.
    • + *
    • Array of object literals, each representing a set of + * YAHOO.widget.MenuItem + * configuration attributes.
    • + *
    • Array of strings representing the text labels for each menu + * item in the menu.
    • + *
    + * @type YAHOO.widget.Menu|YAHOO.widget.Overlay|HTMLElement|String|Array + * @default null + */ + this.setAttributeConfig("menu", { + + value: null, + method: this._setMenu, + writeOnce: true + + }); + + + /** + * @attribute lazyloadmenu + * @description Boolean indicating the value to set for the + * "lazyload" + * configuration property of the button's menu. Setting + * "lazyloadmenu" to true will defer rendering of + * the button's menu until the first time it is made visible. + * If "lazyloadmenu" is set to false, the button's + * menu will be rendered immediately if the button is in the + * document, or in response to the button's "appendTo" event if + * the button is not yet in the document. In either case, the + * menu is rendered into the button's parent HTML element. + * This attribute does not apply if a + * YAHOO.widget.Menu or + * YAHOO.widget.Overlay + * instance is passed as the value of the button's "menu" + * configuration attribute. + * YAHOO.widget.Menu or + * YAHOO.widget.Overlay instances should be rendered before + * being set as the value for the "menu" configuration + * attribute. + * @default true + * @type Boolean + */ + this.setAttributeConfig("lazyloadmenu", { + + value: (oAttributes.lazyloadmenu === false ? false : true), + validator: Lang.isBoolean, + writeOnce: true + + }); + + + /** + * @attribute menuclassname + * @description String representing the CSS class name to be + * applied to the root element of the button's menu. + * @type String + * @default "yui-button-menu" + */ + this.setAttributeConfig("menuclassname", { + + value: (oAttributes.menuclassname || "yui-button-menu"), + validator: Lang.isString, + method: this._setMenuClassName, + writeOnce: true + + }); + + + /** + * @attribute menuminscrollheight + * @description Number defining the minimum threshold for the "menumaxheight" + * configuration attribute. When set this attribute is automatically applied + * to all submenus. + * @default 90 + * @type Number + */ + this.setAttributeConfig("menuminscrollheight", { + + value: (oAttributes.menuminscrollheight || 90), + validator: Lang.isNumber + + }); + + + /** + * @attribute menumaxheight + * @description Number defining the maximum height (in pixels) for a menu's + * body element (<div class="bd"<). Once a menu's body + * exceeds this height, the contents of the body are scrolled to maintain + * this value. This value cannot be set lower than the value of the + * "minscrollheight" configuration property. + * @type Number + * @default 0 + */ + this.setAttributeConfig("menumaxheight", { + + value: (oAttributes.menumaxheight || 0), + validator: Lang.isNumber + + }); + + + /** + * @attribute menualignment + * @description Array defining how the Button's Menu is aligned to the Button. + * The default value of ["tl", "bl"] aligns the Menu's top left corner to the Button's + * bottom left corner. + * @type Array + * @default ["tl", "bl"] + */ + this.setAttributeConfig("menualignment", { + + value: (oAttributes.menualignment || ["tl", "bl"]), + validator: Lang.isArray + + }); + + + /** + * @attribute selectedMenuItem + * @description Object representing the item in the button's menu + * that is currently selected. + * @type Number + * @default null + */ + this.setAttributeConfig("selectedMenuItem", { + + value: null, + method: this._setSelectedMenuItem + + }); + + + /** + * @attribute onclick + * @description Object literal representing the code to be executed + * when the button is clicked. Format:
    {
    + * fn: Function, // The handler to call + * when the event fires.
    obj: Object, + * // An object to pass back to the handler.
    + * scope: Object // The object to use + * for the scope of the handler.
    }
    + * @type Object + * @default null + */ + this.setAttributeConfig("onclick", { + + value: oAttributes.onclick, + method: this._setOnClick + + }); + + + /** + * @attribute focusmenu + * @description Boolean indicating whether or not the button's menu + * should be focused when it is made visible. + * @type Boolean + * @default true + */ + this.setAttributeConfig("focusmenu", { + + value: (oAttributes.focusmenu === false ? false : true), + validator: Lang.isBoolean + + }); + + }, + + + /** + * @method focus + * @description Causes the button to receive the focus and fires the + * button's "focus" event. + */ + focus: function () { + + if (!this.get("disabled")) { + + this._button.focus(); + + } + + }, + + + /** + * @method blur + * @description Causes the button to lose focus and fires the button's + * "blur" event. + */ + blur: function () { + + if (!this.get("disabled")) { + + this._button.blur(); + + } + + }, + + + /** + * @method hasFocus + * @description Returns a boolean indicating whether or not the button + * has focus. + * @return {Boolean} + */ + hasFocus: function () { + + return (m_oFocusedButton == this); + + }, + + + /** + * @method isActive + * @description Returns a boolean indicating whether or not the button + * is active. + * @return {Boolean} + */ + isActive: function () { + + return this.hasClass(this.CSS_CLASS_NAME + "-active"); + + }, + + + /** + * @method getMenu + * @description Returns a reference to the button's menu. + * @return { + * YAHOO.widget.Overlay|YAHOO.widget.Menu} + */ + getMenu: function () { + + return this._menu; + + }, + + + /** + * @method getForm + * @description Returns a reference to the button's parent form. + * @return {HTMLFormElement} + */ + getForm: function () { + + var oButton = this._button, + oForm; + + if (oButton) { + + oForm = oButton.form; + + } + + return oForm; + + }, + + + /** + * @method getHiddenFields + * @description Returns an <input> element or + * array of form elements used to represent the button when its parent + * form is submitted. + * @return {HTMLInputElement|Array} + */ + getHiddenFields: function () { + + return this._hiddenFields; + + }, + + + /** + * @method destroy + * @description Removes the button's element from its parent element and + * removes all event handlers. + */ + destroy: function () { + + YAHOO.log("Destroying ...", "info", this.toString()); + + var oElement = this.get("element"), + oParentNode = oElement.parentNode, + oMenu = this._menu, + aButtons; + + if (oMenu) { + + YAHOO.log("Destroying menu.", "info", this.toString()); + + if (m_oOverlayManager && m_oOverlayManager.find(oMenu)) { + + m_oOverlayManager.remove(oMenu); + + } + + oMenu.destroy(); + + } + + YAHOO.log("Removing DOM event listeners.", "info", this.toString()); + + Event.purgeElement(oElement); + Event.purgeElement(this._button); + Event.removeListener(document, "mouseup", this._onDocumentMouseUp); + Event.removeListener(document, "keyup", this._onDocumentKeyUp); + Event.removeListener(document, "mousedown", this._onDocumentMouseDown); + + + var oForm = this.getForm(); + + if (oForm) { + + Event.removeListener(oForm, "reset", this._onFormReset); + Event.removeListener(oForm, "submit", this._onFormSubmit); + + } + + YAHOO.log("Removing CustomEvent listeners.", "info", this.toString()); + + this.unsubscribeAll(); + + if (oParentNode) { + + oParentNode.removeChild(oElement); + + } + + YAHOO.log("Removing from document.", "info", this.toString()); + + delete m_oButtons[this.get("id")]; + + aButtons = Dom.getElementsByClassName(this.CSS_CLASS_NAME, + this.NODE_NAME, oForm); + + if (Lang.isArray(aButtons) && aButtons.length === 0) { + + Event.removeListener(oForm, "keypress", + YAHOO.widget.Button.onFormKeyPress); + + } + + YAHOO.log("Destroyed.", "info", this.toString()); + + }, + + + fireEvent: function (p_sType , p_aArgs) { + + var sType = arguments[0]; + + // Disabled buttons should not respond to DOM events + + if (this.DOM_EVENTS[sType] && this.get("disabled")) { + + return false; + + } + + return YAHOO.widget.Button.superclass.fireEvent.apply(this, arguments); + + }, + + + /** + * @method toString + * @description Returns a string representing the button. + * @return {String} + */ + toString: function () { + + return ("Button " + this.get("id")); + + } + + }); + + + /** + * @method YAHOO.widget.Button.onFormKeyPress + * @description "keypress" event handler for the button's form. + * @param {Event} p_oEvent Object representing the DOM event object passed + * back by the event utility (YAHOO.util.Event). + */ + YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) { + + var oTarget = Event.getTarget(p_oEvent), + nCharCode = Event.getCharCode(p_oEvent), + sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(), + sType = oTarget.type, + + /* + Boolean indicating if the form contains any enabled or + disabled YUI submit buttons + */ + + bFormContainsYUIButtons = false, + + oButton, + + oYUISubmitButton, // The form's first, enabled YUI submit button + + /* + The form's first, enabled HTML submit button that precedes any + YUI submit button + */ + + oPrecedingSubmitButton, + + oEvent; + + + function isSubmitButton(p_oElement) { + + var sId, + oSrcElement; + + switch (p_oElement.nodeName.toUpperCase()) { + + case "INPUT": + case "BUTTON": + + if (p_oElement.type == "submit" && !p_oElement.disabled) { + + if (!bFormContainsYUIButtons && !oPrecedingSubmitButton) { + + oPrecedingSubmitButton = p_oElement; + + } + + } + + break; + + + default: + + sId = p_oElement.id; + + if (sId) { + + oButton = m_oButtons[sId]; + + if (oButton) { + + bFormContainsYUIButtons = true; + + if (!oButton.get("disabled")) { + + oSrcElement = oButton.get("srcelement"); + + if (!oYUISubmitButton && (oButton.get("type") == "submit" || + (oSrcElement && oSrcElement.type == "submit"))) { + + oYUISubmitButton = oButton; + + } + + } + + } + + } + + break; + + } + + } + + + if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || + sType == "password" || sType == "checkbox" || sType == "radio" || + sType == "file")) || sNodeName == "SELECT")) { + + Dom.getElementsBy(isSubmitButton, "*", this); + + + if (oPrecedingSubmitButton) { + + /* + Need to set focus to the first enabled submit button + to make sure that IE includes its name and value + in the form's data set. + */ + + oPrecedingSubmitButton.focus(); + + } + else if (!oPrecedingSubmitButton && oYUISubmitButton) { + + /* + Need to call "preventDefault" to ensure that the form doesn't end up getting + submitted twice. + */ + + Event.preventDefault(p_oEvent); + + + if (UA.ie) { + + oYUISubmitButton.get("element").fireEvent("onclick"); + + } + else { + + oEvent = document.createEvent("HTMLEvents"); + oEvent.initEvent("click", true, true); + + + if (UA.gecko < 1.9) { + + oYUISubmitButton.fireEvent("click", oEvent); + + } + else { + + oYUISubmitButton.get("element").dispatchEvent(oEvent); + + } + + } + + } + + } + + }; + + + /** + * @method YAHOO.widget.Button.addHiddenFieldsToForm + * @description Searches the specified form and adds hidden fields for + * instances of YAHOO.widget.Button that are of type "radio," "checkbox," + * "menu," and "split." + * @param {HTMLFormElement} p_oForm Object reference + * for the form to search. + */ + YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) { + + var aButtons = Dom.getElementsByClassName( + YAHOO.widget.Button.prototype.CSS_CLASS_NAME, + "*", + p_oForm), + + nButtons = aButtons.length, + oButton, + sId, + i; + + if (nButtons > 0) { + + YAHOO.log("Form contains " + nButtons + " YUI buttons.", "info", this.toString()); + + for (i = 0; i < nButtons; i++) { + + sId = aButtons[i].id; + + if (sId) { + + oButton = m_oButtons[sId]; + + if (oButton) { + + oButton.createHiddenFields(); + + } + + } + + } + + } + + }; + + + /** + * @method YAHOO.widget.Button.getButton + * @description Returns a button with the specified id. + * @param {String} p_sId String specifying the id of the root node of the + * HTML element representing the button to be retrieved. + * @return {YAHOO.widget.Button} + */ + YAHOO.widget.Button.getButton = function (p_sId) { + + return m_oButtons[p_sId]; + + }; + + + // Events + + + /** + * @event focus + * @description Fires when the menu item receives focus. Passes back a + * single object representing the original DOM event object passed back by + * the event utility (YAHOO.util.Event) when the event was fired. See + * Element.addListener + * for more information on listening for this event. + * @type YAHOO.util.CustomEvent + */ + + + /** + * @event blur + * @description Fires when the menu item loses the input focus. Passes back + * a single object representing the original DOM event object passed back by + * the event utility (YAHOO.util.Event) when the event was fired. See + * Element.addListener for + * more information on listening for this event. + * @type YAHOO.util.CustomEvent + */ + + + /** + * @event option + * @description Fires when the user invokes the button's option. Passes + * back a single object representing the original DOM event (either + * "mousedown" or "keydown") that caused the "option" event to fire. See + * Element.addListener + * for more information on listening for this event. + * @type YAHOO.util.CustomEvent + */ + +})(); +(function () { + + // Shorthard for utilities + + var Dom = YAHOO.util.Dom, + Event = YAHOO.util.Event, + Lang = YAHOO.lang, + Button = YAHOO.widget.Button, + + // Private collection of radio buttons + + m_oButtons = {}; + + + + /** + * The ButtonGroup class creates a set of buttons that are mutually + * exclusive; checking one button in the set will uncheck all others in the + * button group. + * @param {String} p_oElement String specifying the id attribute of the + * <div> element of the button group. + * @param {HTMLDivElement} p_oElement Object + * specifying the <div> element of the button group. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button group. + * @param {Object} p_oAttributes Optional. Object literal specifying a set + * of configuration attributes used to create the button group. + * @namespace YAHOO.widget + * @class ButtonGroup + * @constructor + * @extends YAHOO.util.Element + */ + YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) { + + var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor, + sNodeName, + oElement, + sId; + + if (arguments.length == 1 && !Lang.isString(p_oElement) && + !p_oElement.nodeName) { + + if (!p_oElement.id) { + + sId = Dom.generateId(); + + p_oElement.id = sId; + + YAHOO.log("No value specified for the button group's \"id\"" + + " attribute. Setting button group id to \"" + sId + "\".", + "info"); + + } + + this.logger = new YAHOO.widget.LogWriter("ButtonGroup " + sId); + + this.logger.log("No source HTML element. Building the button " + + "group using the set of configuration attributes."); + + fnSuperClass.call(this, (this._createGroupElement()), p_oElement); + + } + else if (Lang.isString(p_oElement)) { + + oElement = Dom.get(p_oElement); + + if (oElement) { + + if (oElement.nodeName.toUpperCase() == this.NODE_NAME) { + + this.logger = + new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement); + + fnSuperClass.call(this, oElement, p_oAttributes); + + } + + } + + } + else { + + sNodeName = p_oElement.nodeName.toUpperCase(); + + if (sNodeName && sNodeName == this.NODE_NAME) { + + if (!p_oElement.id) { + + p_oElement.id = Dom.generateId(); + + YAHOO.log("No value specified for the button group's" + + " \"id\" attribute. Setting button group id " + + "to \"" + p_oElement.id + "\".", "warn"); + + } + + this.logger = + new YAHOO.widget.LogWriter("ButtonGroup " + p_oElement.id); + + fnSuperClass.call(this, p_oElement, p_oAttributes); + + } + + } + + }; + + + YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, { + + + // Protected properties + + + /** + * @property _buttons + * @description Array of buttons in the button group. + * @default null + * @protected + * @type Array + */ + _buttons: null, + + + + // Constants + + + /** + * @property NODE_NAME + * @description The name of the tag to be used for the button + * group's element. + * @default "DIV" + * @final + * @type String + */ + NODE_NAME: "DIV", + + + /** + * @property CSS_CLASS_NAME + * @description String representing the CSS class(es) to be applied + * to the button group's element. + * @default "yui-buttongroup" + * @final + * @type String + */ + CSS_CLASS_NAME: "yui-buttongroup", + + + + // Protected methods + + + /** + * @method _createGroupElement + * @description Creates the button group's element. + * @protected + * @return {HTMLDivElement} + */ + _createGroupElement: function () { + + var oElement = document.createElement(this.NODE_NAME); + + return oElement; + + }, + + + + // Protected attribute setter methods + + + /** + * @method _setDisabled + * @description Sets the value of the button groups's + * "disabled" attribute. + * @protected + * @param {Boolean} p_bDisabled Boolean indicating the value for + * the button group's "disabled" attribute. + */ + _setDisabled: function (p_bDisabled) { + + var nButtons = this.getCount(), + i; + + if (nButtons > 0) { + + i = nButtons - 1; + + do { + + this._buttons[i].set("disabled", p_bDisabled); + + } + while (i--); + + } + + }, + + + + // Protected event handlers + + + /** + * @method _onKeyDown + * @description "keydown" event handler for the button group. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onKeyDown: function (p_oEvent) { + + var oTarget = Event.getTarget(p_oEvent), + nCharCode = Event.getCharCode(p_oEvent), + sId = oTarget.parentNode.parentNode.id, + oButton = m_oButtons[sId], + nIndex = -1; + + + if (nCharCode == 37 || nCharCode == 38) { + + nIndex = (oButton.index === 0) ? + (this._buttons.length - 1) : (oButton.index - 1); + + } + else if (nCharCode == 39 || nCharCode == 40) { + + nIndex = (oButton.index === (this._buttons.length - 1)) ? + 0 : (oButton.index + 1); + + } + + + if (nIndex > -1) { + + this.check(nIndex); + this.getButton(nIndex).focus(); + + } + + }, + + + /** + * @method _onAppendTo + * @description "appendTo" event handler for the button group. + * @protected + * @param {Event} p_oEvent Object representing the event that was fired. + */ + _onAppendTo: function (p_oEvent) { + + var aButtons = this._buttons, + nButtons = aButtons.length, + i; + + for (i = 0; i < nButtons; i++) { + + aButtons[i].appendTo(this.get("element")); + + } + + }, + + + /** + * @method _onButtonCheckedChange + * @description "checkedChange" event handler for each button in the + * button group. + * @protected + * @param {Event} p_oEvent Object representing the event that was fired. + * @param {YAHOO.widget.Button} + * p_oButton Object representing the button that fired the event. + */ + _onButtonCheckedChange: function (p_oEvent, p_oButton) { + + var bChecked = p_oEvent.newValue, + oCheckedButton = this.get("checkedButton"); + + if (bChecked && oCheckedButton != p_oButton) { + + if (oCheckedButton) { + + oCheckedButton.set("checked", false, true); + + } + + this.set("checkedButton", p_oButton); + this.set("value", p_oButton.get("value")); + + } + else if (oCheckedButton && !oCheckedButton.set("checked")) { + + oCheckedButton.set("checked", true, true); + + } + + }, + + + + // Public methods + + + /** + * @method init + * @description The ButtonGroup class's initialization method. + * @param {String} p_oElement String specifying the id attribute of the + * <div> element of the button group. + * @param {HTMLDivElement} p_oElement Object + * specifying the <div> element of the button group. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button group. + * @param {Object} p_oAttributes Optional. Object literal specifying a + * set of configuration attributes used to create the button group. + */ + init: function (p_oElement, p_oAttributes) { + + this._buttons = []; + + YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, + p_oAttributes); + + this.addClass(this.CSS_CLASS_NAME); + + this.logger.log("Searching for child nodes with the class name " + + "\"yui-radio-button\" to add to the button group."); + + var aButtons = this.getElementsByClassName("yui-radio-button"); + + + if (aButtons.length > 0) { + + this.logger.log("Found " + aButtons.length + + " child nodes with the class name \"yui-radio-button.\"" + + " Attempting to add to button group."); + + this.addButtons(aButtons); + + } + + + this.logger.log("Searching for child nodes with the type of " + + " \"radio\" to add to the button group."); + + function isRadioButton(p_oElement) { + + return (p_oElement.type == "radio"); + + } + + aButtons = + Dom.getElementsBy(isRadioButton, "input", this.get("element")); + + + if (aButtons.length > 0) { + + this.logger.log("Found " + aButtons.length + " child nodes" + + " with the type of \"radio.\" Attempting to add to" + + " button group."); + + this.addButtons(aButtons); + + } + + this.on("keydown", this._onKeyDown); + this.on("appendTo", this._onAppendTo); + + + var oContainer = this.get("container"); + + if (oContainer) { + + if (Lang.isString(oContainer)) { + + Event.onContentReady(oContainer, function () { + + this.appendTo(oContainer); + + }, null, this); + + } + else { + + this.appendTo(oContainer); + + } + + } + + + this.logger.log("Initialization completed."); + + }, + + + /** + * @method initAttributes + * @description Initializes all of the configuration attributes used to + * create the button group. + * @param {Object} p_oAttributes Object literal specifying a set of + * configuration attributes used to create the button group. + */ + initAttributes: function (p_oAttributes) { + + var oAttributes = p_oAttributes || {}; + + YAHOO.widget.ButtonGroup.superclass.initAttributes.call( + this, oAttributes); + + + /** + * @attribute name + * @description String specifying the name for the button group. + * This name will be applied to each button in the button group. + * @default null + * @type String + */ + this.setAttributeConfig("name", { + + value: oAttributes.name, + validator: Lang.isString + + }); + + + /** + * @attribute disabled + * @description Boolean indicating if the button group should be + * disabled. Disabling the button group will disable each button + * in the button group. Disabled buttons are dimmed and will not + * respond to user input or fire events. + * @default false + * @type Boolean + */ + this.setAttributeConfig("disabled", { + + value: (oAttributes.disabled || false), + validator: Lang.isBoolean, + method: this._setDisabled + + }); + + + /** + * @attribute value + * @description Object specifying the value for the button group. + * @default null + * @type Object + */ + this.setAttributeConfig("value", { + + value: oAttributes.value + + }); + + + /** + * @attribute container + * @description HTML element reference or string specifying the id + * attribute of the HTML element that the button group's markup + * should be rendered into. + * @type HTMLElement|String + * @default null + */ + this.setAttributeConfig("container", { + + value: oAttributes.container, + writeOnce: true + + }); + + + /** + * @attribute checkedButton + * @description Reference for the button in the button group that + * is checked. + * @type {YAHOO.widget.Button} + * @default null + */ + this.setAttributeConfig("checkedButton", { + + value: null + + }); + + }, + + + /** + * @method addButton + * @description Adds the button to the button group. + * @param {YAHOO.widget.Button} + * p_oButton Object reference for the + * YAHOO.widget.Button instance to be added to the button group. + * @param {String} p_oButton String specifying the id attribute of the + * <input> or <span> element + * to be used to create the button to be added to the button group. + * @param {HTMLInputElement|HTMLElement} p_oButton Object reference for the + * <input> or <span> element + * to be used to create the button to be added to the button group. + * @param {Object} p_oButton Object literal specifying a set of + * YAHOO.widget.Button + * configuration attributes used to configure the button to be added to + * the button group. + * @return {YAHOO.widget.Button} + */ + addButton: function (p_oButton) { + + var oButton, + oButtonElement, + oGroupElement, + nIndex, + sButtonName, + sGroupName; + + + if (p_oButton instanceof Button && + p_oButton.get("type") == "radio") { + + oButton = p_oButton; + + } + else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) { + + p_oButton.type = "radio"; + + oButton = new Button(p_oButton); + + } + else { + + oButton = new Button(p_oButton, { type: "radio" }); + + } + + + if (oButton) { + + nIndex = this._buttons.length; + sButtonName = oButton.get("name"); + sGroupName = this.get("name"); + + oButton.index = nIndex; + + this._buttons[nIndex] = oButton; + m_oButtons[oButton.get("id")] = oButton; + + + if (sButtonName != sGroupName) { + + oButton.set("name", sGroupName); + + } + + + if (this.get("disabled")) { + + oButton.set("disabled", true); + + } + + + if (oButton.get("checked")) { + + this.set("checkedButton", oButton); + + } + + + oButtonElement = oButton.get("element"); + oGroupElement = this.get("element"); + + if (oButtonElement.parentNode != oGroupElement) { + + oGroupElement.appendChild(oButtonElement); + + } + + + oButton.on("checkedChange", + this._onButtonCheckedChange, oButton, this); + + this.logger.log("Button " + oButton.get("id") + " added."); + + } + + return oButton; + + }, + + + /** + * @method addButtons + * @description Adds the array of buttons to the button group. + * @param {Array} p_aButtons Array of + * YAHOO.widget.Button instances to be added + * to the button group. + * @param {Array} p_aButtons Array of strings specifying the id + * attribute of the <input> or <span> + * elements to be used to create the buttons to be added to the + * button group. + * @param {Array} p_aButtons Array of object references for the + * <input> or <span> elements + * to be used to create the buttons to be added to the button group. + * @param {Array} p_aButtons Array of object literals, each containing + * a set of YAHOO.widget.Button + * configuration attributes used to configure each button to be added + * to the button group. + * @return {Array} + */ + addButtons: function (p_aButtons) { + + var nButtons, + oButton, + aButtons, + i; + + if (Lang.isArray(p_aButtons)) { + + nButtons = p_aButtons.length; + aButtons = []; + + if (nButtons > 0) { + + for (i = 0; i < nButtons; i++) { + + oButton = this.addButton(p_aButtons[i]); + + if (oButton) { + + aButtons[aButtons.length] = oButton; + + } + + } + + } + + } + + return aButtons; + + }, + + + /** + * @method removeButton + * @description Removes the button at the specified index from the + * button group. + * @param {Number} p_nIndex Number specifying the index of the button + * to be removed from the button group. + */ + removeButton: function (p_nIndex) { + + var oButton = this.getButton(p_nIndex), + nButtons, + i; + + if (oButton) { + + this.logger.log("Removing button " + oButton.get("id") + "."); + + this._buttons.splice(p_nIndex, 1); + delete m_oButtons[oButton.get("id")]; + + oButton.removeListener("checkedChange", + this._onButtonCheckedChange); + + oButton.destroy(); + + + nButtons = this._buttons.length; + + if (nButtons > 0) { + + i = this._buttons.length - 1; + + do { + + this._buttons[i].index = i; + + } + while (i--); + + } + + this.logger.log("Button " + oButton.get("id") + " removed."); + + } + + }, + + + /** + * @method getButton + * @description Returns the button at the specified index. + * @param {Number} p_nIndex The index of the button to retrieve from the + * button group. + * @return {YAHOO.widget.Button} + */ + getButton: function (p_nIndex) { + + return this._buttons[p_nIndex]; + + }, + + + /** + * @method getButtons + * @description Returns an array of the buttons in the button group. + * @return {Array} + */ + getButtons: function () { + + return this._buttons; + + }, + + + /** + * @method getCount + * @description Returns the number of buttons in the button group. + * @return {Number} + */ + getCount: function () { + + return this._buttons.length; + + }, + + + /** + * @method focus + * @description Sets focus to the button at the specified index. + * @param {Number} p_nIndex Number indicating the index of the button + * to focus. + */ + focus: function (p_nIndex) { + + var oButton, + nButtons, + i; + + if (Lang.isNumber(p_nIndex)) { + + oButton = this._buttons[p_nIndex]; + + if (oButton) { + + oButton.focus(); + + } + + } + else { + + nButtons = this.getCount(); + + for (i = 0; i < nButtons; i++) { + + oButton = this._buttons[i]; + + if (!oButton.get("disabled")) { + + oButton.focus(); + break; + + } + + } + + } + + }, + + + /** + * @method check + * @description Checks the button at the specified index. + * @param {Number} p_nIndex Number indicating the index of the button + * to check. + */ + check: function (p_nIndex) { + + var oButton = this.getButton(p_nIndex); + + if (oButton) { + + oButton.set("checked", true); + + } + + }, + + + /** + * @method destroy + * @description Removes the button group's element from its parent + * element and removes all event handlers. + */ + destroy: function () { + + this.logger.log("Destroying..."); + + var nButtons = this._buttons.length, + oElement = this.get("element"), + oParentNode = oElement.parentNode, + i; + + if (nButtons > 0) { + + i = this._buttons.length - 1; + + do { + + this._buttons[i].destroy(); + + } + while (i--); + + } + + this.logger.log("Removing DOM event handlers."); + + Event.purgeElement(oElement); + + this.logger.log("Removing from document."); + + oParentNode.removeChild(oElement); + + }, + + + /** + * @method toString + * @description Returns a string representing the button group. + * @return {String} + */ + toString: function () { + + return ("ButtonGroup " + this.get("id")); + + } + + }); + +})(); +YAHOO.register("button", YAHOO.widget.Button, {version: "2.6.0", build: "1321"}); diff --git a/lib/yui/button/button-min.js b/lib/yui/button/button-min.js new file mode 100644 index 0000000000..84fb3fba4e --- /dev/null +++ b/lib/yui/button/button-min.js @@ -0,0 +1,11 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +(function(){var G=YAHOO.util.Dom,M=YAHOO.util.Event,I=YAHOO.lang,L=YAHOO.env.ua,B=YAHOO.widget.Overlay,J=YAHOO.widget.Menu,D={},K=null,E=null,C=null;function F(O,N,R,P){var S,Q;if(I.isString(O)&&I.isString(N)){if(L.ie){Q='0){U.label=Q;}}}function A(P){var O=P.attributes,N=O.srcelement,R=N.nodeName.toUpperCase(),Q=this;if(R==this.NODE_NAME){P.element=N;P.id=N.id;G.getElementsBy(function(S){switch(S.nodeName.toUpperCase()){case"BUTTON":case"A":case"INPUT":H.call(Q,S,O);break;}},"*",N);}else{switch(R){case"BUTTON":case"A":case"INPUT":H.call(this,N,O);break;}}}YAHOO.widget.Button=function(R,O){if(!B&&YAHOO.widget.Overlay){B=YAHOO.widget.Overlay;}if(!J&&YAHOO.widget.Menu){J=YAHOO.widget.Menu;}var Q=YAHOO.widget.Button.superclass.constructor,P,N;if(arguments.length==1&&!I.isString(R)&&!R.nodeName){if(!R.id){R.id=G.generateId();}Q.call(this,(this.createButtonElement(R.type)),R);}else{P={element:null,attributes:(O||{})};if(I.isString(R)){N=G.get(R);if(N){if(!P.attributes.id){P.attributes.id=R;}P.attributes.srcelement=N;A.call(this,P);if(!P.element){P.element=this.createButtonElement(P.attributes.type);}Q.call(this,P.element,P.attributes);}}else{if(R.nodeName){if(!P.attributes.id){if(R.id){P.attributes.id=R.id;}else{P.attributes.id=G.generateId();}}P.attributes.srcelement=R;A.call(this,P);if(!P.element){P.element=this.createButtonElement(P.attributes.type);}Q.call(this,P.element,P.attributes);}}}};YAHOO.extend(YAHOO.widget.Button,YAHOO.util.Element,{_button:null,_menu:null,_hiddenFields:null,_onclickAttributeValue:null,_activationKeyPressed:false,_activationButtonPressed:false,_hasKeyEventHandlers:false,_hasMouseEventHandlers:false,_nOptionRegionX:0,NODE_NAME:"SPAN",CHECK_ACTIVATION_KEYS:[32],ACTIVATION_KEYS:[13,32],OPTION_AREA_WIDTH:20,CSS_CLASS_NAME:"yui-button",RADIO_DEFAULT_TITLE:"Unchecked. Click to check.",RADIO_CHECKED_TITLE:"Checked. Click another button to uncheck",CHECKBOX_DEFAULT_TITLE:"Unchecked. Click to check.",CHECKBOX_CHECKED_TITLE:"Checked. Click to uncheck.",MENUBUTTON_DEFAULT_TITLE:"Menu collapsed. Click to expand.",MENUBUTTON_MENU_VISIBLE_TITLE:"Menu expanded. Click or press Esc to collapse.",SPLITBUTTON_DEFAULT_TITLE:("Menu collapsed. Click inside option "+"region or press down arrow key to show the menu."),SPLITBUTTON_OPTION_VISIBLE_TITLE:"Menu expanded. Press Esc to hide the menu.",SUBMIT_TITLE:"Click to submit form.",_setType:function(N){if(N=="split"){this.on("option",this._onOption);}},_setLabel:function(O){this._button.innerHTML=O;var P,N=L.gecko;if(N&&N<1.9&&G.inDocument(this.get("element"))){P=this.CSS_CLASS_NAME;this.removeClass(P);I.later(0,this,this.addClass,P);}},_setTabIndex:function(N){this._button.tabIndex=N;},_setTitle:function(O){var N=O;if(this.get("type")!="link"){if(!N){switch(this.get("type")){case"radio":N=this.RADIO_DEFAULT_TITLE;break;case"checkbox":N=this.CHECKBOX_DEFAULT_TITLE;break;case"menu":N=this.MENUBUTTON_DEFAULT_TITLE;break;case"split":N=this.SPLITBUTTON_DEFAULT_TITLE;break;case"submit":N=this.SUBMIT_TITLE;break;}}this._button.title=N;}},_setDisabled:function(N){if(this.get("type")!="link"){if(N){if(this._menu){this._menu.hide();}if(this.hasFocus()){this.blur();}this._button.setAttribute("disabled","disabled");this.addStateCSSClasses("disabled");this.removeStateCSSClasses("hover");this.removeStateCSSClasses("active");this.removeStateCSSClasses("focus");}else{this._button.removeAttribute("disabled");this.removeStateCSSClasses("disabled");}}},_setHref:function(N){if(this.get("type")=="link"){this._button.href=N;}},_setTarget:function(N){if(this.get("type")=="link"){this._button.setAttribute("target",N);}},_setChecked:function(O){var P=this.get("type"),N;if(P=="checkbox"||P=="radio"){if(O){this.addStateCSSClasses("checked");N=(P=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{this.removeStateCSSClasses("checked");N=(P=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}if(!this._hasDefaultTitle){this.set("title",N);}}},_setMenu:function(Y){var R=this.get("lazyloadmenu"),U=this.get("element"),N,a=false,b,Q,T,P,O,X,S;function Z(){b.render(U.parentNode);this.removeListener("appendTo",Z);}function W(){b.cfg.queueProperty("container",U.parentNode);this.removeListener("appendTo",W);}function V(){var c;if(b){G.addClass(b.element,this.get("menuclassname"));G.addClass(b.element,"yui-"+this.get("type")+"-button-menu");b.showEvent.subscribe(this._onMenuShow,null,this);b.hideEvent.subscribe(this._onMenuHide,null,this);b.renderEvent.subscribe(this._onMenuRender,null,this);if(J&&b instanceof J){if(R){c=this.get("container");if(c){b.cfg.queueProperty("container",c);}else{this.on("appendTo",W);}}b.cfg.queueProperty("clicktohide",false);b.keyDownEvent.subscribe(this._onMenuKeyDown,this,true);b.subscribe("click",this._onMenuClick,this,true);b.itemAddedEvent.subscribe(this._onMenuItemAdded,this,true);T=b.srcElement;if(T&&T.nodeName.toUpperCase()=="SELECT"){T.style.display="none";T.parentNode.removeChild(T);}}else{if(B&&b instanceof B){if(!K){K=new YAHOO.widget.OverlayManager(); +}K.register(b);}}this._menu=b;if(!a&&!R){if(G.inDocument(U)){b.render(U.parentNode);}else{this.on("appendTo",Z);}}}}if(B){if(J){N=J.prototype.CSS_CLASS_NAME;}if(Y&&J&&(Y instanceof J)){b=Y;P=b.getItems();O=P.length;a=true;if(O>0){S=O-1;do{X=P[S];if(X){X.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,X,this);}}while(S--);}V.call(this);}else{if(B&&Y&&(Y instanceof B)){b=Y;a=true;b.cfg.queueProperty("visible",false);V.call(this);}else{if(J&&I.isArray(Y)){b=new J(G.generateId(),{lazyload:R,itemdata:Y});this._menu=b;this.on("appendTo",V);}else{if(I.isString(Y)){Q=G.get(Y);if(Q){if(J&&G.hasClass(Q,N)||Q.nodeName.toUpperCase()=="SELECT"){b=new J(Y,{lazyload:R});V.call(this);}else{if(B){b=new B(Y,{visible:false});V.call(this);}}}}else{if(Y&&Y.nodeName){if(J&&G.hasClass(Y,N)||Y.nodeName.toUpperCase()=="SELECT"){b=new J(Y,{lazyload:R});V.call(this);}else{if(B){if(!Y.id){G.generateId(Y);}b=new B(Y,{visible:false});V.call(this);}}}}}}}}},_setOnClick:function(N){if(this._onclickAttributeValue&&(this._onclickAttributeValue!=N)){this.removeListener("click",this._onclickAttributeValue.fn);this._onclickAttributeValue=null;}if(!this._onclickAttributeValue&&I.isObject(N)&&I.isFunction(N.fn)){this.on("click",N.fn,N.obj,N.scope);this._onclickAttributeValue=N;}},_setSelectedMenuItem:function(O){var N=this._menu,P;if(J&&N&&N instanceof J){P=N.getItem(O);if(P&&!P.cfg.getProperty("selected")){P.cfg.setProperty("selected",true);}}},_isActivationKey:function(N){var S=this.get("type"),O=(S=="checkbox"||S=="radio")?this.CHECK_ACTIVATION_KEYS:this.ACTIVATION_KEYS,Q=O.length,R=false,P;if(Q>0){P=Q-1;do{if(N==O[P]){R=true;break;}}while(P--);}return R;},_isSplitButtonOptionKey:function(P){var O=(M.getCharCode(P)==40);var N=function(Q){M.preventDefault(Q);this.removeListener("keypress",N);};if(O){if(L.opera){this.on("keypress",N);}M.preventDefault(P);}return O;},_addListenersToForm:function(){var T=this.getForm(),S=YAHOO.widget.Button.onFormKeyPress,R,N,Q,P,O;if(T){M.on(T,"reset",this._onFormReset,null,this);M.on(T,"submit",this._onFormSubmit,null,this);N=this.get("srcelement");if(this.get("type")=="submit"||(N&&N.type=="submit")){Q=M.getListeners(T,"keypress");R=false;if(Q){P=Q.length;if(P>0){O=P-1;do{if(Q[O].fn==S){R=true;break;}}while(O--);}}if(!R){M.on(T,"keypress",S);}}}},_showMenu:function(R){if(YAHOO.widget.MenuManager){YAHOO.widget.MenuManager.hideVisible();}if(K){K.hideAll();}var N=this._menu,Q=this.get("menualignment"),P=this.get("focusmenu"),O;if(this._renderedMenu){N.cfg.setProperty("context",[this.get("element"),Q[0],Q[1]]);N.cfg.setProperty("preventcontextoverlap",true);N.cfg.setProperty("constraintoviewport",true);}else{N.cfg.queueProperty("context",[this.get("element"),Q[0],Q[1]]);N.cfg.queueProperty("preventcontextoverlap",true);N.cfg.queueProperty("constraintoviewport",true);}this.focus();if(J&&N&&(N instanceof J)){O=N.focus;N.focus=function(){};if(this._renderedMenu){N.cfg.setProperty("minscrollheight",this.get("menuminscrollheight"));N.cfg.setProperty("maxheight",this.get("menumaxheight"));}else{N.cfg.queueProperty("minscrollheight",this.get("menuminscrollheight"));N.cfg.queueProperty("maxheight",this.get("menumaxheight"));}N.show();N.focus=O;N.align();if(R.type=="mousedown"){M.stopPropagation(R);}if(P){N.focus();}}else{if(B&&N&&(N instanceof B)){if(!this._renderedMenu){N.render(this.get("element").parentNode);}N.show();N.align();}}},_hideMenu:function(){var N=this._menu;if(N){N.hide();}},_onMouseOver:function(O){var Q=this.get("type"),N,P;if(Q==="split"){N=this.get("element");P=(G.getX(N)+(N.offsetWidth-this.OPTION_AREA_WIDTH));this._nOptionRegionX=P;}if(!this._hasMouseEventHandlers){if(Q==="split"){this.on("mousemove",this._onMouseMove);}this.on("mouseout",this._onMouseOut);this._hasMouseEventHandlers=true;}this.addStateCSSClasses("hover");if(Q==="split"&&(M.getPageX(O)>P)){this.addStateCSSClasses("hoveroption");}if(this._activationButtonPressed){this.addStateCSSClasses("active");}if(this._bOptionPressed){this.addStateCSSClasses("activeoption");}if(this._activationButtonPressed||this._bOptionPressed){M.removeListener(document,"mouseup",this._onDocumentMouseUp);}},_onMouseMove:function(N){var O=this._nOptionRegionX;if(O){if(M.getPageX(N)>O){this.addStateCSSClasses("hoveroption");}else{this.removeStateCSSClasses("hoveroption");}}},_onMouseOut:function(N){var O=this.get("type");this.removeStateCSSClasses("hover");if(O!="menu"){this.removeStateCSSClasses("active");}if(this._activationButtonPressed||this._bOptionPressed){M.on(document,"mouseup",this._onDocumentMouseUp,null,this);}if(O==="split"&&(M.getPageX(N)>this._nOptionRegionX)){this.removeStateCSSClasses("hoveroption");}},_onDocumentMouseUp:function(P){this._activationButtonPressed=false;this._bOptionPressed=false;var Q=this.get("type"),N,O;if(Q=="menu"||Q=="split"){N=M.getTarget(P);O=this._menu.element;if(N!=O&&!G.isAncestor(O,N)){this.removeStateCSSClasses((Q=="menu"?"active":"activeoption"));this._hideMenu();}}M.removeListener(document,"mouseup",this._onDocumentMouseUp);},_onMouseDown:function(P){var Q,O=true;function N(){this._hideMenu();this.removeListener("mouseup",N);}if((P.which||P.button)==1){if(!this.hasFocus()){this.focus();}Q=this.get("type");if(Q=="split"){if(M.getPageX(P)>this._nOptionRegionX){this.fireEvent("option",P);O=false;}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}else{if(Q=="menu"){if(this.isActive()){this._hideMenu();this._activationButtonPressed=false;}else{this._showMenu(P);this._activationButtonPressed=true;}}else{this.addStateCSSClasses("active");this._activationButtonPressed=true;}}if(Q=="split"||Q=="menu"){this._hideMenuTimer=I.later(250,this,this.on,["mouseup",N]);}}return O;},_onMouseUp:function(P){var Q=this.get("type"),N=this._hideMenuTimer,O=true;if(N){N.cancel();}if(Q=="checkbox"||Q=="radio"){this.set("checked",!(this.get("checked")));}this._activationButtonPressed=false;if(Q!="menu"){this.removeStateCSSClasses("active");}if(Q=="split"&&M.getPageX(P)>this._nOptionRegionX){O=false; +}return O;},_onFocus:function(O){var N;this.addStateCSSClasses("focus");if(this._activationKeyPressed){this.addStateCSSClasses("active");}C=this;if(!this._hasKeyEventHandlers){N=this._button;M.on(N,"blur",this._onBlur,null,this);M.on(N,"keydown",this._onKeyDown,null,this);M.on(N,"keyup",this._onKeyUp,null,this);this._hasKeyEventHandlers=true;}this.fireEvent("focus",O);},_onBlur:function(N){this.removeStateCSSClasses("focus");if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}if(this._activationKeyPressed){M.on(document,"keyup",this._onDocumentKeyUp,null,this);}C=null;this.fireEvent("blur",N);},_onDocumentKeyUp:function(N){if(this._isActivationKey(M.getCharCode(N))){this._activationKeyPressed=false;M.removeListener(document,"keyup",this._onDocumentKeyUp);}},_onKeyDown:function(O){var N=this._menu;if(this.get("type")=="split"&&this._isSplitButtonOptionKey(O)){this.fireEvent("option",O);}else{if(this._isActivationKey(M.getCharCode(O))){if(this.get("type")=="menu"){this._showMenu(O);}else{this._activationKeyPressed=true;this.addStateCSSClasses("active");}}}if(N&&N.cfg.getProperty("visible")&&M.getCharCode(O)==27){N.hide();this.focus();}},_onKeyUp:function(N){var O;if(this._isActivationKey(M.getCharCode(N))){O=this.get("type");if(O=="checkbox"||O=="radio"){this.set("checked",!(this.get("checked")));}this._activationKeyPressed=false;if(this.get("type")!="menu"){this.removeStateCSSClasses("active");}}},_onClick:function(Q){var S=this.get("type"),N,R,O,P;switch(S){case"radio":case"checkbox":if(!this._hasDefaultTitle){if(this.get("checked")){N=(S=="radio")?this.RADIO_CHECKED_TITLE:this.CHECKBOX_CHECKED_TITLE;}else{N=(S=="radio")?this.RADIO_DEFAULT_TITLE:this.CHECKBOX_DEFAULT_TITLE;}this.set("title",N);}break;case"submit":if(Q.returnValue!==false){this.submitForm();}break;case"reset":R=this.getForm();if(R){R.reset();}break;case"menu":N=this._menu.cfg.getProperty("visible")?this.MENUBUTTON_MENU_VISIBLE_TITLE:this.MENUBUTTON_DEFAULT_TITLE;this.set("title",N);break;case"split":if(M.getPageX(Q)>this._nOptionRegionX){P=false;}else{this._hideMenu();O=this.get("srcelement");if(O&&O.type=="submit"){this.submitForm();}}N=this._menu.cfg.getProperty("visible")?this.SPLITBUTTON_OPTION_VISIBLE_TITLE:this.SPLITBUTTON_DEFAULT_TITLE;this.set("title",N);break;}return P;},_onDblClick:function(O){var N=true;if(this.get("type")=="split"&&M.getPageX(O)>this._nOptionRegionX){N=false;}return N;},_onAppendTo:function(N){I.later(0,this,this._addListenersToForm);},_onFormReset:function(O){var P=this.get("type"),N=this._menu;if(P=="checkbox"||P=="radio"){this.resetValue("checked");}if(J&&N&&(N instanceof J)){this.resetValue("selectedMenuItem");}},_onFormSubmit:function(N){this.createHiddenFields();},_onDocumentMouseDown:function(Q){var N=M.getTarget(Q),P=this.get("element"),O=this._menu.element;if(N!=P&&!G.isAncestor(P,N)&&N!=O&&!G.isAncestor(O,N)){this._hideMenu();M.removeListener(document,"mousedown",this._onDocumentMouseDown);}},_onOption:function(N){if(this.hasClass("yui-split-button-activeoption")){this._hideMenu();this._bOptionPressed=false;}else{this._showMenu(N);this._bOptionPressed=true;}},_onMenuShow:function(O){M.on(document,"mousedown",this._onDocumentMouseDown,null,this);var N,P;if(this.get("type")=="split"){N=this.SPLITBUTTON_OPTION_VISIBLE_TITLE;P="activeoption";}else{N=this.MENUBUTTON_MENU_VISIBLE_TITLE;P="active";}this.addStateCSSClasses(P);this.set("title",N);},_onMenuHide:function(P){var O=this._menu,N,Q;if(this.get("type")=="split"){N=this.SPLITBUTTON_DEFAULT_TITLE;Q="activeoption";}else{N=this.MENUBUTTON_DEFAULT_TITLE;Q="active";}this.removeStateCSSClasses(Q);this.set("title",N);if(this.get("type")=="split"){this._bOptionPressed=false;}},_onMenuKeyDown:function(P,O){var N=O[0];if(M.getCharCode(N)==27){this.focus();if(this.get("type")=="split"){this._bOptionPressed=false;}}},_onMenuRender:function(O){var Q=this.get("element"),N=Q.parentNode,P=this._menu.element;if(N!=P.parentNode){N.appendChild(P);}this._renderedMenu=true;this.set("selectedMenuItem",this.get("selectedMenuItem"));},_onMenuItemSelected:function(P,O,N){var Q=O[0];if(Q){this.set("selectedMenuItem",N);}},_onMenuItemAdded:function(P,O,N){var Q=O[0];Q.cfg.subscribeToConfigEvent("selected",this._onMenuItemSelected,Q,this);},_onMenuClick:function(O,N){var Q=N[1],P;if(Q){this.set("selectedMenuItem",Q);P=this.get("srcelement");if(P&&P.type=="submit"){this.submitForm();}this._hideMenu();}},createButtonElement:function(N){var P=this.NODE_NAME,O=document.createElement(P);O.innerHTML="<"+P+' class="first-child">'+(N=="link"?"":'')+"";return O;},addStateCSSClasses:function(N){var O=this.get("type");if(I.isString(N)){if(N!="activeoption"&&N!="hoveroption"){this.addClass(this.CSS_CLASS_NAME+("-"+N));}this.addClass("yui-"+O+("-button-"+N));}},removeStateCSSClasses:function(N){var O=this.get("type");if(I.isString(N)){this.removeClass(this.CSS_CLASS_NAME+("-"+N));this.removeClass("yui-"+O+("-button-"+N));}},createHiddenFields:function(){this.removeHiddenFields();var V=this.getForm(),Z,O,S,X,Y,T,U,N,R,W,P,Q=false;if(V&&!this.get("disabled")){O=this.get("type");S=(O=="checkbox"||O=="radio");if((S&&this.get("checked"))||(E==this)){Z=F((S?O:"hidden"),this.get("name"),this.get("value"),this.get("checked"));if(Z){if(S){Z.style.display="none";}V.appendChild(Z);}}X=this._menu;if(J&&X&&(X instanceof J)){Y=this.get("selectedMenuItem");P=X.srcElement;Q=(P&&P.nodeName.toUpperCase()=="SELECT");if(Y){U=(Y.value===null||Y.value==="")?Y.cfg.getProperty("text"):Y.value;T=this.get("name");if(Q){W=P.name;}else{if(T){W=(T+"_options");}}if(U&&W){N=F("hidden",W,U);V.appendChild(N);}}else{if(Q){V.appendChild(P);}}}if(Z&&N){this._hiddenFields=[Z,N];}else{if(!Z&&N){this._hiddenFields=N;}else{if(Z&&!N){this._hiddenFields=Z;}}}R=this._hiddenFields;}return R;},removeHiddenFields:function(){var Q=this._hiddenFields,O,P;function N(R){if(G.inDocument(R)){R.parentNode.removeChild(R);}}if(Q){if(I.isArray(Q)){O=Q.length;if(O>0){P=O-1; +do{N(Q[P]);}while(P--);}}else{N(Q);}this._hiddenFields=null;}},submitForm:function(){var Q=this.getForm(),P=this.get("srcelement"),O=false,N;if(Q){if(this.get("type")=="submit"||(P&&P.type=="submit")){E=this;}if(L.ie){O=Q.fireEvent("onsubmit");}else{N=document.createEvent("HTMLEvents");N.initEvent("submit",true,true);O=Q.dispatchEvent(N);}if((L.ie||L.webkit)&&O){Q.submit();}}return O;},init:function(O,Z){var Q=Z.type=="link"?"a":"button",V=Z.srcelement,Y=O.getElementsByTagName(Q)[0],X;if(!Y){X=O.getElementsByTagName("input")[0];if(X){Y=document.createElement("button");Y.setAttribute("type","button");X.parentNode.replaceChild(Y,X);}}this._button=Y;this._hasDefaultTitle=(Z.title&&Z.title.length>0);YAHOO.widget.Button.superclass.init.call(this,O,Z);var T=this.get("id"),N=T+"-button";Y.id=N;var U,W;var c=function(d){return(d.htmlFor===T);};var S=function(){W.setAttribute((L.ie?"htmlFor":"for"),N);};if(V&&this.get("type")!="link"){U=G.getElementsBy(c,"label");if(I.isArray(U)&&U.length>0){W=U[0];}}D[T]=this;this.addClass(this.CSS_CLASS_NAME);this.addClass("yui-"+this.get("type")+"-button");M.on(this._button,"focus",this._onFocus,null,this);this.on("mouseover",this._onMouseOver);this.on("mousedown",this._onMouseDown);this.on("mouseup",this._onMouseUp);this.on("click",this._onClick);this.on("dblclick",this._onDblClick);if(W){this.on("appendTo",S);}this.on("appendTo",this._onAppendTo);var b=this.get("container"),P=this.get("element"),a=G.inDocument(P),R;if(b){if(V&&V!=P){R=V.parentNode;if(R){R.removeChild(V);}}if(I.isString(b)){M.onContentReady(b,this.appendTo,b,this);}else{this.on("init",function(){I.later(0,this,this.appendTo,b);});}}else{if(!a&&V&&V!=P){R=V.parentNode;if(R){this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:R});R.replaceChild(P,V);this.fireEvent("appendTo",{type:"appendTo",target:R});}}else{if(this.get("type")!="link"&&a&&V&&V==P){this._addListenersToForm();}}}this.fireEvent("init",{type:"init",target:this});},initAttributes:function(O){var N=O||{};YAHOO.widget.Button.superclass.initAttributes.call(this,N);this.setAttributeConfig("type",{value:(N.type||"push"),validator:I.isString,writeOnce:true,method:this._setType});this.setAttributeConfig("label",{value:N.label,validator:I.isString,method:this._setLabel});this.setAttributeConfig("value",{value:N.value});this.setAttributeConfig("name",{value:N.name,validator:I.isString});this.setAttributeConfig("tabindex",{value:N.tabindex,validator:I.isNumber,method:this._setTabIndex});this.configureAttribute("title",{value:N.title,validator:I.isString,method:this._setTitle});this.setAttributeConfig("disabled",{value:(N.disabled||false),validator:I.isBoolean,method:this._setDisabled});this.setAttributeConfig("href",{value:N.href,validator:I.isString,method:this._setHref});this.setAttributeConfig("target",{value:N.target,validator:I.isString,method:this._setTarget});this.setAttributeConfig("checked",{value:(N.checked||false),validator:I.isBoolean,method:this._setChecked});this.setAttributeConfig("container",{value:N.container,writeOnce:true});this.setAttributeConfig("srcelement",{value:N.srcelement,writeOnce:true});this.setAttributeConfig("menu",{value:null,method:this._setMenu,writeOnce:true});this.setAttributeConfig("lazyloadmenu",{value:(N.lazyloadmenu===false?false:true),validator:I.isBoolean,writeOnce:true});this.setAttributeConfig("menuclassname",{value:(N.menuclassname||"yui-button-menu"),validator:I.isString,method:this._setMenuClassName,writeOnce:true});this.setAttributeConfig("menuminscrollheight",{value:(N.menuminscrollheight||90),validator:I.isNumber});this.setAttributeConfig("menumaxheight",{value:(N.menumaxheight||0),validator:I.isNumber});this.setAttributeConfig("menualignment",{value:(N.menualignment||["tl","bl"]),validator:I.isArray});this.setAttributeConfig("selectedMenuItem",{value:null,method:this._setSelectedMenuItem});this.setAttributeConfig("onclick",{value:N.onclick,method:this._setOnClick});this.setAttributeConfig("focusmenu",{value:(N.focusmenu===false?false:true),validator:I.isBoolean});},focus:function(){if(!this.get("disabled")){this._button.focus();}},blur:function(){if(!this.get("disabled")){this._button.blur();}},hasFocus:function(){return(C==this);},isActive:function(){return this.hasClass(this.CSS_CLASS_NAME+"-active");},getMenu:function(){return this._menu;},getForm:function(){var N=this._button,O;if(N){O=N.form;}return O;},getHiddenFields:function(){return this._hiddenFields;},destroy:function(){var P=this.get("element"),O=P.parentNode,N=this._menu,R;if(N){if(K&&K.find(N)){K.remove(N);}N.destroy();}M.purgeElement(P);M.purgeElement(this._button);M.removeListener(document,"mouseup",this._onDocumentMouseUp);M.removeListener(document,"keyup",this._onDocumentKeyUp);M.removeListener(document,"mousedown",this._onDocumentMouseDown);var Q=this.getForm();if(Q){M.removeListener(Q,"reset",this._onFormReset);M.removeListener(Q,"submit",this._onFormSubmit);}this.unsubscribeAll();if(O){O.removeChild(P);}delete D[this.get("id")];R=G.getElementsByClassName(this.CSS_CLASS_NAME,this.NODE_NAME,Q);if(I.isArray(R)&&R.length===0){M.removeListener(Q,"keypress",YAHOO.widget.Button.onFormKeyPress);}},fireEvent:function(O,N){var P=arguments[0];if(this.DOM_EVENTS[P]&&this.get("disabled")){return false;}return YAHOO.widget.Button.superclass.fireEvent.apply(this,arguments);},toString:function(){return("Button "+this.get("id"));}});YAHOO.widget.Button.onFormKeyPress=function(R){var P=M.getTarget(R),S=M.getCharCode(R),Q=P.nodeName&&P.nodeName.toUpperCase(),N=P.type,T=false,V,X,O,W;function U(a){var Z,Y;switch(a.nodeName.toUpperCase()){case"INPUT":case"BUTTON":if(a.type=="submit"&&!a.disabled){if(!T&&!O){O=a;}}break;default:Z=a.id;if(Z){V=D[Z];if(V){T=true;if(!V.get("disabled")){Y=V.get("srcelement");if(!X&&(V.get("type")=="submit"||(Y&&Y.type=="submit"))){X=V;}}}}break;}}if(S==13&&((Q=="INPUT"&&(N=="text"||N=="password"||N=="checkbox"||N=="radio"||N=="file"))||Q=="SELECT")){G.getElementsBy(U,"*",this);if(O){O.focus();}else{if(!O&&X){M.preventDefault(R); +if(L.ie){X.get("element").fireEvent("onclick");}else{W=document.createEvent("HTMLEvents");W.initEvent("click",true,true);if(L.gecko<1.9){X.fireEvent("click",W);}else{X.get("element").dispatchEvent(W);}}}}}};YAHOO.widget.Button.addHiddenFieldsToForm=function(N){var S=G.getElementsByClassName(YAHOO.widget.Button.prototype.CSS_CLASS_NAME,"*",N),Q=S.length,R,O,P;if(Q>0){for(P=0;P0){F=H-1;do{this._buttons[F].set("disabled",G);}while(F--);}},_onKeyDown:function(K){var G=B.getTarget(K),I=B.getCharCode(K),H=G.parentNode.parentNode.id,J=E[H],F=-1;if(I==37||I==38){F=(J.index===0)?(this._buttons.length-1):(J.index-1);}else{if(I==39||I==40){F=(J.index===(this._buttons.length-1))?0:(J.index+1);}}if(F>-1){this.check(F);this.getButton(F).focus();}},_onAppendTo:function(H){var I=this._buttons,G=I.length,F;for(F=0;F0){this.addButtons(J);}function F(K){return(K.type=="radio");}J=C.getElementsBy(F,"input",this.get("element"));if(J.length>0){this.addButtons(J);}this.on("keydown",this._onKeyDown);this.on("appendTo",this._onAppendTo);var G=this.get("container");if(G){if(D.isString(G)){B.onContentReady(G,function(){this.appendTo(G);},null,this);}else{this.appendTo(G);}}},initAttributes:function(G){var F=G||{};YAHOO.widget.ButtonGroup.superclass.initAttributes.call(this,F);this.setAttributeConfig("name",{value:F.name,validator:D.isString});this.setAttributeConfig("disabled",{value:(F.disabled||false),validator:D.isBoolean,method:this._setDisabled});this.setAttributeConfig("value",{value:F.value});this.setAttributeConfig("container",{value:F.container,writeOnce:true});this.setAttributeConfig("checkedButton",{value:null});},addButton:function(J){var L,K,G,F,H,I;if(J instanceof A&&J.get("type")=="radio"){L=J;}else{if(!D.isString(J)&&!J.nodeName){J.type="radio";L=new A(J);}else{L=new A(J,{type:"radio"});}}if(L){F=this._buttons.length;H=L.get("name");I=this.get("name");L.index=F;this._buttons[F]=L;E[L.get("id")]=L;if(H!=I){L.set("name",I);}if(this.get("disabled")){L.set("disabled",true);}if(L.get("checked")){this.set("checkedButton",L);}K=L.get("element");G=this.get("element");if(K.parentNode!=G){G.appendChild(K);}L.on("checkedChange",this._onButtonCheckedChange,L,this);}return L;},addButtons:function(G){var H,I,J,F;if(D.isArray(G)){H=G.length;J=[];if(H>0){for(F=0;F0){F=this._buttons.length-1;do{this._buttons[F].index=F;}while(F--);}}},getButton:function(F){return this._buttons[F];},getButtons:function(){return this._buttons;},getCount:function(){return this._buttons.length;},focus:function(H){var I,G,F;if(D.isNumber(H)){I=this._buttons[H];if(I){I.focus();}}else{G=this.getCount();for(F=0;F0){G=this._buttons.length-1;do{this._buttons[G].destroy();}while(G--);}B.purgeElement(H);F.removeChild(H);},toString:function(){return("ButtonGroup "+this.get("id"));}});})();YAHOO.register("button",YAHOO.widget.Button,{version:"2.6.0",build:"1321"}); \ No newline at end of file diff --git a/lib/yui/button/button.js b/lib/yui/button/button.js new file mode 100644 index 0000000000..544faa0eb1 --- /dev/null +++ b/lib/yui/button/button.js @@ -0,0 +1,4798 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +/** +* @module button +* @description

    The Button Control enables the creation of rich, graphical +* buttons that function like traditional HTML form buttons. Unlike +* tradition HTML form buttons, buttons created with the Button Control can have +* a label that is different from its value. With the inclusion of the optional +* Menu Control, the Button Control can also be +* used to create menu buttons and split buttons, controls that are not +* available natively in HTML. The Button Control can also be thought of as a +* way to create more visually engaging implementations of the browser's +* default radio-button and check-box controls.

    +*

    The Button Control supports the following types:

    +*
    +*
    push
    +*
    Basic push button that can execute a user-specified command when +* pressed.
    +*
    link
    +*
    Navigates to a specified url when pressed.
    +*
    submit
    +*
    Submits the parent form when pressed.
    +*
    reset
    +*
    Resets the parent form when pressed.
    +*
    checkbox
    +*
    Maintains a "checked" state that can be toggled on and off.
    +*
    radio
    +*
    Maintains a "checked" state that can be toggled on and off. Use with +* the ButtonGroup class to create a set of controls that are mutually +* exclusive; checking one button in the set will uncheck all others in +* the group.
    +*
    menu
    +*
    When pressed will show/hide a menu.
    +*
    split
    +*
    Can execute a user-specified command or display a menu when pressed.
    +*
    +* @title Button +* @namespace YAHOO.widget +* @requires yahoo, dom, element, event +* @optional container, menu +*/ + + +(function () { + + + /** + * The Button class creates a rich, graphical button. + * @param {String} p_oElement String specifying the id attribute of the + * <input>, <button>, + * <a>, or <span> element to + * be used to create the button. + * @param {HTMLInputElement| + * HTMLButtonElement|HTMLElement} p_oElement Object reference for the + * <input>, <button>, + * <a>, or <span> element to be + * used to create the button. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button. + * @param {Object} p_oAttributes Optional. Object literal specifying a set + * of configuration attributes used to create the button. + * @namespace YAHOO.widget + * @class Button + * @constructor + * @extends YAHOO.util.Element + */ + + + + // Shorthard for utilities + + var Dom = YAHOO.util.Dom, + Event = YAHOO.util.Event, + Lang = YAHOO.lang, + UA = YAHOO.env.ua, + Overlay = YAHOO.widget.Overlay, + Menu = YAHOO.widget.Menu, + + + // Private member variables + + m_oButtons = {}, // Collection of all Button instances + m_oOverlayManager = null, // YAHOO.widget.OverlayManager instance + m_oSubmitTrigger = null, // The button that submitted the form + m_oFocusedButton = null; // The button that has focus + + + + // Private methods + + + + /** + * @method createInputElement + * @description Creates an <input> element of the + * specified type. + * @private + * @param {String} p_sType String specifying the type of + * <input> element to create. + * @param {String} p_sName String specifying the name of + * <input> element to create. + * @param {String} p_sValue String specifying the value of + * <input> element to create. + * @param {String} p_bChecked Boolean specifying if the + * <input> element is to be checked. + * @return {HTMLInputElement} + */ + function createInputElement(p_sType, p_sName, p_sValue, p_bChecked) { + + var oInput, + sInput; + + if (Lang.isString(p_sType) && Lang.isString(p_sName)) { + + if (UA.ie) { + + /* + For IE it is necessary to create the element with the + "type," "name," "value," and "checked" properties set all + at once. + */ + + sInput = "<input> or <a>) that + * map to Button configuration attributes and sets them into a collection + * that is passed to the Button constructor. + * @private + * @param {HTMLInputElement|HTMLAnchorElement} p_oElement Object reference to the HTML + * element (either <input> or <span> + * ) used to create the button. + * @param {Object} p_oAttributes Object reference for the collection of + * configuration attributes used to create the button. + */ + function setAttributesFromSrcElement(p_oElement, p_oAttributes) { + + var sSrcElementNodeName = p_oElement.nodeName.toUpperCase(), + me = this, + oAttribute, + oRootNode, + sText; + + + /** + * @method setAttributeFromDOMAttribute + * @description Gets the value of the specified DOM attribute and sets it + * into the collection of configuration attributes used to configure + * the button. + * @private + * @param {String} p_sAttribute String representing the name of the + * attribute to retrieve from the DOM element. + */ + function setAttributeFromDOMAttribute(p_sAttribute) { + + if (!(p_sAttribute in p_oAttributes)) { + + /* + Need to use "getAttributeNode" instead of "getAttribute" + because using "getAttribute," IE will return the innerText + of a <button> for the value attribute + rather than the value of the "value" attribute. + */ + + oAttribute = p_oElement.getAttributeNode(p_sAttribute); + + + if (oAttribute && ("value" in oAttribute)) { + + + p_oAttributes[p_sAttribute] = oAttribute.value; + + } + + } + + } + + + /** + * @method setFormElementProperties + * @description Gets the value of the attributes from the form element + * and sets them into the collection of configuration attributes used to + * configure the button. + * @private + */ + function setFormElementProperties() { + + setAttributeFromDOMAttribute("type"); + + if (p_oAttributes.type == "button") { + + p_oAttributes.type = "push"; + + } + + if (!("disabled" in p_oAttributes)) { + + p_oAttributes.disabled = p_oElement.disabled; + + } + + setAttributeFromDOMAttribute("name"); + setAttributeFromDOMAttribute("value"); + setAttributeFromDOMAttribute("title"); + + } + + + switch (sSrcElementNodeName) { + + case "A": + + p_oAttributes.type = "link"; + + setAttributeFromDOMAttribute("href"); + setAttributeFromDOMAttribute("target"); + + break; + + case "INPUT": + + setFormElementProperties(); + + if (!("checked" in p_oAttributes)) { + + p_oAttributes.checked = p_oElement.checked; + + } + + break; + + case "BUTTON": + + setFormElementProperties(); + + oRootNode = p_oElement.parentNode.parentNode; + + if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-checked")) { + + p_oAttributes.checked = true; + + } + + if (Dom.hasClass(oRootNode, this.CSS_CLASS_NAME + "-disabled")) { + + p_oAttributes.disabled = true; + + } + + p_oElement.removeAttribute("value"); + + p_oElement.setAttribute("type", "button"); + + break; + + } + + p_oElement.removeAttribute("id"); + p_oElement.removeAttribute("name"); + + if (!("tabindex" in p_oAttributes)) { + + p_oAttributes.tabindex = p_oElement.tabIndex; + + } + + if (!("label" in p_oAttributes)) { + + // Set the "label" property + + sText = sSrcElementNodeName == "INPUT" ? + p_oElement.value : p_oElement.innerHTML; + + + if (sText && sText.length > 0) { + + p_oAttributes.label = sText; + + } + + } + + } + + + /** + * @method initConfig + * @description Initializes the set of configuration attributes that are + * used to instantiate the button. + * @private + * @param {Object} Object representing the button's set of + * configuration attributes. + */ + function initConfig(p_oConfig) { + + var oAttributes = p_oConfig.attributes, + oSrcElement = oAttributes.srcelement, + sSrcElementNodeName = oSrcElement.nodeName.toUpperCase(), + me = this; + + + if (sSrcElementNodeName == this.NODE_NAME) { + + p_oConfig.element = oSrcElement; + p_oConfig.id = oSrcElement.id; + + Dom.getElementsBy(function (p_oElement) { + + switch (p_oElement.nodeName.toUpperCase()) { + + case "BUTTON": + case "A": + case "INPUT": + + setAttributesFromSrcElement.call(me, p_oElement, + oAttributes); + + break; + + } + + }, "*", oSrcElement); + + } + else { + + switch (sSrcElementNodeName) { + + case "BUTTON": + case "A": + case "INPUT": + + setAttributesFromSrcElement.call(this, oSrcElement, + oAttributes); + + break; + + } + + } + + } + + + + // Constructor + + YAHOO.widget.Button = function (p_oElement, p_oAttributes) { + + if (!Overlay && YAHOO.widget.Overlay) { + + Overlay = YAHOO.widget.Overlay; + + } + + + if (!Menu && YAHOO.widget.Menu) { + + Menu = YAHOO.widget.Menu; + + } + + + var fnSuperClass = YAHOO.widget.Button.superclass.constructor, + oConfig, + oElement; + + + if (arguments.length == 1 && !Lang.isString(p_oElement) && !p_oElement.nodeName) { + + if (!p_oElement.id) { + + p_oElement.id = Dom.generateId(); + + + } + + + fnSuperClass.call(this, (this.createButtonElement(p_oElement.type)), p_oElement); + + } + else { + + oConfig = { element: null, attributes: (p_oAttributes || {}) }; + + + if (Lang.isString(p_oElement)) { + + oElement = Dom.get(p_oElement); + + if (oElement) { + + if (!oConfig.attributes.id) { + + oConfig.attributes.id = p_oElement; + + } + + + + oConfig.attributes.srcelement = oElement; + + initConfig.call(this, oConfig); + + + if (!oConfig.element) { + + + oConfig.element = this.createButtonElement(oConfig.attributes.type); + + } + + fnSuperClass.call(this, oConfig.element, oConfig.attributes); + + } + + } + else if (p_oElement.nodeName) { + + if (!oConfig.attributes.id) { + + if (p_oElement.id) { + + oConfig.attributes.id = p_oElement.id; + + } + else { + + oConfig.attributes.id = Dom.generateId(); + + + } + + } + + + + oConfig.attributes.srcelement = p_oElement; + + initConfig.call(this, oConfig); + + + if (!oConfig.element) { + + + oConfig.element = this.createButtonElement(oConfig.attributes.type); + + } + + fnSuperClass.call(this, oConfig.element, oConfig.attributes); + + } + + } + + }; + + + + YAHOO.extend(YAHOO.widget.Button, YAHOO.util.Element, { + + + // Protected properties + + + /** + * @property _button + * @description Object reference to the button's internal + * <a> or <button> element. + * @default null + * @protected + * @type HTMLAnchorElement|HTMLButtonElement + */ + _button: null, + + + /** + * @property _menu + * @description Object reference to the button's menu. + * @default null + * @protected + * @type {YAHOO.widget.Overlay| + * YAHOO.widget.Menu} + */ + _menu: null, + + + /** + * @property _hiddenFields + * @description Object reference to the <input> + * element, or array of HTML form elements used to represent the button + * when its parent form is submitted. + * @default null + * @protected + * @type HTMLInputElement|Array + */ + _hiddenFields: null, + + + /** + * @property _onclickAttributeValue + * @description Object reference to the button's current value for the + * "onclick" configuration attribute. + * @default null + * @protected + * @type Object + */ + _onclickAttributeValue: null, + + + /** + * @property _activationKeyPressed + * @description Boolean indicating if the key(s) that toggle the button's + * "active" state have been pressed. + * @default false + * @protected + * @type Boolean + */ + _activationKeyPressed: false, + + + /** + * @property _activationButtonPressed + * @description Boolean indicating if the mouse button that toggles + * the button's "active" state has been pressed. + * @default false + * @protected + * @type Boolean + */ + _activationButtonPressed: false, + + + /** + * @property _hasKeyEventHandlers + * @description Boolean indicating if the button's "blur", "keydown" and + * "keyup" event handlers are assigned + * @default false + * @protected + * @type Boolean + */ + _hasKeyEventHandlers: false, + + + /** + * @property _hasMouseEventHandlers + * @description Boolean indicating if the button's "mouseout," + * "mousedown," and "mouseup" event handlers are assigned + * @default false + * @protected + * @type Boolean + */ + _hasMouseEventHandlers: false, + + + /** + * @property _nOptionRegionX + * @description Number representing the X coordinate of the leftmost edge of the Button's + * option region. Applies only to Buttons of type "split". + * @default 0 + * @protected + * @type Number + */ + _nOptionRegionX: 0, + + + + // Constants + + + /** + * @property NODE_NAME + * @description The name of the node to be used for the button's + * root element. + * @default "SPAN" + * @final + * @type String + */ + NODE_NAME: "SPAN", + + + /** + * @property CHECK_ACTIVATION_KEYS + * @description Array of numbers representing keys that (when pressed) + * toggle the button's "checked" attribute. + * @default [32] + * @final + * @type Array + */ + CHECK_ACTIVATION_KEYS: [32], + + + /** + * @property ACTIVATION_KEYS + * @description Array of numbers representing keys that (when presed) + * toggle the button's "active" state. + * @default [13, 32] + * @final + * @type Array + */ + ACTIVATION_KEYS: [13, 32], + + + /** + * @property OPTION_AREA_WIDTH + * @description Width (in pixels) of the area of a split button that + * when pressed will display a menu. + * @default 20 + * @final + * @type Number + */ + OPTION_AREA_WIDTH: 20, + + + /** + * @property CSS_CLASS_NAME + * @description String representing the CSS class(es) to be applied to + * the button's root element. + * @default "yui-button" + * @final + * @type String + */ + CSS_CLASS_NAME: "yui-button", + + + /** + * @property RADIO_DEFAULT_TITLE + * @description String representing the default title applied to buttons + * of type "radio." + * @default "Unchecked. Click to check." + * @final + * @type String + */ + RADIO_DEFAULT_TITLE: "Unchecked. Click to check.", + + + /** + * @property RADIO_CHECKED_TITLE + * @description String representing the title applied to buttons of + * type "radio" when checked. + * @default "Checked. Click another button to uncheck" + * @final + * @type String + */ + RADIO_CHECKED_TITLE: "Checked. Click another button to uncheck", + + + /** + * @property CHECKBOX_DEFAULT_TITLE + * @description String representing the default title applied to + * buttons of type "checkbox." + * @default "Unchecked. Click to check." + * @final + * @type String + */ + CHECKBOX_DEFAULT_TITLE: "Unchecked. Click to check.", + + + /** + * @property CHECKBOX_CHECKED_TITLE + * @description String representing the title applied to buttons of type + * "checkbox" when checked. + * @default "Checked. Click to uncheck." + * @final + * @type String + */ + CHECKBOX_CHECKED_TITLE: "Checked. Click to uncheck.", + + + /** + * @property MENUBUTTON_DEFAULT_TITLE + * @description String representing the default title applied to + * buttons of type "menu." + * @default "Menu collapsed. Click to expand." + * @final + * @type String + */ + MENUBUTTON_DEFAULT_TITLE: "Menu collapsed. Click to expand.", + + + /** + * @property MENUBUTTON_MENU_VISIBLE_TITLE + * @description String representing the title applied to buttons of type + * "menu" when the button's menu is visible. + * @default "Menu expanded. Click or press Esc to collapse." + * @final + * @type String + */ + MENUBUTTON_MENU_VISIBLE_TITLE: + "Menu expanded. Click or press Esc to collapse.", + + + /** + * @property SPLITBUTTON_DEFAULT_TITLE + * @description String representing the default title applied to + * buttons of type "split." + * @default "Menu collapsed. Click inside option region or press + * Ctrl + Shift + M to show the menu." + * @final + * @type String + */ + SPLITBUTTON_DEFAULT_TITLE: ("Menu collapsed. Click inside option " + + "region or press down arrow key to show the menu."), + + + /** + * @property SPLITBUTTON_OPTION_VISIBLE_TITLE + * @description String representing the title applied to buttons of type + * "split" when the button's menu is visible. + * @default "Menu expanded. Press Esc or Ctrl + Shift + M to hide + * the menu." + * @final + * @type String + */ + SPLITBUTTON_OPTION_VISIBLE_TITLE: + "Menu expanded. Press Esc to hide the menu.", + + + /** + * @property SUBMIT_TITLE + * @description String representing the title applied to buttons of + * type "submit." + * @default "Click to submit form." + * @final + * @type String + */ + SUBMIT_TITLE: "Click to submit form.", + + + + // Protected attribute setter methods + + + /** + * @method _setType + * @description Sets the value of the button's "type" attribute. + * @protected + * @param {String} p_sType String indicating the value for the button's + * "type" attribute. + */ + _setType: function (p_sType) { + + if (p_sType == "split") { + + this.on("option", this._onOption); + + } + + }, + + + /** + * @method _setLabel + * @description Sets the value of the button's "label" attribute. + * @protected + * @param {String} p_sLabel String indicating the value for the button's + * "label" attribute. + */ + _setLabel: function (p_sLabel) { + + this._button.innerHTML = p_sLabel; + + + /* + Remove and add the default class name from the root element + for Gecko to ensure that the button shrinkwraps to the label. + Without this the button will not be rendered at the correct + width when the label changes. The most likely cause for this + bug is button's use of the Gecko-specific CSS display type of + "-moz-inline-box" to simulate "inline-block" supported by IE, + Safari and Opera. + */ + + var sClass, + nGeckoVersion = UA.gecko; + + + if (nGeckoVersion && nGeckoVersion < 1.9 && Dom.inDocument(this.get("element"))) { + + sClass = this.CSS_CLASS_NAME; + + this.removeClass(sClass); + + Lang.later(0, this, this.addClass, sClass); + + } + + }, + + + /** + * @method _setTabIndex + * @description Sets the value of the button's "tabindex" attribute. + * @protected + * @param {Number} p_nTabIndex Number indicating the value for the + * button's "tabindex" attribute. + */ + _setTabIndex: function (p_nTabIndex) { + + this._button.tabIndex = p_nTabIndex; + + }, + + + /** + * @method _setTitle + * @description Sets the value of the button's "title" attribute. + * @protected + * @param {String} p_nTabIndex Number indicating the value for + * the button's "title" attribute. + */ + _setTitle: function (p_sTitle) { + + var sTitle = p_sTitle; + + if (this.get("type") != "link") { + + if (!sTitle) { + + switch (this.get("type")) { + + case "radio": + + sTitle = this.RADIO_DEFAULT_TITLE; + + break; + + case "checkbox": + + sTitle = this.CHECKBOX_DEFAULT_TITLE; + + break; + + case "menu": + + sTitle = this.MENUBUTTON_DEFAULT_TITLE; + + break; + + case "split": + + sTitle = this.SPLITBUTTON_DEFAULT_TITLE; + + break; + + case "submit": + + sTitle = this.SUBMIT_TITLE; + + break; + + } + + } + + this._button.title = sTitle; + + } + + }, + + + /** + * @method _setDisabled + * @description Sets the value of the button's "disabled" attribute. + * @protected + * @param {Boolean} p_bDisabled Boolean indicating the value for + * the button's "disabled" attribute. + */ + _setDisabled: function (p_bDisabled) { + + if (this.get("type") != "link") { + + if (p_bDisabled) { + + if (this._menu) { + + this._menu.hide(); + + } + + if (this.hasFocus()) { + + this.blur(); + + } + + this._button.setAttribute("disabled", "disabled"); + + this.addStateCSSClasses("disabled"); + + this.removeStateCSSClasses("hover"); + this.removeStateCSSClasses("active"); + this.removeStateCSSClasses("focus"); + + } + else { + + this._button.removeAttribute("disabled"); + + this.removeStateCSSClasses("disabled"); + + } + + } + + }, + + + /** + * @method _setHref + * @description Sets the value of the button's "href" attribute. + * @protected + * @param {String} p_sHref String indicating the value for the button's + * "href" attribute. + */ + _setHref: function (p_sHref) { + + if (this.get("type") == "link") { + + this._button.href = p_sHref; + + } + + }, + + + /** + * @method _setTarget + * @description Sets the value of the button's "target" attribute. + * @protected + * @param {String} p_sTarget String indicating the value for the button's + * "target" attribute. + */ + _setTarget: function (p_sTarget) { + + if (this.get("type") == "link") { + + this._button.setAttribute("target", p_sTarget); + + } + + }, + + + /** + * @method _setChecked + * @description Sets the value of the button's "target" attribute. + * @protected + * @param {Boolean} p_bChecked Boolean indicating the value for + * the button's "checked" attribute. + */ + _setChecked: function (p_bChecked) { + + var sType = this.get("type"), + sTitle; + + if (sType == "checkbox" || sType == "radio") { + + if (p_bChecked) { + + this.addStateCSSClasses("checked"); + + sTitle = (sType == "radio") ? + this.RADIO_CHECKED_TITLE : + this.CHECKBOX_CHECKED_TITLE; + + } + else { + + this.removeStateCSSClasses("checked"); + + sTitle = (sType == "radio") ? + this.RADIO_DEFAULT_TITLE : + this.CHECKBOX_DEFAULT_TITLE; + + } + + + if (!this._hasDefaultTitle) { + + this.set("title", sTitle); + + } + + } + + }, + + + /** + * @method _setMenu + * @description Sets the value of the button's "menu" attribute. + * @protected + * @param {Object} p_oMenu Object indicating the value for the button's + * "menu" attribute. + */ + _setMenu: function (p_oMenu) { + + var bLazyLoad = this.get("lazyloadmenu"), + oButtonElement = this.get("element"), + sMenuCSSClassName, + + /* + Boolean indicating if the value of p_oMenu is an instance + of YAHOO.widget.Menu or YAHOO.widget.Overlay. + */ + + bInstance = false, + + + oMenu, + oMenuElement, + oSrcElement, + aItems, + nItems, + oItem, + i; + + + function onAppendTo() { + + oMenu.render(oButtonElement.parentNode); + + this.removeListener("appendTo", onAppendTo); + + } + + + function setMenuContainer() { + + oMenu.cfg.queueProperty("container", oButtonElement.parentNode); + + this.removeListener("appendTo", setMenuContainer); + + } + + + function initMenu() { + + var oContainer; + + if (oMenu) { + + Dom.addClass(oMenu.element, this.get("menuclassname")); + Dom.addClass(oMenu.element, "yui-" + this.get("type") + "-button-menu"); + + oMenu.showEvent.subscribe(this._onMenuShow, null, this); + oMenu.hideEvent.subscribe(this._onMenuHide, null, this); + oMenu.renderEvent.subscribe(this._onMenuRender, null, this); + + + if (Menu && oMenu instanceof Menu) { + + if (bLazyLoad) { + + oContainer = this.get("container"); + + if (oContainer) { + + oMenu.cfg.queueProperty("container", oContainer); + + } + else { + + this.on("appendTo", setMenuContainer); + + } + + } + + oMenu.cfg.queueProperty("clicktohide", false); + + oMenu.keyDownEvent.subscribe(this._onMenuKeyDown, this, true); + oMenu.subscribe("click", this._onMenuClick, this, true); + oMenu.itemAddedEvent.subscribe(this._onMenuItemAdded, this, true); + + oSrcElement = oMenu.srcElement; + + if (oSrcElement && oSrcElement.nodeName.toUpperCase() == "SELECT") { + + oSrcElement.style.display = "none"; + oSrcElement.parentNode.removeChild(oSrcElement); + + } + + } + else if (Overlay && oMenu instanceof Overlay) { + + if (!m_oOverlayManager) { + + m_oOverlayManager = new YAHOO.widget.OverlayManager(); + + } + + m_oOverlayManager.register(oMenu); + + } + + + this._menu = oMenu; + + + if (!bInstance && !bLazyLoad) { + + if (Dom.inDocument(oButtonElement)) { + + oMenu.render(oButtonElement.parentNode); + + } + else { + + this.on("appendTo", onAppendTo); + + } + + } + + } + + } + + + if (Overlay) { + + if (Menu) { + + sMenuCSSClassName = Menu.prototype.CSS_CLASS_NAME; + + } + + if (p_oMenu && Menu && (p_oMenu instanceof Menu)) { + + oMenu = p_oMenu; + aItems = oMenu.getItems(); + nItems = aItems.length; + bInstance = true; + + + if (nItems > 0) { + + i = nItems - 1; + + do { + + oItem = aItems[i]; + + if (oItem) { + + oItem.cfg.subscribeToConfigEvent("selected", + this._onMenuItemSelected, oItem, this); + + } + + } + while (i--); + + } + + initMenu.call(this); + + } + else if (Overlay && p_oMenu && (p_oMenu instanceof Overlay)) { + + oMenu = p_oMenu; + bInstance = true; + + oMenu.cfg.queueProperty("visible", false); + + initMenu.call(this); + + } + else if (Menu && Lang.isArray(p_oMenu)) { + + oMenu = new Menu(Dom.generateId(), { lazyload: bLazyLoad, itemdata: p_oMenu }); + + this._menu = oMenu; + + this.on("appendTo", initMenu); + + } + else if (Lang.isString(p_oMenu)) { + + oMenuElement = Dom.get(p_oMenu); + + if (oMenuElement) { + + if (Menu && Dom.hasClass(oMenuElement, sMenuCSSClassName) || + oMenuElement.nodeName.toUpperCase() == "SELECT") { + + oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); + + initMenu.call(this); + + } + else if (Overlay) { + + oMenu = new Overlay(p_oMenu, { visible: false }); + + initMenu.call(this); + + } + + } + + } + else if (p_oMenu && p_oMenu.nodeName) { + + if (Menu && Dom.hasClass(p_oMenu, sMenuCSSClassName) || + p_oMenu.nodeName.toUpperCase() == "SELECT") { + + oMenu = new Menu(p_oMenu, { lazyload: bLazyLoad }); + + initMenu.call(this); + + } + else if (Overlay) { + + if (!p_oMenu.id) { + + Dom.generateId(p_oMenu); + + } + + oMenu = new Overlay(p_oMenu, { visible: false }); + + initMenu.call(this); + + } + + } + + } + + }, + + + /** + * @method _setOnClick + * @description Sets the value of the button's "onclick" attribute. + * @protected + * @param {Object} p_oObject Object indicating the value for the button's + * "onclick" attribute. + */ + _setOnClick: function (p_oObject) { + + /* + Remove any existing listeners if a "click" event handler + has already been specified. + */ + + if (this._onclickAttributeValue && + (this._onclickAttributeValue != p_oObject)) { + + this.removeListener("click", this._onclickAttributeValue.fn); + + this._onclickAttributeValue = null; + + } + + + if (!this._onclickAttributeValue && + Lang.isObject(p_oObject) && + Lang.isFunction(p_oObject.fn)) { + + this.on("click", p_oObject.fn, p_oObject.obj, p_oObject.scope); + + this._onclickAttributeValue = p_oObject; + + } + + }, + + + /** + * @method _setSelectedMenuItem + * @description Sets the value of the button's + * "selectedMenuItem" attribute. + * @protected + * @param {Number} p_nIndex Number representing the index of the item + * in the button's menu that is currently selected. + */ + _setSelectedMenuItem: function (p_nIndex) { + + var oMenu = this._menu, + oMenuItem; + + + if (Menu && oMenu && oMenu instanceof Menu) { + + oMenuItem = oMenu.getItem(p_nIndex); + + + if (oMenuItem && !oMenuItem.cfg.getProperty("selected")) { + + oMenuItem.cfg.setProperty("selected", true); + + } + + } + + }, + + + // Protected methods + + + + /** + * @method _isActivationKey + * @description Determines if the specified keycode is one that toggles + * the button's "active" state. + * @protected + * @param {Number} p_nKeyCode Number representing the keycode to + * be evaluated. + * @return {Boolean} + */ + _isActivationKey: function (p_nKeyCode) { + + var sType = this.get("type"), + aKeyCodes = (sType == "checkbox" || sType == "radio") ? + this.CHECK_ACTIVATION_KEYS : this.ACTIVATION_KEYS, + + nKeyCodes = aKeyCodes.length, + bReturnVal = false, + i; + + + if (nKeyCodes > 0) { + + i = nKeyCodes - 1; + + do { + + if (p_nKeyCode == aKeyCodes[i]) { + + bReturnVal = true; + break; + + } + + } + while (i--); + + } + + return bReturnVal; + + }, + + + /** + * @method _isSplitButtonOptionKey + * @description Determines if the specified keycode is one that toggles + * the display of the split button's menu. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + * @return {Boolean} + */ + _isSplitButtonOptionKey: function (p_oEvent) { + + var bShowMenu = (Event.getCharCode(p_oEvent) == 40); + + + var onKeyPress = function (p_oEvent) { + + Event.preventDefault(p_oEvent); + + this.removeListener("keypress", onKeyPress); + + }; + + + // Prevent the browser from scrolling the window + if (bShowMenu) { + + if (UA.opera) { + + this.on("keypress", onKeyPress); + + } + + Event.preventDefault(p_oEvent); + } + + return bShowMenu; + + }, + + + /** + * @method _addListenersToForm + * @description Adds event handlers to the button's form. + * @protected + */ + _addListenersToForm: function () { + + var oForm = this.getForm(), + onFormKeyPress = YAHOO.widget.Button.onFormKeyPress, + bHasKeyPressListener, + oSrcElement, + aListeners, + nListeners, + i; + + + if (oForm) { + + Event.on(oForm, "reset", this._onFormReset, null, this); + Event.on(oForm, "submit", this._onFormSubmit, null, this); + + oSrcElement = this.get("srcelement"); + + + if (this.get("type") == "submit" || + (oSrcElement && oSrcElement.type == "submit")) + { + + aListeners = Event.getListeners(oForm, "keypress"); + bHasKeyPressListener = false; + + if (aListeners) { + + nListeners = aListeners.length; + + if (nListeners > 0) { + + i = nListeners - 1; + + do { + + if (aListeners[i].fn == onFormKeyPress) { + + bHasKeyPressListener = true; + break; + + } + + } + while (i--); + + } + + } + + + if (!bHasKeyPressListener) { + + Event.on(oForm, "keypress", onFormKeyPress); + + } + + } + + } + + }, + + + + /** + * @method _showMenu + * @description Shows the button's menu. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event) that triggered + * the display of the menu. + */ + _showMenu: function (p_oEvent) { + + if (YAHOO.widget.MenuManager) { + YAHOO.widget.MenuManager.hideVisible(); + } + + + if (m_oOverlayManager) { + m_oOverlayManager.hideAll(); + } + + + var oMenu = this._menu, + aMenuAlignment = this.get("menualignment"), + bFocusMenu = this.get("focusmenu"), + fnFocusMethod; + + + if (this._renderedMenu) { + + oMenu.cfg.setProperty("context", + [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); + + oMenu.cfg.setProperty("preventcontextoverlap", true); + oMenu.cfg.setProperty("constraintoviewport", true); + + } + else { + + oMenu.cfg.queueProperty("context", + [this.get("element"), aMenuAlignment[0], aMenuAlignment[1]]); + + oMenu.cfg.queueProperty("preventcontextoverlap", true); + oMenu.cfg.queueProperty("constraintoviewport", true); + + } + + + /* + Refocus the Button before showing its Menu in case the call to + YAHOO.widget.MenuManager.hideVisible() resulted in another element in the + DOM being focused after another Menu was hidden. + */ + + this.focus(); + + + if (Menu && oMenu && (oMenu instanceof Menu)) { + + // Since Menus automatically focus themselves when made visible, temporarily + // replace the Menu focus method so that the value of the Button's "focusmenu" + // attribute determines if the Menu should be focus when made visible. + + fnFocusMethod = oMenu.focus; + + oMenu.focus = function () {}; + + if (this._renderedMenu) { + + oMenu.cfg.setProperty("minscrollheight", this.get("menuminscrollheight")); + oMenu.cfg.setProperty("maxheight", this.get("menumaxheight")); + + } + else { + + oMenu.cfg.queueProperty("minscrollheight", this.get("menuminscrollheight")); + oMenu.cfg.queueProperty("maxheight", this.get("menumaxheight")); + + } + + + oMenu.show(); + + oMenu.focus = fnFocusMethod; + + oMenu.align(); + + + /* + Stop the propagation of the event so that the MenuManager + doesn't blur the menu after it gets focus. + */ + + if (p_oEvent.type == "mousedown") { + Event.stopPropagation(p_oEvent); + } + + + if (bFocusMenu) { + oMenu.focus(); + } + + } + else if (Overlay && oMenu && (oMenu instanceof Overlay)) { + + if (!this._renderedMenu) { + oMenu.render(this.get("element").parentNode); + } + + oMenu.show(); + oMenu.align(); + + } + + }, + + + /** + * @method _hideMenu + * @description Hides the button's menu. + * @protected + */ + _hideMenu: function () { + + var oMenu = this._menu; + + if (oMenu) { + + oMenu.hide(); + + } + + }, + + + + + // Protected event handlers + + + /** + * @method _onMouseOver + * @description "mouseover" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseOver: function (p_oEvent) { + + var sType = this.get("type"), + oElement, + nOptionRegionX; + + + if (sType === "split") { + + oElement = this.get("element"); + nOptionRegionX = + (Dom.getX(oElement) + (oElement.offsetWidth - this.OPTION_AREA_WIDTH)); + + this._nOptionRegionX = nOptionRegionX; + + } + + + if (!this._hasMouseEventHandlers) { + + if (sType === "split") { + + this.on("mousemove", this._onMouseMove); + + } + + this.on("mouseout", this._onMouseOut); + + this._hasMouseEventHandlers = true; + + } + + + this.addStateCSSClasses("hover"); + + + if (sType === "split" && (Event.getPageX(p_oEvent) > nOptionRegionX)) { + + this.addStateCSSClasses("hoveroption"); + + } + + + if (this._activationButtonPressed) { + + this.addStateCSSClasses("active"); + + } + + + if (this._bOptionPressed) { + + this.addStateCSSClasses("activeoption"); + + } + + + if (this._activationButtonPressed || this._bOptionPressed) { + + Event.removeListener(document, "mouseup", this._onDocumentMouseUp); + + } + + }, + + + /** + * @method _onMouseMove + * @description "mousemove" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseMove: function (p_oEvent) { + + var nOptionRegionX = this._nOptionRegionX; + + if (nOptionRegionX) { + + if (Event.getPageX(p_oEvent) > nOptionRegionX) { + + this.addStateCSSClasses("hoveroption"); + + } + else { + + this.removeStateCSSClasses("hoveroption"); + + } + + } + + }, + + /** + * @method _onMouseOut + * @description "mouseout" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseOut: function (p_oEvent) { + + var sType = this.get("type"); + + this.removeStateCSSClasses("hover"); + + + if (sType != "menu") { + + this.removeStateCSSClasses("active"); + + } + + + if (this._activationButtonPressed || this._bOptionPressed) { + + Event.on(document, "mouseup", this._onDocumentMouseUp, null, this); + + } + + + if (sType === "split" && (Event.getPageX(p_oEvent) > this._nOptionRegionX)) { + + this.removeStateCSSClasses("hoveroption"); + + } + + }, + + + /** + * @method _onDocumentMouseUp + * @description "mouseup" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDocumentMouseUp: function (p_oEvent) { + + this._activationButtonPressed = false; + this._bOptionPressed = false; + + var sType = this.get("type"), + oTarget, + oMenuElement; + + if (sType == "menu" || sType == "split") { + + oTarget = Event.getTarget(p_oEvent); + oMenuElement = this._menu.element; + + if (oTarget != oMenuElement && + !Dom.isAncestor(oMenuElement, oTarget)) { + + this.removeStateCSSClasses((sType == "menu" ? + "active" : "activeoption")); + + this._hideMenu(); + + } + + } + + Event.removeListener(document, "mouseup", this._onDocumentMouseUp); + + }, + + + /** + * @method _onMouseDown + * @description "mousedown" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseDown: function (p_oEvent) { + + var sType, + bReturnVal = true; + + + function onMouseUp() { + + this._hideMenu(); + this.removeListener("mouseup", onMouseUp); + + } + + + if ((p_oEvent.which || p_oEvent.button) == 1) { + + + if (!this.hasFocus()) { + + this.focus(); + + } + + + sType = this.get("type"); + + + if (sType == "split") { + + if (Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + this.fireEvent("option", p_oEvent); + bReturnVal = false; + + } + else { + + this.addStateCSSClasses("active"); + + this._activationButtonPressed = true; + + } + + } + else if (sType == "menu") { + + if (this.isActive()) { + + this._hideMenu(); + + this._activationButtonPressed = false; + + } + else { + + this._showMenu(p_oEvent); + + this._activationButtonPressed = true; + + } + + } + else { + + this.addStateCSSClasses("active"); + + this._activationButtonPressed = true; + + } + + + + if (sType == "split" || sType == "menu") { + + this._hideMenuTimer = Lang.later(250, this, this.on, ["mouseup", onMouseUp]); + + } + + } + + return bReturnVal; + + }, + + + /** + * @method _onMouseUp + * @description "mouseup" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onMouseUp: function (p_oEvent) { + + var sType = this.get("type"), + oHideMenuTimer = this._hideMenuTimer, + bReturnVal = true; + + + if (oHideMenuTimer) { + + oHideMenuTimer.cancel(); + + } + + + if (sType == "checkbox" || sType == "radio") { + + this.set("checked", !(this.get("checked"))); + + } + + + this._activationButtonPressed = false; + + + if (sType != "menu") { + + this.removeStateCSSClasses("active"); + + } + + + if (sType == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + bReturnVal = false; + + } + + return bReturnVal; + + }, + + + /** + * @method _onFocus + * @description "focus" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onFocus: function (p_oEvent) { + + var oElement; + + this.addStateCSSClasses("focus"); + + if (this._activationKeyPressed) { + + this.addStateCSSClasses("active"); + + } + + m_oFocusedButton = this; + + + if (!this._hasKeyEventHandlers) { + + oElement = this._button; + + Event.on(oElement, "blur", this._onBlur, null, this); + Event.on(oElement, "keydown", this._onKeyDown, null, this); + Event.on(oElement, "keyup", this._onKeyUp, null, this); + + this._hasKeyEventHandlers = true; + + } + + + this.fireEvent("focus", p_oEvent); + + }, + + + /** + * @method _onBlur + * @description "blur" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onBlur: function (p_oEvent) { + + this.removeStateCSSClasses("focus"); + + if (this.get("type") != "menu") { + + this.removeStateCSSClasses("active"); + + } + + if (this._activationKeyPressed) { + + Event.on(document, "keyup", this._onDocumentKeyUp, null, this); + + } + + + m_oFocusedButton = null; + + this.fireEvent("blur", p_oEvent); + + }, + + + /** + * @method _onDocumentKeyUp + * @description "keyup" event handler for the document. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDocumentKeyUp: function (p_oEvent) { + + if (this._isActivationKey(Event.getCharCode(p_oEvent))) { + + this._activationKeyPressed = false; + + Event.removeListener(document, "keyup", this._onDocumentKeyUp); + + } + + }, + + + /** + * @method _onKeyDown + * @description "keydown" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onKeyDown: function (p_oEvent) { + + var oMenu = this._menu; + + + if (this.get("type") == "split" && + this._isSplitButtonOptionKey(p_oEvent)) { + + this.fireEvent("option", p_oEvent); + + } + else if (this._isActivationKey(Event.getCharCode(p_oEvent))) { + + if (this.get("type") == "menu") { + + this._showMenu(p_oEvent); + + } + else { + + this._activationKeyPressed = true; + + this.addStateCSSClasses("active"); + + } + + } + + + if (oMenu && oMenu.cfg.getProperty("visible") && + Event.getCharCode(p_oEvent) == 27) { + + oMenu.hide(); + this.focus(); + + } + + }, + + + /** + * @method _onKeyUp + * @description "keyup" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onKeyUp: function (p_oEvent) { + + var sType; + + if (this._isActivationKey(Event.getCharCode(p_oEvent))) { + + sType = this.get("type"); + + if (sType == "checkbox" || sType == "radio") { + + this.set("checked", !(this.get("checked"))); + + } + + this._activationKeyPressed = false; + + if (this.get("type") != "menu") { + + this.removeStateCSSClasses("active"); + + } + + } + + }, + + + /** + * @method _onClick + * @description "click" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onClick: function (p_oEvent) { + + var sType = this.get("type"), + sTitle, + oForm, + oSrcElement, + bReturnVal; + + + switch (sType) { + + case "radio": + case "checkbox": + + if (!this._hasDefaultTitle) { + + if (this.get("checked")) { + + sTitle = (sType == "radio") ? + this.RADIO_CHECKED_TITLE : + this.CHECKBOX_CHECKED_TITLE; + + } + else { + + sTitle = (sType == "radio") ? + this.RADIO_DEFAULT_TITLE : + this.CHECKBOX_DEFAULT_TITLE; + + } + + this.set("title", sTitle); + + } + + break; + + case "submit": + + if (p_oEvent.returnValue !== false) { + + this.submitForm(); + + } + + break; + + case "reset": + + oForm = this.getForm(); + + if (oForm) { + + oForm.reset(); + + } + + break; + + case "menu": + + sTitle = this._menu.cfg.getProperty("visible") ? + this.MENUBUTTON_MENU_VISIBLE_TITLE : + this.MENUBUTTON_DEFAULT_TITLE; + + this.set("title", sTitle); + + break; + + case "split": + + if (Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + bReturnVal = false; + + } + else { + + this._hideMenu(); + + oSrcElement = this.get("srcelement"); + + if (oSrcElement && oSrcElement.type == "submit") { + + this.submitForm(); + + } + + } + + sTitle = this._menu.cfg.getProperty("visible") ? + this.SPLITBUTTON_OPTION_VISIBLE_TITLE : + this.SPLITBUTTON_DEFAULT_TITLE; + + this.set("title", sTitle); + + break; + + } + + return bReturnVal; + + }, + + + /** + * @method _onDblClick + * @description "dblclick" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDblClick: function (p_oEvent) { + + var bReturnVal = true; + + if (this.get("type") == "split" && Event.getPageX(p_oEvent) > this._nOptionRegionX) { + + bReturnVal = false; + + } + + return bReturnVal; + + }, + + + /** + * @method _onAppendTo + * @description "appendTo" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onAppendTo: function (p_oEvent) { + + /* + It is necessary to call "_addListenersToForm" using + "setTimeout" to make sure that the button's "form" property + returns a node reference. Sometimes, if you try to get the + reference immediately after appending the field, it is null. + */ + + Lang.later(0, this, this._addListenersToForm); + + }, + + + /** + * @method _onFormReset + * @description "reset" event handler for the button's form. + * @protected + * @param {Event} p_oEvent Object representing the DOM event + * object passed back by the event utility (YAHOO.util.Event). + */ + _onFormReset: function (p_oEvent) { + + var sType = this.get("type"), + oMenu = this._menu; + + if (sType == "checkbox" || sType == "radio") { + + this.resetValue("checked"); + + } + + + if (Menu && oMenu && (oMenu instanceof Menu)) { + + this.resetValue("selectedMenuItem"); + + } + + }, + + + /** + * @method _onFormSubmit + * @description "submit" event handler for the button's form. + * @protected + * @param {Event} p_oEvent Object representing the DOM event + * object passed back by the event utility (YAHOO.util.Event). + */ + _onFormSubmit: function (p_oEvent) { + + this.createHiddenFields(); + + }, + + + /** + * @method _onDocumentMouseDown + * @description "mousedown" event handler for the document. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onDocumentMouseDown: function (p_oEvent) { + + var oTarget = Event.getTarget(p_oEvent), + oButtonElement = this.get("element"), + oMenuElement = this._menu.element; + + + if (oTarget != oButtonElement && + !Dom.isAncestor(oButtonElement, oTarget) && + oTarget != oMenuElement && + !Dom.isAncestor(oMenuElement, oTarget)) { + + this._hideMenu(); + + Event.removeListener(document, "mousedown", + this._onDocumentMouseDown); + + } + + }, + + + /** + * @method _onOption + * @description "option" event handler for the button. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onOption: function (p_oEvent) { + + if (this.hasClass("yui-split-button-activeoption")) { + + this._hideMenu(); + + this._bOptionPressed = false; + + } + else { + + this._showMenu(p_oEvent); + + this._bOptionPressed = true; + + } + + }, + + + /** + * @method _onMenuShow + * @description "show" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + */ + _onMenuShow: function (p_sType) { + + Event.on(document, "mousedown", this._onDocumentMouseDown, + null, this); + + var sTitle, + sState; + + if (this.get("type") == "split") { + + sTitle = this.SPLITBUTTON_OPTION_VISIBLE_TITLE; + sState = "activeoption"; + + } + else { + + sTitle = this.MENUBUTTON_MENU_VISIBLE_TITLE; + sState = "active"; + + } + + this.addStateCSSClasses(sState); + this.set("title", sTitle); + + }, + + + /** + * @method _onMenuHide + * @description "hide" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + */ + _onMenuHide: function (p_sType) { + + var oMenu = this._menu, + sTitle, + sState; + + + if (this.get("type") == "split") { + + sTitle = this.SPLITBUTTON_DEFAULT_TITLE; + sState = "activeoption"; + + } + else { + + sTitle = this.MENUBUTTON_DEFAULT_TITLE; + sState = "active"; + } + + + this.removeStateCSSClasses(sState); + this.set("title", sTitle); + + + if (this.get("type") == "split") { + + this._bOptionPressed = false; + + } + + }, + + + /** + * @method _onMenuKeyDown + * @description "keydown" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + */ + _onMenuKeyDown: function (p_sType, p_aArgs) { + + var oEvent = p_aArgs[0]; + + if (Event.getCharCode(oEvent) == 27) { + + this.focus(); + + if (this.get("type") == "split") { + + this._bOptionPressed = false; + + } + + } + + }, + + + /** + * @method _onMenuRender + * @description "render" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the + * event thatwas fired. + */ + _onMenuRender: function (p_sType) { + + var oButtonElement = this.get("element"), + oButtonParent = oButtonElement.parentNode, + oMenuElement = this._menu.element; + + + if (oButtonParent != oMenuElement.parentNode) { + + oButtonParent.appendChild(oMenuElement); + + } + + this._renderedMenu = true; + + this.set("selectedMenuItem", this.get("selectedMenuItem")); + + }, + + + /** + * @method _onMenuItemSelected + * @description "selectedchange" event handler for each item in the + * button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + * @param {MenuItem} p_oItem Object representing the menu item that + * subscribed to the event. + */ + _onMenuItemSelected: function (p_sType, p_aArgs, p_oItem) { + + var bSelected = p_aArgs[0]; + + if (bSelected) { + + this.set("selectedMenuItem", p_oItem); + + } + + }, + + + /** + * @method _onMenuItemAdded + * @description "itemadded" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + * @param { + * YAHOO.widget.MenuItem} p_oItem Object representing the menu + * item that subscribed to the event. + */ + _onMenuItemAdded: function (p_sType, p_aArgs, p_oItem) { + + var oItem = p_aArgs[0]; + + oItem.cfg.subscribeToConfigEvent("selected", this._onMenuItemSelected, oItem, this); + + }, + + + /** + * @method _onMenuClick + * @description "click" event handler for the button's menu. + * @private + * @param {String} p_sType String representing the name of the event + * that was fired. + * @param {Array} p_aArgs Array of arguments sent when the event + * was fired. + */ + _onMenuClick: function (p_sType, p_aArgs) { + + var oItem = p_aArgs[1], + oSrcElement; + + if (oItem) { + + this.set("selectedMenuItem", oItem); + + oSrcElement = this.get("srcelement"); + + if (oSrcElement && oSrcElement.type == "submit") { + + this.submitForm(); + + } + + this._hideMenu(); + + } + + }, + + + + // Public methods + + + /** + * @method createButtonElement + * @description Creates the button's HTML elements. + * @param {String} p_sType String indicating the type of element + * to create. + * @return {HTMLElement} + */ + createButtonElement: function (p_sType) { + + var sNodeName = this.NODE_NAME, + oElement = document.createElement(sNodeName); + + oElement.innerHTML = "<" + sNodeName + " class=\"first-child\">" + + (p_sType == "link" ? "" : + "") + ""; + + return oElement; + + }, + + + /** + * @method addStateCSSClasses + * @description Appends state-specific CSS classes to the button's root + * DOM element. + */ + addStateCSSClasses: function (p_sState) { + + var sType = this.get("type"); + + if (Lang.isString(p_sState)) { + + if (p_sState != "activeoption" && p_sState != "hoveroption") { + + this.addClass(this.CSS_CLASS_NAME + ("-" + p_sState)); + + } + + this.addClass("yui-" + sType + ("-button-" + p_sState)); + + } + + }, + + + /** + * @method removeStateCSSClasses + * @description Removes state-specific CSS classes to the button's root + * DOM element. + */ + removeStateCSSClasses: function (p_sState) { + + var sType = this.get("type"); + + if (Lang.isString(p_sState)) { + + this.removeClass(this.CSS_CLASS_NAME + ("-" + p_sState)); + this.removeClass("yui-" + sType + ("-button-" + p_sState)); + + } + + }, + + + /** + * @method createHiddenFields + * @description Creates the button's hidden form field and appends it + * to its parent form. + * @return {HTMLInputElement|Array} + */ + createHiddenFields: function () { + + this.removeHiddenFields(); + + var oForm = this.getForm(), + oButtonField, + sType, + bCheckable, + oMenu, + oMenuItem, + sButtonName, + oValue, + oMenuField, + oReturnVal, + sMenuFieldName, + oMenuSrcElement, + bMenuSrcElementIsSelect = false; + + + if (oForm && !this.get("disabled")) { + + sType = this.get("type"); + bCheckable = (sType == "checkbox" || sType == "radio"); + + + if ((bCheckable && this.get("checked")) || (m_oSubmitTrigger == this)) { + + + oButtonField = createInputElement((bCheckable ? sType : "hidden"), + this.get("name"), this.get("value"), this.get("checked")); + + + if (oButtonField) { + + if (bCheckable) { + + oButtonField.style.display = "none"; + + } + + oForm.appendChild(oButtonField); + + } + + } + + + oMenu = this._menu; + + + if (Menu && oMenu && (oMenu instanceof Menu)) { + + + oMenuItem = this.get("selectedMenuItem"); + oMenuSrcElement = oMenu.srcElement; + bMenuSrcElementIsSelect = (oMenuSrcElement && + oMenuSrcElement.nodeName.toUpperCase() == "SELECT"); + + if (oMenuItem) { + + oValue = (oMenuItem.value === null || oMenuItem.value === "") ? + oMenuItem.cfg.getProperty("text") : oMenuItem.value; + + sButtonName = this.get("name"); + + + if (bMenuSrcElementIsSelect) { + + sMenuFieldName = oMenuSrcElement.name; + + } + else if (sButtonName) { + + sMenuFieldName = (sButtonName + "_options"); + + } + + + if (oValue && sMenuFieldName) { + + oMenuField = createInputElement("hidden", sMenuFieldName, oValue); + oForm.appendChild(oMenuField); + + } + + } + else if (bMenuSrcElementIsSelect) { + + oForm.appendChild(oMenuSrcElement); + + } + + } + + + if (oButtonField && oMenuField) { + + this._hiddenFields = [oButtonField, oMenuField]; + + } + else if (!oButtonField && oMenuField) { + + this._hiddenFields = oMenuField; + + } + else if (oButtonField && !oMenuField) { + + this._hiddenFields = oButtonField; + + } + + oReturnVal = this._hiddenFields; + + } + + return oReturnVal; + + }, + + + /** + * @method removeHiddenFields + * @description Removes the button's hidden form field(s) from its + * parent form. + */ + removeHiddenFields: function () { + + var oField = this._hiddenFields, + nFields, + i; + + function removeChild(p_oElement) { + + if (Dom.inDocument(p_oElement)) { + + p_oElement.parentNode.removeChild(p_oElement); + + } + + } + + + if (oField) { + + if (Lang.isArray(oField)) { + + nFields = oField.length; + + if (nFields > 0) { + + i = nFields - 1; + + do { + + removeChild(oField[i]); + + } + while (i--); + + } + + } + else { + + removeChild(oField); + + } + + this._hiddenFields = null; + + } + + }, + + + /** + * @method submitForm + * @description Submits the form to which the button belongs. Returns + * true if the form was submitted successfully, false if the submission + * was cancelled. + * @protected + * @return {Boolean} + */ + submitForm: function () { + + var oForm = this.getForm(), + + oSrcElement = this.get("srcelement"), + + /* + Boolean indicating if the event fired successfully + (was not cancelled by any handlers) + */ + + bSubmitForm = false, + + oEvent; + + + if (oForm) { + + if (this.get("type") == "submit" || (oSrcElement && oSrcElement.type == "submit")) { + + m_oSubmitTrigger = this; + + } + + + if (UA.ie) { + + bSubmitForm = oForm.fireEvent("onsubmit"); + + } + else { // Gecko, Opera, and Safari + + oEvent = document.createEvent("HTMLEvents"); + oEvent.initEvent("submit", true, true); + + bSubmitForm = oForm.dispatchEvent(oEvent); + + } + + + /* + In IE and Safari, dispatching a "submit" event to a form + WILL cause the form's "submit" event to fire, but WILL NOT + submit the form. Therefore, we need to call the "submit" + method as well. + */ + + if ((UA.ie || UA.webkit) && bSubmitForm) { + + oForm.submit(); + + } + + } + + return bSubmitForm; + + }, + + + /** + * @method init + * @description The Button class's initialization method. + * @param {String} p_oElement String specifying the id attribute of the + * <input>, <button>, + * <a>, or <span> element to + * be used to create the button. + * @param {HTMLInputElement|HTMLButtonElement| + * HTMLElement} p_oElement Object reference for the + * <input>, <button>, + * <a>, or <span> element to be + * used to create the button. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button. + * @param {Object} p_oAttributes Optional. Object literal specifying a + * set of configuration attributes used to create the button. + */ + init: function (p_oElement, p_oAttributes) { + + var sNodeName = p_oAttributes.type == "link" ? "a" : "button", + oSrcElement = p_oAttributes.srcelement, + oButton = p_oElement.getElementsByTagName(sNodeName)[0], + oInput; + + + if (!oButton) { + + oInput = p_oElement.getElementsByTagName("input")[0]; + + + if (oInput) { + + oButton = document.createElement("button"); + oButton.setAttribute("type", "button"); + + oInput.parentNode.replaceChild(oButton, oInput); + + } + + } + + this._button = oButton; + + /* + Capture if the button has a value for the title attribute. If so, we won't + override it for type of "checkbox" or "radio". + */ + + this._hasDefaultTitle = (p_oAttributes.title && p_oAttributes.title.length > 0); + + YAHOO.widget.Button.superclass.init.call(this, p_oElement, p_oAttributes); + + + var sId = this.get("id"), + sButtonId = sId + "-button"; + + + oButton.id = sButtonId; + + + var aLabels, + oLabel; + + + var hasLabel = function (element) { + + return (element.htmlFor === sId); + + }; + + + var setLabel = function () { + + oLabel.setAttribute((UA.ie ? "htmlFor" : "for"), sButtonId); + + }; + + + if (oSrcElement && this.get("type") != "link") { + + aLabels = Dom.getElementsBy(hasLabel, "label"); + + if (Lang.isArray(aLabels) && aLabels.length > 0) { + + oLabel = aLabels[0]; + + } + + } + + + m_oButtons[sId] = this; + + + this.addClass(this.CSS_CLASS_NAME); + this.addClass("yui-" + this.get("type") + "-button"); + + Event.on(this._button, "focus", this._onFocus, null, this); + this.on("mouseover", this._onMouseOver); + this.on("mousedown", this._onMouseDown); + this.on("mouseup", this._onMouseUp); + this.on("click", this._onClick); + this.on("dblclick", this._onDblClick); + + if (oLabel) { + + this.on("appendTo", setLabel); + + } + + this.on("appendTo", this._onAppendTo); + + + + var oContainer = this.get("container"), + oElement = this.get("element"), + bElInDoc = Dom.inDocument(oElement), + oParentNode; + + + if (oContainer) { + + if (oSrcElement && oSrcElement != oElement) { + + oParentNode = oSrcElement.parentNode; + + if (oParentNode) { + + oParentNode.removeChild(oSrcElement); + + } + + } + + if (Lang.isString(oContainer)) { + + Event.onContentReady(oContainer, this.appendTo, oContainer, this); + + } + else { + + this.on("init", function () { + + Lang.later(0, this, this.appendTo, oContainer); + + }); + + } + + } + else if (!bElInDoc && oSrcElement && oSrcElement != oElement) { + + oParentNode = oSrcElement.parentNode; + + if (oParentNode) { + + this.fireEvent("beforeAppendTo", { + type: "beforeAppendTo", + target: oParentNode + }); + + oParentNode.replaceChild(oElement, oSrcElement); + + this.fireEvent("appendTo", { + type: "appendTo", + target: oParentNode + }); + + } + + } + else if (this.get("type") != "link" && bElInDoc && oSrcElement && + oSrcElement == oElement) { + + this._addListenersToForm(); + + } + + + + this.fireEvent("init", { + type: "init", + target: this + }); + + }, + + + /** + * @method initAttributes + * @description Initializes all of the configuration attributes used to + * create the button. + * @param {Object} p_oAttributes Object literal specifying a set of + * configuration attributes used to create the button. + */ + initAttributes: function (p_oAttributes) { + + var oAttributes = p_oAttributes || {}; + + YAHOO.widget.Button.superclass.initAttributes.call(this, + oAttributes); + + + /** + * @attribute type + * @description String specifying the button's type. Possible + * values are: "push," "link," "submit," "reset," "checkbox," + * "radio," "menu," and "split." + * @default "push" + * @type String + */ + this.setAttributeConfig("type", { + + value: (oAttributes.type || "push"), + validator: Lang.isString, + writeOnce: true, + method: this._setType + + }); + + + /** + * @attribute label + * @description String specifying the button's text label + * or innerHTML. + * @default null + * @type String + */ + this.setAttributeConfig("label", { + + value: oAttributes.label, + validator: Lang.isString, + method: this._setLabel + + }); + + + /** + * @attribute value + * @description Object specifying the value for the button. + * @default null + * @type Object + */ + this.setAttributeConfig("value", { + + value: oAttributes.value + + }); + + + /** + * @attribute name + * @description String specifying the name for the button. + * @default null + * @type String + */ + this.setAttributeConfig("name", { + + value: oAttributes.name, + validator: Lang.isString + + }); + + + /** + * @attribute tabindex + * @description Number specifying the tabindex for the button. + * @default null + * @type Number + */ + this.setAttributeConfig("tabindex", { + + value: oAttributes.tabindex, + validator: Lang.isNumber, + method: this._setTabIndex + + }); + + + /** + * @attribute title + * @description String specifying the title for the button. + * @default null + * @type String + */ + this.configureAttribute("title", { + + value: oAttributes.title, + validator: Lang.isString, + method: this._setTitle + + }); + + + /** + * @attribute disabled + * @description Boolean indicating if the button should be disabled. + * (Disabled buttons are dimmed and will not respond to user input + * or fire events. Does not apply to button's of type "link.") + * @default false + * @type Boolean + */ + this.setAttributeConfig("disabled", { + + value: (oAttributes.disabled || false), + validator: Lang.isBoolean, + method: this._setDisabled + + }); + + + /** + * @attribute href + * @description String specifying the href for the button. Applies + * only to buttons of type "link." + * @type String + */ + this.setAttributeConfig("href", { + + value: oAttributes.href, + validator: Lang.isString, + method: this._setHref + + }); + + + /** + * @attribute target + * @description String specifying the target for the button. + * Applies only to buttons of type "link." + * @type String + */ + this.setAttributeConfig("target", { + + value: oAttributes.target, + validator: Lang.isString, + method: this._setTarget + + }); + + + /** + * @attribute checked + * @description Boolean indicating if the button is checked. + * Applies only to buttons of type "radio" and "checkbox." + * @default false + * @type Boolean + */ + this.setAttributeConfig("checked", { + + value: (oAttributes.checked || false), + validator: Lang.isBoolean, + method: this._setChecked + + }); + + + /** + * @attribute container + * @description HTML element reference or string specifying the id + * attribute of the HTML element that the button's markup should be + * rendered into. + * @type HTMLElement|String + * @default null + */ + this.setAttributeConfig("container", { + + value: oAttributes.container, + writeOnce: true + + }); + + + /** + * @attribute srcelement + * @description Object reference to the HTML element (either + * <input> or <span>) + * used to create the button. + * @type HTMLElement|String + * @default null + */ + this.setAttributeConfig("srcelement", { + + value: oAttributes.srcelement, + writeOnce: true + + }); + + + /** + * @attribute menu + * @description Object specifying the menu for the button. + * The value can be one of the following: + *
      + *
    • Object specifying a + * YAHOO.widget.Menu instance.
    • + *
    • Object specifying a + * YAHOO.widget.Overlay instance.
    • + *
    • String specifying the id attribute of the <div> + * element used to create the menu. By default the menu + * will be created as an instance of + * YAHOO.widget.Overlay. + * If the + * default CSS class name for YAHOO.widget.Menu is applied to + * the <div> element, it will be created as an + * instance of YAHOO.widget.Menu + * .
    • String specifying the id attribute of the + * <select> element used to create the menu. + *
    • Object specifying the <div> element + * used to create the menu.
    • + *
    • Object specifying the <select> element + * used to create the menu.
    • + *
    • Array of object literals, each representing a set of + * YAHOO.widget.MenuItem + * configuration attributes.
    • + *
    • Array of strings representing the text labels for each menu + * item in the menu.
    • + *
    + * @type YAHOO.widget.Menu|YAHOO.widget.Overlay|HTMLElement|String|Array + * @default null + */ + this.setAttributeConfig("menu", { + + value: null, + method: this._setMenu, + writeOnce: true + + }); + + + /** + * @attribute lazyloadmenu + * @description Boolean indicating the value to set for the + * "lazyload" + * configuration property of the button's menu. Setting + * "lazyloadmenu" to true will defer rendering of + * the button's menu until the first time it is made visible. + * If "lazyloadmenu" is set to false, the button's + * menu will be rendered immediately if the button is in the + * document, or in response to the button's "appendTo" event if + * the button is not yet in the document. In either case, the + * menu is rendered into the button's parent HTML element. + * This attribute does not apply if a + * YAHOO.widget.Menu or + * YAHOO.widget.Overlay + * instance is passed as the value of the button's "menu" + * configuration attribute. + * YAHOO.widget.Menu or + * YAHOO.widget.Overlay instances should be rendered before + * being set as the value for the "menu" configuration + * attribute. + * @default true + * @type Boolean + */ + this.setAttributeConfig("lazyloadmenu", { + + value: (oAttributes.lazyloadmenu === false ? false : true), + validator: Lang.isBoolean, + writeOnce: true + + }); + + + /** + * @attribute menuclassname + * @description String representing the CSS class name to be + * applied to the root element of the button's menu. + * @type String + * @default "yui-button-menu" + */ + this.setAttributeConfig("menuclassname", { + + value: (oAttributes.menuclassname || "yui-button-menu"), + validator: Lang.isString, + method: this._setMenuClassName, + writeOnce: true + + }); + + + /** + * @attribute menuminscrollheight + * @description Number defining the minimum threshold for the "menumaxheight" + * configuration attribute. When set this attribute is automatically applied + * to all submenus. + * @default 90 + * @type Number + */ + this.setAttributeConfig("menuminscrollheight", { + + value: (oAttributes.menuminscrollheight || 90), + validator: Lang.isNumber + + }); + + + /** + * @attribute menumaxheight + * @description Number defining the maximum height (in pixels) for a menu's + * body element (<div class="bd"<). Once a menu's body + * exceeds this height, the contents of the body are scrolled to maintain + * this value. This value cannot be set lower than the value of the + * "minscrollheight" configuration property. + * @type Number + * @default 0 + */ + this.setAttributeConfig("menumaxheight", { + + value: (oAttributes.menumaxheight || 0), + validator: Lang.isNumber + + }); + + + /** + * @attribute menualignment + * @description Array defining how the Button's Menu is aligned to the Button. + * The default value of ["tl", "bl"] aligns the Menu's top left corner to the Button's + * bottom left corner. + * @type Array + * @default ["tl", "bl"] + */ + this.setAttributeConfig("menualignment", { + + value: (oAttributes.menualignment || ["tl", "bl"]), + validator: Lang.isArray + + }); + + + /** + * @attribute selectedMenuItem + * @description Object representing the item in the button's menu + * that is currently selected. + * @type Number + * @default null + */ + this.setAttributeConfig("selectedMenuItem", { + + value: null, + method: this._setSelectedMenuItem + + }); + + + /** + * @attribute onclick + * @description Object literal representing the code to be executed + * when the button is clicked. Format:
    {
    + * fn: Function, // The handler to call + * when the event fires.
    obj: Object, + * // An object to pass back to the handler.
    + * scope: Object // The object to use + * for the scope of the handler.
    }
    + * @type Object + * @default null + */ + this.setAttributeConfig("onclick", { + + value: oAttributes.onclick, + method: this._setOnClick + + }); + + + /** + * @attribute focusmenu + * @description Boolean indicating whether or not the button's menu + * should be focused when it is made visible. + * @type Boolean + * @default true + */ + this.setAttributeConfig("focusmenu", { + + value: (oAttributes.focusmenu === false ? false : true), + validator: Lang.isBoolean + + }); + + }, + + + /** + * @method focus + * @description Causes the button to receive the focus and fires the + * button's "focus" event. + */ + focus: function () { + + if (!this.get("disabled")) { + + this._button.focus(); + + } + + }, + + + /** + * @method blur + * @description Causes the button to lose focus and fires the button's + * "blur" event. + */ + blur: function () { + + if (!this.get("disabled")) { + + this._button.blur(); + + } + + }, + + + /** + * @method hasFocus + * @description Returns a boolean indicating whether or not the button + * has focus. + * @return {Boolean} + */ + hasFocus: function () { + + return (m_oFocusedButton == this); + + }, + + + /** + * @method isActive + * @description Returns a boolean indicating whether or not the button + * is active. + * @return {Boolean} + */ + isActive: function () { + + return this.hasClass(this.CSS_CLASS_NAME + "-active"); + + }, + + + /** + * @method getMenu + * @description Returns a reference to the button's menu. + * @return { + * YAHOO.widget.Overlay|YAHOO.widget.Menu} + */ + getMenu: function () { + + return this._menu; + + }, + + + /** + * @method getForm + * @description Returns a reference to the button's parent form. + * @return {HTMLFormElement} + */ + getForm: function () { + + var oButton = this._button, + oForm; + + if (oButton) { + + oForm = oButton.form; + + } + + return oForm; + + }, + + + /** + * @method getHiddenFields + * @description Returns an <input> element or + * array of form elements used to represent the button when its parent + * form is submitted. + * @return {HTMLInputElement|Array} + */ + getHiddenFields: function () { + + return this._hiddenFields; + + }, + + + /** + * @method destroy + * @description Removes the button's element from its parent element and + * removes all event handlers. + */ + destroy: function () { + + + var oElement = this.get("element"), + oParentNode = oElement.parentNode, + oMenu = this._menu, + aButtons; + + if (oMenu) { + + + if (m_oOverlayManager && m_oOverlayManager.find(oMenu)) { + + m_oOverlayManager.remove(oMenu); + + } + + oMenu.destroy(); + + } + + + Event.purgeElement(oElement); + Event.purgeElement(this._button); + Event.removeListener(document, "mouseup", this._onDocumentMouseUp); + Event.removeListener(document, "keyup", this._onDocumentKeyUp); + Event.removeListener(document, "mousedown", this._onDocumentMouseDown); + + + var oForm = this.getForm(); + + if (oForm) { + + Event.removeListener(oForm, "reset", this._onFormReset); + Event.removeListener(oForm, "submit", this._onFormSubmit); + + } + + + this.unsubscribeAll(); + + if (oParentNode) { + + oParentNode.removeChild(oElement); + + } + + + delete m_oButtons[this.get("id")]; + + aButtons = Dom.getElementsByClassName(this.CSS_CLASS_NAME, + this.NODE_NAME, oForm); + + if (Lang.isArray(aButtons) && aButtons.length === 0) { + + Event.removeListener(oForm, "keypress", + YAHOO.widget.Button.onFormKeyPress); + + } + + + }, + + + fireEvent: function (p_sType , p_aArgs) { + + var sType = arguments[0]; + + // Disabled buttons should not respond to DOM events + + if (this.DOM_EVENTS[sType] && this.get("disabled")) { + + return false; + + } + + return YAHOO.widget.Button.superclass.fireEvent.apply(this, arguments); + + }, + + + /** + * @method toString + * @description Returns a string representing the button. + * @return {String} + */ + toString: function () { + + return ("Button " + this.get("id")); + + } + + }); + + + /** + * @method YAHOO.widget.Button.onFormKeyPress + * @description "keypress" event handler for the button's form. + * @param {Event} p_oEvent Object representing the DOM event object passed + * back by the event utility (YAHOO.util.Event). + */ + YAHOO.widget.Button.onFormKeyPress = function (p_oEvent) { + + var oTarget = Event.getTarget(p_oEvent), + nCharCode = Event.getCharCode(p_oEvent), + sNodeName = oTarget.nodeName && oTarget.nodeName.toUpperCase(), + sType = oTarget.type, + + /* + Boolean indicating if the form contains any enabled or + disabled YUI submit buttons + */ + + bFormContainsYUIButtons = false, + + oButton, + + oYUISubmitButton, // The form's first, enabled YUI submit button + + /* + The form's first, enabled HTML submit button that precedes any + YUI submit button + */ + + oPrecedingSubmitButton, + + oEvent; + + + function isSubmitButton(p_oElement) { + + var sId, + oSrcElement; + + switch (p_oElement.nodeName.toUpperCase()) { + + case "INPUT": + case "BUTTON": + + if (p_oElement.type == "submit" && !p_oElement.disabled) { + + if (!bFormContainsYUIButtons && !oPrecedingSubmitButton) { + + oPrecedingSubmitButton = p_oElement; + + } + + } + + break; + + + default: + + sId = p_oElement.id; + + if (sId) { + + oButton = m_oButtons[sId]; + + if (oButton) { + + bFormContainsYUIButtons = true; + + if (!oButton.get("disabled")) { + + oSrcElement = oButton.get("srcelement"); + + if (!oYUISubmitButton && (oButton.get("type") == "submit" || + (oSrcElement && oSrcElement.type == "submit"))) { + + oYUISubmitButton = oButton; + + } + + } + + } + + } + + break; + + } + + } + + + if (nCharCode == 13 && ((sNodeName == "INPUT" && (sType == "text" || + sType == "password" || sType == "checkbox" || sType == "radio" || + sType == "file")) || sNodeName == "SELECT")) { + + Dom.getElementsBy(isSubmitButton, "*", this); + + + if (oPrecedingSubmitButton) { + + /* + Need to set focus to the first enabled submit button + to make sure that IE includes its name and value + in the form's data set. + */ + + oPrecedingSubmitButton.focus(); + + } + else if (!oPrecedingSubmitButton && oYUISubmitButton) { + + /* + Need to call "preventDefault" to ensure that the form doesn't end up getting + submitted twice. + */ + + Event.preventDefault(p_oEvent); + + + if (UA.ie) { + + oYUISubmitButton.get("element").fireEvent("onclick"); + + } + else { + + oEvent = document.createEvent("HTMLEvents"); + oEvent.initEvent("click", true, true); + + + if (UA.gecko < 1.9) { + + oYUISubmitButton.fireEvent("click", oEvent); + + } + else { + + oYUISubmitButton.get("element").dispatchEvent(oEvent); + + } + + } + + } + + } + + }; + + + /** + * @method YAHOO.widget.Button.addHiddenFieldsToForm + * @description Searches the specified form and adds hidden fields for + * instances of YAHOO.widget.Button that are of type "radio," "checkbox," + * "menu," and "split." + * @param {HTMLFormElement} p_oForm Object reference + * for the form to search. + */ + YAHOO.widget.Button.addHiddenFieldsToForm = function (p_oForm) { + + var aButtons = Dom.getElementsByClassName( + YAHOO.widget.Button.prototype.CSS_CLASS_NAME, + "*", + p_oForm), + + nButtons = aButtons.length, + oButton, + sId, + i; + + if (nButtons > 0) { + + + for (i = 0; i < nButtons; i++) { + + sId = aButtons[i].id; + + if (sId) { + + oButton = m_oButtons[sId]; + + if (oButton) { + + oButton.createHiddenFields(); + + } + + } + + } + + } + + }; + + + /** + * @method YAHOO.widget.Button.getButton + * @description Returns a button with the specified id. + * @param {String} p_sId String specifying the id of the root node of the + * HTML element representing the button to be retrieved. + * @return {YAHOO.widget.Button} + */ + YAHOO.widget.Button.getButton = function (p_sId) { + + return m_oButtons[p_sId]; + + }; + + + // Events + + + /** + * @event focus + * @description Fires when the menu item receives focus. Passes back a + * single object representing the original DOM event object passed back by + * the event utility (YAHOO.util.Event) when the event was fired. See + * Element.addListener + * for more information on listening for this event. + * @type YAHOO.util.CustomEvent + */ + + + /** + * @event blur + * @description Fires when the menu item loses the input focus. Passes back + * a single object representing the original DOM event object passed back by + * the event utility (YAHOO.util.Event) when the event was fired. See + * Element.addListener for + * more information on listening for this event. + * @type YAHOO.util.CustomEvent + */ + + + /** + * @event option + * @description Fires when the user invokes the button's option. Passes + * back a single object representing the original DOM event (either + * "mousedown" or "keydown") that caused the "option" event to fire. See + * Element.addListener + * for more information on listening for this event. + * @type YAHOO.util.CustomEvent + */ + +})(); +(function () { + + // Shorthard for utilities + + var Dom = YAHOO.util.Dom, + Event = YAHOO.util.Event, + Lang = YAHOO.lang, + Button = YAHOO.widget.Button, + + // Private collection of radio buttons + + m_oButtons = {}; + + + + /** + * The ButtonGroup class creates a set of buttons that are mutually + * exclusive; checking one button in the set will uncheck all others in the + * button group. + * @param {String} p_oElement String specifying the id attribute of the + * <div> element of the button group. + * @param {HTMLDivElement} p_oElement Object + * specifying the <div> element of the button group. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button group. + * @param {Object} p_oAttributes Optional. Object literal specifying a set + * of configuration attributes used to create the button group. + * @namespace YAHOO.widget + * @class ButtonGroup + * @constructor + * @extends YAHOO.util.Element + */ + YAHOO.widget.ButtonGroup = function (p_oElement, p_oAttributes) { + + var fnSuperClass = YAHOO.widget.ButtonGroup.superclass.constructor, + sNodeName, + oElement, + sId; + + if (arguments.length == 1 && !Lang.isString(p_oElement) && + !p_oElement.nodeName) { + + if (!p_oElement.id) { + + sId = Dom.generateId(); + + p_oElement.id = sId; + + + } + + + + fnSuperClass.call(this, (this._createGroupElement()), p_oElement); + + } + else if (Lang.isString(p_oElement)) { + + oElement = Dom.get(p_oElement); + + if (oElement) { + + if (oElement.nodeName.toUpperCase() == this.NODE_NAME) { + + + fnSuperClass.call(this, oElement, p_oAttributes); + + } + + } + + } + else { + + sNodeName = p_oElement.nodeName.toUpperCase(); + + if (sNodeName && sNodeName == this.NODE_NAME) { + + if (!p_oElement.id) { + + p_oElement.id = Dom.generateId(); + + + } + + + fnSuperClass.call(this, p_oElement, p_oAttributes); + + } + + } + + }; + + + YAHOO.extend(YAHOO.widget.ButtonGroup, YAHOO.util.Element, { + + + // Protected properties + + + /** + * @property _buttons + * @description Array of buttons in the button group. + * @default null + * @protected + * @type Array + */ + _buttons: null, + + + + // Constants + + + /** + * @property NODE_NAME + * @description The name of the tag to be used for the button + * group's element. + * @default "DIV" + * @final + * @type String + */ + NODE_NAME: "DIV", + + + /** + * @property CSS_CLASS_NAME + * @description String representing the CSS class(es) to be applied + * to the button group's element. + * @default "yui-buttongroup" + * @final + * @type String + */ + CSS_CLASS_NAME: "yui-buttongroup", + + + + // Protected methods + + + /** + * @method _createGroupElement + * @description Creates the button group's element. + * @protected + * @return {HTMLDivElement} + */ + _createGroupElement: function () { + + var oElement = document.createElement(this.NODE_NAME); + + return oElement; + + }, + + + + // Protected attribute setter methods + + + /** + * @method _setDisabled + * @description Sets the value of the button groups's + * "disabled" attribute. + * @protected + * @param {Boolean} p_bDisabled Boolean indicating the value for + * the button group's "disabled" attribute. + */ + _setDisabled: function (p_bDisabled) { + + var nButtons = this.getCount(), + i; + + if (nButtons > 0) { + + i = nButtons - 1; + + do { + + this._buttons[i].set("disabled", p_bDisabled); + + } + while (i--); + + } + + }, + + + + // Protected event handlers + + + /** + * @method _onKeyDown + * @description "keydown" event handler for the button group. + * @protected + * @param {Event} p_oEvent Object representing the DOM event object + * passed back by the event utility (YAHOO.util.Event). + */ + _onKeyDown: function (p_oEvent) { + + var oTarget = Event.getTarget(p_oEvent), + nCharCode = Event.getCharCode(p_oEvent), + sId = oTarget.parentNode.parentNode.id, + oButton = m_oButtons[sId], + nIndex = -1; + + + if (nCharCode == 37 || nCharCode == 38) { + + nIndex = (oButton.index === 0) ? + (this._buttons.length - 1) : (oButton.index - 1); + + } + else if (nCharCode == 39 || nCharCode == 40) { + + nIndex = (oButton.index === (this._buttons.length - 1)) ? + 0 : (oButton.index + 1); + + } + + + if (nIndex > -1) { + + this.check(nIndex); + this.getButton(nIndex).focus(); + + } + + }, + + + /** + * @method _onAppendTo + * @description "appendTo" event handler for the button group. + * @protected + * @param {Event} p_oEvent Object representing the event that was fired. + */ + _onAppendTo: function (p_oEvent) { + + var aButtons = this._buttons, + nButtons = aButtons.length, + i; + + for (i = 0; i < nButtons; i++) { + + aButtons[i].appendTo(this.get("element")); + + } + + }, + + + /** + * @method _onButtonCheckedChange + * @description "checkedChange" event handler for each button in the + * button group. + * @protected + * @param {Event} p_oEvent Object representing the event that was fired. + * @param {YAHOO.widget.Button} + * p_oButton Object representing the button that fired the event. + */ + _onButtonCheckedChange: function (p_oEvent, p_oButton) { + + var bChecked = p_oEvent.newValue, + oCheckedButton = this.get("checkedButton"); + + if (bChecked && oCheckedButton != p_oButton) { + + if (oCheckedButton) { + + oCheckedButton.set("checked", false, true); + + } + + this.set("checkedButton", p_oButton); + this.set("value", p_oButton.get("value")); + + } + else if (oCheckedButton && !oCheckedButton.set("checked")) { + + oCheckedButton.set("checked", true, true); + + } + + }, + + + + // Public methods + + + /** + * @method init + * @description The ButtonGroup class's initialization method. + * @param {String} p_oElement String specifying the id attribute of the + * <div> element of the button group. + * @param {HTMLDivElement} p_oElement Object + * specifying the <div> element of the button group. + * @param {Object} p_oElement Object literal specifying a set of + * configuration attributes used to create the button group. + * @param {Object} p_oAttributes Optional. Object literal specifying a + * set of configuration attributes used to create the button group. + */ + init: function (p_oElement, p_oAttributes) { + + this._buttons = []; + + YAHOO.widget.ButtonGroup.superclass.init.call(this, p_oElement, + p_oAttributes); + + this.addClass(this.CSS_CLASS_NAME); + + + var aButtons = this.getElementsByClassName("yui-radio-button"); + + + if (aButtons.length > 0) { + + + this.addButtons(aButtons); + + } + + + + function isRadioButton(p_oElement) { + + return (p_oElement.type == "radio"); + + } + + aButtons = + Dom.getElementsBy(isRadioButton, "input", this.get("element")); + + + if (aButtons.length > 0) { + + + this.addButtons(aButtons); + + } + + this.on("keydown", this._onKeyDown); + this.on("appendTo", this._onAppendTo); + + + var oContainer = this.get("container"); + + if (oContainer) { + + if (Lang.isString(oContainer)) { + + Event.onContentReady(oContainer, function () { + + this.appendTo(oContainer); + + }, null, this); + + } + else { + + this.appendTo(oContainer); + + } + + } + + + + }, + + + /** + * @method initAttributes + * @description Initializes all of the configuration attributes used to + * create the button group. + * @param {Object} p_oAttributes Object literal specifying a set of + * configuration attributes used to create the button group. + */ + initAttributes: function (p_oAttributes) { + + var oAttributes = p_oAttributes || {}; + + YAHOO.widget.ButtonGroup.superclass.initAttributes.call( + this, oAttributes); + + + /** + * @attribute name + * @description String specifying the name for the button group. + * This name will be applied to each button in the button group. + * @default null + * @type String + */ + this.setAttributeConfig("name", { + + value: oAttributes.name, + validator: Lang.isString + + }); + + + /** + * @attribute disabled + * @description Boolean indicating if the button group should be + * disabled. Disabling the button group will disable each button + * in the button group. Disabled buttons are dimmed and will not + * respond to user input or fire events. + * @default false + * @type Boolean + */ + this.setAttributeConfig("disabled", { + + value: (oAttributes.disabled || false), + validator: Lang.isBoolean, + method: this._setDisabled + + }); + + + /** + * @attribute value + * @description Object specifying the value for the button group. + * @default null + * @type Object + */ + this.setAttributeConfig("value", { + + value: oAttributes.value + + }); + + + /** + * @attribute container + * @description HTML element reference or string specifying the id + * attribute of the HTML element that the button group's markup + * should be rendered into. + * @type HTMLElement|String + * @default null + */ + this.setAttributeConfig("container", { + + value: oAttributes.container, + writeOnce: true + + }); + + + /** + * @attribute checkedButton + * @description Reference for the button in the button group that + * is checked. + * @type {YAHOO.widget.Button} + * @default null + */ + this.setAttributeConfig("checkedButton", { + + value: null + + }); + + }, + + + /** + * @method addButton + * @description Adds the button to the button group. + * @param {YAHOO.widget.Button} + * p_oButton Object reference for the + * YAHOO.widget.Button instance to be added to the button group. + * @param {String} p_oButton String specifying the id attribute of the + * <input> or <span> element + * to be used to create the button to be added to the button group. + * @param {HTMLInputElement|HTMLElement} p_oButton Object reference for the + * <input> or <span> element + * to be used to create the button to be added to the button group. + * @param {Object} p_oButton Object literal specifying a set of + * YAHOO.widget.Button + * configuration attributes used to configure the button to be added to + * the button group. + * @return {YAHOO.widget.Button} + */ + addButton: function (p_oButton) { + + var oButton, + oButtonElement, + oGroupElement, + nIndex, + sButtonName, + sGroupName; + + + if (p_oButton instanceof Button && + p_oButton.get("type") == "radio") { + + oButton = p_oButton; + + } + else if (!Lang.isString(p_oButton) && !p_oButton.nodeName) { + + p_oButton.type = "radio"; + + oButton = new Button(p_oButton); + + } + else { + + oButton = new Button(p_oButton, { type: "radio" }); + + } + + + if (oButton) { + + nIndex = this._buttons.length; + sButtonName = oButton.get("name"); + sGroupName = this.get("name"); + + oButton.index = nIndex; + + this._buttons[nIndex] = oButton; + m_oButtons[oButton.get("id")] = oButton; + + + if (sButtonName != sGroupName) { + + oButton.set("name", sGroupName); + + } + + + if (this.get("disabled")) { + + oButton.set("disabled", true); + + } + + + if (oButton.get("checked")) { + + this.set("checkedButton", oButton); + + } + + + oButtonElement = oButton.get("element"); + oGroupElement = this.get("element"); + + if (oButtonElement.parentNode != oGroupElement) { + + oGroupElement.appendChild(oButtonElement); + + } + + + oButton.on("checkedChange", + this._onButtonCheckedChange, oButton, this); + + + } + + return oButton; + + }, + + + /** + * @method addButtons + * @description Adds the array of buttons to the button group. + * @param {Array} p_aButtons Array of + * YAHOO.widget.Button instances to be added + * to the button group. + * @param {Array} p_aButtons Array of strings specifying the id + * attribute of the <input> or <span> + * elements to be used to create the buttons to be added to the + * button group. + * @param {Array} p_aButtons Array of object references for the + * <input> or <span> elements + * to be used to create the buttons to be added to the button group. + * @param {Array} p_aButtons Array of object literals, each containing + * a set of YAHOO.widget.Button + * configuration attributes used to configure each button to be added + * to the button group. + * @return {Array} + */ + addButtons: function (p_aButtons) { + + var nButtons, + oButton, + aButtons, + i; + + if (Lang.isArray(p_aButtons)) { + + nButtons = p_aButtons.length; + aButtons = []; + + if (nButtons > 0) { + + for (i = 0; i < nButtons; i++) { + + oButton = this.addButton(p_aButtons[i]); + + if (oButton) { + + aButtons[aButtons.length] = oButton; + + } + + } + + } + + } + + return aButtons; + + }, + + + /** + * @method removeButton + * @description Removes the button at the specified index from the + * button group. + * @param {Number} p_nIndex Number specifying the index of the button + * to be removed from the button group. + */ + removeButton: function (p_nIndex) { + + var oButton = this.getButton(p_nIndex), + nButtons, + i; + + if (oButton) { + + + this._buttons.splice(p_nIndex, 1); + delete m_oButtons[oButton.get("id")]; + + oButton.removeListener("checkedChange", + this._onButtonCheckedChange); + + oButton.destroy(); + + + nButtons = this._buttons.length; + + if (nButtons > 0) { + + i = this._buttons.length - 1; + + do { + + this._buttons[i].index = i; + + } + while (i--); + + } + + + } + + }, + + + /** + * @method getButton + * @description Returns the button at the specified index. + * @param {Number} p_nIndex The index of the button to retrieve from the + * button group. + * @return {YAHOO.widget.Button} + */ + getButton: function (p_nIndex) { + + return this._buttons[p_nIndex]; + + }, + + + /** + * @method getButtons + * @description Returns an array of the buttons in the button group. + * @return {Array} + */ + getButtons: function () { + + return this._buttons; + + }, + + + /** + * @method getCount + * @description Returns the number of buttons in the button group. + * @return {Number} + */ + getCount: function () { + + return this._buttons.length; + + }, + + + /** + * @method focus + * @description Sets focus to the button at the specified index. + * @param {Number} p_nIndex Number indicating the index of the button + * to focus. + */ + focus: function (p_nIndex) { + + var oButton, + nButtons, + i; + + if (Lang.isNumber(p_nIndex)) { + + oButton = this._buttons[p_nIndex]; + + if (oButton) { + + oButton.focus(); + + } + + } + else { + + nButtons = this.getCount(); + + for (i = 0; i < nButtons; i++) { + + oButton = this._buttons[i]; + + if (!oButton.get("disabled")) { + + oButton.focus(); + break; + + } + + } + + } + + }, + + + /** + * @method check + * @description Checks the button at the specified index. + * @param {Number} p_nIndex Number indicating the index of the button + * to check. + */ + check: function (p_nIndex) { + + var oButton = this.getButton(p_nIndex); + + if (oButton) { + + oButton.set("checked", true); + + } + + }, + + + /** + * @method destroy + * @description Removes the button group's element from its parent + * element and removes all event handlers. + */ + destroy: function () { + + + var nButtons = this._buttons.length, + oElement = this.get("element"), + oParentNode = oElement.parentNode, + i; + + if (nButtons > 0) { + + i = this._buttons.length - 1; + + do { + + this._buttons[i].destroy(); + + } + while (i--); + + } + + + Event.purgeElement(oElement); + + + oParentNode.removeChild(oElement); + + }, + + + /** + * @method toString + * @description Returns a string representing the button group. + * @return {String} + */ + toString: function () { + + return ("ButtonGroup " + this.get("id")); + + } + + }); + +})(); +YAHOO.register("button", YAHOO.widget.Button, {version: "2.6.0", build: "1321"}); diff --git a/lib/yui/calendar/README b/lib/yui/calendar/README new file mode 100755 index 0000000000..da90268886 --- /dev/null +++ b/lib/yui/calendar/README @@ -0,0 +1,421 @@ +Calendar Release Notes + +*** version 2.6.0 *** + ++ Fixed incorrect cell index parsing from cell id attribute, when + Calendar id contained "cell". + ++ Added text to previous month, next month and close icons, to + enhance accessibility for screen-readers. + ++ Fixed issue with bubbled previous month, next month click events + missing target information in certain browsers (due to replaced HTML), + by delaying click event handling through a setTimeout. + ++ Added destroy method to Calendar/CalendarGroup + ++ Fixed incorrect clear method behavior for CalendarGroup where all + pages would be set to the same month. + ++ Refactored code to reduce minified Kweight. + +*** version 2.5.2 *** + ++ CalendarGroup toDate method no longer throws javascript exception + +*** version 2.5.1 *** + ++ Fixed bug with mindate, maxdate being applied incorrectly if + set to a day on which time change took place (DST, E.U Summertime) + and the day is not the first day of the week. + ++ Fixed DateMath.getWeekNumber implementation to return correct + week numbers. The older implementation would return Week 0 for + certain weeks (e.g. the week starting Sun Dec 28th 2008) + + To suppor the fix, DateMath.getWeekNumber has a signature + change in 2.5.1 and can now support U.S Week calculations based + on Jan 1st identifying the first week of the year, as well as + ISO8601 week calculations based on Jan 4th identifying the first + week of the year + + The arguments which the method expected prior to 2.5.1 were not + being used in calculating the week number. The new signature is: + + DateMath.getWeekNumber(Date dt, Number firstDayOfWeek, Number janDate) + + Where: + + dt is the date for which week number is required + + firstDayOfWeek is the day index identifying the first + day of the week. Default is 0 (Sunday). + + janDate is the date in the first week of January, which + identifies the first week of the year. + Default is YAHOO.widget.DateMath.WEEK_ONE_JAN_DATE (1) + + NOTE: Calendar instances themselves do not currently expose a + configuration property to change the week numbering system + used. A "janDate" value is not passed to the getWeekNumber + method, when used by Calendar, resulting in it using the default value. + + Therefore, ISO8601 week numbering can be generated for Calendars + by setting the value of YAHOO.widget.DateMath.WEEK_ONE_JAN_DATE + to 4. + +*** version 2.5.0 *** + ++ Prevent default event handling in CalendarNavigator enter key + listener, to prevent automatic form submission when using Calendar + inside a form. + ++ Added workaround to DateMath.add and subtract for Safari 2 (webkit) + bug in Date.setDate(n) which doesn't handle value of n less than -128 + or greater than 127 correctly. + + See: http://brianary.blogspot.com/2006/03/safari-date-bug.html + ++ Added border, padding and margin rules to Calendar Sam Skin to + protect Sam Skin's look and feel when Calendar is used with + YUI base.css + +*** version 2.4.0 *** + ++ Added CalendarNavigator (year selector) feature to allow the user to + jump to a year/month directly without having to scroll through months + sequentially. + + The feature is enabled/configured using the "navigator" configuration + property. + ++ Added Custom Events: + + showNav/beforeShowNav + hideNav/beforeHideNav, + renderNav/beforeRenderNav + + To Calendar/CalendarGroup, in support of the CalendarNavigator + functionality. + ++ Added Custom Events: + + show/beforeShow + hide/beforeHide + + To Calendar and CalendarGroup. Returning false from a + beforeShow/beforeHide listener can be used to prevent the Calendar + from being shown/hidden respectively. + ++ Added Public Methods: + + getCellIndex(date) [ Calendar ] + getCalendarPage(date) [ CalendarGroup ] + toDate(dateArray) [ Calendar/CalendarGroup ] + removeRenderers() [ Calendar/CalendarGroup ] + ++ The Calendar/CalendarGroup constructor is now more flexible: + + * It no longer requires an "id" argument. + + In it's simplest form, a Calendar/CalendarGroup can be + constructed by simply providing a container id or reference. + + var cal = new YAHOO.widget.Calendar("container"); + -or- + var containerDiv = YAHOO.util.Dom.get("container"); + var cal = new YAHOO.widget.Calendar(containerDiv); + + An id for the Calendar does not need to be provided, and will be + generated from the container id by appending an "_t" suffix to the + container id if only the container is provided. + + * The container argument can be either a string, representing the + id of the container, or an HTMLElement referring to the container + element itself, as suggested in the example above. + + * If an HTMLElement is provided for the container argument and the + element does not have an id, one will be generated for it using + YAHOO.util.Dom.generateId(). + + * The older form of Calendar/CalendarGroup signature, expecting + both an id and containerId is still supported and works as it did + prior to 2.4.0. + ++ Fixed performance issue, where the same custom renderer was being + applied multiple times to the same cell. + ++ Added getDate(year, month, date) factory method to the DateMath utility, + which can be used to create JavaScript Date instances for years less + than 100. + + The default Date(year, month, date) constructor implementations across + browsers, assume that if year < 100, the caller is referring to the + nineteen hundreds, and the year is set to 19xx instead of xx (as with + the deprecated setYear method). However Date.setFullYear(xx) can + be used to set dates below 100. The above factory method provides a + construction mechanism consistent with setFullYear. + ++ Changed Calendar/CalendarGroup/DateMath code to use the DateMath.getDate + method, so that 2 digit years are not assumed to be in the 1900's. + + NOTE: Calendar's API already expects 4 digit date strings when referring + to years after 999. + +*** version 2.3.1 *** + ++ Changed Calendar/CalendarGroup to render an empty title bar element + when "close" is set to true, but "title" has not been set, to allow Sam + Skin to render a title bar correctly. + +*** version 2.3.0 *** + ++ Added checks to select, selectCell, deselect and deselectCell methods + to ensure the Calendar/Calendar group was not set to an invalid state + by programmatically selecting unselectable dates or cells. + ++ Added new locale configuration properties for the Month/Year label + used in the Calendar header (MY_LABEL_MONTH_POSITION, + MY_LABEL_YEAR_POSITION, MY_LABEL_YEAR_SUFFIX, MY_LABEL_MONTH_SUFFIX). + Japan is an example locale, where customization of the Month/Year + label is required. + ++ Changed "first", "last" class names to "first-of-type", "last-of-type", + to avoid collision with YUI Grids' use of the "first" class name. + ++ Added public isDateOOB method, to check if a given date is outside of + the minimum/maximum configuration dates of the Calendar. + ++ Deprecated YAHOO.widget.Calendar.browser, refactored to use + YAHOO.env.ua instead. + ++ Removed overflow:hidden from default Calendar/CalendarGroup container + for non-IE6 browsers to fix clipping issue with IE7 when CalendarGroup + was inside a box with a specific width. overflow:hidden is still + required for IE6 with an iframe shim. + ++ Added Opera container width calculation fix to CalendarGroup.show + method, to fix incorrect wrapping when using a CalendarGroup which is + initially rendered hidden (display:none). Previously this fix was + only applied on render. + +*** version 2.2.2 *** + ++ Fixed problem with selected dates being shared across instances, when + more than one Calendar/CalendarGroup was on the page + +*** version 2.2.1 *** + ++ Fixed problem with selectCell adding duplicate selected date entries + for dates which were already selected + ++ Fixed problem with CalendarGroup iframe shim not covering the + CalendarGroup title area + ++ Removed javascript:void(null) from close button and cell links which + was interrupting form submission and firing onbeforeunload in IE + ++ Fixed problem with CalendarGroup getSelectedDates returning invalid + results, when used in conjunction with the "selected" Config property + (either passed in the constructor config argument or set seperately + after construction) + ++ Refactored Calendar and CalendarGroup to improve performance, + especially when working with a large number of instances in + IE6 + +*** version 2.2.0 *** + ++ Image customization can now be done through CSS. Images for Close, + Left and Right Arrows are now pulled in using CSS defined in + calendar.css and by default use relative paths to the images in + the same directory as calendar.css. + ++ Deprecated Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT + configuration properties. Customizations based on older releases + which set these properties will still function as expected. + ++ Deprecated CalendarGroup.CSS_2UPCLOSE. Calendar's Style.CSS_CLOSE + property now represents the new default CSS class (calclose) for + the close button. CSS_2UPCLOSE is still applied along with + CSS_CLOSE to the new markup for the close button to support existing + customizations of the CSS_2UPCLOSE CSS class (close-icon) + ++ Fixed problem with Safari setting Calendar pages to incorrect dates + if the pages spanned a year boundary in CalendarGroups with 3 or more + pages, due to a bug in Safari's implementation of Date setMonth + ++ Fixed problem with CalendarGroup setMonth rendering Calendar pages + with incorrect dates in all browsers if current pages spanned year + boundary + ++ Fixed incorrect CalendarGroup logging statement in calendar-debug.js + ++ Fixed domEventMap support for Safari versions prior to 2.0.2, + caused by hasOwnProperty not being supported + ++ Removed unused private property : _pageDate from Calendar class + +*** version 0.12.2 *** + ++ Corrected documentation for clearTime function to reflect the + change from midnight to noon + +*** version 0.12.1 *** + ++ Calendar and CalendarGroup now automatically parse the argument + passed to setMonth and setYear into an integer, eliminating + potential concatenation bugs. + +*** version 0.12 *** + ++ New documentation format implemented + ++ Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone + represents the single Calendar instance, and CalendarGroup represents + an n-up instance, defaulting to 2up + ++ Added semantic style classes to Calendar elements to allow for + custom styling solely using CSS. + ++ Remapped all configuration properties to use the Config object + (familiar to those who use the Container collection of controls). + Property names are the same as their previous counterparts, but + wrapped into Calendar.cfg, allowing for runtime reconfiguration of + most properties + ++ Added "title" property for setting the Calendar title + ++ Added "close" property for enabling and disabling the close icon + ++ Added "iframe" property for enabling an iframe shim in Internet + Explorer 6 and below to fix the select bleed-through bug + ++ pageDate moved to property: "pagedate" + ++ selectedDates moved to property: "selected" + ++ minDate moved to property : "mindate", which accepts a JavaScript + Date object like its predecessor, but also supports string dates + ++ maxDate moved to property : "maxdate", which accepts a JavaScript + Date object like its predecessor, but also supports string dates + ++ Moved style declarations to initStyles function + ++ Optimized event handling in doSelectCell/doCellMouseOver/ + doCellMouseOut by only attaching the listener to the outer + Calendar container, and only reacting to events on cells with + the "selectable" CSS class. + ++ Added domEventMap field for applying DOM event listeners to cells + containing specific class and tag combinations. + ++ Moved all cell DOM event attachment to applyListeners function + ++ Added getDateByCellId / getDateFieldsByCellId helper functions + ++ Corrected DateMath.getWeekNumber to comply with ISO week number + handling + ++ Separated renderCellDefault style portions into styleCellDefault + function for easy extension + ++ Deprecated onBeforeSelect. Created beforeSelectEvent which + automatically subscribes to its deprecated predecessor. + ++ Deprecated onSelect. Created selectEvent, which automatically + subscribes to its deprecated predecessor. + ++ Deprecated onBeforeDeselect. Created beforeSelectEvent which + automatically subscribes to its deprecated predecessor. + ++ Deprecated onDeselect. Created beforeDeselectEvent, which + automatically subscribes to its deprecated predecessor. + ++ Deprecated onChangePage. Created changePageEvent, which automatically + subscribes to its deprecated predecessor. + ++ Deprecated onRender. Created renderEvent, which automatically + subscribes to its deprecated predecessor. + ++ Deprecated onReset. Created resetEvent, which automatically + subscribes to its deprecated predecessor. + ++ Deprecated onClear. Created clearEvent, which automatically + subscribes to its deprecated predecessor. + ++ Corrected setMonth documentation to refer to 0-11 indexed months. + ++ Added show and hide methods to Calendar for setting the Calendar's + display property. + ++ Optimized internal render classes to use innerHTML and string buffers + ++ Removed wireCustomEvents function + ++ Removed wireDefaultEvents function + ++ Removed doNextMonth / doPreviousMonth + ++ Removed all buildShell (header, body, footer) functions, since + the Calendar shell is now built dynamically on each render + ++ Wired all CalendarGroup events and configuration properties to + be properly delegated to Calendar + ++ Augmented CalendarGroup with all built-in renderers, label functions, + hide, show, and initStyles, creating API transparency between Calendar + and CalendarGroup. + ++ Made all tagName, createElement, and entity references XHTML compliant + ++ Fixed Daylight Saving Time bug for Brazilian time zone + +*** version 0.11.3 *** + ++ Calendar_Core: Added arguments for selected/deselected dates to + onSelect/onDeselect + ++ CalendarGroup: Fixed bug where selected dates passed to constructor + were not represented in selectedDates + ++ Calendar2up: Now displays correctly in Opera 9 + +*** version 0.11.0 *** + ++ DateMath: DateMath.add now properly adds weeks + ++ DateMath: between() function added + ++ DateMath: getWeekNumber() fixed to take starting day of week into + account + ++ All references to Calendar's built in CSS class handlers are + removed, replaced with calls to Dom utility (addClass, removeClass) + ++ Several CSS class constants now have clearer names + ++ All CSS classes are now properly namespaced to avoid CSS conflicts + ++ Fixed table:hover bug in CSS + ++ Calendar no longer requires the container ID and variable name to + match in order for month navigation to function properly + ++ Calendar month navigation arrows are now represented as + background images + +*** version 0.10.0 *** + ++ Major performance improvements from attaching DOM events to + associated table cells only once, when the Calendar shell is built + ++ DOM events for mouseover/mouseout are now fired for all browsers + (not just Internet Explorer) + ++ Reset functionality bug fixed for 2-up Calendar view + +*** version 0.9.0 *** + +* Initial release \ No newline at end of file diff --git a/lib/yui/calendar/assets/calendar-core.css b/lib/yui/calendar/assets/calendar-core.css new file mode 100755 index 0000000000..2fb51e4924 --- /dev/null +++ b/lib/yui/calendar/assets/calendar-core.css @@ -0,0 +1,132 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +/** + * CORE + * + * This is the set of CSS rules required by Calendar to drive core functionality and structure. + * Changes to these rules may result in the Calendar not functioning or rendering correctly. + * + * They should not be modified for skinning. + **/ + +/* CALENDAR BOUNDING BOX */ +.yui-calcontainer { + position:relative; + float:left; + _overflow:hidden; /* IE6 only, to clip iframe shim */ +} + +/* IFRAME SHIM */ +.yui-calcontainer iframe { + position:absolute; + border:none; + margin:0;padding:0; + z-index:0; + width:100%; + height:100%; + left:0px; + top:0px; +} + +/* IFRAME SHIM IE6 only */ +.yui-calcontainer iframe.fixedsize { + width:50em; + height:50em; + top:-1px; + left:-1px; +} + +/* BOUNDING BOX FOR EACH CALENDAR GROUP PAGE */ +.yui-calcontainer.multi .groupcal { + z-index:1; + float:left; + position:relative; +} + +/* TITLE BAR */ +.yui-calcontainer .title { + position:relative; + z-index:1; +} + +/* CLOSE ICON CONTAINER */ +.yui-calcontainer .close-icon { + position:absolute; + z-index:1; + text-indent:-10000em; + overflow:hidden; +} + +/* CALENDAR TABLE */ +.yui-calendar { + position:relative; +} + +/* NAVBAR LEFT ARROW CONTAINER */ +.yui-calendar .calnavleft { + position:absolute; + z-index:1; + text-indent:-10000em; + overflow:hidden; +} + +/* NAVBAR RIGHT ARROW CONTAINER */ +.yui-calendar .calnavright { + position:absolute; + z-index:1; + text-indent:-10000em; + overflow:hidden; +} + +/* NAVBAR TEXT CONTAINER */ +.yui-calendar .calheader { + position:relative; + width:100%; + text-align:center; +} + +/* CalendarNavigator */ +.yui-calcontainer .yui-cal-nav-mask { + position:absolute; + z-index:2; + margin:0; + padding:0; + width:100%; + height:100%; + _width:0; /* IE6, IE7 quirks - width/height set programmatically to match container */ + _height:0; + left:0; + top:0; + display:none; +} + +/* NAVIGATOR BOUNDING BOX */ +.yui-calcontainer .yui-cal-nav { + position:absolute; + z-index:3; + top:0; + display:none; +} + +/* NAVIGATOR BUTTONS (based on button-core.css) */ +.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn { + display: -moz-inline-box; /* Gecko */ + display: inline-block; /* IE, Opera and Safari */ +} + +.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button { + display: block; + *display: inline-block; /* IE */ + *overflow: visible; /* Remove superfluous padding for IE */ + border: none; + background-color: transparent; + cursor: pointer; +} + +/* Specific changes for calendar running under fonts/reset */ +.yui-calendar .calbody a:hover {background:inherit;} +p#clear {clear:left; padding-top:10px;} \ No newline at end of file diff --git a/lib/yui/calendar/assets/calendar.css b/lib/yui/calendar/assets/calendar.css new file mode 100755 index 0000000000..f01446f300 --- /dev/null +++ b/lib/yui/calendar/assets/calendar.css @@ -0,0 +1,320 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-calcontainer { + position:relative; + padding:5px; + background-color:#F7F9FB; + border:1px solid #7B9EBD; + float:left; + _overflow:hidden; /* IE6 only, to clip iframe shim */ +} + +.yui-calcontainer iframe { + position:absolute; + border:none; + margin:0;padding:0; + z-index:0; + width:100%; + height:100%; + left:0px; + top:0px; +} + +/* IE6 only */ +.yui-calcontainer iframe.fixedsize { + width:50em; + height:50em; + top:-1px; + left:-1px; +} + +.yui-calcontainer.multi { + padding:0; +} + +.yui-calcontainer.multi .groupcal { + padding:5px; + background-color:transparent; + z-index:1; + float:left; + position:relative; + border:none; +} + +.yui-calcontainer .title { + font:100% sans-serif; + color:#000; + font-weight:bold; + margin-bottom:5px; + height:25px; + position:absolute; + top:3px;left:5px; + z-index:1; +} + +.yui-calcontainer .close-icon { + position:absolute; + overflow:hidden; + text-indent:-10000em; + right:3px; + top:3px; + border:none; + z-index:1; +} + +.yui-calcontainer .calclose { + background: url("calx.gif") no-repeat; + width:17px; + height:13px; + cursor:pointer; +} + +/* Calendar element styles */ + +.yui-calendar { + font:100% sans-serif; + text-align:center; + border-spacing:0; + border-collapse:separate; + position:relative; +} + +.yui-calcontainer.withtitle { + padding-top:1.5em; +} + +.yui-calendar .calnavleft { + position:absolute; + overflow:hidden; + text-indent:-10000em; + cursor:pointer; + top:2px; + bottom:0; + width:9px; + height:12px; + left:2px; + z-index:1; + background: url("callt.gif") no-repeat; +} + +.yui-calendar .calnavright { + position:absolute; + overflow:hidden; + text-indent:-10000em; + cursor:pointer; + top:2px; + bottom:0; + width:9px; + height:12px; + right:2px; + z-index:1; + background: url("calrt.gif") no-repeat; +} + +.yui-calendar td.calcell { + padding:.1em .2em; + border:1px solid #E0E0E0; + text-align:center; +} + +.yui-calendar td.calcell a { + color:#003DB8; + text-decoration:none; +} + +.yui-calendar td.calcell.today { + border:1px solid #000; +} + +.yui-calendar td.calcell.oom { + cursor:default; + color:#999; + background-color:#EEE; + border:1px solid #E0E0E0; +} + +.yui-calendar td.calcell.selected { + color:#003DB8; + background-color:#FFF19F; + border:1px solid #FF9900; +} + +.yui-calendar td.calcell.calcellhover { + cursor:pointer; + color:#FFF; + background-color:#FF9900; + border:1px solid #FF9900; +} + +.yui-calendar td.calcell.calcellhover a { + color:#FFF; +} + +.yui-calendar td.calcell.restricted { + text-decoration:line-through; +} + +.yui-calendar td.calcell.previous { + color:#CCC; +} + +.yui-calendar td.calcell.highlight1 { background-color:#CCFF99; } +.yui-calendar td.calcell.highlight2 { background-color:#99CCFF; } +.yui-calendar td.calcell.highlight3 { background-color:#FFCCCC; } +.yui-calendar td.calcell.highlight4 { background-color:#CCFF99; } + +.yui-calendar .calhead { + border:1px solid #E0E0E0; + vertical-align:middle; + background-color:#FFF; +} + +.yui-calendar .calheader { + position:relative; + width:100%; + text-align:center; +} + +.yui-calendar .calheader img { + border:none; +} + +.yui-calendar .calweekdaycell { + color:#666; + font-weight:normal; + text-align:center; + width:1.5em; +} + +.yui-calendar .calfoot { + background-color:#EEE; +} + +.yui-calendar .calrowhead, .yui-calendar .calrowfoot { + color:#666; + font-size:9px; + font-style:italic; + font-weight:normal; + width:15px; +} + +.yui-calendar .calrowhead { + border-right-width:2px; +} + +/* CalendarNavigator */ +.yui-calendar a.calnav { + _position:relative; + padding-left:2px; + padding-right:2px; + text-decoration:none; + color:#000; +} + +.yui-calendar a.calnav:hover { + border:1px solid #003366; + background-color:#6699cc; + background: url(calgrad.png) repeat-x; + color:#fff; + cursor:pointer; +} + +.yui-calcontainer .yui-cal-nav-mask { + position:absolute; + z-index:2; + display:none; + + margin:0; + padding:0; + + left:0; + top:0; + width:100%; + height:100%; + _width:0; /* IE6, IE7 Quirks - width/height set programmatically to match container */ + _height:0; + + background-color:#000; + opacity:0.25; + *filter:alpha(opacity=25); +} + +.yui-calcontainer .yui-cal-nav { + position:absolute; + z-index:3; + display:none; + + padding:0; + top:1.5em; + left:50%; + width:12em; + margin-left:-6em; + + border:1px solid #7B9EBD; + background-color:#F7F9FB; + font-size:93%; +} + +.yui-calcontainer.withtitle .yui-cal-nav { + top:3.5em; +} + +.yui-calcontainer .yui-cal-nav-y, +.yui-calcontainer .yui-cal-nav-m, +.yui-calcontainer .yui-cal-nav-b { + padding:2px 5px 2px 5px; +} + +.yui-calcontainer .yui-cal-nav-b { + text-align:center; +} + +.yui-calcontainer .yui-cal-nav-e { + margin-top:2px; + padding:2px; + background-color:#EDF5FF; + border-top:1px solid black; + display:none; +} + +.yui-calcontainer .yui-cal-nav label { + display:block; + font-weight:bold; +} + +.yui-calcontainer .yui-cal-nav-mc { + width:100%; + _width:auto; /* IE6 doesn't like width 100% */ +} + +.yui-calcontainer .yui-cal-nav-y input.yui-invalid { + background-color:#FFEE69; + border: 1px solid #000; +} + +.yui-calcontainer .yui-cal-nav-yc { + width:3em; +} + +.yui-calcontainer .yui-cal-nav-b button { + font-size:93%; + text-decoration:none; + cursor: pointer; + background-color: #79b2ea; + border: 1px solid #003366; + border-top-color:#FFF; + border-left-color:#FFF; + margin:1px; +} + +.yui-calcontainer .yui-cal-nav-b .yui-default button { + /* not implemented */ +} + +/* Specific changes for calendar running under fonts/reset */ +.yui-calendar .calbody a:hover {background:inherit;} +p#clear {clear:left; padding-top:10px;} diff --git a/lib/yui/calendar/assets/calgrad.png b/lib/yui/calendar/assets/calgrad.png new file mode 100644 index 0000000000000000000000000000000000000000..9be3d958c746ded4969acf34d7f86d76c3687314 GIT binary patch literal 497 zcmVAX0@tbEX_lf-Yf{5=MAjkHT4uzgdmI zVwT8Zl*V3>#8-;EVU)*XmdRX?!7^l*JaD3Am&;?8$YhtwBUOl7kHTJ&#b1%cRED}r zeXuHBkTqzV98ZEVWS3@{%zNWqssI20$4Nv%RCwBK#_1M9P!t8=ouU##rbL>|G)VLG z{%_T}mesGmz0bZEpCA1H))mLq99Pv9j;WKTM`ycr;Fe`pW^R_b$n&dq(ejI?Av#l{ z9R+b5C#*>V6etQh0H$f)#wLS)r_&bdsG+JO+<%}b%7D;dIH9naz*<@Jxn z0=kUdwQU>IXKRZ6yFm{Y3u8kuj13-*85N=^dKA&~z>^b&=dtWDOM+Kx{empZK_Cb8 nz}J19Rre7}k`%I$z5)yYWr-#SjNuqv00000NkvXXu0mjfG2YZl literal 0 HcmV?d00001 diff --git a/lib/yui/calendar/assets/callt.gif b/lib/yui/calendar/assets/callt.gif new file mode 100755 index 0000000000000000000000000000000000000000..a6cc8da5b221d372ea075b3a4a10211d3a23cb51 GIT binary patch literal 93 zcmZ?wbhEHb|1*Gr;!hSv1_o9J9S{$smVsF* qV%6o-OdT896eo&R8_GI9Z+s-tb-65V<*lvjzBf272=!xPum%9G>mWw} literal 0 HcmV?d00001 diff --git a/lib/yui/calendar/assets/calrt.gif b/lib/yui/calendar/assets/calrt.gif new file mode 100755 index 0000000000000000000000000000000000000000..ee137b2ff769d99132234b67f1e528daf65cb397 GIT binary patch literal 94 zcmZ?wbhEHb|1*Gr;!hSv1_o9J9S{$smVsG0 rV)Ip7rjCbGR9fsBH@3+N1|(QayL)o!6Ro<}FL)f+p7oi^z+epk(%c}| literal 0 HcmV?d00001 diff --git a/lib/yui/calendar/assets/calx.gif b/lib/yui/calendar/assets/calx.gif new file mode 100755 index 0000000000000000000000000000000000000000..27e7bc36e4524623db3c43f4d86717a703f37406 GIT binary patch literal 88 zcmZ?wbhEHb6lCCKn8?J?-rj!k;>G{}|1&T!DE?$&WME)o&;ha;K=KSsnmzrMhu-GT qE4kQMmbu}I7_0#*o**Fr literal 0 HcmV?d00001 diff --git a/lib/yui/calendar/assets/skins/sam/calendar-skin.css b/lib/yui/calendar/assets/skins/sam/calendar-skin.css new file mode 100755 index 0000000000..d498919d93 --- /dev/null +++ b/lib/yui/calendar/assets/skins/sam/calendar-skin.css @@ -0,0 +1,361 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +/** + * SAM + * + * Skin colors used: + * + * - Control Border : 808080 + * - Control Chrome : f2f2f2 + * - Cell Borders : cccccc + * - Normal Cell BG : ffffff + * - Date Links : 0066cc + * - Selected Cells BG : b3d4ff + * - Cell Hover BG : 426fd9 + * - Disabled BG : cccccc + * - Disabled Text Color : a6a6a6 + **/ + +/* CALENDAR BOUNDING BOX */ +.yui-skin-sam .yui-calcontainer { + background-color:#f2f2f2; + border:1px solid #808080; + padding:10px; +} + +/* CALENDARGROUP BOUNDING BOX */ +.yui-skin-sam .yui-calcontainer.multi { + padding:0 5px 0 5px; +} + +/* BOUNDING BOX FOR EACH CALENDAR GROUP PAGE */ +.yui-skin-sam .yui-calcontainer.multi .groupcal { + background-color:transparent; + border:none; + padding:10px 5px 10px 5px; + margin:0; +} + +/* TITLE BAR */ +.yui-skin-sam .yui-calcontainer .title { + background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; + border-bottom:1px solid #cccccc; + font:100% sans-serif; + color:#000; + font-weight:bold; + height:auto; + padding:.4em; + margin:0 -10px 10px -10px; + top:0; + left:0; + text-align:left; +} + +.yui-skin-sam .yui-calcontainer.multi .title { + margin:0 -5px 0 -5px; +} + +.yui-skin-sam .yui-calcontainer.withtitle { + padding-top:0; +} + +/* CLOSE BUTTON */ +.yui-skin-sam .yui-calcontainer .calclose { + background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px; + width:25px; + height:15px; + top:.4em; + right:.4em; + cursor:pointer; +} + +/* CALENDAR TABLE */ +.yui-skin-sam .yui-calendar { + border-spacing:0; + border-collapse:collapse; + font:100% sans-serif; + text-align:center; + margin:0; +} + +/* NAVBAR BOUNDING BOX */ +.yui-skin-sam .yui-calendar .calhead { + background:transparent; + border:none; + vertical-align:middle; + padding:0; +} + +/* NAVBAR TEXT CONTAINER */ +.yui-skin-sam .yui-calendar .calheader { + background:transparent; + font-weight:bold; + padding:0 0 .6em 0; + text-align:center; +} + +.yui-skin-sam .yui-calendar .calheader img { + border:none; +} + +/* NAVBAR LEFT ARROW */ +.yui-skin-sam .yui-calendar .calnavleft { + background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -450px; + width:25px; + height:15px; + top:0; + bottom:0; + left:-10px; + margin-left:.4em; + cursor:pointer; +} + +/* NAVBAR RIGHT ARROW */ +.yui-skin-sam .yui-calendar .calnavright { + background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -500px; + width:25px; + height:15px; + top:0; + bottom:0; + right:-10px; + margin-right:.4em; + cursor:pointer; +} + +/* WEEKDAY HEADER ROW */ +.yui-skin-sam .yui-calendar .calweekdayrow { + height:2em; +} + +.yui-skin-sam .yui-calendar .calweekdayrow th { + padding:0; + border:none; +} + +/* WEEKDAY (Su, Mo, Tu...) HEADER CELLS */ +.yui-skin-sam .yui-calendar .calweekdaycell { + color:#000; + font-weight:bold; + text-align:center; + width:2em; +} + +/* CALENDAR FOOTER. NOT IMPLEMENTED BY DEFAULT */ +.yui-skin-sam .yui-calendar .calfoot { + background-color:#f2f2f2; +} + +/* WEEK NUMBERS (ROW HEADERS/FOOTERS) */ +.yui-skin-sam .yui-calendar .calrowhead, .yui-skin-sam .yui-calendar .calrowfoot { + color:#a6a6a6; + font-size:85%; + font-style:normal; + font-weight:normal; + border:none; +} + +.yui-skin-sam .yui-calendar .calrowhead { + text-align:right; + padding:0 2px 0 0; +} + +.yui-skin-sam .yui-calendar .calrowfoot { + text-align:left; + padding:0 0 0 2px; +} + +/* NORMAL CELLS */ +.yui-skin-sam .yui-calendar td.calcell { + border:1px solid #cccccc; + background:#fff; + padding:1px; + height:1.6em; + line-height:1.6em; /* set line height equal to cell height to center vertically */ + text-align:center; + white-space:nowrap; +} + +/* LINK INSIDE NORMAL CELLS */ +.yui-skin-sam .yui-calendar td.calcell a { + color:#0066cc; + display:block; + height:100%; + text-decoration:none; +} + +/* TODAY'S DATE */ +.yui-skin-sam .yui-calendar td.calcell.today { + background-color:#000; +} + +.yui-skin-sam .yui-calendar td.calcell.today a { + background-color:#fff; +} + +/* OOM DATES */ +.yui-skin-sam .yui-calendar td.calcell.oom { + background-color:#cccccc; + color:#a6a6a6; + cursor:default; +} + +/* SELECTED DATE */ +.yui-skin-sam .yui-calendar td.calcell.selected { + background-color:#fff; + color:#000; +} + +.yui-skin-sam .yui-calendar td.calcell.selected a { + background-color:#b3d4ff; + color:#000; +} + +/* HOVER DATE */ +.yui-skin-sam .yui-calendar td.calcell.calcellhover { + background-color:#426fd9; + color:#fff; + cursor:pointer; +} + +.yui-skin-sam .yui-calendar td.calcell.calcellhover a { + background-color:#426fd9; + color:#fff; +} + +/* DEFAULT OOB DATES */ +.yui-skin-sam .yui-calendar td.calcell.previous { + color:#e0e0e0; +} + +/* CUSTOM RENDERERS */ +.yui-skin-sam .yui-calendar td.calcell.restricted { text-decoration:line-through; } +.yui-skin-sam .yui-calendar td.calcell.highlight1 { background-color:#ccff99; } +.yui-skin-sam .yui-calendar td.calcell.highlight2 { background-color:#99ccff; } +.yui-skin-sam .yui-calendar td.calcell.highlight3 { background-color:#ffcccc; } +.yui-skin-sam .yui-calendar td.calcell.highlight4 { background-color:#ccff99; } + +/* CalendarNavigator */ + +/* MONTH/YEAR LABEL */ +.yui-skin-sam .yui-calendar a.calnav { + border: 1px solid #f2f2f2; + padding:0 4px; + text-decoration:none; + color:#000; + zoom:1; +} + +.yui-skin-sam .yui-calendar a.calnav:hover { + background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; + border-color:#A0A0A0; + cursor:pointer; +} + +/* NAVIGATOR MASK */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask { + background-color:#000; + opacity:0.25; + *filter:alpha(opacity=25); /* IE */ +} + +/* NAVIGATOR BOUNDING BOX */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav { + font-family:arial,helvetica,clean,sans-serif; + font-size:93%; + border:1px solid #808080; + left:50%; + margin-left:-7em; + width:14em; + padding:0; + top:2.5em; + background-color:#f2f2f2; +} + +.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav { + top:4.5em; +} + +/* NAVIGATOR BOUNDING BOX */ +.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav { + width:16em; + margin-left:-8em; +} + +/* NAVIGATOR YEAR/MONTH/BUTTON/ERROR BOUNDING BLOCKS */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav-y, +.yui-skin-sam .yui-calcontainer .yui-cal-nav-m, +.yui-skin-sam .yui-calcontainer .yui-cal-nav-b { + padding:5px 10px 5px 10px; +} + +.yui-skin-sam .yui-calcontainer .yui-cal-nav-b { + text-align:center; +} + +.yui-skin-sam .yui-calcontainer .yui-cal-nav-e { + margin-top:5px; + padding:5px; + background-color:#EDF5FF; + border-top:1px solid black; + display:none; +} + +/* NAVIGATOR LABELS */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav label { + display:block; + font-weight:bold; +} + +/* NAVIGATOR MONTH CONTROL */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc { + width:100%; + _width:auto; /* IE6, IE7 Quirks don't handle 100% well */ +} + +/* NAVIGATOR MONTH CONTROL, VALIDATION ERROR */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid { + background-color:#FFEE69; + border: 1px solid #000; +} + +/* NAVIGATOR YEAR CONTROL */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc { + width:4em; +} + +/* NAVIGATOR BUTTONS */ + +/* BUTTON WRAPPER */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn { + border:1px solid #808080; + background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0; + background-color:#ccc; + margin: auto .15em; +} + +/* BUTTON (based on button-skin.css) */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button { + padding:0 8px; + font-size:93%; + line-height: 2; /* ~24px */ + *line-height: 1.7; /* For IE */ + min-height: 2em; /* For Gecko */ + *min-height: auto; /* For IE */ + color: #000; +} + +/* DEFAULT BUTTONS */ +/* NOTE: IE6 will only pickup the yui-default specifier from the multiple class specifier */ +.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default { + border:1px solid #304369; + background-color: #426fd9; + background: url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px; +} + +.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button { + color:#fff; +} diff --git a/lib/yui/calendar/assets/skins/sam/calendar.css b/lib/yui/calendar/assets/skins/sam/calendar.css new file mode 100755 index 0000000000..8da25a4783 --- /dev/null +++ b/lib/yui/calendar/assets/skins/sam/calendar.css @@ -0,0 +1,7 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +.yui-calcontainer{position:relative;float:left;_overflow:hidden;}.yui-calcontainer iframe{position:absolute;border:none;margin:0;padding:0;z-index:0;width:100%;height:100%;left:0px;top:0px;}.yui-calcontainer iframe.fixedsize{width:50em;height:50em;top:-1px;left:-1px;}.yui-calcontainer.multi .groupcal{z-index:1;float:left;position:relative;}.yui-calcontainer .title{position:relative;z-index:1;}.yui-calcontainer .close-icon{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar{position:relative;}.yui-calendar .calnavleft{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar .calnavright{position:absolute;z-index:1;text-indent:-10000em;overflow:hidden;}.yui-calendar .calheader{position:relative;width:100%;text-align:center;}.yui-calcontainer .yui-cal-nav-mask{position:absolute;z-index:2;margin:0;padding:0;width:100%;height:100%;_width:0;_height:0;left:0;top:0;display:none;}.yui-calcontainer .yui-cal-nav{position:absolute;z-index:3;top:0;display:none;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{display:-moz-inline-box;display:inline-block;}.yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{display:block;*display:inline-block;*overflow:visible;border:none;background-color:transparent;cursor:pointer;}.yui-calendar .calbody a:hover{background:inherit;}p#clear{clear:left;padding-top:10px;}.yui-skin-sam .yui-calcontainer{background-color:#f2f2f2;border:1px solid #808080;padding:10px;}.yui-skin-sam .yui-calcontainer.multi{padding:0 5px 0 5px;}.yui-skin-sam .yui-calcontainer.multi .groupcal{background-color:transparent;border:none;padding:10px 5px 10px 5px;margin:0;}.yui-skin-sam .yui-calcontainer .title{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border-bottom:1px solid #cccccc;font:100% sans-serif;color:#000;font-weight:bold;height:auto;padding:.4em;margin:0 -10px 10px -10px;top:0;left:0;text-align:left;}.yui-skin-sam .yui-calcontainer.multi .title{margin:0 -5px 0 -5px;}.yui-skin-sam .yui-calcontainer.withtitle{padding-top:0;}.yui-skin-sam .yui-calcontainer .calclose{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -300px;width:25px;height:15px;top:.4em;right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar{border-spacing:0;border-collapse:collapse;font:100% sans-serif;text-align:center;margin:0;}.yui-skin-sam .yui-calendar .calhead{background:transparent;border:none;vertical-align:middle;padding:0;}.yui-skin-sam .yui-calendar .calheader{background:transparent;font-weight:bold;padding:0 0 .6em 0;text-align:center;}.yui-skin-sam .yui-calendar .calheader img{border:none;}.yui-skin-sam .yui-calendar .calnavleft{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -450px;width:25px;height:15px;top:0;bottom:0;left:-10px;margin-left:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calnavright{background:url(../../../../assets/skins/sam/sprite.png) no-repeat 0 -500px;width:25px;height:15px;top:0;bottom:0;right:-10px;margin-right:.4em;cursor:pointer;}.yui-skin-sam .yui-calendar .calweekdayrow{height:2em;}.yui-skin-sam .yui-calendar .calweekdayrow th{padding:0;border:none;}.yui-skin-sam .yui-calendar .calweekdaycell{color:#000;font-weight:bold;text-align:center;width:2em;}.yui-skin-sam .yui-calendar .calfoot{background-color:#f2f2f2;}.yui-skin-sam .yui-calendar .calrowhead,.yui-skin-sam .yui-calendar .calrowfoot{color:#a6a6a6;font-size:85%;font-style:normal;font-weight:normal;border:none;}.yui-skin-sam .yui-calendar .calrowhead{text-align:right;padding:0 2px 0 0;}.yui-skin-sam .yui-calendar .calrowfoot{text-align:left;padding:0 0 0 2px;}.yui-skin-sam .yui-calendar td.calcell{border:1px solid #cccccc;background:#fff;padding:1px;height:1.6em;line-height:1.6em;text-align:center;white-space:nowrap;}.yui-skin-sam .yui-calendar td.calcell a{color:#0066cc;display:block;height:100%;text-decoration:none;}.yui-skin-sam .yui-calendar td.calcell.today{background-color:#000;}.yui-skin-sam .yui-calendar td.calcell.today a{background-color:#fff;}.yui-skin-sam .yui-calendar td.calcell.oom{background-color:#cccccc;color:#a6a6a6;cursor:default;}.yui-skin-sam .yui-calendar td.calcell.selected{background-color:#fff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.selected a{background-color:#b3d4ff;color:#000;}.yui-skin-sam .yui-calendar td.calcell.calcellhover{background-color:#426fd9;color:#fff;cursor:pointer;}.yui-skin-sam .yui-calendar td.calcell.calcellhover a{background-color:#426fd9;color:#fff;}.yui-skin-sam .yui-calendar td.calcell.previous{color:#e0e0e0;}.yui-skin-sam .yui-calendar td.calcell.restricted{text-decoration:line-through;}.yui-skin-sam .yui-calendar td.calcell.highlight1{background-color:#ccff99;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#99ccff;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#ffcccc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#ccff99;}.yui-skin-sam .yui-calendar a.calnav{border:1px solid #f2f2f2;padding:0 4px;text-decoration:none;color:#000;zoom:1;}.yui-skin-sam .yui-calendar a.calnav:hover{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;border-color:#A0A0A0;cursor:pointer;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mask{background-color:#000;opacity:0.25;*filter:alpha(opacity=25);}.yui-skin-sam .yui-calcontainer .yui-cal-nav{font-family:arial,helvetica,clean,sans-serif;font-size:93%;border:1px solid #808080;left:50%;margin-left:-7em;width:14em;padding:0;top:2.5em;background-color:#f2f2f2;}.yui-skin-sam .yui-calcontainer.withtitle .yui-cal-nav{top:4.5em;}.yui-skin-sam .yui-calcontainer.multi .yui-cal-nav{width:16em;margin-left:-8em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y,.yui-skin-sam .yui-calcontainer .yui-cal-nav-m,.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{padding:5px 10px 5px 10px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-b{text-align:center;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-e{margin-top:5px;padding:5px;background-color:#EDF5FF;border-top:1px solid black;display:none;}.yui-skin-sam .yui-calcontainer .yui-cal-nav label{display:block;font-weight:bold;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-mc{width:100%;_width:auto;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-y input.yui-invalid{background-color:#FFEE69;border:1px solid #000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav-yc{width:4em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn{border:1px solid #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;background-color:#ccc;margin:auto .15em;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button{padding:0 8px;font-size:93%;line-height:2;*line-height:1.7;min-height:2em;*min-height:auto;color:#000;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default{border:1px solid #304369;background-color:#426fd9;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px;}.yui-skin-sam .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn.yui-default button{color:#fff;} diff --git a/lib/yui/calendar/calendar-debug.js b/lib/yui/calendar/calendar-debug.js new file mode 100755 index 0000000000..689843ca61 --- /dev/null +++ b/lib/yui/calendar/calendar-debug.js @@ -0,0 +1,7168 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.6.0 +*/ +(function () { + + /** + * Config is a utility used within an Object to allow the implementer to + * maintain a list of local configuration properties and listen for changes + * to those properties dynamically using CustomEvent. The initial values are + * also maintained so that the configuration can be reset at any given point + * to its initial state. + * @namespace YAHOO.util + * @class Config + * @constructor + * @param {Object} owner The owner Object to which this Config Object belongs + */ + YAHOO.util.Config = function (owner) { + + if (owner) { + this.init(owner); + } + + if (!owner) { YAHOO.log("No owner specified for Config object", "error", "Config"); } + + }; + + + var Lang = YAHOO.lang, + CustomEvent = YAHOO.util.CustomEvent, + Config = YAHOO.util.Config; + + + /** + * Constant representing the CustomEvent type for the config changed event. + * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT + * @private + * @static + * @final + */ + Config.CONFIG_CHANGED_EVENT = "configChanged"; + + /** + * Constant representing the boolean type string + * @property YAHOO.util.Config.BOOLEAN_TYPE + * @private + * @static + * @final + */ + Config.BOOLEAN_TYPE = "boolean"; + + Config.prototype = { + + /** + * Object reference to the owner of this Config Object + * @property owner + * @type Object + */ + owner: null, + + /** + * Boolean flag that specifies whether a queue is currently + * being executed + * @property queueInProgress + * @type Boolean + */ + queueInProgress: false, + + /** + * Maintains the local collection of configuration property objects and + * their specified values + * @property config + * @private + * @type Object + */ + config: null, + + /** + * Maintains the local collection of configuration property objects as + * they were initially applied. + * This object is used when resetting a property. + * @property initialConfig + * @private + * @type Object + */ + initialConfig: null, + + /** + * Maintains the local, normalized CustomEvent queue + * @property eventQueue + * @private + * @type Object + */ + eventQueue: null, + + /** + * Custom Event, notifying subscribers when Config properties are set + * (setProperty is called without the silent flag + * @event configChangedEvent + */ + configChangedEvent: null, + + /** + * Initializes the configuration Object and all of its local members. + * @method init + * @param {Object} owner The owner Object to which this Config + * Object belongs + */ + init: function (owner) { + + this.owner = owner; + + this.configChangedEvent = + this.createEvent(Config.CONFIG_CHANGED_EVENT); + + this.configChangedEvent.signature = CustomEvent.LIST; + this.queueInProgress = false; + this.config = {}; + this.initialConfig = {}; + this.eventQueue = []; + + }, + + /** + * Validates that the value passed in is a Boolean. + * @method checkBoolean + * @param {Object} val The value to validate + * @return {Boolean} true, if the value is valid + */ + checkBoolean: function (val) { + return (typeof val == Config.BOOLEAN_TYPE); + }, + + /** + * Validates that the value passed in is a number. + * @method checkNumber + * @param {Object} val The value to validate + * @return {Boolean} true, if the value is valid + */ + checkNumber: function (val) { + return (!isNaN(val)); + }, + + /** + * Fires a configuration property event using the specified value. + * @method fireEvent + * @private + * @param {String} key The configuration property's name + * @param {value} Object The value of the correct type for the property + */ + fireEvent: function ( key, value ) { + YAHOO.log("Firing Config event: " + key + "=" + value, "info", "Config"); + var property = this.config[key]; + + if (property && property.event) { + property.event.fire(value); + } + }, + + /** + * Adds a property to the Config Object's private config hash. + * @method addProperty + * @param {String} key The configuration property's name + * @param {Object} propertyObject The Object containing all of this + * property's arguments + */ + addProperty: function ( key, propertyObject ) { + key = key.toLowerCase(); + YAHOO.log("Added property: " + key, "info", "Config"); + + this.config[key] = propertyObject; + + propertyObject.event = this.createEvent(key, { scope: this.owner }); + propertyObject.event.signature = CustomEvent.LIST; + + + propertyObject.key = key; + + if (propertyObject.handler) { + propertyObject.event.subscribe(propertyObject.handler, + this.owner); + } + + this.setProperty(key, propertyObject.value, true); + + if (! propertyObject.suppressEvent) { + this.queueProperty(key, propertyObject.value); + } + + }, + + /** + * Returns a key-value configuration map of the values currently set in + * the Config Object. + * @method getConfig + * @return {Object} The current config, represented in a key-value map + */ + getConfig: function () { + + var cfg = {}, + currCfg = this.config, + prop, + property; + + for (prop in currCfg) { + if (Lang.hasOwnProperty(currCfg, prop)) { + property = currCfg[prop]; + if (property && property.event) { + cfg[prop] = property.value; + } + } + } + + return cfg; + }, + + /** + * Returns the value of specified property. + * @method getProperty + * @param {String} key The name of the property + * @return {Object} The value of the specified property + */ + getProperty: function (key) { + var property = this.config[key.toLowerCase()]; + if (property && property.event) { + return property.value; + } else { + return undefined; + } + }, + + /** + * Resets the specified property's value to its initial value. + * @method resetProperty + * @param {String} key The name of the property + * @return {Boolean} True is the property was reset, false if not + */ + resetProperty: function (key) { + + key = key.toLowerCase(); + + var property = this.config[key]; + + if (property && property.event) { + + if (this.initialConfig[key] && + !Lang.isUndefined(this.initialConfig[key])) { + + this.setProperty(key, this.initialConfig[key]); + + return true; + + } + + } else { + + return false; + } + + }, + + /** + * Sets the value of a property. If the silent property is passed as + * true, the property's event will not be fired. + * @method setProperty + * @param {String} key The name of the property + * @param {String} value The value to set the property to + * @param {Boolean} silent Whether the value should be set silently, + * without firing the property event. + * @return {Boolean} True, if the set was successful, false if it failed. + */ + setProperty: function (key, value, silent) { + + var property; + + key = key.toLowerCase(); + YAHOO.log("setProperty: " + key + "=" + value, "info", "Config"); + + if (this.queueInProgress && ! silent) { + // Currently running through a queue... + this.queueProperty(key,value); + return true; + + } else { + property = this.config[key]; + if (property && property.event) { + if (property.validator && !property.validator(value)) { + return false; + } else { + property.value = value; + if (! silent) { + this.fireEvent(key, value); + this.configChangedEvent.fire([key, value]); + } + return true; + } + } else { + return false; + } + } + }, + + /** + * Sets the value of a property and queues its event to execute. If the + * event is already scheduled to execute, it is + * moved from its current position to the end of the queue. + * @method queueProperty + * @param {String} key The name of the property + * @param {String} value The value to set the property to + * @return {Boolean} true, if the set was successful, false if + * it failed. + */ + queueProperty: function (key, value) { + + key = key.toLowerCase(); + YAHOO.log("queueProperty: " + key + "=" + value, "info", "Config"); + + var property = this.config[key], + foundDuplicate = false, + iLen, + queueItem, + queueItemKey, + queueItemValue, + sLen, + supercedesCheck, + qLen, + queueItemCheck, + queueItemCheckKey, + queueItemCheckValue, + i, + s, + q; + + if (property && property.event) { + + if (!Lang.isUndefined(value) && property.validator && + !property.validator(value)) { // validator + return false; + } else { + + if (!Lang.isUndefined(value)) { + property.value = value; + } else { + value = property.value; + } + + foundDuplicate = false; + iLen = this.eventQueue.length; + + for (i = 0; i < iLen; i++) { + queueItem = this.eventQueue[i]; + + if (queueItem) { + queueItemKey = queueItem[0]; + queueItemValue = queueItem[1]; + + if (queueItemKey == key) { + + /* + found a dupe... push to end of queue, null + current item, and break + */ + + this.eventQueue[i] = null; + + this.eventQueue.push( + [key, (!Lang.isUndefined(value) ? + value : queueItemValue)]); + + foundDuplicate = true; + break; + } + } + } + + // this is a refire, or a new property in the queue + + if (! foundDuplicate && !Lang.isUndefined(value)) { + this.eventQueue.push([key, value]); + } + } + + if (property.supercedes) { + + sLen = property.supercedes.length; + + for (s = 0; s < sLen; s++) { + + supercedesCheck = property.supercedes[s]; + qLen = this.eventQueue.length; + + for (q = 0; q < qLen; q++) { + queueItemCheck = this.eventQueue[q]; + + if (queueItemCheck) { + queueItemCheckKey = queueItemCheck[0]; + queueItemCheckValue = queueItemCheck[1]; + + if (queueItemCheckKey == + supercedesCheck.toLowerCase() ) { + + this.eventQueue.push([queueItemCheckKey, + queueItemCheckValue]); + + this.eventQueue[q] = null; + break; + + } + } + } + } + } + + YAHOO.log("Config event queue: " + this.outputEventQueue(), "info", "Config"); + + return true; + } else { + return false; + } + }, + + /** + * Fires the event for a property using the property's current value. + * @method refireEvent + * @param {String} key The name of the property + */ + refireEvent: function (key) { + + key = key.toLowerCase(); + + var property = this.config[key]; + + if (property && property.event && + + !Lang.isUndefined(property.value)) { + + if (this.queueInProgress) { + + this.queueProperty(key); + + } else { + + this.fireEvent(key, property.value); + + } + + } + }, + + /** + * Applies a key-value Object literal to the configuration, replacing + * any existing values, and queueing the property events. + * Although the values will be set, fireQueue() must be called for their + * associated events to execute. + * @method applyConfig + * @param {Object} userConfig The configuration Object literal + * @param {Boolean} init When set to true, the initialConfig will + * be set to the userConfig passed in, so that calling a reset will + * reset the properties to the passed values. + */ + applyConfig: function (userConfig, init) { + + var sKey, + oConfig; + + if (init) { + oConfig = {}; + for (sKey in userConfig) { + if (Lang.hasOwnProperty(userConfig, sKey)) { + oConfig[sKey.toLowerCase()] = userConfig[sKey]; + } + } + this.initialConfig = oConfig; + } + + for (sKey in userConfig) { + if (Lang.hasOwnProperty(userConfig, sKey)) { + this.queueProperty(sKey, userConfig[sKey]); + } + } + }, + + /** + * Refires the events for all configuration properties using their + * current values. + * @method refresh + */ + refresh: function () { + + var prop; + + for (prop in this.config) { + if (Lang.hasOwnProperty(this.config, prop)) { + this.refireEvent(prop); + } + } + }, + + /** + * Fires the normalized list of queued property change events + * @method fireQueue + */ + fireQueue: function () { + + var i, + queueItem, + key, + value, + property; + + this.queueInProgress = true; + for (i = 0;i < this.eventQueue.length; i++) { + queueItem = this.eventQueue[i]; + if (queueItem) { + + key = queueItem[0]; + value = queueItem[1]; + property = this.config[key]; + + property.value = value; + + this.fireEvent(key,value); + } + } + + this.queueInProgress = false; + this.eventQueue = []; + }, + + /** + * Subscribes an external handler to the change event for any + * given property. + * @method subscribeToConfigEvent + * @param {String} key The property name + * @param {Function} handler The handler function to use subscribe to + * the property's event + * @param {Object} obj The Object to use for scoping the event handler + * (see CustomEvent documentation) + * @param {Boolean} override Optional. If true, will override "this" + * within the handler to map to the scope Object passed into the method. + * @return {Boolean} True, if the subscription was successful, + * otherwise false. + */ + subscribeToConfigEvent: function (key, handler, obj, override) { + + var property = this.config[key.toLowerCase()]; + + if (property && property.event) { + if (!Config.alreadySubscribed(property.event, handler, obj)) { + property.event.subscribe(handler, obj, override); + } + return true; + } else { + return false; + } + + }, + + /** + * Unsubscribes an external handler from the change event for any + * given property. + * @method unsubscribeFromConfigEvent + * @param {String} key The property name + * @param {Function} handler The handler function to use subscribe to + * the property's event + * @param {Object} obj The Object to use for scoping the event + * handler (see CustomEvent documentation) + * @return {Boolean} True, if the unsubscription was successful, + * otherwise false. + */ + unsubscribeFromConfigEvent: function (key, handler, obj) { + var property = this.config[key.toLowerCase()]; + if (property && property.event) { + return property.event.unsubscribe(handler, obj); + } else { + return false; + } + }, + + /** + * Returns a string representation of the Config object + * @method toString + * @return {String} The Config object in string format. + */ + toString: function () { + var output = "Config"; + if (this.owner) { + output += " [" + this.owner.toString() + "]"; + } + return output; + }, + + /** + * Returns a string representation of the Config object's current + * CustomEvent queue + * @method outputEventQueue + * @return {String} The string list of CustomEvents currently queued + * for execution + */ + outputEventQueue: function () { + + var output = "", + queueItem, + q, + nQueue = this.eventQueue.length; + + for (q = 0; q < nQueue; q++) { + queueItem = this.eventQueue[q]; + if (queueItem) { + output += queueItem[0] + "=" + queueItem[1] + ", "; + } + } + return output; + }, + + /** + * Sets all properties to null, unsubscribes all listeners from each + * property's change event and all listeners from the configChangedEvent. + * @method destroy + */ + destroy: function () { + + var oConfig = this.config, + sProperty, + oProperty; + + + for (sProperty in oConfig) { + + if (Lang.hasOwnProperty(oConfig, sProperty)) { + + oProperty = oConfig[sProperty]; + + oProperty.event.unsubscribeAll(); + oProperty.event = null; + + } + + } + + this.configChangedEvent.unsubscribeAll(); + + this.configChangedEvent = null; + this.owner = null; + this.config = null; + this.initialConfig = null; + this.eventQueue = null; + + } + + }; + + + + /** + * Checks to determine if a particular function/Object pair are already + * subscribed to the specified CustomEvent + * @method YAHOO.util.Config.alreadySubscribed + * @static + * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check + * the subscriptions + * @param {Function} fn The function to look for in the subscribers list + * @param {Object} obj The execution scope Object for the subscription + * @return {Boolean} true, if the function/Object pair is already subscribed + * to the CustomEvent passed in + */ + Config.alreadySubscribed = function (evt, fn, obj) { + + var nSubscribers = evt.subscribers.length, + subsc, + i; + + if (nSubscribers > 0) { + i = nSubscribers - 1; + do { + subsc = evt.subscribers[i]; + if (subsc && subsc.obj == obj && subsc.fn == fn) { + return true; + } + } + while (i--); + } + + return false; + + }; + + YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider); + +}()); + +/** +* YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility +* used for adding, subtracting, and comparing dates. +* @namespace YAHOO.widget +* @class DateMath +*/ +YAHOO.widget.DateMath = { + /** + * Constant field representing Day + * @property DAY + * @static + * @final + * @type String + */ + DAY : "D", + + /** + * Constant field representing Week + * @property WEEK + * @static + * @final + * @type String + */ + WEEK : "W", + + /** + * Constant field representing Year + * @property YEAR + * @static + * @final + * @type String + */ + YEAR : "Y", + + /** + * Constant field representing Month + * @property MONTH + * @static + * @final + * @type String + */ + MONTH : "M", + + /** + * Constant field representing one day, in milliseconds + * @property ONE_DAY_MS + * @static + * @final + * @type Number + */ + ONE_DAY_MS : 1000*60*60*24, + + /** + * Constant field representing the date in first week of January + * which identifies the first week of the year. + *

    + * In the U.S, Jan 1st is normally used based on a Sunday start of week. + * ISO 8601, used widely throughout Europe, uses Jan 4th, based on a Monday start of week. + *

    + * @property WEEK_ONE_JAN_DATE + * @static + * @type Number + */ + WEEK_ONE_JAN_DATE : 1, + + /** + * Adds the specified amount of time to the this instance. + * @method add + * @param {Date} date The JavaScript Date object to perform addition on + * @param {String} field The field constant to be used for performing addition. + * @param {Number} amount The number of units (measured in the field constant) to add to the date. + * @return {Date} The resulting Date object + */ + add : function(date, field, amount) { + var d = new Date(date.getTime()); + switch (field) { + case this.MONTH: + var newMonth = date.getMonth() + amount; + var years = 0; + + if (newMonth < 0) { + while (newMonth < 0) { + newMonth += 12; + years -= 1; + } + } else if (newMonth > 11) { + while (newMonth > 11) { + newMonth -= 12; + years += 1; + } + } + + d.setMonth(newMonth); + d.setFullYear(date.getFullYear() + years); + break; + case this.DAY: + this._addDays(d, amount); + // d.setDate(date.getDate() + amount); + break; + case this.YEAR: + d.setFullYear(date.getFullYear() + amount); + break; + case this.WEEK: + this._addDays(d, (amount * 7)); + // d.setDate(date.getDate() + (amount * 7)); + break; + } + return d; + }, + + /** + * Private helper method to account for bug in Safari 2 (webkit < 420) + * when Date.setDate(n) is called with n less than -128 or greater than 127. + *

    + * Fix approach and original findings are available here: + * http://brianary.blogspot.com/2006/03/safari-date-bug.html + *

    + * @method _addDays + * @param {Date} d JavaScript date object + * @param {Number} nDays The number of days to add to the date object (can be negative) + * @private + */ + _addDays : function(d, nDays) { + if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420) { + if (nDays < 0) { + // Ensure we don't go below -128 (getDate() is always 1 to 31, so we won't go above 127) + for(var min = -128; nDays < min; nDays -= min) { + d.setDate(d.getDate() + min); + } + } else { + // Ensure we don't go above 96 + 31 = 127 + for(var max = 96; nDays > max; nDays -= max) { + d.setDate(d.getDate() + max); + } + } + // nDays should be remainder between -128 and 96 + } + d.setDate(d.getDate() + nDays); + }, + + /** + * Subtracts the specified amount of time from the this instance. + * @method subtract + * @param {Date} date The JavaScript Date object to perform subtraction on + * @param {Number} field The this field constant to be used for performing subtraction. + * @param {Number} amount The number of units (measured in the field constant) to subtract from the date. + * @return {Date} The resulting Date object + */ + subtract : function(date, field, amount) { + return this.add(date, field, (amount*-1)); + }, + + /** + * Determines whether a given date is before another date on the calendar. + * @method before + * @param {Date} date The Date object to compare with the compare argument + * @param {Date} compareTo The Date object to use for the comparison + * @return {Boolean} true if the date occurs before the compared date; false if not. + */ + before : function(date, compareTo) { + var ms = compareTo.getTime(); + if (date.getTime() < ms) { + return true; + } else { + return false; + } + }, + + /** + * Determines whether a given date is after another date on the calendar. + * @method after + * @param {Date} date The Date object to compare with the compare argument + * @param {Date} compareTo The Date object to use for the comparison + * @return {Boolean} true if the date occurs after the compared date; false if not. + */ + after : function(date, compareTo) { + var ms = compareTo.getTime(); + if (date.getTime() > ms) { + return true; + } else { + return false; + } + }, + + /** + * Determines whether a given date is between two other dates on the calendar. + * @method between + * @param {Date} date The date to check for + * @param {Date} dateBegin The start of the range + * @param {Date} dateEnd The end of the range + * @return {Boolean} true if the date occurs between the compared dates; false if not. + */ + between : function(date, dateBegin, dateEnd) { + if (this.after(date, dateBegin) && this.before(date, dateEnd)) { + return true; + } else { + return false; + } + }, + + /** + * Retrieves a JavaScript Date object representing January 1 of any given year. + * @method getJan1 + * @param {Number} calendarYear The calendar year for which to retrieve January 1 + * @return {Date} January 1 of the calendar year specified. + */ + getJan1 : function(calendarYear) { + return this.getDate(calendarYear,0,1); + }, + + /** + * Calculates the number of days the specified date is from January 1 of the specified calendar year. + * Passing January 1 to this function would return an offset value of zero. + * @method getDayOffset + * @param {Date} date The JavaScript date for which to find the offset + * @param {Number} calendarYear The calendar year to use for determining the offset + * @return {Number} The number of days since January 1 of the given year + */ + getDayOffset : function(date, calendarYear) { + var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1. + + // Find the number of days the passed in date is away from the calendar year start + var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS); + return dayOffset; + }, + + /** + * Calculates the week number for the given date. Can currently support standard + * U.S. week numbers, based on Jan 1st defining the 1st week of the year, and + * ISO8601 week numbers, based on Jan 4th defining the 1st week of the year. + * + * @method getWeekNumber + * @param {Date} date The JavaScript date for which to find the week number + * @param {Number} firstDayOfWeek The index of the first day of the week (0 = Sun, 1 = Mon ... 6 = Sat). + * Defaults to 0 + * @param {Number} janDate The date in the first week of January which defines week one for the year + * Defaults to the value of YAHOO.widget.DateMath.WEEK_ONE_JAN_DATE, which is 1 (Jan 1st). + * For the U.S, this is normally Jan 1st. ISO8601 uses Jan 4th to define the first week of the year. + * + * @return {Number} The number of the week containing the given date. + */ + getWeekNumber : function(date, firstDayOfWeek, janDate) { + + // Setup Defaults + firstDayOfWeek = firstDayOfWeek || 0; + janDate = janDate || this.WEEK_ONE_JAN_DATE; + + var targetDate = this.clearTime(date), + startOfWeek, + endOfWeek; + + if (targetDate.getDay() === firstDayOfWeek) { + startOfWeek = targetDate; + } else { + startOfWeek = this.getFirstDayOfWeek(targetDate, firstDayOfWeek); + } + + var startYear = startOfWeek.getFullYear(), + startTime = startOfWeek.getTime(); + + // DST shouldn't be a problem here, math is quicker than setDate(); + endOfWeek = new Date(startOfWeek.getTime() + 6*this.ONE_DAY_MS); + + var weekNum; + if (startYear !== endOfWeek.getFullYear() && endOfWeek.getDate() >= janDate) { + // If years don't match, endOfWeek is in Jan. and if the + // week has WEEK_ONE_JAN_DATE in it, it's week one by definition. + weekNum = 1; + } else { + // Get the 1st day of the 1st week, and + // find how many days away we are from it. + var weekOne = this.clearTime(this.getDate(startYear, 0, janDate)), + weekOneDayOne = this.getFirstDayOfWeek(weekOne, firstDayOfWeek); + + // Round days to smoothen out 1 hr DST diff + var daysDiff = Math.round((targetDate.getTime() - weekOneDayOne.getTime())/this.ONE_DAY_MS); + + // Calc. Full Weeks + var rem = daysDiff % 7; + var weeksDiff = (daysDiff - rem)/7; + weekNum = weeksDiff + 1; + } + return weekNum; + }, + + /** + * Get the first day of the week, for the give date. + * @param {Date} dt The date in the week for which the first day is required. + * @param {Number} startOfWeek The index for the first day of the week, 0 = Sun, 1 = Mon ... 6 = Sat (defaults to 0) + * @return {Date} The first day of the week + */ + getFirstDayOfWeek : function (dt, startOfWeek) { + startOfWeek = startOfWeek || 0; + var dayOfWeekIndex = dt.getDay(), + dayOfWeek = (dayOfWeekIndex - startOfWeek + 7) % 7; + + return this.subtract(dt, this.DAY, dayOfWeek); + }, + + /** + * Determines if a given week overlaps two different years. + * @method isYearOverlapWeek + * @param {Date} weekBeginDate The JavaScript Date representing the first day of the week. + * @return {Boolean} true if the date overlaps two different years. + */ + isYearOverlapWeek : function(weekBeginDate) { + var overlaps = false; + var nextWeek = this.add(weekBeginDate, this.DAY, 6); + if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) { + overlaps = true; + } + return overlaps; + }, + + /** + * Determines if a given week overlaps two different months. + * @method isMonthOverlapWeek + * @param {Date} weekBeginDate The JavaScript Date representing the first day of the week. + * @return {Boolean} true if the date overlaps two different months. + */ + isMonthOverlapWeek : function(weekBeginDate) { + var overlaps = false; + var nextWeek = this.add(weekBeginDate, this.DAY, 6); + if (nextWeek.getMonth() != weekBeginDate.getMonth()) { + overlaps = true; + } + return overlaps; + }, + + /** + * Gets the first day of a month containing a given date. + * @method findMonthStart + * @param {Date} date The JavaScript Date used to calculate the month start + * @return {Date} The JavaScript Date representing the first day of the month + */ + findMonthStart : function(date) { + var start = this.getDate(date.getFullYear(), date.getMonth(), 1); + return start; + }, + + /** + * Gets the last day of a month containing a given date. + * @method findMonthEnd + * @param {Date} date The JavaScript Date used to calculate the month end + * @return {Date} The JavaScript Date representing the last day of the month + */ + findMonthEnd : function(date) { + var start = this.findMonthStart(date); + var nextMonth = this.add(start, this.MONTH, 1); + var end = this.subtract(nextMonth, this.DAY, 1); + return end; + }, + + /** + * Clears the time fields from a given date, effectively setting the time to 12 noon. + * @method clearTime + * @param {Date} date The JavaScript Date for which the time fields will be cleared + * @return {Date} The JavaScript Date cleared of all time fields + */ + clearTime : function(date) { + date.setHours(12,0,0,0); + return date; + }, + + /** + * Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object + * are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations + * set the year to 19xx if a year (xx) which is less than 100 is provided. + *

    + * NOTE:Validation on argument values is not performed. It is the caller's responsibility to ensure + * arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor. + *

    + * @method getDate + * @param {Number} y Year. + * @param {Number} m Month index from 0 (Jan) to 11 (Dec). + * @param {Number} d (optional) Date from 1 to 31. If not provided, defaults to 1. + * @return {Date} The JavaScript date object with year, month, date set as provided. + */ + getDate : function(y, m, d) { + var dt = null; + if (YAHOO.lang.isUndefined(d)) { + d = 1; + } + if (y >= 100) { + dt = new Date(y, m, d); + } else { + dt = new Date(); + dt.setFullYear(y); + dt.setMonth(m); + dt.setDate(d); + dt.setHours(0,0,0,0); + } + return dt; + } +}; + +/** +* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month or +* multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes. +* @module calendar +* @title Calendar +* @namespace YAHOO.widget +* @requires yahoo,dom,event +*/ +(function(){ + + var Dom = YAHOO.util.Dom, + Event = YAHOO.util.Event, + Lang = YAHOO.lang, + DateMath = YAHOO.widget.DateMath; + +/** +* Calendar is the base class for the Calendar widget. In its most basic +* implementation, it has the ability to render a calendar widget on the page +* that can be manipulated to select a single date, move back and forth between +* months and years. +*

    To construct the placeholder for the calendar widget, the code is as +* follows: +*

    +* <div id="calContainer"></div> +* +*

    +*

    +* NOTE: As of 2.4.0, the constructor's ID argument is optional. +* The Calendar can be constructed by simply providing a container ID string, +* or a reference to a container DIV HTMLElement (the element needs to exist +* in the document). +* +* E.g.: +*

    +* var c = new YAHOO.widget.Calendar("calContainer", configOptions); +* +* or: +* +* var containerDiv = YAHOO.util.Dom.get("calContainer"); +* var c = new YAHOO.widget.Calendar(containerDiv, configOptions); +* +*

    +*

    +* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix. +* For example if an ID is not provided, and the container's ID is "calContainer", the Calendar's ID will be set to "calContainer_t". +*

    +* +* @namespace YAHOO.widget +* @class Calendar +* @constructor +* @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional. +* @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document. +* @param {Object} config optional The configuration object containing the initial configuration values for the Calendar. +*/ +function Calendar(id, containerId, config) { + this.init.apply(this, arguments); +} + +/** +* The path to be used for images loaded for the Calendar +* @property YAHOO.widget.Calendar.IMG_ROOT +* @static +* @deprecated You can now customize images by overriding the calclose, calnavleft and calnavright default CSS classes for the close icon, left arrow and right arrow respectively +* @type String +*/ +Calendar.IMG_ROOT = null; + +/** +* Type constant used for renderers to represent an individual date (M/D/Y) +* @property YAHOO.widget.Calendar.DATE +* @static +* @final +* @type String +*/ +Calendar.DATE = "D"; + +/** +* Type constant used for renderers to represent an individual date across any year (M/D) +* @property YAHOO.widget.Calendar.MONTH_DAY +* @static +* @final +* @type String +*/ +Calendar.MONTH_DAY = "MD"; + +/** +* Type constant used for renderers to represent a weekday +* @property YAHOO.widget.Calendar.WEEKDAY +* @static +* @final +* @type String +*/ +Calendar.WEEKDAY = "WD"; + +/** +* Type constant used for renderers to represent a range of individual dates (M/D/Y-M/D/Y) +* @property YAHOO.widget.Calendar.RANGE +* @static +* @final +* @type String +*/ +Calendar.RANGE = "R"; + +/** +* Type constant used for renderers to represent a month across any year +* @property YAHOO.widget.Calendar.MONTH +* @static +* @final +* @type String +*/ +Calendar.MONTH = "M"; + +/** +* Constant that represents the total number of date cells that are displayed in a given month +* @property YAHOO.widget.Calendar.DISPLAY_DAYS +* @static +* @final +* @type Number +*/ +Calendar.DISPLAY_DAYS = 42; + +/** +* Constant used for halting the execution of the remainder of the render stack +* @property YAHOO.widget.Calendar.STOP_RENDER +* @static +* @final +* @type String +*/ +Calendar.STOP_RENDER = "S"; + +/** +* Constant used to represent short date field string formats (e.g. Tu or Feb) +* @property YAHOO.widget.Calendar.SHORT +* @static +* @final +* @type String +*/ +Calendar.SHORT = "short"; + +/** +* Constant used to represent long date field string formats (e.g. Monday or February) +* @property YAHOO.widget.Calendar.LONG +* @static +* @final +* @type String +*/ +Calendar.LONG = "long"; + +/** +* Constant used to represent medium date field string formats (e.g. Mon) +* @property YAHOO.widget.Calendar.MEDIUM +* @static +* @final +* @type String +*/ +Calendar.MEDIUM = "medium"; + +/** +* Constant used to represent single character date field string formats (e.g. M, T, W) +* @property YAHOO.widget.Calendar.ONE_CHAR +* @static +* @final +* @type String +*/ +Calendar.ONE_CHAR = "1char"; + +/** +* The set of default Config property keys and values for the Calendar +* @property YAHOO.widget.Calendar._DEFAULT_CONFIG +* @final +* @static +* @private +* @type Object +*/ +Calendar._DEFAULT_CONFIG = { + // Default values for pagedate and selected are not class level constants - they are set during instance creation + PAGEDATE : {key:"pagedate", value:null}, + SELECTED : {key:"selected", value:null}, + TITLE : {key:"title", value:""}, + CLOSE : {key:"close", value:false}, + IFRAME : {key:"iframe", value:(YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) ? true : false}, + MINDATE : {key:"mindate", value:null}, + MAXDATE : {key:"maxdate", value:null}, + MULTI_SELECT : {key:"multi_select", value:false}, + START_WEEKDAY : {key:"start_weekday", value:0}, + SHOW_WEEKDAYS : {key:"show_weekdays", value:true}, + SHOW_WEEK_HEADER : {key:"show_week_header", value:false}, + SHOW_WEEK_FOOTER : {key:"show_week_footer", value:false}, + HIDE_BLANK_WEEKS : {key:"hide_blank_weeks", value:false}, + NAV_ARROW_LEFT: {key:"nav_arrow_left", value:null} , + NAV_ARROW_RIGHT : {key:"nav_arrow_right", value:null} , + MONTHS_SHORT : {key:"months_short", value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]}, + MONTHS_LONG: {key:"months_long", value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]}, + WEEKDAYS_1CHAR: {key:"weekdays_1char", value:["S", "M", "T", "W", "T", "F", "S"]}, + WEEKDAYS_SHORT: {key:"weekdays_short", value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]}, + WEEKDAYS_MEDIUM: {key:"weekdays_medium", value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]}, + WEEKDAYS_LONG: {key:"weekdays_long", value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]}, + LOCALE_MONTHS:{key:"locale_months", value:"long"}, + LOCALE_WEEKDAYS:{key:"locale_weekdays", value:"short"}, + DATE_DELIMITER:{key:"date_delimiter", value:","}, + DATE_FIELD_DELIMITER:{key:"date_field_delimiter", value:"/"}, + DATE_RANGE_DELIMITER:{key:"date_range_delimiter", value:"-"}, + MY_MONTH_POSITION:{key:"my_month_position", value:1}, + MY_YEAR_POSITION:{key:"my_year_position", value:2}, + MD_MONTH_POSITION:{key:"md_month_position", value:1}, + MD_DAY_POSITION:{key:"md_day_position", value:2}, + MDY_MONTH_POSITION:{key:"mdy_month_position", value:1}, + MDY_DAY_POSITION:{key:"mdy_day_position", value:2}, + MDY_YEAR_POSITION:{key:"mdy_year_position", value:3}, + MY_LABEL_MONTH_POSITION:{key:"my_label_month_position", value:1}, + MY_LABEL_YEAR_POSITION:{key:"my_label_year_position", value:2}, + MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix", value:" "}, + MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""}, + NAV: {key:"navigator", value: null}, + STRINGS : { + key:"strings", + value: { + previousMonth : "Previous Month", + nextMonth : "Next Month", + close: "Close" + }, + supercedes : ["close", "title"] + } +}; + +var DEF_CFG = Calendar._DEFAULT_CONFIG; + +/** +* The set of Custom Event types supported by the Calendar +* @property YAHOO.widget.Calendar._EVENT_TYPES +* @final +* @static +* @private +* @type Object +*/ +Calendar._EVENT_TYPES = { + BEFORE_SELECT : "beforeSelect", + SELECT : "select", + BEFORE_DESELECT : "beforeDeselect", + DESELECT : "deselect", + CHANGE_PAGE : "changePage", + BEFORE_RENDER : "beforeRender", + RENDER : "render", + BEFORE_DESTROY : "beforeDestroy", + DESTROY : "destroy", + RESET : "reset", + CLEAR : "clear", + BEFORE_HIDE : "beforeHide", + HIDE : "hide", + BEFORE_SHOW : "beforeShow", + SHOW : "show", + BEFORE_HIDE_NAV : "beforeHideNav", + HIDE_NAV : "hideNav", + BEFORE_SHOW_NAV : "beforeShowNav", + SHOW_NAV : "showNav", + BEFORE_RENDER_NAV : "beforeRenderNav", + RENDER_NAV : "renderNav" +}; + +/** +* The set of default style constants for the Calendar +* @property YAHOO.widget.Calendar._STYLES +* @final +* @static +* @private +* @type Object +*/ +Calendar._STYLES = { + CSS_ROW_HEADER: "calrowhead", + CSS_ROW_FOOTER: "calrowfoot", + CSS_CELL : "calcell", + CSS_CELL_SELECTOR : "selector", + CSS_CELL_SELECTED : "selected", + CSS_CELL_SELECTABLE : "selectable", + CSS_CELL_RESTRICTED : "restricted", + CSS_CELL_TODAY : "today", + CSS_CELL_OOM : "oom", + CSS_CELL_OOB : "previous", + CSS_HEADER : "calheader", + CSS_HEADER_TEXT : "calhead", + CSS_BODY : "calbody", + CSS_WEEKDAY_CELL : "calweekdaycell", + CSS_WEEKDAY_ROW : "calweekdayrow", + CSS_FOOTER : "calfoot", + CSS_CALENDAR : "yui-calendar", + CSS_SINGLE : "single", + CSS_CONTAINER : "yui-calcontainer", + CSS_NAV_LEFT : "calnavleft", + CSS_NAV_RIGHT : "calnavright", + CSS_NAV : "calnav", + CSS_CLOSE : "calclose", + CSS_CELL_TOP : "calcelltop", + CSS_CELL_LEFT : "calcellleft", + CSS_CELL_RIGHT : "calcellright", + CSS_CELL_BOTTOM : "calcellbottom", + CSS_CELL_HOVER : "calcellhover", + CSS_CELL_HIGHLIGHT1 : "highlight1", + CSS_CELL_HIGHLIGHT2 : "highlight2", + CSS_CELL_HIGHLIGHT3 : "highlight3", + CSS_CELL_HIGHLIGHT4 : "highlight4" +}; + +Calendar.prototype = { + + /** + * The configuration object used to set up the calendars various locale and style options. + * @property Config + * @private + * @deprecated Configuration properties should be set by calling Calendar.cfg.setProperty. + * @type Object + */ + Config : null, + + /** + * The parent CalendarGroup, only to be set explicitly by the parent group + * @property parent + * @type CalendarGroup + */ + parent : null, + + /** + * The index of this item in the parent group + * @property index + * @type Number + */ + index : -1, + + /** + * The collection of calendar table cells + * @property cells + * @type HTMLTableCellElement[] + */ + cells : null, + + /** + * The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays in the format of [YYYY, M, D]. + * @property cellDates + * @type Array[](Number[]) + */ + cellDates : null, + + /** + * The id that uniquely identifies this Calendar. + * @property id + * @type String + */ + id : null, + + /** + * The unique id associated with the Calendar's container + * @property containerId + * @type String + */ + containerId: null, + + /** + * The DOM element reference that points to this calendar's container element. The calendar will be inserted into this element when the shell is rendered. + * @property oDomContainer + * @type HTMLElement + */ + oDomContainer : null, + + /** + * A Date object representing today's date. + * @property today + * @type Date + */ + today : null, + + /** + * The list of render functions, along with required parameters, used to render cells. + * @property renderStack + * @type Array[] + */ + renderStack : null, + + /** + * A copy of the initial render functions created before rendering. + * @property _renderStack + * @private + * @type Array + */ + _renderStack : null, + + /** + * A reference to the CalendarNavigator instance created for this Calendar. + * Will be null if the "navigator" configuration property has not been set + * @property oNavigator + * @type CalendarNavigator + */ + oNavigator : null, + + /** + * The private list of initially selected dates. + * @property _selectedDates + * @private + * @type Array + */ + _selectedDates : null, + + /** + * A map of DOM event handlers to attach to cells associated with specific CSS class names + * @property domEventMap + * @type Object + */ + domEventMap : null, + + /** + * Protected helper used to parse Calendar constructor/init arguments. + * + * As of 2.4.0, Calendar supports a simpler constructor + * signature. This method reconciles arguments + * received in the pre 2.4.0 and 2.4.0 formats. + * + * @protected + * @method _parseArgs + * @param {Array} Function "arguments" array + * @return {Object} Object with id, container, config properties containing + * the reconciled argument values. + **/ + _parseArgs : function(args) { + /* + 2.4.0 Constructors signatures + + new Calendar(String) + new Calendar(HTMLElement) + new Calendar(String, ConfigObject) + new Calendar(HTMLElement, ConfigObject) + + Pre 2.4.0 Constructor signatures + + new Calendar(String, String) + new Calendar(String, HTMLElement) + new Calendar(String, String, ConfigObject) + new Calendar(String, HTMLElement, ConfigObject) + */ + var nArgs = {id:null, container:null, config:null}; + + if (args && args.length && args.length > 0) { + switch (args.length) { + case 1: + nArgs.id = null; + nArgs.container = args[0]; + nArgs.config = null; + break; + case 2: + if (Lang.isObject(args[1]) && !args[1].tagName && !(args[1] instanceof String)) { + nArgs.id = null; + nArgs.container = args[0]; + nArgs.config = args[1]; + } else { + nArgs.id = args[0]; + nArgs.container = args[1]; + nArgs.config = null; + } + break; + default: // 3+ + nArgs.id = args[0]; + nArgs.container = args[1]; + nArgs.config = args[2]; + break; + } + } else { + this.logger.log("Invalid constructor/init arguments", "error"); + } + return nArgs; + }, + + /** + * Initializes the Calendar widget. + * @method init + * + * @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional. + * @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document. + * @param {Object} config optional The configuration object containing the initial configuration values for the Calendar. + */ + init : function(id, container, config) { + // Normalize 2.4.0, pre 2.4.0 args + var nArgs = this._parseArgs(arguments); + + id = nArgs.id; + container = nArgs.container; + config = nArgs.config; + + this.oDomContainer = Dom.get(container); + if (!this.oDomContainer) { this.logger.log("Container not found in document.", "error"); } + + if (!this.oDomContainer.id) { + this.oDomContainer.id = Dom.generateId(); + } + if (!id) { + id = this.oDomContainer.id + "_t"; + } + + this.id = id; + this.containerId = this.oDomContainer.id; + + this.logger = new YAHOO.widget.LogWriter("Calendar " + this.id); + this.initEvents(); + + this.today = new Date(); + DateMath.clearTime(this.today); + + /** + * The Config object used to hold the configuration variables for the Calendar + * @property cfg + * @type YAHOO.util.Config + */ + this.cfg = new YAHOO.util.Config(this); + + /** + * The local object which contains the Calendar's options + * @property Options + * @type Object + */ + this.Options = {}; + + /** + * The local object which contains the Calendar's locale settings + * @property Locale + * @type Object + */ + this.Locale = {}; + + this.initStyles(); + + Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER); + Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE); + + this.cellDates = []; + this.cells = []; + this.renderStack = []; + this._renderStack = []; + + this.setupConfig(); + + if (config) { + this.cfg.applyConfig(config, true); + } + + this.cfg.fireQueue(); + }, + + /** + * Default Config listener for the iframe property. If the iframe config property is set to true, + * renders the built-in IFRAME shim if the container is relatively or absolutely positioned. + * + * @method configIframe + */ + configIframe : function(type, args, obj) { + var useIframe = args[0]; + + if (!this.parent) { + if (Dom.inDocument(this.oDomContainer)) { + if (useIframe) { + var pos = Dom.getStyle(this.oDomContainer, "position"); + + if (pos == "absolute" || pos == "relative") { + + if (!Dom.inDocument(this.iframe)) { + this.iframe = document.createElement("iframe"); + this.iframe.src = "javascript:false;"; + + Dom.setStyle(this.iframe, "opacity", "0"); + + if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) { + Dom.addClass(this.iframe, "fixedsize"); + } + + this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild); + } + } + } else { + if (this.iframe) { + if (this.iframe.parentNode) { + this.iframe.parentNode.removeChild(this.iframe); + } + this.iframe = null; + } + } + } + } + }, + + /** + * Default handler for the "title" property + * @method configTitle + */ + configTitle : function(type, args, obj) { + var title = args[0]; + + // "" disables title bar + if (title) { + this.createTitleBar(title); + } else { + var close = this.cfg.getProperty(DEF_CFG.CLOSE.key); + if (!close) { + this.removeTitleBar(); + } else { + this.createTitleBar(" "); + } + } + }, + + /** + * Default handler for the "close" property + * @method configClose + */ + configClose : function(type, args, obj) { + var close = args[0], + title = this.cfg.getProperty(DEF_CFG.TITLE.key); + + if (close) { + if (!title) { + this.createTitleBar(" "); + } + this.createCloseButton(); + } else { + this.removeCloseButton(); + if (!title) { + this.removeTitleBar(); + } + } + }, + + /** + * Initializes Calendar's built-in CustomEvents + * @method initEvents + */ + initEvents : function() { + + var defEvents = Calendar._EVENT_TYPES, + CE = YAHOO.util.CustomEvent, + cal = this; // To help with minification + + /** + * Fired before a selection is made + * @event beforeSelectEvent + */ + cal.beforeSelectEvent = new CE(defEvents.BEFORE_SELECT); + + /** + * Fired when a selection is made + * @event selectEvent + * @param {Array} Array of Date field arrays in the format [YYYY, MM, DD]. + */ + cal.selectEvent = new CE(defEvents.SELECT); + + /** + * Fired before a selection is made + * @event beforeDeselectEvent + */ + cal.beforeDeselectEvent = new CE(defEvents.BEFORE_DESELECT); + + /** + * Fired when a selection is made + * @event deselectEvent + * @param {Array} Array of Date field arrays in the format [YYYY, MM, DD]. + */ + cal.deselectEvent = new CE(defEvents.DESELECT); + + /** + * Fired when the Calendar page is changed + * @event changePageEvent + */ + cal.changePageEvent = new CE(defEvents.CHANGE_PAGE); + + /** + * Fired before the Calendar is rendered + * @event beforeRenderEvent + */ + cal.beforeRenderEvent = new CE(defEvents.BEFORE_RENDER); + + /** + * Fired when the Calendar is rendered + * @event renderEvent + */ + cal.renderEvent = new CE(defEvents.RENDER); + + /** + * Fired just before the Calendar is to be destroyed + * @event beforeDestroyEvent + */ + cal.beforeDestroyEvent = new CE(defEvents.BEFORE_DESTROY); + + /** + * Fired after the Calendar is destroyed. This event should be used + * for notification only. When this event is fired, important Calendar instance + * properties, dom references and event listeners have already been + * removed/dereferenced, and hence the Calendar instance is not in a usable + * state. + * + * @event destroyEvent + */ + cal.destroyEvent = new CE(defEvents.DESTROY); + + /** + * Fired when the Calendar is reset + * @event resetEvent + */ + cal.resetEvent = new CE(defEvents.RESET); + + /** + * Fired when the Calendar is cleared + * @event clearEvent + */ + cal.clearEvent = new CE(defEvents.CLEAR); + + /** + * Fired just before the Calendar is to be shown + * @event beforeShowEvent + */ + cal.beforeShowEvent = new CE(defEvents.BEFORE_SHOW); + + /** + * Fired after the Calendar is shown + * @event showEvent + */ + cal.showEvent = new CE(defEvents.SHOW); + + /** + * Fired just before the Calendar is to be hidden + * @event beforeHideEvent + */ + cal.beforeHideEvent = new CE(defEvents.BEFORE_HIDE); + + /** + * Fired after the Calendar is hidden + * @event hideEvent + */ + cal.hideEvent = new CE(defEvents.HIDE); + + /** + * Fired just before the CalendarNavigator is to be shown + * @event beforeShowNavEvent + */ + cal.beforeShowNavEvent = new CE(defEvents.BEFORE_SHOW_NAV); + + /** + * Fired after the CalendarNavigator is shown + * @event showNavEvent + */ + cal.showNavEvent = new CE(defEvents.SHOW_NAV); + + /** + * Fired just before the CalendarNavigator is to be hidden + * @event beforeHideNavEvent + */ + cal.beforeHideNavEvent = new CE(defEvents.BEFORE_HIDE_NAV); + + /** + * Fired after the CalendarNavigator is hidden + * @event hideNavEvent + */ + cal.hideNavEvent = new CE(defEvents.HIDE_NAV); + + /** + * Fired just before the CalendarNavigator is to be rendered + * @event beforeRenderNavEvent + */ + cal.beforeRenderNavEvent = new CE(defEvents.BEFORE_RENDER_NAV); + + /** + * Fired after the CalendarNavigator is rendered + * @event renderNavEvent + */ + cal.renderNavEvent = new CE(defEvents.RENDER_NAV); + + cal.beforeSelectEvent.subscribe(cal.onBeforeSelect, this, true); + cal.selectEvent.subscribe(cal.onSelect, this, true); + cal.beforeDeselectEvent.subscribe(cal.onBeforeDeselect, this, true); + cal.deselectEvent.subscribe(cal.onDeselect, this, true); + cal.changePageEvent.subscribe(cal.onChangePage, this, true); + cal.renderEvent.subscribe(cal.onRender, this, true); + cal.resetEvent.subscribe(cal.onReset, this, true); + cal.clearEvent.subscribe(cal.onClear, this, true); + }, + + /** + * The default event handler for clicks on the "Previous Month" navigation UI + * + * @method doPreviousMonthNav + * @param {DOMEvent} e The DOM event + * @param {Calendar} cal A reference to the calendar + */ + doPreviousMonthNav : function(e, cal) { + Event.preventDefault(e); + // previousMonth invoked in a timeout, to allow + // event to bubble up, with correct target. Calling + // previousMonth, will call render which will remove + // HTML which generated the event, resulting in an + // invalid event target in certain browsers. + setTimeout(function() { + cal.previousMonth(); + var navs = Dom.getElementsByClassName(cal.Style.CSS_NAV_LEFT, "a", cal.oDomContainer); + if (navs && navs[0]) { + try { + navs[0].focus(); + } catch (e) { + // ignore + } + } + }, 0); + }, + + /** + * The default event handler for clicks on the "Next Month" navigation UI + * + * @method doNextMonthNav + * @param {DOMEvent} e The DOM event + * @param {Calendar} cal A reference to the calendar + */ + doNextMonthNav : function(e, cal) { + Event.preventDefault(e); + setTimeout(function() { + cal.nextMonth(); + var navs = Dom.getElementsByClassName(cal.Style.CSS_NAV_RIGHT, "a", cal.oDomContainer); + if (navs && navs[0]) { + try { + navs[0].focus(); + } catch (e) { + // ignore + } + } + }, 0); + }, + + /** + * The default event handler for date cell selection. Currently attached to + * the Calendar's bounding box, referenced by it's oDomContainer property. + * + * @method doSelectCell + * @param {DOMEvent} e The DOM event + * @param {Calendar} cal A reference to the calendar + */ + doSelectCell : function(e, cal) { + var cell, d, date, index; + + var target = Event.getTarget(e), + tagName = target.tagName.toLowerCase(), + defSelector = false; + + while (tagName != "td" && !Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) { + + if (!defSelector && tagName == "a" && Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) { + defSelector = true; + } + + target = target.parentNode; + tagName = target.tagName.toLowerCase(); + + if (target == this.oDomContainer || tagName == "html") { + return; + } + } + + if (defSelector) { + // Stop link href navigation for default renderer + Event.preventDefault(e); + } + + cell = target; + + if (Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) { + index = cal.getIndexFromId(cell.id); + if (index > -1) { + d = cal.cellDates[index]; + if (d) { + date = DateMath.getDate(d[0],d[1]-1,d[2]); + + var link; + + cal.logger.log("Selecting cell " + index + " via click", "info"); + if (cal.Options.MULTI_SELECT) { + link = cell.getElementsByTagName("a")[0]; + if (link) { + link.blur(); + } + + var cellDate = cal.cellDates[index]; + var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate); + + if (cellDateIndex > -1) { + cal.deselectCell(index); + } else { + cal.selectCell(index); + } + + } else { + link = cell.getElementsByTagName("a")[0]; + if (link) { + link.blur(); + } + cal.selectCell(index); + } + } + } + } + }, + + /** + * The event that is executed when the user hovers over a cell + * @method doCellMouseOver + * @param {DOMEvent} e The event + * @param {Calendar} cal A reference to the calendar passed by the Event utility + */ + doCellMouseOver : function(e, cal) { + var target; + if (e) { + target = Event.getTarget(e); + } else { + target = this; + } + + while (target.tagName && target.tagName.toLowerCase() != "td") { + target = target.parentNode; + if (!target.tagName || target.tagName.toLowerCase() == "html") { + return; + } + } + + if (Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) { + Dom.addClass(target, cal.Style.CSS_CELL_HOVER); + } + }, + + /** + * The event that is executed when the user moves the mouse out of a cell + * @method doCellMouseOut + * @param {DOMEvent} e The event + * @param {Calendar} cal A reference to the calendar passed by the Event utility + */ + doCellMouseOut : function(e, cal) { + var target; + if (e) { + target = Event.getTarget(e); + } else { + target = this; + } + + while (target.tagName && target.tagName.toLowerCase() != "td") { + target = target.parentNode; + if (!target.tagName || target.tagName.toLowerCase() == "html") { + return; + } + } + + if (Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) { + Dom.removeClass(target, cal.Style.CSS_CELL_HOVER); + } + }, + + setupConfig : function() { + var cfg = this.cfg; + + /** + * The month/year representing the current visible Calendar date (mm/yyyy) + * @config pagedate + * @type String | Date + * @default today's date + */ + cfg.addProperty(DEF_CFG.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } ); + + /** + * The date or range of dates representing the current Calendar selection + * @config selected + * @type String + * @default [] + */ + cfg.addProperty(DEF_CFG.SELECTED.key, { value:[], handler:this.configSelected } ); + + /** + * The title to display above the Calendar's month header + * @config title + * @type String + * @default "" + */ + cfg.addProperty(DEF_CFG.TITLE.key, { value:DEF_CFG.TITLE.value, handler:this.configTitle } ); + + /** + * Whether or not a close button should be displayed for this Calendar + * @config close + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.CLOSE.key, { value:DEF_CFG.CLOSE.value, handler:this.configClose } ); + + /** + * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below. + * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be + * enabled if required. + * + * @config iframe + * @type Boolean + * @default true for IE6 and below, false for all other browsers + */ + cfg.addProperty(DEF_CFG.IFRAME.key, { value:DEF_CFG.IFRAME.value, handler:this.configIframe, validator:cfg.checkBoolean } ); + + /** + * The minimum selectable date in the current Calendar (mm/dd/yyyy) + * @config mindate + * @type String | Date + * @default null + */ + cfg.addProperty(DEF_CFG.MINDATE.key, { value:DEF_CFG.MINDATE.value, handler:this.configMinDate } ); + + /** + * The maximum selectable date in the current Calendar (mm/dd/yyyy) + * @config maxdate + * @type String | Date + * @default null + */ + cfg.addProperty(DEF_CFG.MAXDATE.key, { value:DEF_CFG.MAXDATE.value, handler:this.configMaxDate } ); + + + // Options properties + + /** + * True if the Calendar should allow multiple selections. False by default. + * @config MULTI_SELECT + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.MULTI_SELECT.key, { value:DEF_CFG.MULTI_SELECT.value, handler:this.configOptions, validator:cfg.checkBoolean } ); + + /** + * The weekday the week begins on. Default is 0 (Sunday = 0, Monday = 1 ... Saturday = 6). + * @config START_WEEKDAY + * @type number + * @default 0 + */ + cfg.addProperty(DEF_CFG.START_WEEKDAY.key, { value:DEF_CFG.START_WEEKDAY.value, handler:this.configOptions, validator:cfg.checkNumber } ); + + /** + * True if the Calendar should show weekday labels. True by default. + * @config SHOW_WEEKDAYS + * @type Boolean + * @default true + */ + cfg.addProperty(DEF_CFG.SHOW_WEEKDAYS.key, { value:DEF_CFG.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:cfg.checkBoolean } ); + + /** + * True if the Calendar should show week row headers. False by default. + * @config SHOW_WEEK_HEADER + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.SHOW_WEEK_HEADER.key, { value:DEF_CFG.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:cfg.checkBoolean } ); + + /** + * True if the Calendar should show week row footers. False by default. + * @config SHOW_WEEK_FOOTER + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.SHOW_WEEK_FOOTER.key,{ value:DEF_CFG.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:cfg.checkBoolean } ); + + /** + * True if the Calendar should suppress weeks that are not a part of the current month. False by default. + * @config HIDE_BLANK_WEEKS + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.HIDE_BLANK_WEEKS.key, { value:DEF_CFG.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:cfg.checkBoolean } ); + + /** + * The image that should be used for the left navigation arrow. + * @config NAV_ARROW_LEFT + * @type String + * @deprecated You can customize the image by overriding the default CSS class for the left arrow - "calnavleft" + * @default null + */ + cfg.addProperty(DEF_CFG.NAV_ARROW_LEFT.key, { value:DEF_CFG.NAV_ARROW_LEFT.value, handler:this.configOptions } ); + + /** + * The image that should be used for the right navigation arrow. + * @config NAV_ARROW_RIGHT + * @type String + * @deprecated You can customize the image by overriding the default CSS class for the right arrow - "calnavright" + * @default null + */ + cfg.addProperty(DEF_CFG.NAV_ARROW_RIGHT.key, { value:DEF_CFG.NAV_ARROW_RIGHT.value, handler:this.configOptions } ); + + // Locale properties + + /** + * The short month labels for the current locale. + * @config MONTHS_SHORT + * @type String[] + * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + */ + cfg.addProperty(DEF_CFG.MONTHS_SHORT.key, { value:DEF_CFG.MONTHS_SHORT.value, handler:this.configLocale } ); + + /** + * The long month labels for the current locale. + * @config MONTHS_LONG + * @type String[] + * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + */ + cfg.addProperty(DEF_CFG.MONTHS_LONG.key, { value:DEF_CFG.MONTHS_LONG.value, handler:this.configLocale } ); + + /** + * The 1-character weekday labels for the current locale. + * @config WEEKDAYS_1CHAR + * @type String[] + * @default ["S", "M", "T", "W", "T", "F", "S"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_1CHAR.key, { value:DEF_CFG.WEEKDAYS_1CHAR.value, handler:this.configLocale } ); + + /** + * The short weekday labels for the current locale. + * @config WEEKDAYS_SHORT + * @type String[] + * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_SHORT.key, { value:DEF_CFG.WEEKDAYS_SHORT.value, handler:this.configLocale } ); + + /** + * The medium weekday labels for the current locale. + * @config WEEKDAYS_MEDIUM + * @type String[] + * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_MEDIUM.key, { value:DEF_CFG.WEEKDAYS_MEDIUM.value, handler:this.configLocale } ); + + /** + * The long weekday labels for the current locale. + * @config WEEKDAYS_LONG + * @type String[] + * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_LONG.key, { value:DEF_CFG.WEEKDAYS_LONG.value, handler:this.configLocale } ); + + /** + * Refreshes the locale values used to build the Calendar. + * @method refreshLocale + * @private + */ + var refreshLocale = function() { + cfg.refireEvent(DEF_CFG.LOCALE_MONTHS.key); + cfg.refireEvent(DEF_CFG.LOCALE_WEEKDAYS.key); + }; + + cfg.subscribeToConfigEvent(DEF_CFG.START_WEEKDAY.key, refreshLocale, this, true); + cfg.subscribeToConfigEvent(DEF_CFG.MONTHS_SHORT.key, refreshLocale, this, true); + cfg.subscribeToConfigEvent(DEF_CFG.MONTHS_LONG.key, refreshLocale, this, true); + cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_1CHAR.key, refreshLocale, this, true); + cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_SHORT.key, refreshLocale, this, true); + cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_MEDIUM.key, refreshLocale, this, true); + cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_LONG.key, refreshLocale, this, true); + + /** + * The setting that determines which length of month labels should be used. Possible values are "short" and "long". + * @config LOCALE_MONTHS + * @type String + * @default "long" + */ + cfg.addProperty(DEF_CFG.LOCALE_MONTHS.key, { value:DEF_CFG.LOCALE_MONTHS.value, handler:this.configLocaleValues } ); + + /** + * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long". + * @config LOCALE_WEEKDAYS + * @type String + * @default "short" + */ + cfg.addProperty(DEF_CFG.LOCALE_WEEKDAYS.key, { value:DEF_CFG.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } ); + + /** + * The value used to delimit individual dates in a date string passed to various Calendar functions. + * @config DATE_DELIMITER + * @type String + * @default "," + */ + cfg.addProperty(DEF_CFG.DATE_DELIMITER.key, { value:DEF_CFG.DATE_DELIMITER.value, handler:this.configLocale } ); + + /** + * The value used to delimit date fields in a date string passed to various Calendar functions. + * @config DATE_FIELD_DELIMITER + * @type String + * @default "/" + */ + cfg.addProperty(DEF_CFG.DATE_FIELD_DELIMITER.key, { value:DEF_CFG.DATE_FIELD_DELIMITER.value, handler:this.configLocale } ); + + /** + * The value used to delimit date ranges in a date string passed to various Calendar functions. + * @config DATE_RANGE_DELIMITER + * @type String + * @default "-" + */ + cfg.addProperty(DEF_CFG.DATE_RANGE_DELIMITER.key, { value:DEF_CFG.DATE_RANGE_DELIMITER.value, handler:this.configLocale } ); + + /** + * The position of the month in a month/year date string + * @config MY_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MY_MONTH_POSITION.key, { value:DEF_CFG.MY_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the year in a month/year date string + * @config MY_YEAR_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MY_YEAR_POSITION.key, { value:DEF_CFG.MY_YEAR_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the month in a month/day date string + * @config MD_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MD_MONTH_POSITION.key, { value:DEF_CFG.MD_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the day in a month/year date string + * @config MD_DAY_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MD_DAY_POSITION.key, { value:DEF_CFG.MD_DAY_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the month in a month/day/year date string + * @config MDY_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MDY_MONTH_POSITION.key, { value:DEF_CFG.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the day in a month/day/year date string + * @config MDY_DAY_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MDY_DAY_POSITION.key, { value:DEF_CFG.MDY_DAY_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the year in a month/day/year date string + * @config MDY_YEAR_POSITION + * @type Number + * @default 3 + */ + cfg.addProperty(DEF_CFG.MDY_YEAR_POSITION.key, { value:DEF_CFG.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the month in the month year label string used as the Calendar header + * @config MY_LABEL_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_POSITION.key, { value:DEF_CFG.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The position of the year in the month year label string used as the Calendar header + * @config MY_LABEL_YEAR_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_POSITION.key, { value:DEF_CFG.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } ); + + /** + * The suffix used after the month when rendering the Calendar header + * @config MY_LABEL_MONTH_SUFFIX + * @type String + * @default " " + */ + cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_SUFFIX.key, { value:DEF_CFG.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } ); + + /** + * The suffix used after the year when rendering the Calendar header + * @config MY_LABEL_YEAR_SUFFIX + * @type String + * @default "" + */ + cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_SUFFIX.key, { value:DEF_CFG.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } ); + + /** + * Configuration for the Month/Year CalendarNavigator UI which allows the user to jump directly to a + * specific Month/Year without having to scroll sequentially through months. + *

    + * Setting this property to null (default value) or false, will disable the CalendarNavigator UI. + *

    + *

    + * Setting this property to true will enable the CalendarNavigatior UI with the default CalendarNavigator configuration values. + *

    + *

    + * This property can also be set to an object literal containing configuration properties for the CalendarNavigator UI. + * The configuration object expects the the following case-sensitive properties, with the "strings" property being a nested object. + * Any properties which are not provided will use the default values (defined in the CalendarNavigator class). + *

    + *
    + *
    strings
    + *
    Object : An object with the properties shown below, defining the string labels to use in the Navigator's UI + *
    + *
    month
    String : The string to use for the month label. Defaults to "Month".
    + *
    year
    String : The string to use for the year label. Defaults to "Year".
    + *
    submit
    String : The string to use for the submit button label. Defaults to "Okay".
    + *
    cancel
    String : The string to use for the cancel button label. Defaults to "Cancel".
    + *
    invalidYear
    String : The string to use for invalid year values. Defaults to "Year needs to be a number".
    + *
    + *
    + *
    monthFormat
    String : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG
    + *
    initialFocus
    String : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"
    + *
    + *

    E.g.

    + *
    +		* var navConfig = {
    +		*	  strings: {
    +		*		  month:"Calendar Month",
    +		*		  year:"Calendar Year",
    +		*		  submit: "Submit",
    +		*		  cancel: "Cancel",
    +		*		  invalidYear: "Please enter a valid year"
    +		*	  },
    +		*	  monthFormat: YAHOO.widget.Calendar.SHORT,
    +		*	  initialFocus: "month"
    +		* }
    +		* 
    + * @config navigator + * @type {Object|Boolean} + * @default null + */ + cfg.addProperty(DEF_CFG.NAV.key, { value:DEF_CFG.NAV.value, handler:this.configNavigator } ); + + /** + * The map of UI strings which the Calendar UI uses. + * + * @config strings + * @type {Object} + * @default An object with the properties shown below: + *
    + *
    previousMonth
    String : The string to use for the "Previous Month" navigation UI. Defaults to "Previous Month".
    + *
    nextMonth
    String : The string to use for the "Next Month" navigation UI. Defaults to "Next Month".
    + *
    close
    String : The string to use for the close button label. Defaults to "Close".
    + *
    + */ + cfg.addProperty(DEF_CFG.STRINGS.key, { + value:DEF_CFG.STRINGS.value, + handler:this.configStrings, + validator: function(val) { + return Lang.isObject(val); + }, + supercedes:DEF_CFG.STRINGS.supercedes + }); + }, + + /** + * The default handler for the "strings" property + * @method configStrings + */ + configStrings : function(type, args, obj) { + var val = Lang.merge(DEF_CFG.STRINGS.value, args[0]); + this.cfg.setProperty(DEF_CFG.STRINGS.key, val, true); + }, + + /** + * The default handler for the "pagedate" property + * @method configPageDate + */ + configPageDate : function(type, args, obj) { + this.cfg.setProperty(DEF_CFG.PAGEDATE.key, this._parsePageDate(args[0]), true); + }, + + /** + * The default handler for the "mindate" property + * @method configMinDate + */ + configMinDate : function(type, args, obj) { + var val = args[0]; + if (Lang.isString(val)) { + val = this._parseDate(val); + this.cfg.setProperty(DEF_CFG.MINDATE.key, DateMath.getDate(val[0],(val[1]-1),val[2])); + } + }, + + /** + * The default handler for the "maxdate" property + * @method configMaxDate + */ + configMaxDate : function(type, args, obj) { + var val = args[0]; + if (Lang.isString(val)) { + val = this._parseDate(val); + this.cfg.setProperty(DEF_CFG.MAXDATE.key, DateMath.getDate(val[0],(val[1]-1),val[2])); + } + }, + + /** + * The default handler for the "selected" property + * @method configSelected + */ + configSelected : function(type, args, obj) { + var selected = args[0], + cfgSelected = DEF_CFG.SELECTED.key; + + if (selected) { + if (Lang.isString(selected)) { + this.cfg.setProperty(cfgSelected, this._parseDates(selected), true); + } + } + if (! this._selectedDates) { + this._selectedDates = this.cfg.getProperty(cfgSelected); + } + }, + + /** + * The default handler for all configuration options properties + * @method configOptions + */ + configOptions : function(type, args, obj) { + this.Options[type.toUpperCase()] = args[0]; + }, + + /** + * The default handler for all configuration locale properties + * @method configLocale + */ + configLocale : function(type, args, obj) { + this.Locale[type.toUpperCase()] = args[0]; + + this.cfg.refireEvent(DEF_CFG.LOCALE_MONTHS.key); + this.cfg.refireEvent(DEF_CFG.LOCALE_WEEKDAYS.key); + }, + + /** + * The default handler for all configuration locale field length properties + * @method configLocaleValues + */ + configLocaleValues : function(type, args, obj) { + + type = type.toLowerCase(); + + var val = args[0], + cfg = this.cfg, + Locale = this.Locale; + + switch (type) { + case DEF_CFG.LOCALE_MONTHS.key: + switch (val) { + case Calendar.SHORT: + Locale.LOCALE_MONTHS = cfg.getProperty(DEF_CFG.MONTHS_SHORT.key).concat(); + break; + case Calendar.LONG: + Locale.LOCALE_MONTHS = cfg.getProperty(DEF_CFG.MONTHS_LONG.key).concat(); + break; + } + break; + case DEF_CFG.LOCALE_WEEKDAYS.key: + switch (val) { + case Calendar.ONE_CHAR: + Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_1CHAR.key).concat(); + break; + case Calendar.SHORT: + Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_SHORT.key).concat(); + break; + case Calendar.MEDIUM: + Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_MEDIUM.key).concat(); + break; + case Calendar.LONG: + Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_LONG.key).concat(); + break; + } + + var START_WEEKDAY = cfg.getProperty(DEF_CFG.START_WEEKDAY.key); + + if (START_WEEKDAY > 0) { + for (var w=0; w < START_WEEKDAY; ++w) { + Locale.LOCALE_WEEKDAYS.push(Locale.LOCALE_WEEKDAYS.shift()); + } + } + break; + } + }, + + /** + * The default handler for the "navigator" property + * @method configNavigator + */ + configNavigator : function(type, args, obj) { + var val = args[0]; + if (YAHOO.widget.CalendarNavigator && (val === true || Lang.isObject(val))) { + if (!this.oNavigator) { + this.oNavigator = new YAHOO.widget.CalendarNavigator(this); + // Cleanup DOM Refs/Events before innerHTML is removed. + this.beforeRenderEvent.subscribe(function () { + if (!this.pages) { + this.oNavigator.erase(); + } + }, this, true); + } + } else { + if (this.oNavigator) { + this.oNavigator.destroy(); + this.oNavigator = null; + } + } + }, + + /** + * Defines the style constants for the Calendar + * @method initStyles + */ + initStyles : function() { + + var defStyle = Calendar._STYLES; + + this.Style = { + /** + * @property Style.CSS_ROW_HEADER + */ + CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER, + /** + * @property Style.CSS_ROW_FOOTER + */ + CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER, + /** + * @property Style.CSS_CELL + */ + CSS_CELL : defStyle.CSS_CELL, + /** + * @property Style.CSS_CELL_SELECTOR + */ + CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR, + /** + * @property Style.CSS_CELL_SELECTED + */ + CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED, + /** + * @property Style.CSS_CELL_SELECTABLE + */ + CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE, + /** + * @property Style.CSS_CELL_RESTRICTED + */ + CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED, + /** + * @property Style.CSS_CELL_TODAY + */ + CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY, + /** + * @property Style.CSS_CELL_OOM + */ + CSS_CELL_OOM : defStyle.CSS_CELL_OOM, + /** + * @property Style.CSS_CELL_OOB + */ + CSS_CELL_OOB : defStyle.CSS_CELL_OOB, + /** + * @property Style.CSS_HEADER + */ + CSS_HEADER : defStyle.CSS_HEADER, + /** + * @property Style.CSS_HEADER_TEXT + */ + CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT, + /** + * @property Style.CSS_BODY + */ + CSS_BODY : defStyle.CSS_BODY, + /** + * @property Style.CSS_WEEKDAY_CELL + */ + CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL, + /** + * @property Style.CSS_WEEKDAY_ROW + */ + CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW, + /** + * @property Style.CSS_FOOTER + */ + CSS_FOOTER : defStyle.CSS_FOOTER, + /** + * @property Style.CSS_CALENDAR + */ + CSS_CALENDAR : defStyle.CSS_CALENDAR, + /** + * @property Style.CSS_SINGLE + */ + CSS_SINGLE : defStyle.CSS_SINGLE, + /** + * @property Style.CSS_CONTAINER + */ + CSS_CONTAINER : defStyle.CSS_CONTAINER, + /** + * @property Style.CSS_NAV_LEFT + */ + CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT, + /** + * @property Style.CSS_NAV_RIGHT + */ + CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT, + /** + * @property Style.CSS_NAV + */ + CSS_NAV : defStyle.CSS_NAV, + /** + * @property Style.CSS_CLOSE + */ + CSS_CLOSE : defStyle.CSS_CLOSE, + /** + * @property Style.CSS_CELL_TOP + */ + CSS_CELL_TOP : defStyle.CSS_CELL_TOP, + /** + * @property Style.CSS_CELL_LEFT + */ + CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT, + /** + * @property Style.CSS_CELL_RIGHT + */ + CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT, + /** + * @property Style.CSS_CELL_BOTTOM + */ + CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM, + /** + * @property Style.CSS_CELL_HOVER + */ + CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER, + /** + * @property Style.CSS_CELL_HIGHLIGHT1 + */ + CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1, + /** + * @property Style.CSS_CELL_HIGHLIGHT2 + */ + CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2, + /** + * @property Style.CSS_CELL_HIGHLIGHT3 + */ + CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3, + /** + * @property Style.CSS_CELL_HIGHLIGHT4 + */ + CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4 + }; + }, + + /** + * Builds the date label that will be displayed in the calendar header or + * footer, depending on configuration. + * @method buildMonthLabel + * @return {String} The formatted calendar month label + */ + buildMonthLabel : function() { + return this._buildMonthLabel(this.cfg.getProperty(DEF_CFG.PAGEDATE.key)); + }, + + /** + * Helper method, to format a Month Year string, given a JavaScript Date, based on the + * Calendar localization settings + * + * @method _buildMonthLabel + * @private + * @param {Date} date + * @return {String} Formated month, year string + */ + _buildMonthLabel : function(date) { + var monthLabel = this.Locale.LOCALE_MONTHS[date.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX, + yearLabel = date.getFullYear() + this.Locale.MY_LABEL_YEAR_SUFFIX; + + if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) { + return yearLabel + monthLabel; + } else { + return monthLabel + yearLabel; + } + }, + + /** + * Builds the date digit that will be displayed in calendar cells + * @method buildDayLabel + * @param {Date} workingDate The current working date + * @return {String} The formatted day label + */ + buildDayLabel : function(workingDate) { + return workingDate.getDate(); + }, + + /** + * Creates the title bar element and adds it to Calendar container DIV + * + * @method createTitleBar + * @param {String} strTitle The title to display in the title bar + * @return The title bar element + */ + createTitleBar : function(strTitle) { + var tDiv = Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div"); + tDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE; + tDiv.innerHTML = strTitle; + this.oDomContainer.insertBefore(tDiv, this.oDomContainer.firstChild); + + Dom.addClass(this.oDomContainer, "withtitle"); + + return tDiv; + }, + + /** + * Removes the title bar element from the DOM + * + * @method removeTitleBar + */ + removeTitleBar : function() { + var tDiv = Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null; + if (tDiv) { + Event.purgeElement(tDiv); + this.oDomContainer.removeChild(tDiv); + } + Dom.removeClass(this.oDomContainer, "withtitle"); + }, + + /** + * Creates the close button HTML element and adds it to Calendar container DIV + * + * @method createCloseButton + * @return The close HTML element created + */ + createCloseButton : function() { + var cssClose = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE, + DEPR_CLOSE_PATH = "us/my/bn/x_d.gif", + lnk = Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0], + strings = this.cfg.getProperty(DEF_CFG.STRINGS.key), + closeStr = (strings && strings.close) ? strings.close : ""; + + if (!lnk) { + lnk = document.createElement("a"); + Event.addListener(lnk, "click", function(e, cal) { + cal.hide(); + Event.preventDefault(e); + }, this); + } + + lnk.href = "#"; + lnk.className = "link-close"; + + if (Calendar.IMG_ROOT !== null) { + var img = Dom.getElementsByClassName(cssClose, "img", lnk)[0] || document.createElement("img"); + img.src = Calendar.IMG_ROOT + DEPR_CLOSE_PATH; + img.className = cssClose; + lnk.appendChild(img); + } else { + lnk.innerHTML = '' + closeStr + ''; + } + this.oDomContainer.appendChild(lnk); + + return lnk; + }, + + /** + * Removes the close button HTML element from the DOM + * + * @method removeCloseButton + */ + removeCloseButton : function() { + var btn = Dom.getElementsByClassName("link-close", "a", this.oDomContainer)[0] || null; + if (btn) { + Event.purgeElement(btn); + this.oDomContainer.removeChild(btn); + } + }, + + /** + * Renders the calendar header. + * @method renderHeader + * @param {Array} html The current working HTML array + * @return {Array} The current working HTML array + */ + renderHeader : function(html) { + + this.logger.log("Rendering header", "render"); + + var colSpan = 7, + DEPR_NAV_LEFT = "us/tr/callt.gif", + DEPR_NAV_RIGHT = "us/tr/calrt.gif", + cfg = this.cfg, + pageDate = cfg.getProperty(DEF_CFG.PAGEDATE.key), + strings= cfg.getProperty(DEF_CFG.STRINGS.key), + prevStr = (strings && strings.previousMonth) ? strings.previousMonth : "", + nextStr = (strings && strings.nextMonth) ? strings.nextMonth : "", + monthLabel; + + if (cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key)) { + colSpan += 1; + } + + if (cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key)) { + colSpan += 1; + } + + html[html.length] = ""; + html[html.length] = ""; + html[html.length] = ''; + html[html.length] = '
    '; + + var renderLeft, renderRight = false; + + if (this.parent) { + if (this.index === 0) { + renderLeft = true; + } + if (this.index == (this.parent.cfg.getProperty("pages") -1)) { + renderRight = true; + } + } else { + renderLeft = true; + renderRight = true; + } + + if (renderLeft) { + monthLabel = this._buildMonthLabel(DateMath.subtract(pageDate, DateMath.MONTH, 1)); + + var leftArrow = cfg.getProperty(DEF_CFG.NAV_ARROW_LEFT.key); + // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value + if (leftArrow === null && Calendar.IMG_ROOT !== null) { + leftArrow = Calendar.IMG_ROOT + DEPR_NAV_LEFT; + } + var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"'; + html[html.length] = '' + prevStr + ' (' + monthLabel + ')' + ''; + } + + var lbl = this.buildMonthLabel(); + var cal = this.parent || this; + if (cal.cfg.getProperty("navigator")) { + lbl = "" + lbl + ""; + } + html[html.length] = lbl; + + if (renderRight) { + monthLabel = this._buildMonthLabel(DateMath.add(pageDate, DateMath.MONTH, 1)); + + var rightArrow = cfg.getProperty(DEF_CFG.NAV_ARROW_RIGHT.key); + if (rightArrow === null && Calendar.IMG_ROOT !== null) { + rightArrow = Calendar.IMG_ROOT + DEPR_NAV_RIGHT; + } + var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"'; + html[html.length] = '' + nextStr + ' (' + monthLabel + ')' + ''; + } + + html[html.length] = '
    \n\n'; + + if (cfg.getProperty(DEF_CFG.SHOW_WEEKDAYS.key)) { + html = this.buildWeekdays(html); + } + + html[html.length] = ''; + + return html; + }, + + /** + * Renders the Calendar's weekday headers. + * @method buildWeekdays + * @param {Array} html The current working HTML array + * @return {Array} The current working HTML array + */ + buildWeekdays : function(html) { + + html[html.length] = ''; + + if (this.cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key)) { + html[html.length] = ' '; + } + + for(var i=0;i < this.Locale.LOCALE_WEEKDAYS.length; ++i) { + html[html.length] = '' + this.Locale.LOCALE_WEEKDAYS[i] + ''; + } + + if (this.cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key)) { + html[html.length] = ' '; + } + + html[html.length] = ''; + + return html; + }, + + /** + * Renders the calendar body. + * @method renderBody + * @param {Date} workingDate The current working Date being used for the render process + * @param {Array} html The current working HTML array + * @return {Array} The current working HTML array + */ + renderBody : function(workingDate, html) { + this.logger.log("Rendering body", "render"); + + var startDay = this.cfg.getProperty(DEF_CFG.START_WEEKDAY.key); + + this.preMonthDays = workingDate.getDay(); + if (startDay > 0) { + this.preMonthDays -= startDay; + } + if (this.preMonthDays < 0) { + this.preMonthDays += 7; + } + + this.monthDays = DateMath.findMonthEnd(workingDate).getDate(); + this.postMonthDays = Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays; + + this.logger.log(this.preMonthDays + " preciding out-of-month days", "render"); + this.logger.log(this.monthDays + " month days", "render"); + this.logger.log(this.postMonthDays + " post-month days", "render"); + + workingDate = DateMath.subtract(workingDate, DateMath.DAY, this.preMonthDays); + this.logger.log("Calendar page starts on " + workingDate, "render"); + + var weekNum, + weekClass, + weekPrefix = "w", + cellPrefix = "_cell", + workingDayPrefix = "wd", + dayPrefix = "d", + cellRenderers, + renderer, + t = this.today, + cfg = this.cfg, + todayYear = t.getFullYear(), + todayMonth = t.getMonth(), + todayDate = t.getDate(), + useDate = cfg.getProperty(DEF_CFG.PAGEDATE.key), + hideBlankWeeks = cfg.getProperty(DEF_CFG.HIDE_BLANK_WEEKS.key), + showWeekFooter = cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key), + showWeekHeader = cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key), + mindate = cfg.getProperty(DEF_CFG.MINDATE.key), + maxdate = cfg.getProperty(DEF_CFG.MAXDATE.key); + + if (mindate) { + mindate = DateMath.clearTime(mindate); + } + if (maxdate) { + maxdate = DateMath.clearTime(maxdate); + } + + html[html.length] = ''; + + var i = 0, + tempDiv = document.createElement("div"), + cell = document.createElement("td"); + + tempDiv.appendChild(cell); + + var cal = this.parent || this; + + for (var r=0;r<6;r++) { + weekNum = DateMath.getWeekNumber(workingDate, startDay); + weekClass = weekPrefix + weekNum; + + // Local OOM check for performance, since we already have pagedate + if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) { + break; + } else { + html[html.length] = ''; + + if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); } + + for (var d=0; d < 7; d++){ // Render actual days + + cellRenderers = []; + + this.clearElement(cell); + cell.className = this.Style.CSS_CELL; + cell.id = this.id + cellPrefix + i; + this.logger.log("Rendering cell " + cell.id + " (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender"); + + if (workingDate.getDate() == todayDate && + workingDate.getMonth() == todayMonth && + workingDate.getFullYear() == todayYear) { + cellRenderers[cellRenderers.length]=cal.renderCellStyleToday; + } + + var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()]; + this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates + + // Local OOM check for performance, since we already have pagedate + if (workingDate.getMonth() != useDate.getMonth()) { + cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth; + } else { + Dom.addClass(cell, workingDayPrefix + workingDate.getDay()); + Dom.addClass(cell, dayPrefix + workingDate.getDate()); + + for (var s=0;s= d1.getTime() && workingDate.getTime() <= d2.getTime()) { + renderer = rArray[2]; + + if (workingDate.getTime()==d2.getTime()) { + this.renderStack.splice(s,1); + } + } + break; + case Calendar.WEEKDAY: + var weekday = rArray[1][0]; + if (workingDate.getDay()+1 == weekday) { + renderer = rArray[2]; + } + break; + case Calendar.MONTH: + month = rArray[1][0]; + if (workingDate.getMonth()+1 == month) { + renderer = rArray[2]; + } + break; + } + + if (renderer) { + cellRenderers[cellRenderers.length]=renderer; + } + } + + } + + if (this._indexOfSelectedFieldArray(workingArray) > -1) { + cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; + } + + if ((mindate && (workingDate.getTime() < mindate.getTime())) || + (maxdate && (workingDate.getTime() > maxdate.getTime())) + ) { + cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate; + } else { + cellRenderers[cellRenderers.length]=cal.styleCellDefault; + cellRenderers[cellRenderers.length]=cal.renderCellDefault; + } + + for (var x=0; x < cellRenderers.length; ++x) { + this.logger.log("renderer[" + x + "] for (" + workingDate.getFullYear() + "-" + (workingDate.getMonth()+1) + "-" + workingDate.getDate() + ")", "cellrender"); + if (cellRenderers[x].call(cal, workingDate, cell) == Calendar.STOP_RENDER) { + break; + } + } + + workingDate.setTime(workingDate.getTime() + DateMath.ONE_DAY_MS); + // Just in case we crossed DST/Summertime boundaries + workingDate = DateMath.clearTime(workingDate); + + if (i >= 0 && i <= 6) { + Dom.addClass(cell, this.Style.CSS_CELL_TOP); + } + if ((i % 7) === 0) { + Dom.addClass(cell, this.Style.CSS_CELL_LEFT); + } + if (((i+1) % 7) === 0) { + Dom.addClass(cell, this.Style.CSS_CELL_RIGHT); + } + + var postDays = this.postMonthDays; + if (hideBlankWeeks && postDays >= 7) { + var blankWeeks = Math.floor(postDays/7); + for (var p=0;p= ((this.preMonthDays+postDays+this.monthDays)-7)) { + Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM); + } + + html[html.length] = tempDiv.innerHTML; + i++; + } + + if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); } + + html[html.length] = ''; + } + } + + html[html.length] = ''; + + return html; + }, + + /** + * Renders the calendar footer. In the default implementation, there is + * no footer. + * @method renderFooter + * @param {Array} html The current working HTML array + * @return {Array} The current working HTML array + */ + renderFooter : function(html) { return html; }, + + /** + * Renders the calendar after it has been configured. The render() method has a specific call chain that will execute + * when the method is called: renderHeader, renderBody, renderFooter. + * Refer to the documentation for those methods for information on + * individual render tasks. + * @method render + */ + render : function() { + this.beforeRenderEvent.fire(); + + // Find starting day of the current month + var workingDate = DateMath.findMonthStart(this.cfg.getProperty(DEF_CFG.PAGEDATE.key)); + + this.resetRenderers(); + this.cellDates.length = 0; + + Event.purgeElement(this.oDomContainer, true); + + var html = []; + + html[html.length] = ''; + html = this.renderHeader(html); + html = this.renderBody(workingDate, html); + html = this.renderFooter(html); + html[html.length] = '
    '; + + this.oDomContainer.innerHTML = html.join("\n"); + + this.applyListeners(); + this.cells = this.oDomContainer.getElementsByTagName("td"); + + this.cfg.refireEvent(DEF_CFG.TITLE.key); + this.cfg.refireEvent(DEF_CFG.CLOSE.key); + this.cfg.refireEvent(DEF_CFG.IFRAME.key); + + this.renderEvent.fire(); + }, + + /** + * Applies the Calendar's DOM listeners to applicable elements. + * @method applyListeners + */ + applyListeners : function() { + var root = this.oDomContainer, + cal = this.parent || this, + anchor = "a", + click = "click"; + + var linkLeft = Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root), + linkRight = Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root); + + if (linkLeft && linkLeft.length > 0) { + this.linkLeft = linkLeft[0]; + Event.addListener(this.linkLeft, click, this.doPreviousMonthNav, cal, true); + } + + if (linkRight && linkRight.length > 0) { + this.linkRight = linkRight[0]; + Event.addListener(this.linkRight, click, this.doNextMonthNav, cal, true); + } + + if (cal.cfg.getProperty("navigator") !== null) { + this.applyNavListeners(); + } + + if (this.domEventMap) { + var el,elements; + for (var cls in this.domEventMap) { + if (Lang.hasOwnProperty(this.domEventMap, cls)) { + var items = this.domEventMap[cls]; + + if (! (items instanceof Array)) { + items = [items]; + } + + for (var i=0;i 0) { + + Event.addListener(navBtns, "click", function (e, obj) { + var target = Event.getTarget(e); + // this == navBtn + if (this === target || Dom.isAncestor(this, target)) { + Event.preventDefault(e); + } + var navigator = calParent.oNavigator; + if (navigator) { + var pgdate = cal.cfg.getProperty("pagedate"); + navigator.setYear(pgdate.getFullYear()); + navigator.setMonth(pgdate.getMonth()); + navigator.show(); + } + }); + } + }, + + /** + * Retrieves the Date object for the specified Calendar cell + * @method getDateByCellId + * @param {String} id The id of the cell + * @return {Date} The Date object for the specified Calendar cell + */ + getDateByCellId : function(id) { + var date = this.getDateFieldsByCellId(id); + return (date) ? DateMath.getDate(date[0],date[1]-1,date[2]) : null; + }, + + /** + * Retrieves the Date object for the specified Calendar cell + * @method getDateFieldsByCellId + * @param {String} id The id of the cell + * @return {Array} The array of Date fields for the specified Calendar cell + */ + getDateFieldsByCellId : function(id) { + id = this.getIndexFromId(id); + return (id > -1) ? this.cellDates[id] : null; + }, + + /** + * Find the Calendar's cell index for a given date. + * If the date is not found, the method returns -1. + *

    + * The returned index can be used to lookup the cell HTMLElement + * using the Calendar's cells array or passed to selectCell to select + * cells by index. + *

    + * + * See cells, selectCell. + * + * @method getCellIndex + * @param {Date} date JavaScript Date object, for which to find a cell index. + * @return {Number} The index of the date in Calendars cellDates/cells arrays, or -1 if the date + * is not on the curently rendered Calendar page. + */ + getCellIndex : function(date) { + var idx = -1; + if (date) { + var m = date.getMonth(), + y = date.getFullYear(), + d = date.getDate(), + dates = this.cellDates; + + for (var i = 0; i < dates.length; ++i) { + var cellDate = dates[i]; + if (cellDate[0] === y && cellDate[1] === m+1 && cellDate[2] === d) { + idx = i; + break; + } + } + } + return idx; + }, + + /** + * Given the id used to mark each Calendar cell, this method + * extracts the index number from the id. + * + * @param {String} strId The cell id + * @return {Number} The index of the cell, or -1 if id does not contain an index number + */ + getIndexFromId : function(strId) { + var idx = -1, + li = strId.lastIndexOf("_cell"); + + if (li > -1) { + idx = parseInt(strId.substring(li + 5), 10); + } + + return idx; + }, + + // BEGIN BUILT-IN TABLE CELL RENDERERS + + /** + * Renders a cell that falls before the minimum date or after the maximum date. + * widget class. + * @method renderOutOfBoundsDate + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering + * should not be terminated + */ + renderOutOfBoundsDate : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_OOB); + cell.innerHTML = workingDate.getDate(); + return Calendar.STOP_RENDER; + }, + + /** + * Renders the row header for a week. + * @method renderRowHeader + * @param {Number} weekNum The week number of the current row + * @param {Array} cell The current working HTML array + */ + renderRowHeader : function(weekNum, html) { + html[html.length] = '' + weekNum + ''; + return html; + }, + + /** + * Renders the row footer for a week. + * @method renderRowFooter + * @param {Number} weekNum The week number of the current row + * @param {Array} cell The current working HTML array + */ + renderRowFooter : function(weekNum, html) { + html[html.length] = '' + weekNum + ''; + return html; + }, + + /** + * Renders a single standard calendar cell in the calendar widget table. + * All logic for determining how a standard default cell will be rendered is + * encapsulated in this method, and must be accounted for when extending the + * widget class. + * @method renderCellDefault + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + */ + renderCellDefault : function(workingDate, cell) { + cell.innerHTML = '' + this.buildDayLabel(workingDate) + ""; + }, + + /** + * Styles a selectable cell. + * @method styleCellDefault + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + */ + styleCellDefault : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE); + }, + + + /** + * Renders a single standard calendar cell using the CSS hightlight1 style + * @method renderCellStyleHighlight1 + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + */ + renderCellStyleHighlight1 : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1); + }, + + /** + * Renders a single standard calendar cell using the CSS hightlight2 style + * @method renderCellStyleHighlight2 + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + */ + renderCellStyleHighlight2 : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2); + }, + + /** + * Renders a single standard calendar cell using the CSS hightlight3 style + * @method renderCellStyleHighlight3 + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + */ + renderCellStyleHighlight3 : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3); + }, + + /** + * Renders a single standard calendar cell using the CSS hightlight4 style + * @method renderCellStyleHighlight4 + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + */ + renderCellStyleHighlight4 : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4); + }, + + /** + * Applies the default style used for rendering today's date to the current calendar cell + * @method renderCellStyleToday + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + */ + renderCellStyleToday : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_TODAY); + }, + + /** + * Applies the default style used for rendering selected dates to the current calendar cell + * @method renderCellStyleSelected + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering + * should not be terminated + */ + renderCellStyleSelected : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_SELECTED); + }, + + /** + * Applies the default style used for rendering dates that are not a part of the current + * month (preceding or trailing the cells for the current month) + * @method renderCellNotThisMonth + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering + * should not be terminated + */ + renderCellNotThisMonth : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL_OOM); + cell.innerHTML=workingDate.getDate(); + return Calendar.STOP_RENDER; + }, + + /** + * Renders the current calendar cell as a non-selectable "black-out" date using the default + * restricted style. + * @method renderBodyCellRestricted + * @param {Date} workingDate The current working Date object being used to generate the calendar + * @param {HTMLTableCellElement} cell The current working cell in the calendar + * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering + * should not be terminated + */ + renderBodyCellRestricted : function(workingDate, cell) { + Dom.addClass(cell, this.Style.CSS_CELL); + Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED); + cell.innerHTML=workingDate.getDate(); + return Calendar.STOP_RENDER; + }, + + // END BUILT-IN TABLE CELL RENDERERS + + // BEGIN MONTH NAVIGATION METHODS + + /** + * Adds the designated number of months to the current calendar month, and sets the current + * calendar page date to the new month. + * @method addMonths + * @param {Number} count The number of months to add to the current calendar + */ + addMonths : function(count) { + var cfgPageDate = DEF_CFG.PAGEDATE.key; + this.cfg.setProperty(cfgPageDate, DateMath.add(this.cfg.getProperty(cfgPageDate), DateMath.MONTH, count)); + this.resetRenderers(); + this.changePageEvent.fire(); + }, + + /** + * Subtracts the designated number of months from the current calendar month, and sets the current + * calendar page date to the new month. + * @method subtractMonths + * @param {Number} count The number of months to subtract from the current calendar + */ + subtractMonths : function(count) { + var cfgPageDate = DEF_CFG.PAGEDATE.key; + this.cfg.setProperty(cfgPageDate, DateMath.subtract(this.cfg.getProperty(cfgPageDate), DateMath.MONTH, count)); + this.resetRenderers(); + this.changePageEvent.fire(); + }, + + /** + * Adds the designated number of years to the current calendar, and sets the current + * calendar page date to the new month. + * @method addYears + * @param {Number} count The number of years to add to the current calendar + */ + addYears : function(count) { + var cfgPageDate = DEF_CFG.PAGEDATE.key; + this.cfg.setProperty(cfgPageDate, DateMath.add(this.cfg.getProperty(cfgPageDate), DateMath.YEAR, count)); + this.resetRenderers(); + this.changePageEvent.fire(); + }, + + /** + * Subtcats the designated number of years from the current calendar, and sets the current + * calendar page date to the new month. + * @method subtractYears + * @param {Number} count The number of years to subtract from the current calendar + */ + subtractYears : function(count) { + var cfgPageDate = DEF_CFG.PAGEDATE.key; + this.cfg.setProperty(cfgPageDate, DateMath.subtract(this.cfg.getProperty(cfgPageDate), DateMath.YEAR, count)); + this.resetRenderers(); + this.changePageEvent.fire(); + }, + + /** + * Navigates to the next month page in the calendar widget. + * @method nextMonth + */ + nextMonth : function() { + this.addMonths(1); + }, + + /** + * Navigates to the previous month page in the calendar widget. + * @method previousMonth + */ + previousMonth : function() { + this.subtractMonths(1); + }, + + /** + * Navigates to the next year in the currently selected month in the calendar widget. + * @method nextYear + */ + nextYear : function() { + this.addYears(1); + }, + + /** + * Navigates to the previous year in the currently selected month in the calendar widget. + * @method previousYear + */ + previousYear : function() { + this.subtractYears(1); + }, + + // END MONTH NAVIGATION METHODS + + // BEGIN SELECTION METHODS + + /** + * Resets the calendar widget to the originally selected month and year, and + * sets the calendar to the initial selection(s). + * @method reset + */ + reset : function() { + this.cfg.resetProperty(DEF_CFG.SELECTED.key); + this.cfg.resetProperty(DEF_CFG.PAGEDATE.key); + this.resetEvent.fire(); + }, + + /** + * Clears the selected dates in the current calendar widget and sets the calendar + * to the current month and year. + * @method clear + */ + clear : function() { + this.cfg.setProperty(DEF_CFG.SELECTED.key, []); + this.cfg.setProperty(DEF_CFG.PAGEDATE.key, new Date(this.today.getTime())); + this.clearEvent.fire(); + }, + + /** + * Selects a date or a collection of dates on the current calendar. This method, by default, + * does not call the render method explicitly. Once selection has completed, render must be + * called for the changes to be reflected visually. + * + * Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of + * selected dates passed to the selectEvent will not contain OOB dates. + * + * If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired. + * + * @method select + * @param {String/Date/Date[]} date The date string of dates to select in the current calendar. Valid formats are + * individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006). + * Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005). + * This method can also take a JavaScript Date object or an array of Date objects. + * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected. + */ + select : function(date) { + this.logger.log("Select: " + date, "info"); + + var aToBeSelected = this._toFieldArray(date), + validDates = [], + selected = [], + cfgSelected = DEF_CFG.SELECTED.key; + + this.logger.log("Selection field array: " + aToBeSelected, "info"); + + for (var a=0; a < aToBeSelected.length; ++a) { + var toSelect = aToBeSelected[a]; + + if (!this.isDateOOB(this._toDate(toSelect))) { + + if (validDates.length === 0) { + this.beforeSelectEvent.fire(); + selected = this.cfg.getProperty(cfgSelected); + } + validDates.push(toSelect); + + if (this._indexOfSelectedFieldArray(toSelect) == -1) { + selected[selected.length] = toSelect; + } + } + } + + if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeSelect and select events not fired", "info"); } + + if (validDates.length > 0) { + if (this.parent) { + this.parent.cfg.setProperty(cfgSelected, selected); + } else { + this.cfg.setProperty(cfgSelected, selected); + } + this.selectEvent.fire(validDates); + } + + return this.getSelectedDates(); + }, + + /** + * Selects a date on the current calendar by referencing the index of the cell that should be selected. + * This method is used to easily select a single cell (usually with a mouse click) without having to do + * a full render. The selected style is applied to the cell directly. + * + * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month + * or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired. + * + * @method selectCell + * @param {Number} cellIndex The index of the cell to select in the current calendar. + * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected. + */ + selectCell : function(cellIndex) { + + var cell = this.cells[cellIndex], + cellDate = this.cellDates[cellIndex], + dCellDate = this._toDate(cellDate), + selectable = Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE); + + this.logger.log("Select: " + dCellDate, "info"); + if (!selectable) {this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable cell. beforeSelect, select events not fired", "info"); } + + if (selectable) { + + this.beforeSelectEvent.fire(); + + var cfgSelected = DEF_CFG.SELECTED.key; + var selected = this.cfg.getProperty(cfgSelected); + + var selectDate = cellDate.concat(); + + if (this._indexOfSelectedFieldArray(selectDate) == -1) { + selected[selected.length] = selectDate; + } + if (this.parent) { + this.parent.cfg.setProperty(cfgSelected, selected); + } else { + this.cfg.setProperty(cfgSelected, selected); + } + this.renderCellStyleSelected(dCellDate,cell); + this.selectEvent.fire([selectDate]); + + this.doCellMouseOut.call(cell, null, this); + } + + return this.getSelectedDates(); + }, + + /** + * Deselects a date or a collection of dates on the current calendar. This method, by default, + * does not call the render method explicitly. Once deselection has completed, render must be + * called for the changes to be reflected visually. + * + * The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) + * and the array of deselected dates passed to the deselectEvent will not contain any OOB dates. + * + * If all dates are OOB, beforeDeselect and deselect events will not be fired. + * + * @method deselect + * @param {String/Date/Date[]} date The date string of dates to deselect in the current calendar. Valid formats are + * individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006). + * Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005). + * This method can also take a JavaScript Date object or an array of Date objects. + * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected. + */ + deselect : function(date) { + this.logger.log("Deselect: " + date, "info"); + + var aToBeDeselected = this._toFieldArray(date), + validDates = [], + selected = [], + cfgSelected = DEF_CFG.SELECTED.key; + + this.logger.log("Deselection field array: " + aToBeDeselected, "info"); + + for (var a=0; a < aToBeDeselected.length; ++a) { + var toDeselect = aToBeDeselected[a]; + + if (!this.isDateOOB(this._toDate(toDeselect))) { + + if (validDates.length === 0) { + this.beforeDeselectEvent.fire(); + selected = this.cfg.getProperty(cfgSelected); + } + + validDates.push(toDeselect); + + var index = this._indexOfSelectedFieldArray(toDeselect); + if (index != -1) { + selected.splice(index,1); + } + } + } + + if (validDates.length === 0) { this.logger.log("All provided dates were OOB. beforeDeselect and deselect events not fired");} + + if (validDates.length > 0) { + if (this.parent) { + this.parent.cfg.setProperty(cfgSelected, selected); + } else { + this.cfg.setProperty(cfgSelected, selected); + } + this.deselectEvent.fire(validDates); + } + + return this.getSelectedDates(); + }, + + /** + * Deselects a date on the current calendar by referencing the index of the cell that should be deselected. + * This method is used to easily deselect a single cell (usually with a mouse click) without having to do + * a full render. The selected style is removed from the cell directly. + * + * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month + * or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and + * deselect events will not be fired. + * + * @method deselectCell + * @param {Number} cellIndex The index of the cell to deselect in the current calendar. + * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected. + */ + deselectCell : function(cellIndex) { + var cell = this.cells[cellIndex], + cellDate = this.cellDates[cellIndex], + cellDateIndex = this._indexOfSelectedFieldArray(cellDate); + + var selectable = Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE); + if (!selectable) { this.logger.log("The cell at cellIndex:" + cellIndex + " is not a selectable/deselectable cell", "info"); } + + if (selectable) { + + this.beforeDeselectEvent.fire(); + + var selected = this.cfg.getProperty(DEF_CFG.SELECTED.key), + dCellDate = this._toDate(cellDate), + selectDate = cellDate.concat(); + + if (cellDateIndex > -1) { + if (this.cfg.getProperty(DEF_CFG.PAGEDATE.key).getMonth() == dCellDate.getMonth() && + this.cfg.getProperty(DEF_CFG.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) { + Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED); + } + selected.splice(cellDateIndex, 1); + } + + if (this.parent) { + this.parent.cfg.setProperty(DEF_CFG.SELECTED.key, selected); + } else { + this.cfg.setProperty(DEF_CFG.SELECTED.key, selected); + } + + this.deselectEvent.fire(selectDate); + } + + return this.getSelectedDates(); + }, + + /** + * Deselects all dates on the current calendar. + * @method deselectAll + * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected. + * Assuming that this function executes properly, the return value should be an empty array. + * However, the empty array is returned for the sake of being able to check the selection status + * of the calendar. + */ + deselectAll : function() { + this.beforeDeselectEvent.fire(); + + var cfgSelected = DEF_CFG.SELECTED.key, + selected = this.cfg.getProperty(cfgSelected), + count = selected.length, + sel = selected.concat(); + + if (this.parent) { + this.parent.cfg.setProperty(cfgSelected, []); + } else { + this.cfg.setProperty(cfgSelected, []); + } + + if (count > 0) { + this.deselectEvent.fire(sel); + } + + return this.getSelectedDates(); + }, + + // END SELECTION METHODS + + // BEGIN TYPE CONVERSION METHODS + + /** + * Converts a date (either a JavaScript Date object, or a date string) to the internal data structure + * used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]]. + * @method _toFieldArray + * @private + * @param {String/Date/Date[]} date The date string of dates to deselect in the current calendar. Valid formats are + * individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006). + * Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005). + * This method can also take a JavaScript Date object or an array of Date objects. + * @return {Array[](Number[])} Array of date field arrays + */ + _toFieldArray : function(date) { + var returnDate = []; + + if (date instanceof Date) { + returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]]; + } else if (Lang.isString(date)) { + returnDate = this._parseDates(date); + } else if (Lang.isArray(date)) { + for (var i=0;i maxDate.getTime())); + }, + + /** + * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object + * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object + * @method _parsePageDate + * @private + * @param {Date|String} date Pagedate value which needs to be parsed + * @return {Date} The Date object representing the pagedate + */ + _parsePageDate : function(date) { + var parsedDate; + + if (date) { + if (date instanceof Date) { + parsedDate = DateMath.findMonthStart(date); + } else { + var month, year, aMonthYear; + aMonthYear = date.split(this.cfg.getProperty(DEF_CFG.DATE_FIELD_DELIMITER.key)); + month = parseInt(aMonthYear[this.cfg.getProperty(DEF_CFG.MY_MONTH_POSITION.key)-1], 10)-1; + year = parseInt(aMonthYear[this.cfg.getProperty(DEF_CFG.MY_YEAR_POSITION.key)-1], 10); + + parsedDate = DateMath.getDate(year, month, 1); + } + } else { + parsedDate = DateMath.getDate(this.today.getFullYear(), this.today.getMonth(), 1); + } + return parsedDate; + }, + + // END UTILITY METHODS + + // BEGIN EVENT HANDLERS + + /** + * Event executed before a date is selected in the calendar widget. + * @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent. + */ + onBeforeSelect : function() { + if (this.cfg.getProperty(DEF_CFG.MULTI_SELECT.key) === false) { + if (this.parent) { + this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED); + this.parent.deselectAll(); + } else { + this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED); + this.deselectAll(); + } + } + }, + + /** + * Event executed when a date is selected in the calendar widget. + * @param {Array} selected An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ] + * @deprecated Event handlers for this event should be susbcribed to selectEvent. + */ + onSelect : function(selected) { }, + + /** + * Event executed before a date is deselected in the calendar widget. + * @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent. + */ + onBeforeDeselect : function() { }, + + /** + * Event executed when a date is deselected in the calendar widget. + * @param {Array} selected An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ] + * @deprecated Event handlers for this event should be susbcribed to deselectEvent. + */ + onDeselect : function(deselected) { }, + + /** + * Event executed when the user navigates to a different calendar page. + * @deprecated Event handlers for this event should be susbcribed to changePageEvent. + */ + onChangePage : function() { + this.render(); + }, + + /** + * Event executed when the calendar widget is rendered. + * @deprecated Event handlers for this event should be susbcribed to renderEvent. + */ + onRender : function() { }, + + /** + * Event executed when the calendar widget is reset to its original state. + * @deprecated Event handlers for this event should be susbcribed to resetEvemt. + */ + onReset : function() { this.render(); }, + + /** + * Event executed when the calendar widget is completely cleared to the current month with no selections. + * @deprecated Event handlers for this event should be susbcribed to clearEvent. + */ + onClear : function() { this.render(); }, + + /** + * Validates the calendar widget. This method has no default implementation + * and must be extended by subclassing the widget. + * @return Should return true if the widget validates, and false if + * it doesn't. + * @type Boolean + */ + validate : function() { return true; }, + + // END EVENT HANDLERS + + // BEGIN DATE PARSE METHODS + + /** + * Converts a date string to a date field array + * @private + * @param {String} sDate Date string. Valid formats are mm/dd and mm/dd/yyyy. + * @return A date field array representing the string passed to the method + * @type Array[](Number[]) + */ + _parseDate : function(sDate) { + var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER), + rArray; + + if (aDate.length == 2) { + rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]]; + rArray.type = Calendar.MONTH_DAY; + } else { + rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1],aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]]; + rArray.type = Calendar.DATE; + } + + for (var i=0;i +*
    +*
    +* +* The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers. +* +*

    +* NOTE: As of 2.4.0, the constructor's ID argument is optional. +* The CalendarGroup can be constructed by simply providing a container ID string, +* or a reference to a container DIV HTMLElement (the element needs to exist +* in the document). +* +* E.g.: +*

    +* var c = new YAHOO.widget.CalendarGroup("calContainer", configOptions); +* +* or: +* +* var containerDiv = YAHOO.util.Dom.get("calContainer"); +* var c = new YAHOO.widget.CalendarGroup(containerDiv, configOptions); +* +*

    +*

    +* If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix. +* For example if an ID is not provided, and the container's ID is "calContainer", the CalendarGroup's ID will be set to "calContainer_t". +*

    +* +* @namespace YAHOO.widget +* @class CalendarGroup +* @constructor +* @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional. +* @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document. +* @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup. +*/ +function CalendarGroup(id, containerId, config) { + if (arguments.length > 0) { + this.init.apply(this, arguments); + } +} + +/** +* The set of default Config property keys and values for the CalendarGroup +* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG +* @final +* @static +* @private +* @type Object +*/ +CalendarGroup._DEFAULT_CONFIG = Calendar._DEFAULT_CONFIG; +CalendarGroup._DEFAULT_CONFIG.PAGES = {key:"pages", value:2}; + +var DEF_CFG = CalendarGroup._DEFAULT_CONFIG; + +CalendarGroup.prototype = { + + /** + * Initializes the calendar group. All subclasses must call this method in order for the + * group to be initialized properly. + * @method init + * @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional. + * @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document. + * @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup. + */ + init : function(id, container, config) { + + // Normalize 2.4.0, pre 2.4.0 args + var nArgs = this._parseArgs(arguments); + + id = nArgs.id; + container = nArgs.container; + config = nArgs.config; + + this.oDomContainer = Dom.get(container); + if (!this.oDomContainer) { this.logger.log("Container not found in document.", "error"); } + + if (!this.oDomContainer.id) { + this.oDomContainer.id = Dom.generateId(); + } + if (!id) { + id = this.oDomContainer.id + "_t"; + } + + /** + * The unique id associated with the CalendarGroup + * @property id + * @type String + */ + this.id = id; + + /** + * The unique id associated with the CalendarGroup container + * @property containerId + * @type String + */ + this.containerId = this.oDomContainer.id; + + this.logger = new YAHOO.widget.LogWriter("CalendarGroup " + this.id); + this.initEvents(); + this.initStyles(); + + /** + * The collection of Calendar pages contained within the CalendarGroup + * @property pages + * @type YAHOO.widget.Calendar[] + */ + this.pages = []; + + Dom.addClass(this.oDomContainer, CalendarGroup.CSS_CONTAINER); + Dom.addClass(this.oDomContainer, CalendarGroup.CSS_MULTI_UP); + + /** + * The Config object used to hold the configuration variables for the CalendarGroup + * @property cfg + * @type YAHOO.util.Config + */ + this.cfg = new YAHOO.util.Config(this); + + /** + * The local object which contains the CalendarGroup's options + * @property Options + * @type Object + */ + this.Options = {}; + + /** + * The local object which contains the CalendarGroup's locale settings + * @property Locale + * @type Object + */ + this.Locale = {}; + + this.setupConfig(); + + if (config) { + this.cfg.applyConfig(config, true); + } + + this.cfg.fireQueue(); + + // OPERA HACK FOR MISWRAPPED FLOATS + if (YAHOO.env.ua.opera){ + this.renderEvent.subscribe(this._fixWidth, this, true); + this.showEvent.subscribe(this._fixWidth, this, true); + } + + this.logger.log("Initialized " + this.pages.length + "-page CalendarGroup", "info"); + }, + + setupConfig : function() { + + var cfg = this.cfg; + + /** + * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments. + * @config pages + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.PAGES.key, { value:DEF_CFG.PAGES.value, validator:cfg.checkNumber, handler:this.configPages } ); + + /** + * The month/year representing the current visible Calendar date (mm/yyyy) + * @config pagedate + * @type String | Date + * @default today's date + */ + cfg.addProperty(DEF_CFG.PAGEDATE.key, { value:new Date(), handler:this.configPageDate } ); + + /** + * The date or range of dates representing the current Calendar selection + * + * @config selected + * @type String + * @default [] + */ + cfg.addProperty(DEF_CFG.SELECTED.key, { value:[], handler:this.configSelected } ); + + /** + * The title to display above the CalendarGroup's month header + * @config title + * @type String + * @default "" + */ + cfg.addProperty(DEF_CFG.TITLE.key, { value:DEF_CFG.TITLE.value, handler:this.configTitle } ); + + /** + * Whether or not a close button should be displayed for this CalendarGroup + * @config close + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.CLOSE.key, { value:DEF_CFG.CLOSE.value, handler:this.configClose } ); + + /** + * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below. + * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be + * enabled if required. + * + * @config iframe + * @type Boolean + * @default true for IE6 and below, false for all other browsers + */ + cfg.addProperty(DEF_CFG.IFRAME.key, { value:DEF_CFG.IFRAME.value, handler:this.configIframe, validator:cfg.checkBoolean } ); + + /** + * The minimum selectable date in the current Calendar (mm/dd/yyyy) + * @config mindate + * @type String | Date + * @default null + */ + cfg.addProperty(DEF_CFG.MINDATE.key, { value:DEF_CFG.MINDATE.value, handler:this.delegateConfig } ); + + /** + * The maximum selectable date in the current Calendar (mm/dd/yyyy) + * @config maxdate + * @type String | Date + * @default null + */ + cfg.addProperty(DEF_CFG.MAXDATE.key, { value:DEF_CFG.MAXDATE.value, handler:this.delegateConfig } ); + + // Options properties + + /** + * True if the Calendar should allow multiple selections. False by default. + * @config MULTI_SELECT + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.MULTI_SELECT.key, { value:DEF_CFG.MULTI_SELECT.value, handler:this.delegateConfig, validator:cfg.checkBoolean } ); + + /** + * The weekday the week begins on. Default is 0 (Sunday). + * @config START_WEEKDAY + * @type number + * @default 0 + */ + cfg.addProperty(DEF_CFG.START_WEEKDAY.key, { value:DEF_CFG.START_WEEKDAY.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * True if the Calendar should show weekday labels. True by default. + * @config SHOW_WEEKDAYS + * @type Boolean + * @default true + */ + cfg.addProperty(DEF_CFG.SHOW_WEEKDAYS.key, { value:DEF_CFG.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:cfg.checkBoolean } ); + + /** + * True if the Calendar should show week row headers. False by default. + * @config SHOW_WEEK_HEADER + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.SHOW_WEEK_HEADER.key,{ value:DEF_CFG.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:cfg.checkBoolean } ); + + /** + * True if the Calendar should show week row footers. False by default. + * @config SHOW_WEEK_FOOTER + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.SHOW_WEEK_FOOTER.key,{ value:DEF_CFG.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:cfg.checkBoolean } ); + + /** + * True if the Calendar should suppress weeks that are not a part of the current month. False by default. + * @config HIDE_BLANK_WEEKS + * @type Boolean + * @default false + */ + cfg.addProperty(DEF_CFG.HIDE_BLANK_WEEKS.key,{ value:DEF_CFG.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:cfg.checkBoolean } ); + + /** + * The image that should be used for the left navigation arrow. + * @config NAV_ARROW_LEFT + * @type String + * @deprecated You can customize the image by overriding the default CSS class for the left arrow - "calnavleft" + * @default null + */ + cfg.addProperty(DEF_CFG.NAV_ARROW_LEFT.key, { value:DEF_CFG.NAV_ARROW_LEFT.value, handler:this.delegateConfig } ); + + /** + * The image that should be used for the right navigation arrow. + * @config NAV_ARROW_RIGHT + * @type String + * @deprecated You can customize the image by overriding the default CSS class for the right arrow - "calnavright" + * @default null + */ + cfg.addProperty(DEF_CFG.NAV_ARROW_RIGHT.key, { value:DEF_CFG.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } ); + + // Locale properties + + /** + * The short month labels for the current locale. + * @config MONTHS_SHORT + * @type String[] + * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] + */ + cfg.addProperty(DEF_CFG.MONTHS_SHORT.key, { value:DEF_CFG.MONTHS_SHORT.value, handler:this.delegateConfig } ); + + /** + * The long month labels for the current locale. + * @config MONTHS_LONG + * @type String[] + * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" + */ + cfg.addProperty(DEF_CFG.MONTHS_LONG.key, { value:DEF_CFG.MONTHS_LONG.value, handler:this.delegateConfig } ); + + /** + * The 1-character weekday labels for the current locale. + * @config WEEKDAYS_1CHAR + * @type String[] + * @default ["S", "M", "T", "W", "T", "F", "S"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_1CHAR.key, { value:DEF_CFG.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } ); + + /** + * The short weekday labels for the current locale. + * @config WEEKDAYS_SHORT + * @type String[] + * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_SHORT.key, { value:DEF_CFG.WEEKDAYS_SHORT.value, handler:this.delegateConfig } ); + + /** + * The medium weekday labels for the current locale. + * @config WEEKDAYS_MEDIUM + * @type String[] + * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_MEDIUM.key, { value:DEF_CFG.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } ); + + /** + * The long weekday labels for the current locale. + * @config WEEKDAYS_LONG + * @type String[] + * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + */ + cfg.addProperty(DEF_CFG.WEEKDAYS_LONG.key, { value:DEF_CFG.WEEKDAYS_LONG.value, handler:this.delegateConfig } ); + + /** + * The setting that determines which length of month labels should be used. Possible values are "short" and "long". + * @config LOCALE_MONTHS + * @type String + * @default "long" + */ + cfg.addProperty(DEF_CFG.LOCALE_MONTHS.key, { value:DEF_CFG.LOCALE_MONTHS.value, handler:this.delegateConfig } ); + + /** + * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long". + * @config LOCALE_WEEKDAYS + * @type String + * @default "short" + */ + cfg.addProperty(DEF_CFG.LOCALE_WEEKDAYS.key, { value:DEF_CFG.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } ); + + /** + * The value used to delimit individual dates in a date string passed to various Calendar functions. + * @config DATE_DELIMITER + * @type String + * @default "," + */ + cfg.addProperty(DEF_CFG.DATE_DELIMITER.key, { value:DEF_CFG.DATE_DELIMITER.value, handler:this.delegateConfig } ); + + /** + * The value used to delimit date fields in a date string passed to various Calendar functions. + * @config DATE_FIELD_DELIMITER + * @type String + * @default "/" + */ + cfg.addProperty(DEF_CFG.DATE_FIELD_DELIMITER.key,{ value:DEF_CFG.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } ); + + /** + * The value used to delimit date ranges in a date string passed to various Calendar functions. + * @config DATE_RANGE_DELIMITER + * @type String + * @default "-" + */ + cfg.addProperty(DEF_CFG.DATE_RANGE_DELIMITER.key,{ value:DEF_CFG.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } ); + + /** + * The position of the month in a month/year date string + * @config MY_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MY_MONTH_POSITION.key, { value:DEF_CFG.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the year in a month/year date string + * @config MY_YEAR_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MY_YEAR_POSITION.key, { value:DEF_CFG.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the month in a month/day date string + * @config MD_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MD_MONTH_POSITION.key, { value:DEF_CFG.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the day in a month/year date string + * @config MD_DAY_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MD_DAY_POSITION.key, { value:DEF_CFG.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the month in a month/day/year date string + * @config MDY_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MDY_MONTH_POSITION.key, { value:DEF_CFG.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the day in a month/day/year date string + * @config MDY_DAY_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MDY_DAY_POSITION.key, { value:DEF_CFG.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the year in a month/day/year date string + * @config MDY_YEAR_POSITION + * @type Number + * @default 3 + */ + cfg.addProperty(DEF_CFG.MDY_YEAR_POSITION.key, { value:DEF_CFG.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the month in the month year label string used as the Calendar header + * @config MY_LABEL_MONTH_POSITION + * @type Number + * @default 1 + */ + cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_POSITION.key, { value:DEF_CFG.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The position of the year in the month year label string used as the Calendar header + * @config MY_LABEL_YEAR_POSITION + * @type Number + * @default 2 + */ + cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_POSITION.key, { value:DEF_CFG.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } ); + + /** + * The suffix used after the month when rendering the Calendar header + * @config MY_LABEL_MONTH_SUFFIX + * @type String + * @default " " + */ + cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_SUFFIX.key, { value:DEF_CFG.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } ); + + /** + * The suffix used after the year when rendering the Calendar header + * @config MY_LABEL_YEAR_SUFFIX + * @type String + * @default "" + */ + cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_SUFFIX.key, { value:DEF_CFG.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } ); + + /** + * Configuration for the Month Year Navigation UI. By default it is disabled + * @config NAV + * @type Object + * @default null + */ + cfg.addProperty(DEF_CFG.NAV.key, { value:DEF_CFG.NAV.value, handler:this.configNavigator } ); + + /** + * The map of UI strings which the CalendarGroup UI uses. + * + * @config strings + * @type {Object} + * @default An object with the properties shown below: + *
    + *
    previousMonth
    String : The string to use for the "Previous Month" navigation UI. Defaults to "Previous Month".
    + *
    nextMonth
    String : The string to use for the "Next Month" navigation UI. Defaults to "Next Month".
    + *
    close
    String : The string to use for the close button label. Defaults to "Close".
    + *
    + */ + cfg.addProperty(DEF_CFG.STRINGS.key, { + value:DEF_CFG.STRINGS.value, + handler:this.configStrings, + validator: function(val) { + return Lang.isObject(val); + }, + supercedes: DEF_CFG.STRINGS.supercedes + }); + }, + + /** + * Initializes CalendarGroup's built-in CustomEvents + * @method initEvents + */ + initEvents : function() { + + var me = this, + strEvent = "Event", + CE = YAHOO.util.CustomEvent; + + /** + * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents + * @method sub + * @private + * @param {Function} fn The function to subscribe to this CustomEvent + * @param {Object} obj The CustomEvent's scope object + * @param {Boolean} bOverride Whether or not to apply scope correction + */ + var sub = function(fn, obj, bOverride) { + for (var p=0;p