From 62051321fb708fe7bf2553e454143e9ac78177f6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 21 Jun 2012 09:42:56 -0400 Subject: [PATCH] Bug 8281 - Remove unused YUI files This patch removes assets from the YUI library in the OPAC and staff client which are unused by Koha To test, visit pages which still use YUI components: buttons and menus on circulation, for example. Drag-and-drop on the basketgroups page, JSON parsing when filtering orders on the Acquisitions Receive page (acqui/parcel.pl). All of these pages should work without errors. Signed-off-by: Jared Camins-Esakov --- .../lib/yui/assets/skins/sam/ajax-loader.gif | Bin 3208 -> 0 bytes .../prog/en/lib/yui/assets/skins/sam/asc.gif | Bin 177 -> 0 bytes .../lib/yui/assets/skins/sam/autocomplete.css | 7 - .../en/lib/yui/assets/skins/sam/back-h.png | Bin 334 -> 0 bytes .../en/lib/yui/assets/skins/sam/back-v.png | Bin 338 -> 0 bytes .../en/lib/yui/assets/skins/sam/bar-h.png | Bin 365 -> 0 bytes .../en/lib/yui/assets/skins/sam/bar-v.png | Bin 387 -> 0 bytes .../prog/en/lib/yui/assets/skins/sam/bg-h.gif | Bin 212 -> 0 bytes .../prog/en/lib/yui/assets/skins/sam/bg-v.gif | Bin 481 -> 0 bytes .../lib/yui/assets/skins/sam/blankimage.png | Bin 2314 -> 0 bytes .../en/lib/yui/assets/skins/sam/button.css | 7 - .../en/lib/yui/assets/skins/sam/calendar.css | 8 - .../en/lib/yui/assets/skins/sam/carousel.css | 7 - .../en/lib/yui/assets/skins/sam/check0.gif | Bin 608 -> 0 bytes .../en/lib/yui/assets/skins/sam/check1.gif | Bin 622 -> 0 bytes .../en/lib/yui/assets/skins/sam/check2.gif | Bin 609 -> 0 bytes .../lib/yui/assets/skins/sam/colorpicker.css | 7 - .../en/lib/yui/assets/skins/sam/container.css | 7 - .../en/lib/yui/assets/skins/sam/datatable.css | 8 - .../prog/en/lib/yui/assets/skins/sam/desc.gif | Bin 177 -> 0 bytes .../lib/yui/assets/skins/sam/dt-arrow-dn.png | Bin 116 -> 0 bytes .../lib/yui/assets/skins/sam/dt-arrow-up.png | Bin 116 -> 0 bytes .../lib/yui/assets/skins/sam/editor-knob.gif | Bin 138 -> 0 bytes .../assets/skins/sam/editor-sprite-active.gif | Bin 5614 -> 0 bytes .../yui/assets/skins/sam/editor-sprite.gif | Bin 5690 -> 0 bytes .../en/lib/yui/assets/skins/sam/editor.css | 10 - .../assets/skins/sam/header_background.png | Bin 158 -> 0 bytes .../en/lib/yui/assets/skins/sam/hue_bg.png | Bin 1120 -> 0 bytes .../lib/yui/assets/skins/sam/imagecropper.css | 7 - .../en/lib/yui/assets/skins/sam/layout.css | 7 - .../yui/assets/skins/sam/layout_sprite.png | Bin 1409 -> 0 bytes .../en/lib/yui/assets/skins/sam/loading.gif | Bin 2673 -> 0 bytes .../en/lib/yui/assets/skins/sam/logger.css | 7 - .../skins/sam/menu-button-arrow-disabled.png | Bin 173 -> 0 bytes .../assets/skins/sam/menu-button-arrow.png | Bin 173 -> 0 bytes .../prog/en/lib/yui/assets/skins/sam/menu.css | 7 - .../sam/menubaritem_submenuindicator.png | Bin 3618 -> 0 bytes .../menubaritem_submenuindicator_disabled.png | Bin 3618 -> 0 bytes .../assets/skins/sam/menuitem_checkbox.png | Bin 3625 -> 0 bytes .../skins/sam/menuitem_checkbox_disabled.png | Bin 3625 -> 0 bytes .../skins/sam/menuitem_submenuindicator.png | Bin 3617 -> 0 bytes .../menuitem_submenuindicator_disabled.png | Bin 3617 -> 0 bytes .../en/lib/yui/assets/skins/sam/paginator.css | 7 - .../lib/yui/assets/skins/sam/picker_mask.png | Bin 12174 -> 0 bytes .../yui/assets/skins/sam/profilerviewer.css | 7 - .../lib/yui/assets/skins/sam/progressbar.css | 7 - .../en/lib/yui/assets/skins/sam/resize.css | 7 - .../lib/yui/assets/skins/sam/simpleeditor.css | 10 - .../prog/en/lib/yui/assets/skins/sam/skin.css | 36 - .../en/lib/yui/assets/skins/sam/slider.css | 7 - .../skins/sam/split-button-arrow-active.png | Bin 280 -> 0 bytes .../skins/sam/split-button-arrow-disabled.png | Bin 185 -> 0 bytes .../skins/sam/split-button-arrow-focus.png | Bin 185 -> 0 bytes .../skins/sam/split-button-arrow-hover.png | Bin 185 -> 0 bytes .../assets/skins/sam/split-button-arrow.png | Bin 185 -> 0 bytes .../en/lib/yui/assets/skins/sam/sprite.png | Bin 3745 -> 0 bytes .../en/lib/yui/assets/skins/sam/sprite.psd | Bin 118162 -> 0 bytes .../en/lib/yui/assets/skins/sam/tabview.css | 8 - .../yui/assets/skins/sam/treeview-loading.gif | Bin 2673 -> 0 bytes .../yui/assets/skins/sam/treeview-sprite.gif | Bin 4326 -> 0 bytes .../en/lib/yui/assets/skins/sam/treeview.css | 7 - .../prog/en/lib/yui/assets/skins/sam/wait.gif | Bin 1100 -> 0 bytes .../en/lib/yui/assets/skins/sam/yuitest.css | 7 - .../prog/en/lib/yui/base/base-min.css | 7 - .../prog/en/lib/yui/base/base.css | 131 - .../lib/yui/calendar/assets/calendar-core.css | 132 - .../en/lib/yui/calendar/assets/calendar.css | 320 - .../en/lib/yui/calendar/assets/calgrad.png | Bin 497 -> 0 bytes .../prog/en/lib/yui/calendar/assets/callt.gif | Bin 93 -> 0 bytes .../prog/en/lib/yui/calendar/assets/calrt.gif | Bin 94 -> 0 bytes .../prog/en/lib/yui/calendar/assets/calx.gif | Bin 88 -> 0 bytes .../assets/skins/sam/calendar-skin.css | 361 - .../calendar/assets/skins/sam/calendar.css | 8 - .../en/lib/yui/calendar/calendar-debug.js | 7324 ------- .../prog/en/lib/yui/calendar/calendar-min.js | 18 - .../prog/en/lib/yui/calendar/calendar.js | 7294 ------- .../lib/yui/carousel/assets/ajax-loader.gif | Bin 3208 -> 0 bytes .../lib/yui/carousel/assets/carousel-core.css | 88 - .../carousel/assets/skins/sam/ajax-loader.gif | Bin 3208 -> 0 bytes .../assets/skins/sam/carousel-skin.css | 142 - .../carousel/assets/skins/sam/carousel.css | 7 - .../en/lib/yui/carousel/carousel-debug.js | 4390 ---- .../prog/en/lib/yui/carousel/carousel-min.js | 12 - .../prog/en/lib/yui/carousel/carousel.js | 4349 ---- .../prog/en/lib/yui/charts/assets/charts.swf | Bin 81768 -> 0 bytes .../prog/en/lib/yui/charts/charts-debug.js | 2061 -- .../prog/en/lib/yui/charts/charts-min.js | 9 - .../prog/en/lib/yui/charts/charts.js | 2060 -- .../colorpicker/assets/colorpicker-core.css | 6 - .../lib/yui/colorpicker/assets/hue_thumb.png | Bin 195 -> 0 bytes .../yui/colorpicker/assets/picker_mask.png | Bin 12174 -> 0 bytes .../yui/colorpicker/assets/picker_thumb.png | Bin 192 -> 0 bytes .../assets/skins/sam/colorpicker-skin.css | 105 - .../assets/skins/sam/colorpicker.css | 7 - .../colorpicker/assets/skins/sam/hue_bg.png | Bin 1120 -> 0 bytes .../assets/skins/sam/picker_mask.png | Bin 12174 -> 0 bytes .../lib/yui/colorpicker/colorpicker-debug.js | 1783 -- .../en/lib/yui/colorpicker/colorpicker-min.js | 9 - .../en/lib/yui/colorpicker/colorpicker.js | 1763 -- .../en/lib/yui/connection/connection-debug.js | 1576 -- .../en/lib/yui/connection/connection-min.js | 9 - .../prog/en/lib/yui/connection/connection.js | 1546 -- .../prog/en/lib/yui/connection/connection.swf | Bin 2423 -> 0 bytes .../yui/connection/connection_core-debug.js | 980 - .../lib/yui/connection/connection_core-min.js | 8 - .../en/lib/yui/connection/connection_core.js | 957 - .../yui/datatable/assets/datatable-core.css | 93 - .../en/lib/yui/datatable/assets/datatable.css | 49 - .../assets/skins/sam/datatable-skin.css | 240 - .../datatable/assets/skins/sam/datatable.css | 8 - .../assets/skins/sam/dt-arrow-dn.png | Bin 116 -> 0 bytes .../assets/skins/sam/dt-arrow-up.png | Bin 116 -> 0 bytes .../en/lib/yui/datatable/datatable-debug.js | 17360 ---------------- .../en/lib/yui/datatable/datatable-min.js | 29 - .../prog/en/lib/yui/datatable/datatable.js | 17122 --------------- .../en/lib/yui/datemath/datemath-debug.js | 408 - .../prog/en/lib/yui/datemath/datemath-min.js | 7 - .../prog/en/lib/yui/datemath/datemath.js | 408 - .../prog/en/lib/yui/dom/dom-debug.js | 1872 -- .../prog/en/lib/yui/dom/dom-min.js | 9 - .../intranet-tmpl/prog/en/lib/yui/dom/dom.js | 1832 -- .../en/lib/yui/editor/assets/editor-core.css | 602 - .../yui/editor/assets/simpleeditor-core.css | 602 - .../editor/assets/skins/sam/blankimage.png | Bin 2314 -> 0 bytes .../editor/assets/skins/sam/editor-knob.gif | Bin 138 -> 0 bytes .../editor/assets/skins/sam/editor-skin.css | 711 - .../assets/skins/sam/editor-sprite-active.gif | Bin 5614 -> 0 bytes .../editor/assets/skins/sam/editor-sprite.gif | Bin 5690 -> 0 bytes .../yui/editor/assets/skins/sam/editor.css | 10 - .../assets/skins/sam/simpleeditor-skin.css | 711 - .../editor/assets/skins/sam/simpleeditor.css | 10 - .../prog/en/lib/yui/editor/editor-debug.js | 9557 --------- .../prog/en/lib/yui/editor/editor-min.js | 30 - .../prog/en/lib/yui/editor/editor.js | 9447 --------- .../en/lib/yui/editor/simpleeditor-debug.js | 7493 ------- .../en/lib/yui/editor/simpleeditor-min.js | 24 - .../prog/en/lib/yui/editor/simpleeditor.js | 7406 ------- .../element-delegate-debug.js | 141 - .../element-delegate/element-delegate-min.js | 7 - .../yui/element-delegate/element-delegate.js | 138 - .../event-delegate/event-delegate-debug.js | 283 - .../yui/event-delegate/event-delegate-min.js | 7 - .../lib/yui/event-delegate/event-delegate.js | 281 - .../event-mouseenter-debug.js | 219 - .../event-mouseenter/event-mouseenter-min.js | 7 - .../yui/event-mouseenter/event-mouseenter.js | 219 - .../event-simulate/event-simulate-debug.js | 622 - .../yui/event-simulate/event-simulate-min.js | 7 - .../lib/yui/event-simulate/event-simulate.js | 622 - .../prog/en/lib/yui/event/event-debug.js | 2524 --- .../prog/en/lib/yui/event/event-min.js | 11 - .../prog/en/lib/yui/event/event.js | 2500 --- .../prog/en/lib/yui/fonts/fonts-min.css | 7 - .../prog/en/lib/yui/fonts/fonts.css | 56 - .../prog/en/lib/yui/get/get-debug.js | 773 - .../prog/en/lib/yui/get/get-min.js | 7 - .../intranet-tmpl/prog/en/lib/yui/get/get.js | 755 - .../prog/en/lib/yui/grids/grids-min.css | 7 - .../prog/en/lib/yui/grids/grids.css | 467 - .../prog/en/lib/yui/history/assets/blank.html | 1 - .../prog/en/lib/yui/history/history-debug.js | 803 - .../prog/en/lib/yui/history/history-min.js | 7 - .../prog/en/lib/yui/history/history.js | 803 - .../imagecropper/assets/imagecropper-core.css | 33 - .../assets/skins/sam/imagecropper-skin.css | 16 - .../assets/skins/sam/imagecropper.css | 7 - .../yui/imagecropper/imagecropper-debug.js | 907 - .../lib/yui/imagecropper/imagecropper-min.js | 8 - .../en/lib/yui/imagecropper/imagecropper.js | 889 - .../lib/yui/imageloader/imageloader-debug.js | 487 - .../en/lib/yui/imageloader/imageloader-min.js | 7 - .../en/lib/yui/imageloader/imageloader.js | 680 - .../en/lib/yui/layout/assets/layout-core.css | 158 - .../layout/assets/skins/sam/layout-skin.css | 207 - .../yui/layout/assets/skins/sam/layout.css | 7 - .../layout/assets/skins/sam/layout_sprite.png | Bin 1409 -> 0 bytes .../prog/en/lib/yui/layout/layout-debug.js | 2305 -- .../prog/en/lib/yui/layout/layout-min.js | 11 - .../prog/en/lib/yui/layout/layout.js | 2290 -- .../en/lib/yui/logger/assets/logger-core.css | 7 - .../prog/en/lib/yui/logger/assets/logger.css | 57 - .../logger/assets/skins/sam/logger-skin.css | 55 - .../yui/logger/assets/skins/sam/logger.css | 7 - .../prog/en/lib/yui/logger/logger-debug.js | 2104 -- .../prog/en/lib/yui/logger/logger-min.js | 9 - .../prog/en/lib/yui/logger/logger.js | 2104 -- .../yui/paginator/assets/paginator-core.css | 6 - .../assets/skins/sam/paginator-skin.css | 78 - .../paginator/assets/skins/sam/paginator.css | 7 - .../en/lib/yui/paginator/paginator-debug.js | 2393 --- .../en/lib/yui/paginator/paginator-min.js | 10 - .../prog/en/lib/yui/paginator/paginator.js | 2393 --- .../en/lib/yui/profiler/profiler-debug.js | 557 - .../prog/en/lib/yui/profiler/profiler-min.js | 7 - .../prog/en/lib/yui/profiler/profiler.js | 557 - .../assets/profilerviewer-core.css | 6 - .../profilerviewer/assets/skins/sam/asc.gif | Bin 177 -> 0 bytes .../profilerviewer/assets/skins/sam/desc.gif | Bin 177 -> 0 bytes .../assets/skins/sam/header_background.png | Bin 158 -> 0 bytes .../assets/skins/sam/profilerviewer-skin.css | 167 - .../assets/skins/sam/profilerviewer.css | 7 - .../profilerviewer/assets/skins/sam/wait.gif | Bin 1100 -> 0 bytes .../profilerviewer/profilerviewer-debug.js | 1229 -- .../yui/profilerviewer/profilerviewer-min.js | 9 - .../lib/yui/profilerviewer/profilerviewer.js | 1192 -- .../progressbar/assets/progressbar-core.css | 85 - .../progressbar/assets/skins/sam/back-h.png | Bin 334 -> 0 bytes .../progressbar/assets/skins/sam/back-v.png | Bin 338 -> 0 bytes .../progressbar/assets/skins/sam/bar-h.png | Bin 365 -> 0 bytes .../progressbar/assets/skins/sam/bar-v.png | Bin 387 -> 0 bytes .../assets/skins/sam/progressbar-skin.css | 56 - .../assets/skins/sam/progressbar.css | 7 - .../lib/yui/progressbar/progressbar-debug.js | 691 - .../en/lib/yui/progressbar/progressbar-min.js | 8 - .../en/lib/yui/progressbar/progressbar.js | 677 - .../reset-fonts-grids/reset-fonts-grids.css | 7 - .../en/lib/yui/reset-fonts/reset-fonts.css | 7 - .../prog/en/lib/yui/reset/reset-min.css | 7 - .../prog/en/lib/yui/reset/reset.css | 142 - .../en/lib/yui/resize/assets/resize-core.css | 173 - .../resize/assets/skins/sam/layout_sprite.png | Bin 1409 -> 0 bytes .../resize/assets/skins/sam/resize-skin.css | 142 - .../yui/resize/assets/skins/sam/resize.css | 7 - .../prog/en/lib/yui/resize/resize-debug.js | 1749 -- .../prog/en/lib/yui/resize/resize-min.js | 10 - .../prog/en/lib/yui/resize/resize.js | 1689 -- .../en/lib/yui/selector/selector-debug.js | 651 - .../prog/en/lib/yui/selector/selector-min.js | 8 - .../prog/en/lib/yui/selector/selector.js | 644 - .../en/lib/yui/slider/assets/bg-fader.gif | Bin 433 -> 0 bytes .../prog/en/lib/yui/slider/assets/bg-h.gif | Bin 212 -> 0 bytes .../prog/en/lib/yui/slider/assets/bg-v-e.gif | Bin 476 -> 0 bytes .../prog/en/lib/yui/slider/assets/bg-v.gif | Bin 481 -> 0 bytes .../en/lib/yui/slider/assets/left-thumb.png | Bin 348 -> 0 bytes .../en/lib/yui/slider/assets/right-thumb.png | Bin 356 -> 0 bytes .../lib/yui/slider/assets/skins/sam/bg-h.gif | Bin 212 -> 0 bytes .../lib/yui/slider/assets/skins/sam/bg-v.gif | Bin 481 -> 0 bytes .../slider/assets/skins/sam/slider-skin.css | 24 - .../yui/slider/assets/skins/sam/slider.css | 7 - .../en/lib/yui/slider/assets/slider-core.css | 17 - .../en/lib/yui/slider/assets/slider-skin.css | 20 - .../en/lib/yui/slider/assets/thumb-bar.gif | Bin 580 -> 0 bytes .../prog/en/lib/yui/slider/assets/thumb-e.gif | Bin 340 -> 0 bytes .../en/lib/yui/slider/assets/thumb-fader.gif | Bin 645 -> 0 bytes .../prog/en/lib/yui/slider/assets/thumb-n.gif | Bin 612 -> 0 bytes .../prog/en/lib/yui/slider/assets/thumb-s.gif | Bin 615 -> 0 bytes .../prog/en/lib/yui/slider/assets/thumb-w.gif | Bin 340 -> 0 bytes .../prog/en/lib/yui/slider/slider-debug.js | 2114 -- .../prog/en/lib/yui/slider/slider-min.js | 9 - .../prog/en/lib/yui/slider/slider.js | 2068 -- .../prog/en/lib/yui/storage/storage-debug.js | 1185 -- .../prog/en/lib/yui/storage/storage-min.js | 8 - .../prog/en/lib/yui/storage/storage.js | 1183 -- .../en/lib/yui/stylesheet/stylesheet-debug.js | 648 - .../en/lib/yui/stylesheet/stylesheet-min.js | 7 - .../prog/en/lib/yui/stylesheet/stylesheet.js | 645 - .../prog/en/lib/yui/swf/swf-debug.js | 269 - .../prog/en/lib/yui/swf/swf-min.js | 7 - .../intranet-tmpl/prog/en/lib/yui/swf/swf.js | 268 - .../en/lib/yui/swfdetect/swfdetect-debug.js | 93 - .../en/lib/yui/swfdetect/swfdetect-min.js | 7 - .../prog/en/lib/yui/swfdetect/swfdetect.js | 93 - .../prog/en/lib/yui/swfstore/swf.js | 238 - .../en/lib/yui/swfstore/swfstore-debug.js | 470 - .../prog/en/lib/yui/swfstore/swfstore-min.js | 7 - .../prog/en/lib/yui/swfstore/swfstore.js | 453 - .../prog/en/lib/yui/swfstore/swfstore.swf | Bin 4819 -> 0 bytes .../en/lib/yui/tabview/assets/border_tabs.css | 54 - .../en/lib/yui/tabview/assets/loading.gif | Bin 729 -> 0 bytes .../en/lib/yui/tabview/assets/skin-sam.css | 77 - .../tabview/assets/skins/sam/tabview-skin.css | 186 - .../yui/tabview/assets/skins/sam/tabview.css | 8 - .../lib/yui/tabview/assets/tabview-core.css | 133 - .../en/lib/yui/tabview/assets/tabview.css | 77 - .../prog/en/lib/yui/tabview/tabview-debug.js | 995 - .../prog/en/lib/yui/tabview/tabview-min.js | 8 - .../prog/en/lib/yui/tabview/tabview.js | 987 - .../yui/treeview/assets/skins/sam/check0.gif | Bin 608 -> 0 bytes .../yui/treeview/assets/skins/sam/check1.gif | Bin 622 -> 0 bytes .../yui/treeview/assets/skins/sam/check2.gif | Bin 609 -> 0 bytes .../yui/treeview/assets/skins/sam/loading.gif | Bin 2673 -> 0 bytes .../assets/skins/sam/treeview-loading.gif | Bin 2673 -> 0 bytes .../assets/skins/sam/treeview-skin.css | 249 - .../assets/skins/sam/treeview-sprite.gif | Bin 4326 -> 0 bytes .../treeview/assets/skins/sam/treeview.css | 7 - .../lib/yui/treeview/assets/treeview-core.css | 6 - .../en/lib/yui/treeview/treeview-debug.js | 4058 ---- .../prog/en/lib/yui/treeview/treeview-min.js | 12 - .../prog/en/lib/yui/treeview/treeview.js | 3989 ---- .../en/lib/yui/uploader/assets/uploader.swf | Bin 7098 -> 0 bytes .../en/lib/yui/uploader/uploader-debug.js | 1072 - .../prog/en/lib/yui/uploader/uploader-min.js | 15 - .../prog/en/lib/yui/uploader/uploader.js | 1069 - .../prog/en/lib/yui/yahoo/yahoo-debug.js | 1075 - .../prog/en/lib/yui/yahoo/yahoo-min.js | 7 - .../prog/en/lib/yui/yahoo/yahoo.js | 1075 - .../yuiloader-dom-event.js | 17 - .../en/lib/yui/yuiloader/yuiloader-debug.js | 3879 ---- .../en/lib/yui/yuiloader/yuiloader-min.js | 10 - .../prog/en/lib/yui/yuiloader/yuiloader.js | 3879 ---- .../yuitest/assets/skins/sam/yuitest-skin.css | 7 - .../yui/yuitest/assets/skins/sam/yuitest.css | 7 - .../en/lib/yui/yuitest/assets/testlogger.css | 7 - .../lib/yui/yuitest/assets/yuitest-core.css | 7 - .../prog/en/lib/yui/yuitest/yuitest-debug.js | 2741 --- .../prog/en/lib/yui/yuitest/yuitest-min.js | 10 - .../prog/en/lib/yui/yuitest/yuitest.js | 2741 --- .../en/lib/yui/yuitest/yuitest_core-debug.js | 1976 -- .../en/lib/yui/yuitest/yuitest_core-min.js | 9 - .../prog/en/lib/yui/yuitest/yuitest_core.js | 1976 -- 310 files changed, 194966 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/ajax-loader.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/asc.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/autocomplete.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/back-h.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/back-v.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bar-h.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bar-v.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bg-h.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bg-v.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/blankimage.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/button.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/calendar.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/carousel.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check0.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check1.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check2.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/colorpicker.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/container.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/datatable.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/desc.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/dt-arrow-dn.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/dt-arrow-up.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor-knob.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor-sprite-active.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor-sprite.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/header_background.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/hue_bg.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/imagecropper.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/layout.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/layout_sprite.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/loading.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/logger.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menu-button-arrow-disabled.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menu-button-arrow.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menu.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menuitem_checkbox.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menuitem_checkbox_disabled.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menuitem_submenuindicator.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/paginator.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/picker_mask.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/profilerviewer.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/progressbar.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/resize.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/simpleeditor.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/slider.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-active.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-disabled.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-focus.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-hover.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/sprite.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/sprite.psd delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/tabview.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview-loading.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview-sprite.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/wait.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/yuitest.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/base/base-min.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/base/base.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calendar-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calendar.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calgrad.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/callt.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calrt.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calx.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/calendar-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/calendar-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/calendar.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/assets/ajax-loader.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/assets/carousel-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/assets/skins/sam/ajax-loader.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/assets/skins/sam/carousel-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/assets/skins/sam/carousel.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/carousel-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/carousel-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/carousel/carousel.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/charts/assets/charts.swf delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/charts/charts-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/charts/charts-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/charts/charts.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/colorpicker-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/hue_thumb.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/picker_mask.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/picker_thumb.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/skins/sam/colorpicker-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/skins/sam/colorpicker.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/skins/sam/hue_bg.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/assets/skins/sam/picker_mask.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/colorpicker-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/colorpicker-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/colorpicker/colorpicker.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/connection/connection-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/connection/connection-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/connection/connection.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/connection/connection.swf delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/connection/connection_core-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/connection/connection_core-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/connection/connection_core.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/assets/datatable-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/assets/datatable.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/assets/skins/sam/datatable-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/assets/skins/sam/datatable.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/assets/skins/sam/dt-arrow-dn.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/assets/skins/sam/dt-arrow-up.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/datatable-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/datatable-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datatable/datatable.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datemath/datemath-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datemath/datemath-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/datemath/datemath.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/dom/dom-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/dom/dom-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/dom/dom.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/editor-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/simpleeditor-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/blankimage.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/editor-knob.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/editor-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/editor-sprite-active.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/editor-sprite.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/editor.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/simpleeditor-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/assets/skins/sam/simpleeditor.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/editor-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/editor-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/editor.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event/event-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event/event-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/event/event.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/fonts/fonts-min.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/fonts/fonts.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids-min.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/assets/blank.html delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/imagecropper-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/layout-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout_sprite.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/logger-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/logger-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/logger.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/assets/paginator-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/assets/skins/sam/paginator-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/assets/skins/sam/paginator.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/paginator-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/paginator-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/paginator.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/profilerviewer-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/asc.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/desc.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/header_background.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/wait.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/profilerviewer-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/profilerviewer-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/profilerviewer.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/progressbar-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/back-h.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/back-v.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/bar-h.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/bar-v.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts-grids/reset-fonts-grids.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts/reset-fonts.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset-min.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/resize-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/layout_sprite.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-fader.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-h.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-v-e.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-v.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/left-thumb.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/right-thumb.png delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/skins/sam/bg-h.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/skins/sam/bg-v.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/skins/sam/slider-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/skins/sam/slider.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/slider-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/slider-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-bar.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-e.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-fader.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-n.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-s.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-w.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swf.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore.swf delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/border_tabs.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/loading.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skin-sam.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check0.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check1.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check2.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/loading.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/treeview-loading.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/treeview-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/treeview-sprite.gif delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/treeview.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/treeview-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/treeview-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/treeview-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/treeview.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/uploader/assets/uploader.swf delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/uploader/uploader-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/uploader/uploader-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/uploader/uploader.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yahoo/yahoo-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yahoo/yahoo-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yahoo/yahoo.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuiloader-dom-event/yuiloader-dom-event.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuiloader/yuiloader-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuiloader/yuiloader-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuiloader/yuiloader.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/assets/skins/sam/yuitest-skin.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/assets/skins/sam/yuitest.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/assets/testlogger.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/assets/yuitest-core.css delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/yuitest-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/yuitest-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/yuitest.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/yuitest_core-debug.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/yuitest_core-min.js delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/yuitest/yuitest_core.js diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/ajax-loader.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/ajax-loader.gif deleted file mode 100644 index fe2cd23b3a3c017ae6acfd291135a998e2f8ee74..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3208 zcmc(iX;4#H9>pJdFE7h`I{03&1A#Fh5ut4eDm1GK0RjYM5fB7KV#MGsi$D+vOBRqd zgf*ZfkQkyZBB-FP%_0qIW8nsBs{?emDDG|9WA}8815QoVR1F`dYN~qf$6L4Vt>5{d zbE+;kz|X}skqIz?cL4D54JR>7R zC=>$!T9zM?jlL0^I9{Q?tL@pK(cHe}-_1BFI}+1&2$&hkX+mb=uEfke`x6EB$@`M_ z1D3x+6zbfmRr5E@KMFuI#v=jAiQ3uG89q;9-Ry^&w1yMBlo4lEk+iEfP1~`Z92~Ch z)f})CRri0#HYFIlTMw~0MospF06WXy{W&YWHZ0k11QlAYagA`g5O>qXR=-HrvaSDB z_Zb0=l#$8xjDe^-X;5K?KVNEb2=?++uqjb-O>uH}3V{f=X`7C@YYi%YeTnA8$>uJL zdiJ@qX{;*$)Z!y4F&_ST_WAfw@%dWHWd;8me2W=>IK+3S8&sdijfuDK^L*g-myocg zROu67HjY0iw0C{snY#0R-qG!)?{-XEVE62>ig9TY@TJe3GXKdwJI@}|HamJe#?Oh? z>{oe56Alk5BlvXgg+R&0z85Eh49$Wmvo|XwF?%x^Ps^2qs0qZ3Lus@P^`@A3w%??Y zNrp~Cj`ZJGgco)yaDR-t*2poe`}@ODuqlfmf)3H3yyd&tGHN+(Pbqh2HaizA_Q?03 z6vb*{Wx}dVt(w~oQM1}L?Z-Q0t>x+_$09~DhU4QV>^p8+p>pT`ODnb?l<*T8U_yyX3gn$N3RHXr@+ zyvwBNh$Uem{8w}MwvKc7Gmcy*LA+#TjXHezj51<%sd86PQTE_%4<;Tv<}?{hyF5u{ zkD1y^OsUMEo~3O81nHZ-l2Kp%@HSdEL_C0LBdJI}v^9ywA{T7!B#!)OL4eaycbp&+ z5pvi?(F_W;coQ4kkztVq?e-uwu_(tvT3d^&DOEaAn;~2A)k(wQc0=2_Rt>AyyzwIK zl3z!1spEi>EiV?!bl1O*=~m&5gDzJxOTJN*QbfnDZYaizCp;dV0H%S);r_=zJOw%~ zGhVp7or&@2D4oTwYRN9|WXI!Vp(fU6FKR6n{fm|?=zw|mx6?JVqdQG~BaNGDnRi>l zWr@lNZ{z!Ii}9(;2iDn~t7+Roes3*ru#$tcIN5SvM~=}x@s)B~;nm!UyFj4ns-+KC zc_r464Q9=e8C%yH1+YRNJti+sN5Yn_SwqNX=fla45fUzOXNGxJ4hxjCY{HwGakNE^ z5Gm!7Qctx3)g5m>fwpRouQ_^-Tg&QI9=LFct)n*JU4h~IB~JK=lpSzIw>N9I92(3V z#mN!!gq)F;6@X-7>-2OMuem(+EcT-5*}CKeJ*)igt9`$D-p8gNTswGg?T*nef(P0b zcK@gG+v#UVZEStDg7}(BoUR)T4X1dKm2Q?_{Y{jjD5!4YXH+j@Ig72hZ7T)Vu~st0 zhrrH1_xTCGs)WHrj1dNfmTf!0G9QpSc>9IMZI4_uy=Z;JSQ=ro!vUDYT@jMzLrhFC zPld89_W0NY*EiruQ}aPeN!s@MW-X%DH0Th1i)M9Wrw>?N84RMRn?==Gv)*2$LZFtj z2yh8YM(r*`qrn!`bl7N@Jo-$m`V4N zd#7=6y}+ZI8A2#Xi~iZ;pv~t?ycaJ#{&({Q5Z*pl09Ju4W^-*NO|A0{+hV9Zh26ql z2MH72VLb8&2TY#uH1oxixNyRH@Bou{d;Ek=(P*RR{C}jf8 z4tl&k6u5>WN>#{O0GSx;^S%8J`bnXRdTvecd2(%ukpLhBjxD#vB!4;(wPc{rdch`m z{%<-+=B&UpQHKv~*;s5BYG-s}%Kff&XttelV?p1`IN!0#pDoFGj*%g&ANf!k5>lK4 ze&JKqZ9m<);$PS3Lh-J1r<^%yWkWVJZTbE|+9d_wT+Ca}vEj*!aj>+En31zyUZw=A z6ucU+B3a~I(&7eY7Vsb#Cgyo@^m@{<6*;bXq*E{{O%!KAMB<=xdV`M>-8~aTkY1dq z?+nWqtVG8F%5|iZw;3Bpv1e2bB;w=q)j57RxDTznFZ z3W@4K+O`crTxg*teEmo8b4BzyV0nd0j;L5srpzr-v7(E31Q2w!D0I{4^VvCVEDBK% z66eVw*qhwhwuinQ1=3A&0r@@%}|u!GftRru!rq=CeZOe*qn zn9DxM$)PhKM5mLc$Kh}X3U@IGpfHE8)geTm0W$~$2jiD{5_Niam1Aa-u?l5?(>BA6sZK>V=uqv=_H!;GRk>u*v_2IuH5uz@LJl! zo%n|YVa^Cd1g)$p7CBL?>dp$T>v@mAeRdBQ ze9w4I`#JtYzxS8wKA@n*nM@x$;j>^6p8iiJAfw-kO+FQYF`K+*DbdiS6yEK@3ss4I zb-S367!k?l1nf57%jYeZZRb@fFtH1zC_7P6K-5qzuxPfqlC^Y+Rkn zbFQFvs!+j^0Aulpi7jGEH4eJxe|oc;i#k&X*FNJ#({)(kiy|YGeTF=NOz@lp5 z{Q(*&J)M-|;LMD6f(rxO6Qt&82r*>2FC{xfrINcwkzh@0(^1z}{o3ZEbV%La)Tyd- zkE-Q3P(e`K>r7{mFAmn{+FinI28ktR!TXo>U>7bD#rtjy^Or>rfNofB{O3`2qkBz$ zf=qb{lOZ=#c);7PjT`KNS=CL!uR!jNgJZfMm*M&5n2(0!J$?isJIy7)ef}TtY5fE2 C|Ftdv diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/asc.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/asc.gif deleted file mode 100644 index a1fe7385d5ac940629233f0dc4bbd61f20959c3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/autocomplete.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/autocomplete.css deleted file mode 100644 index 07fc0302a9..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/autocomplete.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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:.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/back-h.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/back-h.png deleted file mode 100644 index 5f69f4e2564357c83eddcecd5f104e14ecf09d49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^8bBP#!2~4rHx?TMDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe3dtTpz6=aiY77hwEes65fIoOOtf|Nms9M{<~TG{NqzV`0JLv$@3}2r!1e&d7^!S-DO!ayYtzu zlYbXZdwJtvz~-c)`W2~GWd>K)%(x?;HM38a$5dPGdwUdyvi-fkSZmx?=65Sx>H+$T N!PC{xWt~$(695Wxh_(O# diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/back-v.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/back-v.png deleted file mode 100644 index 658574a9d560febf6f58a6a005e602ae734f97da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^fk3Rm!2~2Z4>V?gr~;43Vg?4j!ywFfJby(BP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eBzCyA`kS_y6l^O#>Lkk1LFQ8Dv3kHT#0|tgy z2@DKYGZ+}e3+C(!v;j)&_H=O!$#8xetNtMognoD1W&+apvb;IkbSm6HPD+>;$YzUet;PS1vwR5kn@U@xAZc*X`bN{qf6~>%I#YFG@c*bNAWmV~4vw71T)EP4+yI zm~wtolli{h{KvO{m;tHh|I%4jCy1_T3f;gJc5v07ee4g7Yue6#khD9T{)1zz`*b-fq}tl1_Oh5!JJ)zHb9Bj zo-U3d8P0E~+HyA*iX83NS6;e=XVR0zjVBT|NT_&L{`FGpKAL2Fa>10KxKFts1mAI{ zTl(++c+cBw&>1Hg`q?f)-lTL;*t$N(e z5?hd3GOgj$2NlMp2LqYB{x-9SR9ACql#~mV9Q=7MjH&2tFH1^vHs=YGaG?o#I;s{w z@^7uZwW|JFk^J=j)5pJVtzYr_iPcWOb;5U<>=m}`da)?fz4zkhFyGbPdQqiUBy97q c5+S&cLBv9~EU0~*E702vp00i_>zopr03oxJMgRZ+ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bar-v.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bar-v.png deleted file mode 100644 index 2efd664d9abdddff7e06ec512e0198f5fcaf1a56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^0YI$5!2~3qF}(@{Qk(@Ik;M!Qe1}1p@p%4<6rdnu zage(c!@6@aFM%AEbVpxD28NCO+{4xi!)|R=d;J&iHZ8yvVO_gGSA|3s-364JloT@b e|NoWUGS9D3dxyvWMZl0`VDNPHb6Mw<&;$VKhMGhG diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bg-h.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bg-h.gif deleted file mode 100644 index 996288916e82bf2972bb4b8097f1b4a0869955d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 212 zcmV;_04x7TNk%w1VbK5_0HOu};o;%Q$;qdur-_M)x3{;~*Vq65{{R30A^8LW000I6 zEC2ui0MP&(000A-Xu90~Fv>}*y*TU5yZ>M)j$~<`XsWJk>%MR-&vb3yc&_h!@BhG{ za7Zi~kI1BQ$!t1BgQ#>$ty-_xtai)odcWYXI4gJ*&gisy&2GEj@VIs;jK6uCK7M Ova__cwzs%A2>?48g>Yp6 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bg-v.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/bg-v.gif deleted file mode 100644 index 8e287cd52222c75c8f921cfdd4b4ae02b783c0e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 481 zcmV<70UrKGNk%w1VI%+9?F_4V!T?c3Yi)6>)G>FKw(x2LD4*Voto|Nj60 z00000000000000000000A^8LW000R9EC2ui03-n5000F4Fv&@)y*TU5yZ>M)1%db# z2qKu>ks2)LB5`naUe$Rb%^?jF5?t^_yflh-^g;Ix9iB^kPjarXfkzSKvm137eG4lFF3Kmd=>a zn$n!qo;kDDqu96FtKO~LyW+j%zvjW{!|KKC$L`7S%ks_i&-T&y)B4r?*Pu#pof4P| zTr7Xv0HRt$kfFg^2){)Pr?BA>i=iIons~6H#(^J>3vz_$apcC5C`(}s7}B9hkS|51 zeAV(|&5SW!&diq6W>1_uyZvN2bfM3n002t}0{{R350Hx300004XF*Lt007q5 z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzfKW_SMepzL z*?5)vnXr^-@mq~v#Is<_TJv!tH9IQe$@Xx30Dl4m?CIp{=H9&7-_qpj z@$&Na_V>}=-P_s8t;X5r<>9oxu=V))t;fI5&dBfV=di}q&Ctl)z^}#1!s6l2^YQNR z_4fPy{pIZK+vn}2t)%$)_toO#;n%^Nt);HK#<#b(?d|Q^-PrN-^x)*+!OF_W$Hdm! z)7aL|?e6dH@9^Q?*SNj5^z`$uytMfH`|DE_v7Q^$@+uYl) zwyn<6!SC?!+19@4>g)FN@VIM;P5=N05J^NqRCwC#*lSzbSQiFhNFotI4oL6_;vuC{b=qK$I+Xz#Vv+gl@7g<|P-q!D?T7b6AA7YNE^pUbd+%Us zvHiGMY?dFDpVm+7|H0xQ7NY(A7RQyM(T<>!bm{vn3=x8=(rL;Q{SFI3)s8?qX$u8u zH@N?3nH4ckx}#Azn*N_G4oMxo<@6I6%H5fJK~aq=_stfD8jQ*iH3XfEFQlfX+!}Qx ze4~YjL@+!_3T(FWE&nOEIN%yOC)PU~H4MJ1yg;_~-0+z22Q16&6NVKzRfjwP1ed_zA3i zg*8U*O1&IMRBp?=xVZQmEHTY-U$r_!L!g-&bz+X`4t(d)WtnwhDFsip&8{Fwn?C$Y-BAJXOA#XK`_RhKI zdKm{RiY;3Snxy>@I2z;yA7(lgGa&E3x|;RV@bB*M9w! z+hA1ns)v#B*^{x*P0SkNT`$lbbO1 zME0ERVyeQj0n}Jv{oq}t;(WYbiBc-f4zs z%YX#}iTOaK;&}X+uf*nSwGJ!E(%mmvP#Eld++;eN$nw9l&R$elfpTnqJ`jt=_)zHh zEEWjIGmI!o&9${JSS8e?pJ6B}4r^%JRure>NuS5FsBIQf4$MD%o3GdOr9Z`r)$Fow z_7)3VDR7fVlvd3Kp3iKn%Jc0jXMc6DrhK_F|4%-@l8@I9{bf-Uea+=ztJ|c9(jI1G zjt{S#Wi`}ip(Oz5kGJ*uO1}QgL#nr|KKb+-)^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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/button.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/button.css deleted file mode 100644 index 9d63c61081..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/button.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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;_margin:0;}.yui-skin-sam .yui-button button,.yui-skin-sam .yui-button a,.yui-skin-sam .yui-button a:visited{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-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-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-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,.yui-skin-sam .yui-button-disabled a:visited{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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/calendar.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/calendar.css deleted file mode 100644 index b01c7e6185..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/calendar.css +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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:0;top:0;}.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 #ccc;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 #ccc;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:#06c;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:#ccc;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:#cf9;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#9cf;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#fcc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#cf9;}.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:.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/carousel.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/carousel.css deleted file mode 100644 index dc1f97890f..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/carousel.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-carousel{visibility:hidden;overflow:hidden;position:relative;text-align:left;zoom:1;}.yui-carousel.yui-carousel-visible{visibility:visible;}.yui-carousel-content{overflow:hidden;position:relative;text-align:center;}.yui-carousel-element li{border:1px solid #ccc;list-style:none;margin:1px;overflow:hidden;padding:0;position:absolute;text-align:center;}.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{content:".";display:block;height:0;clear:both;visibility:hidden;}.yui-carousel-button-focus{outline:1px dotted #000;}.yui-carousel-min-width{min-width:115px;}.yui-carousel-element{overflow:hidden;position:relative;margin:0 auto;padding:0;text-align:left;*margin:0;}.yui-carousel-horizontal .yui-carousel-element{width:320000px;}.yui-carousel-vertical .yui-carousel-element{height:320000px;}.yui-skin-sam .yui-carousel-nav select{position:static;}.yui-carousel .yui-carousel-item-selected{border:1px dashed #000;margin:1px;}.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,.yui-skin-sam .yui-carousel-button button{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:0 -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:0 -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;height:19px;margin:0;margin-left:-220px;margin-right:100px;*margin-left:-160px;*margin-right:0;padding:0;}.yui-skin-sam .yui-carousel-min-width .yui-carousel-nav ul{*margin-left:-170px;}.yui-skin-sam .yui-carousel-nav select{position:relative;*right:50px;top:4px;}.yui-skin-sam .yui-carousel-vertical .yui-carousel-nav select{position:static;}.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{background:url(sprite.png) no-repeat 0 -650px;cursor:pointer;float:left;height:9px;list-style:none;margin:10px 0 0 5px;overflow:hidden;padding:0;width:9px;}.yui-skin-sam .yui-carousel-nav ul:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.yui-skin-sam .yui-carousel-nav ul li a{display:block;width:100%;height:100%;text-indent:-10000px;text-align:left;overflow:hidden;}.yui-skin-sam .yui-carousel-nav ul li.yui-carousel-nav-page-focus{outline:1px dotted #000;}.yui-skin-sam .yui-carousel-nav ul li.yui-carousel-nav-page-selected{background-position:0 -700px;}.yui-skin-sam .yui-carousel-item-loading{background:url(ajax-loader.gif) no-repeat 50% 50%;position:absolute;text-indent:-150px;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check0.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check0.gif deleted file mode 100644 index 193028b99361c6527f17a9056037f3d8729fada7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 608 zcmZ?wbhEHb6krfzc;>|L^y$-=FJFHD{{8v$=l}lwYiw-%_U+rNSFb*Q{ycHwL|t9o z4nyho27-Mo48_U+qq=FHi!VMBd=eR6X0+O=zU@7{g=`t?<-R$aV!QBO~=si|q# zu3gWbJ!@`mzI^%e$A3uKV-Me@C^y%BTZ(p%u#nr1TIw0qR;)H>HZ-Y})b4zPm zdq-zicTcmUtRf$uChJr_107k%CMHe`N0x;P`5omrrJC4T89CNEtasp8#oolg$!xcC z*G^_mh9((lImRPL*@bMRWts#ebZswOyr3>2&}6S{Yk&KWy@0BkeG`wFo;Jga7tBID z3Or5XCSs!Nxxa8b*r|v&i3p1^@tiSGSg@dh)kuRwD&VlggmwY>tRDsr6B@;pN)`kN kI5!@bwak+c_`=}P#wi$N7O_%^c>;TH(y2L>8UhT~0GYwkU;qFB diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check1.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check1.gif deleted file mode 100644 index 7d9ceba3847ffb41864626de755147cf2e0ccc41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 622 zcmZ?wbhEHb6krfzcoxU7ckkYV2M?Y-d-m9|V>@>2*tTt3LPEl(O`BR;T8=%(xpqq#l;5>99Xq#)&2YTYiepbIy&0g+AOW@ zckS9Guc-F@`}d~imPLyeZQs6~fsu`YfvK{pX2F65U0q$Rt*sL$O-@Ws1A@}h((LT) z?(XjO>(?(?vSiJgH4`UJK6B=bk&)5y`M-)|l9Y<;$0E z*|Mdlr)S-|b(NKs3l=PFZf@Sadv|qB-H{_lmMvRWUS2+J+H@9n9wt`q{DLAwL&J0D z&M`1B06hgHX$=&AvM@3*#4+fAECR&|1N-TQIAB<`wzYS3c6IkOiz~=+aJchM|1mCdzDLXw4hE#vxNR(VN@CJ{DPhF!b7VuM)OM4A+ZRauU+7{|s2 zcnd2w$tde{Md^hbMtE?UD9bddsdKr+>S#rp``L#2t2OayvU`dd#ftf`8raM6HSzlj zc(5=uIVZF*Fl5;XgfOzUFmkr3NH`Qau*iwBl%AN_(0#mLZsnU73LZ^-il>A0j5i(a fVsVr<>G*MA!L!EM+AbM4F05F7ettU>BZD;n{1fhr diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check2.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/check2.gif deleted file mode 100644 index 181317599bfd45f03a7a69784b232509171d98e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 609 zcmZ?wbhEHb6krfzc;?HnW5@{Q2|Z;^P1R|37;4=+mc9 z2M!#ludjdl^y!^DcW&Oi`QX8Wd-v|GTD9u_{rlg(eY<=2?(*f!7cE+}Zr!@3rlz#C zw93lLty{Ntbad?6wX3|me9f9QU0q#_jEvpg-8D5erKP3o*RL-ssmjjIK6B=bk&#hr zYwM9CN4|dj+Sb-)XlVHT`}dxnp5w=lFIlo=!GZ+|z~IZE19BTEP8ittHTX6)x3spkcXW1j_cTk$%W!aLa!=*3 zc9)lEa$s@xW?Hz=(p!newn>g(hVaPYrXndu(oIuG-2?s&?!;%&%Yb2pGtyHpw{(Nw4Sq&gU}|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{ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/dt-arrow-dn.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/dt-arrow-dn.png deleted file mode 100644 index 85fda0bbca21cefc6b8cf1726bc83e43bff993c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/dt-arrow-up.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/dt-arrow-up.png deleted file mode 100644 index 1c674316aed41943dae79b01583956db63c8be08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor-sprite-active.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor-sprite-active.gif deleted file mode 100644 index 3e9d4200b3e6b124354f12d6c5f90513587315d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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#jZDelV+9VN?ncp-JgW~V52 zwIVT{rMFy#iB_M(Mw>~mXBU^-bBK=;wyjfDo5?#^YSF?}mRd7wq62j@gZG{qXc5HU zVDBjeF{zt&@luq|SH3a3{425RvT91&_0wC9&PM*qmz8chsA5hT-f15F zrSL(!X;BTwDiiEub(^}Z-R{h)d&0I&fsbtYeAV3}_$8GRD|%|OJ~+h*h`vXEM9QO8dd zYmcYsgDMk9EnNq{G&8{Pb|>275wcZ*`2F&2Ai4O>P`Q}+<5oRx zrPpuMxO3{uh6!dA$rBGk=l*5JDBs_#A7T&8ueX}y@n1tomGnc^+RK`ACK zLffq81Sa`D!bq!B@3l;{`s1Nv*M+7=k&=Y6F+bzvd|`RbLXY;w2Hwl0yKtmbNFX^9+ewfx;t2zs)75Y%Ib|Y(r)JqTX&`@w z%}7=<5c>FQS2}Pq)z64{m*tnb+|YtmHot9pU(gxEHU#q)PVnLF4y=SM0hTI{pnxwV zsN%fK#6Rs1yY}VO6u$x3qEG}|OT8a_iE+05g2z`_)lscjNhbD8G^x8a*2!F>ob6beCvJIleF zH3wh{PTx0X>`mG-?1DAVP|?b?F<%wGUBYg5*s|e-phNX0_gTC@TRNC(j*g~WF;^PL zARucn&XYxOAIIj=V5+@L7RS zldn|5rI%qum$#hk_xd(kb`WaLPcH}E%~bUsZ<1qX#}@XMsqs6Kot`D*wds7)6COlc zokSyrtrAkl?A*_e15eCtwA`Wq&o4ieAI9F%2`_l*J@F&|u;DhH3sEfkW_n?ZcDbo1 z+wN$wWxm0*s`l0k_J_eld4u7A-A{Rh&@pB)Zsm(!X%R#(Tr8P(*iJ#*>OX%|Uu!JA z!esJkcl7(ko9D-SboRK2;U0)YDdnJeqg(8hgx*E=U?|?Tock&cHK~F%Q#bmVAmuK_ zkzF@2vu$L-NkOgb4R^L5(TsMv)Y&Q(cDd4GaUt*G`(yAraq3)7P@Yd?@+NHM@9%6Yxyv$W{ zL_n}T8t;;n^hj5AceT|GzDxF)R7G0AoR{0|@U^U6)%&h#I8H{7yqE~6;QS2^OvDWj zJ*y8$_+H^7;p6>E+#kS^Ialc$oIcDwkYDypr^YP?Kln+r8pGdo>XcWEk8m}-q3vST z=@)6ZjGI!jn?6^29)0=oM>HP$QeDxAW|8 z({W^V@TAnyhTf${o5w#L=I6%#MlbO&y0d_ALl(>;ppG~=%|!16ET-Sp6SM3O%pc1L zkb~>y%25gA(AR%lhrw4-dZ{+&Sdw%_1V50fXJ7T33R4l~TG zCQ1>CD_!B;%-n*KhNp6qZDDm_6v^!q=K8X<2_R*c=DQ{_!?j4)|Gh z$)g16j9v0#70|O28@VGv^YppaKuXHy=nOB|RfDdus0rn?SlP`aY9r1lW%Ig#1PpsM zfkvGKr9>}T){=b~jH-1$amp#i*s^Ilxo>O(5}haa8suA={#qQP1rF=zp6E&#clGlo zQ8#^Un!oYxPd02#rA@Q>ToHN!Z3Va5)I8ncqZFF&W?%U3YtH?^LCKIO?W=Ew`|BAd z6sD@q^O2`VG;1|N{gjWMBj4G)yC%F!HmuXcP0|Z()S-f9ZV|=BT+x% zXXboOg!qK#*HviUOI5r7uwwA4;|uj7yL|%uV%c?-uS4~n2K@zIKG(-2Jx-aOIOT&Q zDb_K?UfdU>8?Gh4`@>OY7$(PD^o#pP>C?eakH(rUUW++#Km1OE|MC6d*WNYOuH-Lq z&&8e1+WU8=<=(W8u6JU=&Qz&#>PU0Cy{xa^uBJ>&S3Sz&xz0GUrVYkQg2rFGXMJ#E zNK0~@49HX(ZjDj>uJHho8!zL3=hpSzlf74PHfcZ*5-4$POOTfA#w*eYLTFXw@`2e&#{y8h!(cGw^KMVz z`~vY!6W(HJ2dq&T{%%v-i+}|iWsvQ=iTJLGr`g z$FzvG#zZJ*%#_r+P0Q-LmUV-YPs%ORQ+i*VFRlJbl==Dfz|LHL^6D#P`7XvKZ~(o| zzO?rBQkQ^mh|CmIne*>1weWylB77GQb%@JMr!Ym#TS&8Kr0gJH$xHrV!*9iE@Gj5SA!KPCO(a5-5Z=GR#69X1tuRPEN8@Pa=pg zPRkf;Okz7F+1)eQEi&mgFV4F%PS+53Q;2=a!fR1d{5?~&m=}WzQ`%vGA#WF8!5_J2hmVjC#P*Y&5v-bEnBvqD&^zCwaB1H9)7 z|L=0PbwxIamOUn55m#8Zg~`VvQ*0{Z21Upz8ZMD45d)A0$P!wR^f4}4)hkymI9Fwb zbmB?w35@gLcG(}7Rp$*^$SBrIr3YTTBC{T(4>Mx%xv=UB_)2PYSYX(<$gB51XN!jO z7Q1lu^t`?XS3CKgp8DB}bbJ%}YT1%6I4_}Xl!7q>eWpno!O$@y*hU5{BnsvqWgmDK zFUv#i9L`6p0AXV~xJoAzB*N%HSqV`;Ku+4Uk%Jy0DOw(XF zjuc{^W^YTqTBzZkGn40py_PTUp5}GU^vX4F`D>j^*Kl>9w@o3c4h(vlFUu=VHi9uU z3J#I4BkI5l8VOH~AT2>bHY2e~1FGtddmx{8bcEz~Ht*2EL)VRpZepWc=1Vfkzk=E zXt-nnAzI#f+8S;my!nO^&oqLjFCe7=iC1g{syKJlt8}^oAtx+QTP__-jI;DiGOE0J zT%+{E%#D<&!reQ!*IK!ek9p zu#KzeqN=j!sy|zySQ_dGrK*Pw(%E2-0P8@98*}Zzc@Po-g-q&K~ z0s92-LQz$%0{YEtO`CU(8ui`~4t0hO=CSXId1zNMW|Ii}35QChB7Zj0n}xOhDwdJBYN@b2o-kp6<2OSrowba)Vix*>@ep&|Ft;TNE~iZs-5A%K!Z_(3RR zI!37)E`PEP4Fek7_8n)y8N6fB#SiXv_}i634*3XeMO%3xI4g4Q7t@KG1rJa;Fd1^X zB3FS=M^c_YlxO07=|oF1kh&ExAGMShMm950xfG;BjIEdjvlVLcp~tyG{6YIiCwb0? z=N?;_KeA;ac0-S|Iv<@r|JY(OD3Dw4IQPincD?^-{h{>7zFG~D&;4U!8n7IHfBX}S z$`c3sC&|_R6#T=;>IYe)J9kt=^9wRE0?^_Cbcu=IKOu8c2p)Sa{cF1Ed1PW2T3#8h;VPZB>pG*PA z3D#$Q-*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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor-sprite.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor-sprite.gif deleted file mode 100644 index 02042fa1474cd62d7de63588ae536f5495d45be2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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!pRs@DFe)ST&@i`OGY$5)F!R^V2D+-9 zZg@L7IKIBEcWPj{KW+DxeB5?3i?Ok>0|yQ^#2W?%p8E2{I7SB+wq81kGr`bJMPCfpVHFOvZPbSo3}h`zLhV!H8<216B~Q^(&dF$yL)XdlGlD+3a#6quf#9v`2K7J<2Qvh%M`N>2e@9|g%tNv1X> z%@3NV#z!Y6u+7cQ_4n?v+1|6$AJ!%tB)**M|2z`V@~mp8w_N<~(OBQ&^2*Pit9f~O z4Gj&<`xCd1>5AXJ%BZTNniHYH1VFz2p zIoa9ws%!=yrAl7s?)TU;FGOb_SAOd&)2`Hh(DdLv&vsy7Kq{5a&CSt&!5{!g0e#?q z`+p|@f)tPvRqX}*);NNK?$L4-Mx-KV7pv9AodM0tRF^uOoUH z{qpr2#ONOcdkP#I?u4mZq$9@Bz&t>9GiE+BKf6U8TrrS8PRhCoA9iNe@?jFTkD@-QkQdL zu=1AHCe`<`YhTRO1hfj{$ZGqW8|TNnGWB+Arz?*a{am zlBD{6nxog<#-w!JbTmHmyV{^y{@un6m)&_vQq2H=+;}y z@qQcx%h0?LO}4x(c}n9P3s5~bJ-Q$NBhJQSLrUJ8v)X0lV=4Oe(_^Vo^fBk7B`&KD z6Ri#6Q?wo~$B~F=mV_#MRD)g0+$xq(jikc<4O#}irK8N7E&-F-ZiSm!I!enn-Eu|3 zZ&a=4*E6_Q3ta~kb&qSZdUjfMWRR2@Zvv(Y!ai1}=?1@Za0?}xTMtqzMY?YZp zBox@RaWPjI4!Wp{i?wzo;gu79ZJp3I7dui*(pOqu$RTbqU8QYvgHl?qea1?vj%uyF zeqKb^7BS6Ix z(jZRMJDqy*$)xu6GoJaMj+A5s>e`gw`hBRf`iXhaZSv?Xz3LWqxJpoiRH8Kyy>fPE z9?Fr`O(1pXTRjh4YQ>*9U~!xIngq*eT_VNbu7B6Fr%f-bC0mFaW)h# zx~QrxZKwG=s2#%s;t&nq(zqRY%c%{-q4$a%4!Wmp#aLK(E91G!re&!Ks%2=eZmQ~_ zF)Cx`&Lr%o#fUI?RSyZ;q2T`xxo4Bbs7cfG_|ESHmoJ6H-DZTgwtw1g-%5aB)3eF9 z3$8gcDXR(2vY#(CGMcO|OfdIt50Bi^ifH+c?s^3|qmNZSaDv;2n|!?;b`Gk-ahgX? z1$S$13w!ZgpGagldIVf%S@urftX}#3QdHXU+B0-sX!25Z;-WlxiH@;Y#gbrFMd}f> zvn2O)8$sMd5ss20iQB^D()Iue!#N1J6KRw8_h+gop$Y#`IxvB$Oc=MjQDYiI^=t$W zu4kl0gb6Ww%JCCx*rqbt-sGe1LQH7VJ*>Ys<($yQT>7zg2Bwjyx>7;;mFKGEmYSYg1rKrMo$=@^)6 z3NMk);xsidVINRyg-sw>Ao)sRi4!gLgK^d;rf4s@Or_dR%eiitt}X`7^x#W=gfC?B zPYtcIBj)M|xY!+ekj>stRJB!X(l!=B&(kacGy9cxH*yj@TlD@(qTSVoX?!mg$vbR%Gl3vzM_FDtyBcvJ=j8dBp|X|N{3Cwl-X|T8q_jG<^mpV|p zbkRXAw^%1DDPP;2$EN0skM zNAd(9nu>)O*C-DxJUUZIA;=?$QjB z`*rJ0g{BFL?CoM9={gqFPLC>JDy&lQg;_0vted^ca!E|Ut^RBZMlRQ|d7BZagr3G!0)QP9+Cy+eJl z^F{E(qHq_`96o*wRpqYe#w&+t0gw~knc zU^?z%GG#P6vPA8G+`Utt|BN-vy3ti~9IHRH(T~6Ic(O^UCMwn7WDN8EP^eXc{&6{F z*_)Gtc6LYvP99`5RJZo!p6&ee?k{t3 zUpZMWmNPi=Az@qd$&tn@rpFDz6{PBMgI)fY*0JhVRLjWb1rWzxWbe@_V#S!wCX^>1^e!x z_aUBZuZ^{zsPM^MnJ=@jH1)Cy;`qo7mYZXcjuMW(bQ>|JNB(1JUGJluPo*S{Oxw>J#^s?PuSFVg`8Wi zTsX6NSM%8GXG=GatSs!&Tz*ygEV;5ebUwC-yb-7Vvzw%$RHkGRY@zzzMK!N-W440w zY;V6Zd+fh|KL|(2Q2JbV?p%~%{#6@8<<2uZ77Cw7oWw`J7(c^YD7v|Q-pJ|ijC6zi zi>?-^-Z1`akhQ{bf>f#w%M+vXq|4L09~pPeQ9UkYC`rAnEQNL4SSfRjkt-T>R6x?D>fP>uVKZl5mUp3u`4W)u>{YEfcq#}o)It4jWb^z zZ@)TTMuOkFgtuFw8YGbqm?pSrCpZlfKIJA%<;F=xgj4~cN=VXUB$lxfPq-z%$xRIO zS8ZS^acbl$QR2E%#0mwT(}1G_FewAUNWc{iVG9S&ti6b*Q?0~Q)eO=wLNY`VD=C+_ z!h-H_x2)rnh%qvAT+&?@gb`D#QQ|NH=ei(+EJy;trR=B*l(ddXDYZvTQJ_-j_A%E$ zNldD+LoC>sVW#mELb$~H zR+!LeG4h8AEr_W~LSlR#A`*cpb8FCGTHZxs5_+(MY0Qg-t_eUxgm6m;zug!ZcvxAo z1eOXlN(3Y&E+plq|L#iP@G;$Wm$DmjMc(YnWpTpsM#wxYst*8OO9*ELlv85aP61wz zq39;WY4b94D>5{HQGJ#&7%G`Q_D=uZIE#@(9i`UkcpmzzG5xRo0jf^KyeZ0>Cn}-D z#U*MDpOnRqw7cp5b#-=~B8sWV{MiWJ6reqw9xi6-)$A<$GEPiM304>un8KLkK zRzw-Nnj8fNxSEl>T9oq;&ZYnF^8s<^!jT}e+-M;7!mpeaK4>e9H#W_~*5r6h=U`)U z41et-Brt-_2UQ{T@9HYLv8X;K-pT~yS=ib*j;CKq8vE~S?VuNuyn zb>L6#hSzZOGzR$-2cvB5GnfacnV5|fLUQVG5@McVX2DpNHTAdS2|Tu zXr1pQQIR3hioRE@H|&X8at~I#QMCN22gB^KLi>M(dcz>ygS11{Ym+-)dx@sn+9n?NfT_i_#Co>&EV-Pyp|Ja%rW? zb({Qh#V7bQDFUUCS$Bsg$ft8=i`jU7#aZ4X)@Pzkw^qm z5#x#jVSP4i$Go*(gg>zXx$J?p2PzMXDr@%K0yPji1IF=j`eL#!2dgV4r?6pT2~eX^ zm56`|EJD|In2PRumG~?cH0cW zUJR1OcMh}hERn1ka$71Y|A7)N2mm_{HiZTBvv4#NyNQ8B(qvTl*c}2OJs(VFVLVZ6 zgD%1l;n#~Wr85`}GUO@1R+u9U4#pkD?BRgQ=>GuQ&P9Y$zQxd8>^3p9uCjc`5${7v zb&-kZ4<-89Rr=w){S3H-3Y1tWCJ||X%^#{d0(YQ5g@9@yBzkfE9Q1%95m+LI+X2}c z7F^F(3DW|SPl9_n1XUs2j@ElQ>RI9%Y8efIj&|xoET~Bit8DNJBF{;nS_U9S8$vA_ zubKc2{Ko$r?c7d~FFpu}{SP_35eN^upL(_Ka8AP@aG&VymvXh?SgM0MjVxl`7t!vK zuH3i#+_cl;0bir;pd(Ta$OIS56mc}jMoWP$oQRt47zK9UHBX}(e><|aTM zuzs+bFX!0=_C17-PhiA=PtJveJ8IUqf1heKdc@Q zeMp+emMtso64I-dmD&Wqq2sU-mNz1u|w~9K|>q6X(l^3C?(5)~zN!nXnEQg(74@A9Wwj zTLhD90B4EFSqxG@k~5>}Wdv&`74#FWuv7%+jbc^- z%5HIeOv@vi8Tb$y=8QKkL=4C>@F#?bjRaS5kZ2=7f*E+MnCdFQg&=s+73hoz^KlWE zjY32^CYuEuK;E1|WbOVz%vr=eUjVnixHBj;igaOvsX7cW^b6IIIS_OKkBxa1xo^Oc zL**7g0istJBUncaaAk&)3vg)+#NJ@&j2K8nsX8chTQmeSvC!yX!N|}uJL<;B&?pmt z3ZS#5x!16zbxQ-=BmHa6goY>S2K9gb`pje_A2 zyttS_PBZjErjiA>Nr-9!(i9i7`YZy8pdtp~V@$rofxVcRysbbnpeIFTybw4f3>o2E z9^$}5+((pRM(Lsw6O|GDReBB(CE`&s9WX(*wOJl9L48PaB#C&8>fo~Bov2KqPd7VLZet6gcnf2 zToyJFQKuxtZ*K5KkpkYCWWj+eX$nL(^d%K}C=^3+I(?`97aHUd8bb}3#CnrUIdHQw cR{5z6xrwa2TLKn}Th16kCL#yxH3(qwf7i6=Gynhq diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor.css deleted file mode 100644 index 00451d8c59..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/editor.css +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-busy{cursor:wait!important;}.yui-toolbar-container fieldset,.yui-editor-container fieldset{padding:0;margin:0;border:0;}.yui-toolbar-container legend{display:none;}.yui-skin-sam .yui-toolbar-container .yui-button button,.yui-skin-sam .yui-toolbar-container .yui-button a,.yui-skin-sam .yui-toolbar-container .yui-button a:visited{font-size:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select button,.yui-skin-sam .yui-toolbar-container .yui-toolbar-select a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-select a:visited,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton button,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a:visited{font-size:12px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{font-size:0;line-height:0;padding:0;}.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:0;}.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;height:100%;width:100%;position:absolute;top:0;left:0;opacity:.5;filter:alpha(opacity=50);}.yui-editor-container iframe{border:0;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:.25em 0 .25em .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:.75em;}.yui-editor-panel .height-width{float:left;}.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;float:none;} -.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:0;text-indent:0;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:0 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0;}.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:.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:#000;font-weight:bold;margin:0;padding:.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:.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 .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:.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .collapsed{background:url(sprite.png) no-repeat 0 -350px;}.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:0;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:0;}.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:0;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 .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:.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:#fff;}.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/header_background.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/header_background.png deleted file mode 100644 index 3ef7909d3ed04956a06c5d9017076ea30e0ced27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/hue_bg.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/hue_bg.png deleted file mode 100644 index d9bcdeb5c49910d5c32c9ebbb134200bf138b7b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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_+ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/imagecropper.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/imagecropper.css deleted file mode 100644 index 0e8d36f62c..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/imagecropper.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/layout.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/layout.css deleted file mode 100644 index aa5545f155..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/layout.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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:0;}.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{display:none;zoom:1;}.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{zoom:1;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l{width:5px;height:100%;top:0;left:0;zoom:1;}.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;margin:0;}.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;zoom:1;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r{right:0;top:0;background-image:none;zoom:1;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-l{left:0;top:0;background-image:none;zoom:1;}.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:0;display:block;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;zoom:1;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/layout_sprite.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/layout_sprite.png deleted file mode 100644 index d6fce3c7a5bec2e266531e2b921f6a3bc3572bcb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/loading.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/loading.gif deleted file mode 100644 index 0bbf3bc0c0e5e635553e8d1bf9ceddefbc402396..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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^`=~9EL;yL&>*dd5*+XG=_`^3=CG25PbLa+LJ%N(PW_s z=_-TaM{SB!w(n7k+dMDN2G6VPqUA$u7F4m@ABAZ1D`*UMfe}E6csJU}J1Trmp#~7hZ5QSGpNvd1Uz$!Rf3q28pgSj9o zx?zwoWa8GYK@TOz^)mp#V2_VR5WfJ0W9BSSbn+cKb z7B9l9)K#s!?PSt;g%c8u;y7rd?hkP%>vq5BY=N>c=98V=+T&RSPgSu|E(FAK>B?vNN1 zPszwcbxJ?Oh|1pGd!9?gxzSWOR8o=x5!rGh+6r3hBL-14aTaAQxvJ|Y-S_m4niV2S zK@?}-9Dkhg<+w{Ny!vjyp-QmjyGmIW1DFB{k>P2=8cm~9M^_P#8?JFDumGEPaqJvf zZ{f;B#CG;H7q8a_hQ$pR6%%6So8vKM+W+cNPE_TI46^dn9q@qBr@1bUgxcPGB*b-i z3Hx_0(Esy5KKx^Y0yfgB6~}t>@!ctk>J|!vgVRhE2CPQ;AOKY2y%5nM@YF^ZMS~q}%L-n>Lpor#4w48UHYViOt={{43LMRvkIp+rkbs*s; z14}4q0y6`s8DL?uo-~*R@5tnFsC1DR#BGxT8fA20u_o?`0iDNI6lf;^$@AkR1dPTz z>XF1ZAqNjU95c@Vn59Wo;Z6b(YG+L$xy3(?j2I*vQ>PmzMEdh`yw3=)E}JYMDG|*x mDkGVJ;D)fXhxDI?kcM(ish)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;IG.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-overlay.yui-force-redraw{margin-bottom:1px;}.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 .yuimenubaritemlabel:visited{color:#000;}.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,.yui-skin-sam .yuimenubaritemlabel-disabled:visited{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:visited{color:#000;}.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,.yui-skin-sam .yuimenuitemlabel-disabled:visited{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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menubaritem_submenuindicator.png deleted file mode 100644 index 030941c9cffc064276813d7eaab03d8c667ed700..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}00093P)t-s00030|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|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~`6RjA00002bW%=J{{ZE;FiHRb03%66K~#9!Vqky(Mi^jVMCCIw oFfyX>85y7$4gdfE0RR6300puDFk diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menubaritem_submenuindicator_disabled.png deleted file mode 100644 index 6c1612230550ef09678a38a2e3374585055a07eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}00093P)t-se}8}f|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|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;FiHRb03%66K~#9!Vqky(Mi^jVMCCIw oFfyX>85y7$4gdfE0RR6300puDFKLZ*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 z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}00093P)t-s00030|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|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~`6RjA00002bW%=J{{ZE;FiHRb04hmDK~#9!T+A^Jz#tFKLZ*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 z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}00093P)t-se}8}f|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|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;FiHRb04hmDK~#9!T+A^Jz#tFKLZ*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 z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}00093P)t-s00030|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|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~`6RjA00002bW%=J{{ZE;FiHRb03u05K~#9!VqjoI00ssI6b=Il nhXI!ivK}PU00000|NjF33?~3ZGNlzM00000NkvXXu0mjf(Ym^p diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/menuitem_submenuindicator_disabled.png deleted file mode 100644 index 427d60a38af14ac7b530a266dc2e969555d287c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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}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 z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}00093P)t-se}8}f|NjC40s{jB1Ox;H1qB8M1_uWR2nYxX z2?+`c3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH z8XFrM92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021 zEG#T7EiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!- zJv}}?K0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)Wt zPESuyP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5d zU|?WjVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|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* diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/paginator.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/paginator.css deleted file mode 100644 index 31f0d3369b..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/paginator.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/picker_mask.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/picker_mask.png deleted file mode 100644 index f8d91932b376af76ccfac030c12eb9fec7ee4c63..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12174 zcmV;9FLBU`P)_6|b&%Dfjpyv}j54LBIXFZqhE-_t{2r7|?ya1%Cs>h{sswI&ir4|Fh z$jAgxe*E!Arq9Rc<1hC3+xpMn|Ni&&sREphKX2dqw+!rCg4fvHA{v>|sAOH9VUq1Wx=i{&V_yqRn;}h7QkI%<-7fW_4(VkZ}j!+ z*W3A4Q2+7AAN1S*{zm`&=RfJ^|M;1H`st@nDf0RFlp-IAiA&;HZ{w3b`^>wEDMb|H zcWo7$YKZ}V2ee&$PJPY#JEPa?S+a1^5~E@1g&W3xW#A&D$3t?w{=G7DSsA*r_4-%Y z`s|z_E&o@}NSYWQ_Q@Xg&3d|Ou zW&0J1V(Gn21@Ok$tl7ApUjkd|>Gf{~b_Mkc=*rd-*uVe&`%Pc}`s=SZK(DV?u$Q+4 zw*GP77{rl7z$bi8N=|4%dgnzQK{K@X9=v7^ctch^o|!a57b!8M)R5bd+^DZB*f)2h zXi(pP{pA7dU4m@DUcq}~?BDNws-MON*}ARvB9}^yYkUl^^T(x&iy;x&pXVP)oMH zG4>x1DYCNm`n+yi_f;$KX~32?&=bL&3KR!`?Ad)hXq&kbL*FF~DPi6Lgmfs6L(D+0 zND0vbo2}RNnI*FeDS>21aabAxyE61@^}W7lp{p^l|7WGkjF52;svSZcA8su7jAYiZ3LweO3*sn5! zSD>!n=?3mEUmKmhK6d%BxhCszn^Za-*h3D(8SY6kiNgaaXQX90(eY3K$c_zH0Bie! zBHJ2UyB-p(7Bef5YbLIag?2iM6)3&}lecGR>8-$C0bN;o1$K2uG_Y5@@20Q6ep|mt z*;#x0tH7=ryq?1awzczFEUg2jL1spUI~;shFFVJMWT3#Y2!p-uSjIu7V%f`fjs-Ap z^O>)I7X@&(g2WB97X@e*&x;21dj4(4t<5d)+aC4x2CzHGU+%zOzu(5F>;Cn4UV*tj zZ$V@8yjpp$fL&R8ZO0o+m)B>04HkLJJo2A^{CRu7ZvXb}emug@Fk>GfXvJPL@_-^q z01_^oksZ=)$m(QUUX;~R(;!CYEsBZDLoIZEb1~!wBOR^fg#bCy%lortW+6TF_FY@w z&6w46@B~bZ!ZnoFU!@$z>E}`k{^oUMnFB{O&3px81f^O z51QS()3a{J?CEH!+pUC&YHNa5>Eykw2XY`qJYY8f?~*Z#9Wbu!EB)#UYzgYy^IbES z3h4T`vT|kq^`Z574Oq_r_AIDJ0c{44L7>OU1PLbsz#Hu@vK`wj512a*;t0UHoeBa? zk6L-sMY|p{s1$`s7O*7~*BX(c{b~v9`g)Thw{{({Us@kq|5b2nV9S~lBm$l;MJBR- zSsN}46ctdtgi9+$xa(0`+j0;b5@@3(htB#Thl4>@u&CE;xE$KTV_CN$*;#_wksf7p zH>9;!8MRBwYyjM)2y#PKP>c6P+kZ7HSsw`0kDr;x8GBY&%c%cEP&e$K0;+W$c6Ga3 z-f4l|(a#9Tgjm>eL6n{@$mNioz>^;m>!~orEy~tWx3~ zOIPqpfCGkR(H?r%tE(Zjv@CMcj9p#<%|dfa05{ue+I>B?x*{YBs9Lr@sIdpzjet7C z(j3YXHqYbA7G>{gy$rQE(#f8iq4wzn3QC-$G_@y1j3806bjQvT*z2!Z!CPeq$}$Qt zKiFGHksaJG`+EfLE_ox5tq+;W^uV3*u}1^OjK^IhVL9wdjz0DhDyAkTJeq`!B#Pcg zhP)_7_7G+P^?uQ&deV!Q8k_%Iz3u(DO+Od8Pl9$mZo9rWlUfCjjYrK(<6~b$ZT0S1 zS3O;Ux%tu+)a&a-3?R6yAif2U*Sn8h->)oR%UIXfo6X1d@8#Re{rTQ*_p!In<@$MS zi0rd9cH9YgPHQJ6i50k+-%kgas7Aw(CeRhp9mnRTLOFML>EN7Z(g?zUW!g!Hg9HcE;V1EAh^ef|OhyG~Aswq6=s?q4)8Rd863y;SWj zSY7I8OIMc~2-fXFMwH5^wNOOZdAr8m>OGbX*q5qptG2GXdan<;-u3UQn|Fkfk?i04PcV*!JYNDjCSSa=A`)xBsyFVf!o zcEj3Z$<&e+vLHr0ak9iY3#aPde)nR zA-C1eupV=%_1K$crutm{Xra05zTK<7Zd!fooV!f@ zjN&Brbhe|X^)|DOW?&^TSXpb-J8|rPncYZ6g>MN)cr9$&910<@S`i zkQl{aQy;-2thth!_d8NT%MNOLaRo zCuFG|O0cz;&U9i--BvN-HZ`yK2WHwUjV^zvpBugv*x@U8x z({-K67HqPx8;i~;!e{od_khhIU{6k}7aYNF7KD;K_3|HlOG;X68|WyQts~R_Ey{93p$q#vLD)BBQJf!DrZ2nhQiG*TS=m|!i=sNPks~sAWNwo((+QeE z#&&JLOxr|mJq#Wvwe^U!h^q1|mxGNOYb!WJG9t^^ z7DMZKI!Lj#PN|b)?X9WqMFoppm0nG~SG!I#I0zVZ`DqtCYId&sD^t_0?Sst)+mcAN zUvx@c>}O&7-Gj-m-xe7Z%Keh9Wq_!IMZnTSjO}I%4>EJ4jWgw@5p#Q)LYiP`6fiQd z^$Ve27n-UX6~u~jBf+k#TtGMMS9dA;lIYZHi)4l30jO7QF&T(%QhouWT^ zynfVSX2S`ZnZPko&ykt#z}4MKa~F_k(OQ~~0%y}dDP!_F!}v#hlq(gM^>trIkoxdHpiniE-2)#zvMuOXYZ z@JTauPGdhoUrzx&2nsFzYz-P9uOq1X=#HU5Icmr1+m7`=TI)3+i)$@z)KfDUFrb|e zMgs?s-Dk1u&Z5gh$7`mpZ50a_t)I09Z_Y2;>j48bSd6fih|8uJJL^RwJv?I9MOj1S zdLU4vQqm5rNLt8_pn<5I7Sa+!IUbUAt>rFsNh$%|eUVd;2@Sq8wo0jAKq5vm`3kt3 z=3N~Rsk>_m9Wl3@TSRJXnS>Dm>Ye59TAeks*WX>pFw%@&JCaPu7;eaM#?H163Yxqm ziO1X{Y;1uY1)XquF~r!S{e#6HD+K5cU}@)0U+V%VRlwA-9$@K^y(J@8pB$}LpzaKz z#@63&zauQRhE`R26msV$Z^{OZT{Yqz~|MKp5@rfxL0c0%O-=ufe>>^uw{kcP3JqOoTg z+bjHcEIkgV+Xd`yFtrAF15DLXpaVjTJA-wc7@{Rz2CcE1z_Vdg<2a#%A@fTHRary$ zx^qPy{_{TkOX+1&?B6kR^}s#nLpfB<^+cJ+!)2=@cHV%N&a^i{jchr@!b(pU4J^^d zO17|ADFAxZ`eGm^1_e)qtT@Ery0EFfmaLv(=|+cN8%Rh$tyRdxLGaieqrB*@ zL#S!P*wWof-%8)Qb4e_g_L$k4z#SDq0S(+`G&PH>PTX|r+7{K~Ti3eID{{XsPtw=} z0bxo@dr1_)!UUvA#=f(B>9TP$k}MsN5fF`Yl1{Sda#ZD%T;wD_* zrR(uRL+ilL+JnOY9wm9-+$udbbEn?0(LOj>$r_hai=7gPtL*qQi|ZPXQR$29gp zkeHn=VZ^I8vx(Xr3C^*P2@HVj>StOa=0bwJ{*liQX>WaLOu?0&v$0Jsj zZGj8Z3^mjKv_3!Zt()Tzw)7pqx@$jMW2a1WYelRebzTA;ZOaH?FNSYztt>#^x{9&}1iB)CrBSv~c-4}XJO4VNu`kuHu8xMR`H+r@WMy3&f@(oD zV-IQUBfyT>ItFjOyTqV&0>y3{a4&QaiC7u|8A%bSB@^2+!6JcGyO0!VK!4kJZHk>1 znNk-3?ybKKaCMsmp|tx{qUMoqf7#pY9YA&lk%ZZwrPU|5J9327sG0NZzDc%Dr%025 zqCIwz@d$Rqv$k9j0=G{sMPM7F99180rOMfIOX{5lSZj~hBGDq+p)@>{DBd>D(nB2@ zz1GjEM9YEo=n!M0*-1Ij*Dw%_*w@JncJ0>&i~KC^eP`rF2U)|W{@J)VA!A!|1Qar* z*jjIw0i|Z_ef0$;GbCeMEUibRZ?mK78J{kaZ6ym=Hg~jl6AQ>=HEZjAwYpG94|(1j zW6N|q-Bz=DfN-cDdxU)xSwru&TsGqlj#fXTK+$96&LKfghSJ8J%i;Ld466Ic7^EwK zuHB7AWfjo^qGj`m7f~6w&sVL%jGPcDOR5_pYDq3q8i?$oc2L&4#06v<775i>3x}i}tq++VK{F93+C@%G zValBBMTkrmmI0*)W{`~}Bamck?hjo=AIT2H;zr=Ov-i5ctc-b|dO^D>y);olB4TMB zC|XiP28;VR$Cqm(8I)rp>kC5c^snH_B6o0E;XOGDq4mJAaYlw*nfA;o{!0X+V9n+`Q=20nuSDlk0 zdgAwJ=+@w{od%FmxoH4qYj6Ry<_6@487vZ>V-HCY_L4Ek;gHVAHhozyMcV2<0vW}W z{7{x50y!yd{Q&F2azst1q4hSTulr-+Tp`h%A*?MwAJ_+zEJ?ObOB4spn(@)R)X>2& zf=kQ!usm=ppk%N<3>mc_`qq7y4os*fgh3{fE%yV-ALNecQ9724spY3iR-n%;mLmd6 zE873Ja6=*qeEPg1Cyb7X=BtLlGg9Z#Gl5!Z*j^VXfzjv;q(@hx2?D~5Jdw7U_P2|X zXdzX>N67uq%&cTd!^|?#(m5pyv#$2jQbRr?MwiJL*{)@0>KMC94OKA3K#t72B8eGQ zho%5VV9w47VpMu*-A$wNL!A%GiU-iw7fW|M05Jh}mf1p5fbI&HM3Gac!nzy#;7ldzS7-AeZ2l+khNtzzZzBJg{dp zb~=mbyw7Y0_M9bK!fawT={_?Rk|qSC2C5A~wb;**BF6L!W`$oc0wS#Y$YvKE zd17j5OQIOlnsscaN0*DLL$AtD>*~b_1WCz@B5FbwppQe4OMr?AbDH21$qb#P1Oo$h z`Jrt*5Px-YLqh0lp~&%y-E2wy05*1A5Qnk%VHvfhCyH zC=hpY#SvhGb9KOVK)%&Y^RnGaB(p=7)*V4_v-Gn7YcXoCFRC_(RZ!S6b8Cfqwbxbv zIj6A?%91d9Xt1|+Of}XTw3;!B44<0% znWwtB|2&P4+P1NSp^2?K9QLkzeJ!ClT9SHNtqA8<27~p{mMh}O4{Na_#LV9CBRDWv z0#Jih47q~#9>@&J3tPNlQHDPawRfPgO~%%`y0s}74Z!7ym6a4BPiw1+ygEt-x+0)F zb#IHD5sR_Ifd)sVNL0&_vGT}Xc+?%csAYn*+Q^s#o56yZ9IR5MSuC&vo8!1&Bi#ab zqlFVvgjB+%|65pFi}1B2Pjo6A6*5T>N(ltKX>(B|m0NHnM|lj~Jr~#sRwic^FJ1-T`NnK`Sm1G_Iw#v}#|WQK-WlSrb8+AYnEC!}nrHzOofG;mq1M+5E# zF0gem)7`OLLSQ3s1BPWaokAx|WSl1)5O_Z6ba(|#QZlH~GNb{nI{^wDZ8k5vpDICX zWG18F@zH)Vr5-va5qopI{6+-mtjzF^x9ma0=x8jY25H&De=xXL-ukp$GA4EJ?nEl- zQ?{Ut(U?OkHjw~DK_d!wv%y_+E+_VTv|H%tHi!TN=lLhqd)(n^$wIw5XbX}6n z`wVcC!1m9<6ftn4w>5(+5MMNCf!6LiiE4Whw^Y6wQ<}v(+fAE42iREv2fEtS=E3Z# z5uh!P+mj_oiZsVqH6tECPhe|8cAs!~*a#jwEAVkGN;B?DgH?WY8pQ;Rv=0J-zk#a?d`U!O06|i&_pC0~% zs`H#tCai{-F-YNecP#Zgvjn-m4!WXHOEei+>hHL2yn0o89qjDD)2se_dhnP@n|qag zq7K&uG4;zpyE+``=ZwZifMAQ|GqM9DW;}m7&*Dql$%OnMBsqMELWGhrj(%q3(o|;F zm3fVvSr`q@)mGl(=b*|dsgt6oOp6bR~u`cPXan(Y?Gyewo|O!dC`^>(LOeEI&2wo%g8#w=7X*X=dws6C9Z=RM)P&R>XeWcW*}*S9|dBO z#E4vw6hn)0PQ$k*rB~U=N_Ki%gBgJqonHde7}bdbG3X-bM%8BGh!5%`glVkCChN}~g3BW$M}kFK2>ONsVtFvIPh8-j|! zP`X_o->~@7R1I1~_EP)g01;!(lkT_dq{zVuDO3BhOrBuw4xoebW0}oV0S%e1I!G@ zS(<=GAhvWhk}V>&+|*Y)b=L0-?9AW-BY4bAxj;rqE3At~Ky}WW0=SHa2iUo(K{h79 zoT?DC0FAa;NfwZ-@hm`!>^_u$QRi@h3rq?mNydOZGE=G{H&Tn{xCKvROl{R@LvI^( zB**_YItF)xh#kMXDH{M%hCO)$0MF=nR&EvuhTU2bMl1Q!wJQMKqreW=pfU8fHKC=;%8?Wy zW7a2QbPj5(!NIjz>u$oivp7#D1d0NoTZEjF9$;1MK(IMCCG zx#4mA491Rzkwx{-qhlU*CEw$JHpIZDM;^H+`-KBjpLq;>6vPe?U29I&lkB=&7dC0T zkL-zu_B9&G9&wIzIR`R>lTzb(!J|=U9R-`&X&KV;#bWceXp7Ay_biXxa!>Y)!Gw|^ zRzPXZRpL4+;23w5y4e9ilxJLLJ(vJZZMK~=hmp~M@T|Zw#n?zU2c03D=h^@)oM4jt zsnM*VVdlh?mfl95dUI}PN`okEK2kL0v3MjOvN9u+K?D|Fd;ZM@K@!6VE-4WpdRjVS z`e9&)&ImiJgbn!Hp)7H-n8gVs%>dH{es0F7IG{|}g8|!fpqD#of!gVkQq&1hX3_GZ z_3_C-5c<`Ii&6%I$Pr){sa-I;}6YGm*O`nF^QD6H`R=aiQ0s=u4 zTza2}Kqg;X`>lWu)lt7?a43FWI*YMWGq5^yjaX|lW+X^@MFS{LxLd9dEvFY2K>Mgp?OA;_w>u?86cFL0 zl^u|i`zRqxP>`3><7&bkb1pweD>LXk79h=KJ3K9)2o~)&cO%)=1g}F zezt&oXXmE4tL+eryM}%D`&caP0o?<5GC3n&x1^uY*oC}O)4&Ny&lDB0x4RvToOh&) zr$x!r&{le0YierKcvjGr`MhwQN2@c|(vL0gU66c2WH&Pd(};GS(b>6m9(kOx2U$5v z@|0jSjm6$YCkMz`nb*JIW&u`KPe-hr@wz*AM^1+0bSRGYKYlwV;Do^T4dXIFHa6J1 z)5oZS&(qlha)lDCehAo6iE0Y?R>0YuTY#ACrKQ=>*;xRyl>~C^y1g2X{k0@ro$W{? zwvM-s$pDz_i65J#OcG%Bz!;8vLC%YD?so%r2z*0VV~N1-I_u_z2H-X|cn0LCMglSM zk_53Mlgw>~!{KUf$8{>kWIt>;QEu|Y(%7QI@3#!A20N#nd+-LJ&->U1fju>|lm~u` zMVtiAa2v1VIPJr2mhANV{@gxO%YTY*rpumms_z`G6*Nz z@vOfDix06fV0>$B$utX(vNk(w-AuBv%gzxK2aX60xFRL6_ufZ}bZ!6>Cu>P8z_~%E zH<=FdoV||Vfm~{K063R%M}Vz=BS&@=XYTJbm>oS$PO`<-#+Jr*?hJ)Bt`PObM)kSZ8H|g?k<=*@;I^`DUND+wP){p6|2G-|G5*}WiV*^B=KId- z;G@Tf8k-jmEBQtPM31$T_1&(cVlBrp3fd&t$w|wntNq&V-IN5&It_E4@Imd|Kl?!< zfuUTc3zAHObCRvo`Z^&~rld%Ai4Mrxfz*f=J2kV1&iOMk#tIN2lVtAiQla>BXSp(9++bG|?7bP^y}FKW_JBeC3hEjw3ZfkQ=ooGj?Ibj8S#saVB*- z(a3wWYzYE&Mi#gdr2U=EcHfQNhXCmfHXuAzgA3lI-REUKqmoum9Ai$?F!CHEmD0~z zqF9XWl^>uxWn#1olpsOM+>$6(x}0oQrzmhdPl^o4kuac)((nmM5;-1}WlGssZT7om z&`$%t(;*_@Mk^abP-k3?V4{ACM!F=WN2VN=j44B&BSj(rM^iD32B1+VaO%L_i|*Y4 zY*t?&sLqff4*OA7!ZgPku1D6@utwCJ{WyPAO_H%kf$k=8h&W*C==PQYs~c!Wj2#U! zFn*)-F|TRRDm+6Dq3p;2+49V@!K-(?{xPPPoF1to z$x0H=yC}mJp~L3**vIz?8MOj$Qro8;i>#|LTTB(5kG`YF^a7^fmu>C|j@F))CsXdp z2*c0Hi~~%Z-PZrVI2D6HRvrQW5r+0;$An*<4jfMfb~Hxr6qu(0VIU{6XB%fdUt+7GKM$ZQ7d z+*G-q^3AhAkG6UGeKe43wk=Z~@{qi^8g4~a7kh3;^x0=fpYx@Ed05BU<|1?Y@y9GNH9cw6|*ydMtC~bu#Ur zW^%V9`U#e%tuqzfu>F?#-9|w@YT*rZk~0~*#cRn2ktxkSAW3Ed%?xnei<~%b>YUvy zQB0iuZb_Yd#{V~D+^D7_lR5mbj7|2~MWfx0!AN^YIy$^?2|Zp0fzVvE@~A_$*cnVA zMw#g)ypCq2vdiFXhx6E0)LqSNUxhI zVW-W=i}3ha-8{;~vjY#ZReptXbC!%U_7TS<<#h*49XcddFz8&+VQpzLHIvtFG}ukc ztmOZTJf~!aiH*rPc@pR;9nD7=JCGdVDq<116>`I1b5xT@tC-Dp5?2cO>`Zi$Oc?Cc z(=Nq~W}cBGvz~W!9>~};tnKM?az?r*E|O;jW_03+7UVQwICongNlHz~C-}PvCLZYw zR_qcowKa`$hP?y!^;8FkQe+UQgE~86O1M%&)(VWI%!rlfG4Y`wbreh^=ZP%0M8brg z;dU5oO-Jt}hg^{e*c8v~l#?WMUt?_~z?@+B^hF06nQ2~sj#!{Wam0bn8hwA4g(GPp zre)|l%aSOn8U*|Kj6IRW895IgvD0rHxqx+pbT_1PaWqhU>-R^eY8dPASqqQe_aWKy zbYM@gdG;KmUU;{SlVCmuzzWeg767aWXd_QWP{P+&9)h)*5Dlk z!wjP}|BcZa_lfvoG{C0G|7UodwcV@AJHfqqjue^oy9ceoY@nI}^Q?wH6;v~TLW`Kr zXy79tKO?#FmJgG$lhVOuZE*2ZjE(?$gwY2R3`cIyVJA+KNNfEK$gcDqZHkf0VMdOe zm>Iv^1hyK8I~oYO9l-Us@yB|M4gsFj<5}h%0zYagcd)ZD(q&^V&IE^>F~$_5al^!k4%1 zJn&9?;+~W-ewCt^;T`NeM?jwi+M(lXmEnk#nsGM*Cu2AujAFmD9g=3^cRpazg{)2P zn8^slCiA+?NR(!+NuZ1{S-MkuZF%6gv9{}!d*XLgzfH?4N!?6zAmK9F0seNx-8fs1 zXDviP*JZL(3;|+<;j`Pb3|s~}q7~H5vaL6j*f~=voG(jG12zp0Lhxjb*#NQD5r-zc z8>nBrJig*G4d%vKNVex5w1@9RM?K}U<_D?ky?<0-r@?(R`7p`ot`?H2s#>^rZ4^=FlN|z7;uANn-1>IN}N2Cr3Zk`BP^T*Bp+h=GXQ?n zq4@~xH~`i&0DT(!&VYJ`-9wFiKyS}TnG}0}0I747b%*zVRH^Xn>CK)NJe~mTrv#t_ zcabwXLIlFM0P-}L$AMa&#=dX$_}d`x3eTZ?RLY=?o8@$7*!k>srvp9PW)jSU?U;_9 z^Qe?K+IdESZGby%u+M1qd$#NeEItDAvw?m9$ftmLQX9{>7*l{gdPf)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-overlay.yui-force-redraw{margin-bottom:1px;}.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 .yuimenubaritemlabel:visited{color:#000;}.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,.yui-skin-sam .yuimenubaritemlabel-disabled:visited{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:visited{color:#000;}.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,.yui-skin-sam .yuimenuitemlabel-disabled:visited{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-pb-bar,.yui-pb-mask{width:100%;height:100%;}.yui-pb{position:relative;top:0;left:0;width:200px;height:20px;padding:0;border:none;margin:0;text-align:left;}.yui-pb-mask{position:absolute;top:0;left:0;z-index:2;}.yui-pb-mask div{width:50%;height:50%;background-repeat:no-repeat;padding:0;position:absolute;}.yui-pb-tl{background-position:top left;}.yui-pb-tr{background-position:top right;left:50%;}.yui-pb-bl{background-position:bottom left;top:50%;}.yui-pb-br{background-position:bottom right;left:50%;top:50%;}.yui-pb-bar{margin:0;position:absolute;left:0;top:0;z-index:1;}.yui-pb-ltr .yui-pb-bar{_position:static;}.yui-pb-rtl .yui-pb-bar{background-position:right;}.yui-pb-btt .yui-pb-bar{background-position:left bottom;}.yui-pb-bar{background-color:blue;}.yui-pb{border:thin solid #808080;}.yui-skin-sam .yui-pb{background-color:transparent;border:solid #808080;border-width:1px 0;}.yui-skin-sam .yui-pb-rtl,.yui-skin-sam .yui-pb-ltr{background-image:url(back-h.png);background-repeat:repeat-x;}.yui-skin-sam .yui-pb-ttb,.yui-skin-sam .yui-pb-btt{background-image:url(back-v.png);background-repeat:repeat-y;}.yui-skin-sam .yui-pb-bar{background-color:transparent;}.yui-skin-sam .yui-pb-ltr .yui-pb-bar,.yui-skin-sam .yui-pb-rtl .yui-pb-bar{background-image:url(bar-h.png);background-repeat:repeat-x;}.yui-skin-sam .yui-pb-ttb .yui-pb-bar,.yui-skin-sam .yui-pb-btt .yui-pb-bar{background-image:url(bar-v.png);background-repeat:repeat-y;}.yui-skin-sam .yui-pb-mask{border:solid #808080;border-width:0 1px;margin:0 -1px;}.yui-skin-sam .yui-pb-caption{color:#000;text-align:center;margin:0 auto;}.yui-skin-sam .yui-pb-range{color:#a6a6a6;} -.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;zoom:1;}.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%;zoom:1;}.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-skin-sam .yui-resize-textarea .yui-resize-handle-r{right:-8px;}.yui-skin-sam .yui-resize-textarea .yui-resize-handle-b{bottom:-8px;}.yui-skin-sam .yui-resize-textarea .yui-resize-handle-br{right:-8px;bottom:-8px;} -.yui-busy{cursor:wait!important;}.yui-toolbar-container fieldset,.yui-editor-container fieldset{padding:0;margin:0;border:0;}.yui-toolbar-container legend{display:none;}.yui-skin-sam .yui-toolbar-container .yui-button button,.yui-skin-sam .yui-toolbar-container .yui-button a,.yui-skin-sam .yui-toolbar-container .yui-button a:visited{font-size:0;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-select button,.yui-skin-sam .yui-toolbar-container .yui-toolbar-select a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-select a:visited,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton button,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a:visited{font-size:12px;}.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.up,.yui-skin-sam .yui-toolbar-container .yui-toolbar-spinbutton a.down{font-size:0;line-height:0;padding:0;}.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:0;}.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;height:100%;width:100%;position:absolute;top:0;left:0;opacity:.5;filter:alpha(opacity=50);}.yui-editor-container iframe{border:0;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:.25em 0 .25em .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:.75em;}.yui-editor-panel .height-width{float:left;}.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;float:none;} -.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:0;text-indent:0;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:0 3px 7px 17px;}.yui-toolbar-bordersize-menu .yuimenuitemlabel .checkedindicator,.yui-toolbar-bordertype-menu .yuimenuitemlabel .checkedindicator{position:absolute;left:-12px;*top:14px;*left:0;}.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:.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:#000;font-weight:bold;margin:0;padding:.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:.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 .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:.25em;}.yui-skin-sam .yui-toolbar-container .collapse{background:url(sprite.png) no-repeat 0 -400px;}.yui-skin-sam .yui-toolbar-container .collapsed{background:url(sprite.png) no-repeat 0 -350px;}.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:0;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:0;}.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:0;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 .yui-toolbar-container .yui-toolbar-subcont{padding:0;border:none;margin-top:.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:#fff;}.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,.yui-region-slider{position:relative;}.yui-h-slider .yui-slider-thumb,.yui-v-slider .yui-slider-thumb,.yui-region-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-skin-sam .yui-region-slider{height:228px;width:228px;} -.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 .5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 .5em;}.yui-navset .yui-content .yui-hidden{border:0;height:0;width:0;padding:0;position:absolute;left:-999999px;overflow:hidden;visibility:hidden;}.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,.yui-navset .yui-content div{zoom:1;}.yui-navset .yui-content:after{content:'';display:block;clear:both;}.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;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin: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 .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:.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:.35em .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:.25em .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 .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 .16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin: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:.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 .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 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;} -table.ygtvtable{margin-bottom:0;border:none;border-collapse:collapse;}td.ygtvcell{border:none;padding:0;}a.ygtvspacer{text-decoration:none;outline-style:none;display:block;}.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;cursor:pointer;}.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;cursor:pointer;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0 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;cursor:pointer;}.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;}* 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:18px;}.ygtvfocus{background-color:#c0e0e0;border:none;}.ygtvfocus .ygtvlabel,.ygtvfocus .ygtvlabel:link,.ygtvfocus .ygtvlabel:visited,.ygtvfocus .ygtvlabel:hover{background-color:#c0e0e0;}.ygtvfocus 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;}.ygtv-highlight .ygtv-highlight1,.ygtv-highlight .ygtv-highlight1 .ygtvlabel{background-color:blue;color:white;}.ygtv-highlight .ygtv-highlight2,.ygtv-highlight .ygtv-highlight2 .ygtvlabel{background-color:silver;}.ygtv-highlight .ygtv-highlight0 .ygtvfocus .ygtvlabel,.ygtv-highlight .ygtv-highlight1 .ygtvfocus .ygtvlabel,.ygtv-highlight .ygtv-highlight2 .ygtvfocus .ygtvlabel{background-color:#c0e0e0;}.ygtv-highlight .ygtvcontent{padding-right:1em;}.ygtv-checkbox .ygtv-highlight0 .ygtvcontent{padding-left:1em;background:url(check0.gif) no-repeat;}.ygtv-checkbox .ygtv-highlight0 .ygtvfocus.ygtvcontent,.ygtv-checkbox .ygtv-highlight1 .ygtvfocus.ygtvcontent,.ygtv-checkbox .ygtv-highlight2 .ygtvfocus.ygtvcontent{background-color:#c0e0e0;}.ygtv-checkbox .ygtv-highlight1 .ygtvcontent{padding-left:1em;background:url(check1.gif) no-repeat;}.ygtv-checkbox .ygtv-highlight2 .ygtvcontent{padding-left:1em;background:url(check2.gif) no-repeat;} - diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/slider.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/slider.css deleted file mode 100644 index 9450e3be74..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/slider.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-h-slider,.yui-v-slider,.yui-region-slider{position:relative;}.yui-h-slider .yui-slider-thumb,.yui-v-slider .yui-slider-thumb,.yui-region-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-skin-sam .yui-region-slider{height:228px;width:228px;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-active.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-active.png deleted file mode 100644 index fa58c5030e76082c84e38342cf6722c723ad2fd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-focus.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-focus.png deleted file mode 100644 index 167d71eb721ba9b85c6601f9077d5c39faa4ebd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-hover.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow-hover.png deleted file mode 100644 index 167d71eb721ba9b85c6601f9077d5c39faa4ebd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/split-button-arrow.png deleted file mode 100644 index b33a93ff2dc2039bd24e4ea3b75ecf4bb3295f84..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/sprite.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/sprite.png deleted file mode 100644 index 73634d6a22c4377060f49217b63f31b59fe22d51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3745 zcmd^C`B&0g_x=DPilSwrm^nqWnUq#eWm--*^_u07bqmX(Ow1J2va6=14V2nkPNmhY z>pbKX8aQGaYNeQ>fCJzZNCKiJFLv*Dec%7#eSXEiNvKM52X-1&Ks5Iy%nf@%RFP{l#ybSs9bX znx39!vqywNp;#-n3j!vm-TRDQt5)(2~rzV*2|SO56Nspdahr;-Zd(t^W+rlQGslR&tF(rp5JW>HfmW$*F;XK?Y-}yXP~PH%X`W*Y(S$r)L@{ zjk7{I|6FrR>(CIh;$1b5Hz{3Mz<9sg;aNH-5*-Nb{o31i0M}>f-(2&)zWrl|NG#ra zy0NgNbYC#dIlJ#$lc_OtJno%dgL$k5BoeQ{`qAG_A88ZZm-{BkTPN%HPSkCrS8SPA zQHhLkVaRw*@`G^hMGD1Q^X1_Xi zUWE&unOh&s6s4t^9W0!!NNs+kRa-}&?G2tI5Ei| zejK}{Mo&?kr#D=CT5Y)D+G2eC$+(Xbmo<5KwT;H9JRVQt6kiB|S(BD767-I5-vVVZ|jgA2T5P$4tIU|r9SQK>hzc#TLptZ8*+Ul!`b)`vCQ}P z0hEqYj2dd4I|$89%=kg3dSS=@!j73?$C|KXE!eRn>{tXwxF54ik7$E%T!y8j{|k)1 z|0-1@|HP&M%vr!x0X=~otH+L=#Rh1h+QDc80G$g#S5T;3Wa?uw)rmq)B~!I2)HVv$ zheC~~tkU=w?uOJa`|KOdlFD+4X+PI3BC!G6P_+QDhD?2h9n-)F^)NycjL;1ep@V8y zK=WZ}GYU&vm87H^7YMS6A#6ll6-;i$B>x}S>D=qd$wp5Ca+RKF28J6>O#9~?uCEbR zV!E6O(35W+bJVuow=(JdT9@WsK35qz*;(nCk6+uZQ|S<+Q;)6}hn$$J%lY$8&!Zl@ z7(Tmt<+R~vd;oV$`-DfhRyU>B`O*bq^MFK`f zM(ltBp!K{K%Q6z6g@0X_fX3fhdzw!CmKLGbeF3%ABbcSd4pb%PK)Q>ZN{m}iq*MU^ zxM?i~QzQK`7hUfbcN2hX2X0+juvm9nzPUMehR{OVa~68Q+1dHYo9+Y+O|)|Dc}zQM z%?(Bh3L3O0aDZ|nb4_$W&HKjTa_oHlO*1owj#<-i1-5@QzU0XFXM$kx3Cwg~^QP+9 zsOF!yv`D<#r^S9*`r=^+t*e)PKRMlg8alGe(0N-*3xH`jFbF4CDaePf-Lq$+ z_JWWJIAyF4s2>SbA<4EwIu+}0fd}D+BZ4k?f;_pHW%lXAcRWpjqXqXN?Y(dPcturr z8NGFTUYUPOY=32Sj;IN7?DQ+tKi)d|L}Z03^qwkv_FhMxWFvnDIn&tKSOpYwko}qb zxly;Wv{c{|$?2@E@u0sxwj=v&(D_$direR70z3VZANNd)Mx9HNDE8s|BH}l!AZrzd zQUalNCI^9DPg8GXDc;zn0{j8P(m;pYA%|$-PLFdbqP(Y2UU?AkI=Cj&yaJeTo5){2 zR}3k2c`yZ7sE~6te`R8pu+cC|F98?2En&wL%eLaM4+wu87Vo8qZ}}TsS`5BHT4nf= z0I(h=RP0)Bs!&=2l$ZO01e>p~WMKBWwdQk&*kDOd6)j3&?E7wsexnPlXU(O# zuljo1$*Bf4%F4=Zs(G77cyISv`6j5_hOg1kXw|5*Q_2cB!KH^O)fs88-5!20+s+A@ zt{=%a$}-0wlF2Srgt%-)iaGVVqRQvzwCDM7=d@ah>um|??C3nHmk}~l3Q6~;yOg(Tj}AGmP=BBZ6WFh3T>G>E_~0 zV=q;isVW)_KE+Y|5G3X?ue7353?5Jrb^K0XiJBt6gpfE1@hUtOKwlmL<#>et)jQMs zP9@s1sBK_iAkh1R_KwibXvVJJ`nAKzZNyYH-7 zhi$cO?>yczO?*90W))nk{q3pyW{0gCBL)WtA78*;DwF!O-=PU&ilrH~1OnlMf_K_@ zglJW`k*`nnNv?f(?QnKt!5LL{eekGbsROFm4>=Y1>vh^3t|_UmsHlj}RV&8f^y*%9 zeHoZIJ*7mCQu~?DuOj30)8c>lZSJ?4yU}K5is{N9i-OgZTs)lHW`>_HP0aa}n%6Yk zV6-vELYl1nb1J`y_TjCf)Bb@kbu>^|?YQ~eSEtlWr-L6L)BBdFN}-~~G|TOyFNRHu zii+S1UXuoR-?YKhD?gW4o%G??1oq*?i@(#X&(~#USBn-1ZB>ia1_jX(FY3A7@_uze zq%Q1mkV_LPTJS>Sp|wcxd-Z<5;Xk~~eP9N4qO@_{I&G6J(jvu2Hh#;nHCmD>tRw}o zDU{ymFf`QE6xcH3v|B*CS6+VY+K4!AXqTeok*2z8rG)wNbXu&Bnrfj9yimX_JXWiG z&19R>QY{kL|IM>pAHTC+hN6)Vc;Rkpv-< z^ob-bB1w@*QX`UJM3Nqnq(dZuh$IA&w3bLxCX%4UC79}psI0)>Vr)X+i2aoEI6>}f z8^&VE1|{8&lI}rWHb$+BLlCd(5wAjsS3$(9P$Frys+uj-aX-Q_PQfuw$#EI_|21-* z5TBMFPQ(JPC&`gyA}9;2nEFqdMPkPuV#mOk5qYfyp&ut?@Dno(k}@Bb;(yn( zzhaY<@5iXhwGuOnwIR+>4o308=v)P}oP$xe0GbIw^A*sKuVr*lSl2nKn23$2%Wxt_ zwFx6;%MbAaTB4Z5%z!Wz5KM0b^9_QzfMB|+F>}n%$G&w-RGl`sHbqp235x$P&5;k)YU@q zX~|W0i~~FFP(c5lWc2I#uITH5^p)tlV8!RdP9>4uKJAn2xd_I#4K1pNO?5X7eS$$g zh- z3`S&i*Iv?T3X*;?B0=v2-|IE^hO&gQTJLW{5jDf@y-#Ph^7@Q^F70D{FSTsU*EW4i=9hj%JltBYw_d$-48>? zj67G@+QG#0!q)P?`BuOGf9?&FMG;WsvPY65^mUaonrGoX-b8F za^G3nBtU5zoGYm>j(H>Y1+6GqIoRSXPk7}IEELd7aSKMHpI@$Yce!a3;6(Pgqj8z0 zFYS5p_vVr3*$;S`>A$)NBjbd!Bwi14|EVS+`9BbFad1CWY>!R+4|+`f{{R30 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/sprite.psd b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/sprite.psd deleted file mode 100644 index fff2c3471308fed4c93ef4961ea1cd729b41bdca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118162 zcmeHw2|yG_)^PRAa0+;!CWb_jV8ja;4!IPfAjk@dK}|H9F9`x7%3(M}-9+PVqMs)J zy2>uQ@yNy_my%?KjYd|Jc;wQ2L|F}Kj|doG02Kxph8dg{HZ@|`(%9%2yxr$ESZ2{>JlC6e=~WyQWT!y^^rC^Uq}bv&t`GlBilw4hZh zqGOiFr8_Q;i%&?N?o{)iFPt0`Vy8Pj;~nW9xgt1jX~OI^sd4kxJTX6J&GHz(Sf`*s z>uIa}S0$}Tic61nT$PlVoaVo3x>Iy)%HlYGa1*qflOqk1zI?jV4C3LqFmkSAa7t>N zqnE34N{qYbR7bC=t{y&9eLUPJJ4U7?JBG$Bc2xQ~dbqp$IC^;aD?R?r!ZVL&Rx-^bbyri%yRVfjbb&<2wcZmCE@_D3yo5m(LV;AAfiEX(YNdWJk_4 zjmVVPge9xHq~Yc7=?=`1rXdO0ISr_a*y!|VgHn-(?UW8JPfF_il$69kzB=bFO-WBl zTbi=MF?gP*V`OwpLNb9Rg%W}bDNS=DOqMX6)+pguCwy;}5gXH97b`MS6KR#l#<;~L z#wEoir>8-ED0S;2HpYKRN@`McdSLX56^RKk(WJ`VRwl;^6}dtz$uzf)pnXksdnWC~ z>j+Z2cUN(0_wo-;NlZzFx{eFQ)b5m26BqYWKrbUI#bPS&rJXPs8 zb?OukSEV!=Nw{v)nVpc9o|3w{t2}#q@Ur;WqpSP^LLnc=v=yld>2aUR8 z#e&z20BJ*jw(aAu6dFR;h-tBoY0)dYiKip{y~L9iP9(mss})*sWMubMD)tRYNxI@l zqxgp>r=>?H$Haw)1ZHF;#QKL!_4HGQczb(!P4x>2Q7UJ62D{Ht`b-U(8al&oW+>lT zL`F*E^>ta&6P9%Jr#jL}e7XuI!TLX$ngFeiHmN`mr!F{&C{e$KQE_Q0i5a8`213sd ze{M?h6rxJKJ4apAb5yB!=cpYq7bGX72YLv(bwYQJ^#l}aWn4%?d|VpD@t!)_!`laL zU%34ydrbA1?BU}DH{g7|CVP9j!>t52;C($Od-zSA?CGwY?5XsH+i$YB2i%?>fP-{= z+~J0>J_Pm#f4DupJUs$t`hl?eLOuB?J@}^w#qdv0zNC$aBczF7er!RzrC&|kbWQ9CQE}kGm zh>j1KcEwyG>o4&xP3eb-Up-&o*)L4&F&dWZ08N!#TTl=S}_=VB_HP(q&?oQ5-NTut~a1>@tc2Mg=xWmx*0Qaloj+ zCh0P<%P0;Q71$(QCUzOc0iyz&q|3xEqc~txV3Ty2*ku$4j0$X$E)%14aclNtcOTMsdKXz$WQ3vCAk97!|lj>9X!v>=~B~D?Bq{DJNMA zDz74IK_46f-bsm$E8|kh5{~Iku(Hv~F)ld<)*&XxPj^}{KXi&OUHmyV5g+3%!~*Rc66HJ<~9RX*u}ZIh0G6eoEs57Z@wd09qBgf2`5MCLQS#`FODvt zgn(&ousm%=Tx$C22uN%SL~xBwkA)SL)A-bN$N_9@LQHy~wbiucajOGi4W=uf7_2x; zPIsLf9Um7;*ZR56jhvm5ny@AX7AGabI-hB7Bs@eDqIVxZJ%Ox*b&VmbH&ar@I9Air z(jobHNp{Op7V}}Jxe0#ORy`&O>*11Sq^3r%?npG6fIt#N6p7N4M(@QUi2%`wu%-&u zLJ$W@w?~R#{aJckXkv7HJ4Fy4m>3ryml_C5a6~61&`qRpnwv;Atd=yiCM1i*#LU`@ z+-*Jn8tS2&LJ^LOY=ad^qVry=ig_{7i6F}NPc?KZP+g~D6s)~A?vW;uma%v~KhCa*hH?LegybbDFNmXQccb*&$hmVv z=8~|%u=xFn=%hHY`;v^D#*8C|4(L6OpIt|Et7+ocNLVh8n8Zy=)k7&r5aBZ-A}&2W z4!%4(zAD7{oxgR2F|xa1ykivVG>%)f589Ap`$#Uq3Y5-INQsZ89RKxlTTdAzyiSgu zl6ViWyK}|reC^GMU6zrS9v4fHQE@TpzedTwy#kVolC&p)=y>k#3Nqa>viE}a@$~90 zw71Vx9kiq^-2LWeAbX(uyUzuna|!iGz!asgPUQ)Lp$F~b)4c@v>7ws32>@1v!>|ay zVt>`Wa97dpsbIf`uDOH$1`pnu)n z^NJO*_iq=iuW*uXdci!$d*KI5=V3S!OmDSVF z$Mn@JB)>R?IGyvP<1`tw`QNsZwA+7k^^`|fTE$<4ok{H}6)B}+{H}zGbL5>V6$yon z)5yGjpf%ME+#tFEGz86tCj*!8rh7;}M*ZyQlRko8MTo|_NkLni`Ki&#X)B^rL5;AQ z`Y1+FpV9ENMe|WAiblyO4XuE8DvASl3|cLuQA0yQ>KIcOLa_{=hBt+W!V~tu?Be?f z^@UwA`E(Sv?eJ(y^(b9fUQb~w`hdC;&A5tn=hJa}#pP~63o z;D|(|q6Cx9 z4IoA*A2aF)=wWbMP#`=+lD0*BYD&fm9h5mJwqUE)xa5o^h+{Kr9!VY45r6~OHaa6c zB@A|5Oa=W;EFjQ)=)Z)()_h=sAwJtZ6);^TBM z=Fy4i^P}T+aCR|q5HD_3dU)FG`H>NeVLMWiprwe`32e1AC3Ve=#DsW}Q-k@!gIXi)&-Zw0Ll1U)(?ZAIj~P*O(-wg`13dxi2T(I>FE@khS) z{ySy%Tt`QVpCQhnF)LDm%gkH|>=_GN?}Ga^a3^M_uON6r_3*{ZiCadR-0)N&5Zn(E zcRcT&OvCW*$B8>ODH#M@Mrd9Un-ojjr@;NcD>I1T%Ok+OVP!&GCb-Xo+c_~KDFNK1 zhaH|27Y&V3L3rkz9v8C|-0tAENu3`R4DM+lRW|Vw_hN}V9V8IKqTrMjt7)A$y2MO? zy^H;P9cRa7k~zgGb74>A=+s!)@i=KkbTW)+e3?lsG_1=$tQ5^Zdi0cp>&Z##miMoJ ziq;u3^7{^4N6Zdf${y&KVKkHfr31J4Erbrg4t4<-J8;hLAT;0RcZ|tM zUC9Sgke3;V!Pr4#UaHh#eWqgidqF{W^4Aa*(5W6vv9M8X7Og3W*f}1 z&E7Nn)a)y>3ua|zjppX&BhAN~`DKeDmszj3{)hF))?Zm)wyqyEXpqw& zzd=t8N*MI&pnnYd*Pw3)l?-aO8D=xlCfMdVn+%&j+q`e{r44ISZ)+r`?gv)f^J$ga@t=3uMA;|9+d{QTfGgR=+c4gO*9^&wV6 z9vc!oBznl&Av=Z~8B#PvGt_>la_EyolZL)IbpO!rhN^~H40~+YtYNXkUK_S|*vVnn z?B({4+6UXm*#F6XpZ!<%Wy8&fj~^aBeA)0fhJQ4?V0i6_VI#aoJUwF7h#e!2jVK-| zANknG@R5llw~Wjk`Qylz2OfD~#shH=YCU>Y?in!yN(~VjMO*zFUbR5^}toZ*=0 z_z%ZZjHM#^~VJ@eSc#|}TH8vo$<@bPQL9~ghx#nvUr#M zxQ=vhFd)j)2 zdam>Q%v0?($t%w5ZLgoa?Y$$tH+rA&)=u@AnmYC4sg*v?J}>(0^eOTk?mO4_P2X?* z%=~8ht@AtT*X%#lKixmqzb0Tx!193o0jg=^r^QX%H|^SVr|HqtcTX=4bPRkk@SVWo zps_*GL3@HqAAj`m*vH>{ykf?L8Ovtm%(ywzeP-&+PiNi=_78p~_{$J^NLa|`kb+sm zW-XYteb&#RPNDIk2SRJZyuh%Zom~|ENO(;6hvBuq^ZDH?zdJR@X3o4h z+vk){*LvpMLheXEnc{_4~j5zU(>g=Qcd|CL^7730?E<9~6Ix`NN5q$G*J&<&sxsys~>Ovv%>?6YCyb_u9I$SHoWYV7>MF zo;o{F0eRl51?~a_v56J)Y zKd%3I|LEAGJC2Pww&io{&tLl-f3fBZ&6g{_yna0X__Y%+oVavy;mPx-o;p?V)ts-s z{W|pPli$qv=8JEqe|z*h|L=~R_C0<0%+xc7zW4tA)Bp4SzfTLM799G)=ZDYE`kl=` zH|^Z#g+YbK{~Pk(ug`~{KXc)U3+H}Z@Z(QK&lMH_6#J8kO=Q&2mYmHILVPU%RljOr5I6b#K;>s(-)1tKo!ZuIA^)q{h}; zo0~>8ebDUN{7uUDph32FwnOaf zh77l}vl~txcEkB7Lk&p)e~E@#LUH7B#tF%WGV-Aez5+7>3_isK0hMO(sRDmMF!_^1 z;S^@(7M51lgJ7ae*ONgqx#&3rF$zX5Q^?FL%q`92HlE-)RIV61Oldabsc3trm)3ij z58t}`;LJyzM?@W8?CF*I$8*6J>H~!fO5^JC zUOV~UjBE9wZyqxM1PTf!mg ze>J1hQ=Nh;pVWNuhx(|eG(mr@DZiz)c%|(XwEB2g*V2%95)pG5VyD?h-id)4Of7v!|ZQ#U` z+Uh6qSRJK8?0X5}h=S2PmQZw3++p~Z|tyL%bq zB7}hsfl<1F=1F@a9Mk+}QdK8vi|UPTDzVug2)C($5s-iSZ^E0vB) z;oJ~tr0*~tw7ny1Pv7Mox#;Gn@E|{P27V5}n}Hb;NjaF&9pzvila@oqh-omcvW~PN z3Hk@U9_0gllfHEDI|R?zBt<7Dghz!&5pRN@ksLxM3X9<$LIS`If5L<%p$N?gohO|~ zLZM(T(Czf17z?873OQGJV^K;@*~d?q1*<{ zi7{csSp#ktq#zmr$14Qy@;nLcl0?#Qd6A@@49f#B2r2xj$OHad$b7mXw?#zs>bO)# zB}peSBbm@f}5Du9~5K8)hLmsrm`Z(m#D~ITp#ogf0 zM_=V2gE6qbOVLvv3dp~2TB!bV^kp8s(|V`nF(kerVS1v}T&LCv)Klo&^Se8F^iJEI zmd%j(hJ@*zQa%LXn{hQ_d<@+dZwO_^$1t9%+lyfd-%6x~8&(G-T<UK9oLsZy!Ifx!+Ab-_5+F^`VBEtp)SAHe7>h5C`gV zSYQDvbZMBL-FKb>0;Mem#XN^EBQ5B`$(z6g-*eu)@14fyOU##^=LBCSL-OXs+<6ME zP}*YD2IYp<2C63x-b8oA;j2(LKSK-TfHOpyblD)D^hJ8DKtTy8Dk0Zas>dovGH^Fj zcLf+Lpj((hFbon$ncipDp^8t~aQ5~bk^_o<5pw7AY6S+i0bOlaOW#_6TL9*O@+SI5 zKyd}QG2kk|PfOpe@YVt>#^+PxOULKZGbM)lV#u)+s7oOMP*#>b4eI+_iRtMt!4W*-}a9W^|aJ3OWbr5O*uJF$~tU~&3X*fP6pGr^p z819FG4<$fFGw|USaHR9i`|zQ9eriFmuNu^h44|&pVYv5?f_@EQXgTkfav1Ot*022T zosYk*8tI)M0~_MERU4=kMv!a5$Rds}%`kdvpRehxbed?4BR6s1SzG8XHpzo1h{W=ON`ENzJ$vjgQfxC?+mx?)u!u$1t9%+lxVJrSFX!hCmIII<|#NZ0n?r-)Zaa z;4hI_k_+iSNDd?)-aQE19pUc8MN%3B7fGAEtzpSKxyaIYD=5vKq%Fp^p`{?)A{Qyq zuy(gipX4B;JqW1@{^ENRVtPW#)OR%^mdNxralpg@69?{X4p`CNkMxM-%ZK#3~&Vfma!%5W%j25ybPOBDFHf5*kZVTX0HIn7uh2A zJbRY?p8bwJ#eU9y#^$j(?7IVY8CD7sim!)e_7>EGhOL8|sHJsL%~r7$Y&q1(HCocE zP|`~Sa2Zq*gsYCLF*;racb(+jjG2QP4l|mA&4N!0wmg{hx&~`rPdeDrfdlaM>u_sC zTr)NYTpD1+m`zx5JuNBidXo^VYY0fYOFDqtCFHkDOuGfkG`oN-@)U8MD5vFVZ!HG# zKwoHtHOI?=W)0jGl6M=%No@kId$;U3#?7$An8cI1(eduX>*71*N2$<9qp^5>W$Kit zP-ZFZQg>ILbRVD3%~%@sh1VymjYLdu0keq!-@=DV*h;Xw2i@}?*d{q$rzCdYNeLQds%tvp=U!o%to0lp;*M#>~c%!6C$6*g4ObVk`X3kwF3r)EtvkRU-g( zZSrNvNmVQGqfX$5THuFT;76UnkJ?-Ev#@bmoxl&Zz>hkCA9Vsh)B->1YUE3h)8$%$ zAL{E&_{EyL!w!rU`(SL@Rg5k0>)9o^B>VLe%k+SVvP> zXG{tRU4&+F339&-wk=oao4^DwrB$CBt%LaMApSatzYgNVo4^FGFOC$?mzXa-&k3F@ z(l9-{Aq6NgqyVLd6o3;vS9*>m^=*aH7Gvn(;7QE5ICz5t-dCY+euhmtIN%IHT{fsp zkls3)9z4-HNDtn49i*}j(pyK<15QDDz$+;oQa9LhRhM8J482xMb#+x$3s`!UV>2G) zsuYz3QGqQgz`LqhQ^i%vz<{a(QnjLRWu;10UIrkpl4DI}rB=lQOtYpK^644^q~RyAu>Dy~9SUeXNtiXd0clr+QleF+DC+Hz1i0})82DM6|V z3^bRN=q-`7bcVR$2UT;Mww`Hg{sl_GG}m)Yid*%X#^y3?hMVh~nr?9oSi>|@@&MGd za-b0B8WGT^Xl-oNv}!SG0Jxz7%j;WtZ*3#f)L4Pd0ft{4x7r$U6Yq=L8WoymP1AWO zj;5v247?i&fE%?b9L4E^HtSQ8beCodl*Pv1ME?2V7$g$y;*BjRb{368fMh3+A1yB0sMlw zD!CeCwYK~hECWvb(TLhtOi?wE)hU33!djfb|hq*N|zRZm!NQN6N7+KH?nm zl;=LY&&|!n@kj->#I7NcZf>XXY0iyt83%~hJfHJ~BT1v8v~G;!S{0TBc!qFpvb49; z0O2wP5YGOdfPg4~a2-Vu&rRbIZEnaOU`G)qF$f|cDw1=vgcxqFE-qt88fycd<6LPP zE{uJq3g{RY65!%O=x||1*;f!sM>)Ejujj^}?s2rHc ztewKyGgC7AP&j_k7NM&pK+UDH=4N$uQ9&uT`lXC(ZdBJ-6%|~=Rz=Ottpun%1wvD# z<{A|MlmlQ@RIgUIv{YA?e+0nQqUvh3y0ZKf#IeK$MU`rG`Kf=GLLtlwE~?cRKcXL2 zto9=Mx8T~%yIRW$Z1%(MqKmt!ms$Bor%vtufeO;@t9>FMAVMnPs-P1|{8UmYOqpF3 zCd@9d=hz?EGwe4oW%k7YT!xl&Cd*$l*ct5O^a^5w*y(Hl>j#$)>j{@T>&i}IUD(G4 z;4-uv(r{z~mQ4MLld$~sADM`)WpA+6P;=!2a7iibAGcU;e(G7A^z0~eDM;rfn9RMi z%P`vWLFP|^^q+xNaE`qId0vE;aTQufDNMSSQT~&*BetWv{Wh!=9igO?`nQD1WFkuy zP?lmS*+5+#6!z$9g+aKi494j;Y}Qm(TU*vdMqo45ja%@&MMhwYhB6J--Y9D*BS6K? zTNvL^!8aL)t<U0HwQ25#YQFr`)SS%X{3 zYQf!di@PDKxZI=yjH;4gYHt!uaXAcLKmvC|ezU2eLR-RIP*-9`RjGxqK8)K+nBpHR zF)D2>VH(t}CFp!5mX#M5YcIE6z~>S1GHso7Z|lf@z0~nmM<(k+Lu!!cRcC8ClXYQt zyz8)L>&!2cbzx_Ib@0k$U1*GzmGQQM#>colTR{@5b1mzKN$CEyE*uQD8|32c{`$+h zkfd)%tqX}oV_#br5(^ZQb)kMKGWnP|VB&y@1HUc~bZ1>?597#Sz1D@qs;w5R3#(v4 zr4+37el6C8#J=!qyLBO%EG=M9vtO~t+5fPgvY)UY4A|AVSyK-apEpI)qi2}V*I zDmpEE4eEq1=|D^m8B`K|7F#CkLKYNUChJ0dR+4(G2|HV2_OWGT_cnGW>q2T7*~R`( z*RHa&`QUHNy08LFb1HhaE<7i(E~J)DdaVmsV5xV4SQlnueD=hNW5>>7oC#KbJjfkW z93}{`F5Cy+$5dyIaffAR@jhx@Na4eWb8~l68^U99eCF_BE*EX%K}L0k%f$y!CIt`6 zE}qHd4lw&DC_kKg<_vcL?<2nESe2_fbKn5CPqs5t1(}N=x0A^PV?vb4fuD9K-iCk@ zbU>4dwowzq%)T)#BWwT@!=o>0qnMYDQWL|YQCzfQK~$L6QDS0vG%7lJ0hfWp7_Xy1 z9s$EHfYsa<&I=s{6T@}OmW5pagSiZVGeFxOwT}1JdNIykU}6X`#$PRH18@WcC*T^b zmm=(|EzXu;DHyh_)yr%P#%o3ZguS%RC4e9MSI%K$#gjbNf7 zZ^f2DgDfF$1|QXqz+nn!0#ZA}qb-9NOCTHU439o-ZE0!!G!&_Gt=}FDc80~;0;aH- z+8Gv@6@B?-etsdCj1?AXztrZVLa;OZQeKF0AxOb?FfIgdAiXd*cQXLRg@wSgLhgOE zfm#}Zi`f8CfN{K&S{lAD+rFWYS{iN#Uuqz>oq1X6pq7T4MV#p1UPch;_R6Ij3rz4f z26Gdc;EmMMFyF^#(Nn>JJ`*RiO~i!&g)bd2ctz?plrk54S-Ni0z-?5k->m~D1h*BAc(b3@rbrSWCyUb z2$L8D5gfCW3$%n7fj&y5Gf87z@LJA?rlDl)(ut+vq(#9>C80yfIM@+O!+Zy4rE+h< zUZv8(?jUKf*7=hhoF^$KIosJCq?U&3CUJJmr1U-%j{epO%qGD}v&-3K zaK*E6Yz!OCzQFz-uBX{3_6atE4I6;V&~iw_i57RiWlO^r$?|Hl(49<0U!yj0cRCp@ z<+OhHPayMGU^1E56_!(r!b+fmw2zy#t?;czY(sbdt)KGleRM4i#SH|A)hgLQ;L3nq z-Ba5I3zmj?OPA(ROT(h2+q0KaTYs}{Z=A|a-$pGBzg?P(Yc?(YmRcIF-Es=!P3iDy z29}0->3eel+O#x}S{hcRbKA`!=%&@tU|0y2h99inyJ-`y;5ISQTgiA>v2^JOP z;x@_FMivoE!)>dx!FT%>f?2c@1}`9i+a%vo^zB-1jVx1{2d0MGR%_SFc7mzl8fMWn zfTPpF^=%$J(k;Q*aOI*!+Q?QVwnX4*GBz~AbmP~hY#V55c{3N2v7sUL!1JoJ@tn!n zushy$7|?a**RRjmkl!k?|F%o);FZbP&=?~<<4p&Rk6|)4?5=fp;G|m_-Y>?6#3a+S zm0?F6n_MOim^fhKK!0#Rzp!|cD<0|RzRY3$^2UZ_GefeXnQUgr zmvkWJhGp+E_x-k&;dOCOzTehXhS%?}tqiNftMzYX2s;}( zsd_dxENnM6Y*bK#A9W*dH>j@Tw>E6w%CJ^`g=}TmVQhFQ{8IZ?hN5LpnP7A{fX0T^ z`nNKq{OG~huuy7jDDb0B;0J7FNOo2$Y2V6_8XI1zl^7ddYTwGRf7t=XhVOQ4Wmt+! zJ8xxJ3R@YL>TG2wVx(Ic3K9ExE5lP<4mwGU4G*7$ZQ4$PS{k2(-NsIWd0|cs&{>lM zrWHA`KG>lI2Y3U!mZr8_PYdSD7tk%DQA;_1c!5M5~*hqHwyVlqU?JvAR z5I5Msuq3<$HZX)|`v!*kObiFO)pciLr~(s1)$N!VHd>Hw2>!3tx3@eqXnD}|#I8t9 zx+1455);Eq?Hd^OZ_AU)m&wG?WMU|l2dNuO484hop##R-y}f;Wwqxu7W^_Er`6zq| z0!$32gSXG22p`T@wjEC=%4I7G`}+F(2T>zJA32Wj_2vB0OdezoMR5K&069?5SN2MT zKNrAEr=Z-|KO%w)z|)DZIX>inC?X($n=T7-I0TuCAQ!|q90I#K2M+wSL3kztN>G5t z0nMZ)h7NsWQ%2Z9Obj!%VN9lAVi?9fuUHT!niz&X|Gd=15WpTy48uB^7y>LcF(ja9 zV#w&27y=|QF?55%W_Dv@_`G0Z$mp6FG94y{j9_B;%pist^h{rx7`~~U#w>i3nix(q zn>%5`xN!@?R&3#1?F8*Ov=B@TC&(9KypS7>Mu1fzc!P=I!qKDc0C;oZLNGC0$T=W$ zYGMd3#vG!6i6QT#CWa2O5#|f2iQx$FrIukM7;CA6ni$%NIMKmbBM2mw?AvvNiQ(}b z+*W4CacW{%v~y?Pp`4tZTeFIYiDA*!ysvXE;Y&F=S?i04NyW~*lQ}t+xRT3ZvNn>f z@pDddIkG%3uFPT9=YT=Qj+{I|6r3vnMAmW@X13;Pb7T+$;GN4Lz}C};AOIlRa?l)r z*NZTTKoC3f;d25kEh=+%W@TkU60)2fr@5UpjVxwP7O^ngn71P0Py;>J7UzWKsYh&h|Ij5+FVa{@H4zoO~4=oH=YF$tUu`rB`{NPZi zw@UytN(KMelB3w^I`1;)vyLZ9hndl$t+EhaBEQ4sN+~ zdspLVx?e(zv-+)YKoOZw7WqnMk;xvB19ch5U$8LTs8DRA7KWcIye2C?r+XRB9Q*15 zyP4F&aF1dEE_G1sp%#V@On4Q(`Rw4!3@i*c+662C$U(7@S{Ponyn@EYsjaQaowLH2;+b7EmQbNFQN^_oC1GFKS9fCSD#KH>8{ z4{*a|4$MZdD4aQ5`+zJ6EDVP+GDm=Ihk|R*MtBTmz{1c~CetdK83bNnUntr+NZ+Eh zL|^HB46*GnBur2A7!u!*Fu#gC`trDJ*3hHIdkKf=2Kv2^r$V@1QtO#2Q(kb`0D{)r zofcI%5U$TGXFGZZ{!mdny7?D*+DLkjp4v_Ces?zybD*8rEZM^~R8j^)Menrs6r!UX z#6=D#<~Pu>mF99E?S|WXb2lsmOvD~XaKsjf_3`eWH^~WJwbZkQKfjBdNr#Tt3Wrkh zkXnHFfNK8at{NIp*Go4VpW-e)jhpnuF5az&8cM5S<4=5rOgPhuB zP%+4PT?R6yBSmsf7oXL@m6y-C7OHmFE{#}yW^gbYl$tTkmQb zO-!SSX*7`zop*6Gu`!J%oj4%v=?D6U$$c}mW$c)tFMR)vCD#q=gvqz;eelbKnBV=j zewkdSho1jNewj!M+s9)G%yYq?@67PXxzXwAqB}G)Z8^AY;KWKY6Gr|#OsnNP4J_UN zurOhb=YVOoyx}}Et(G^ISLDEvU;k=(8)Qu{8#r#nx*vKX(`tDlSK^Na!(~j==JIbt z;u#;qc&ctMM*kko!yjwY-$(PGSQhOxXd&1D$EG1FWI;gUE~8^SR@jPWxQ#>X(8s@sdvzjGO;V}^T^D$`s> zZyYlDn>b+NfQbWr%Yp9ZGE9cX-Sb%dvLJ8MTt@diGGTwa95Bsg7+&|LxeQ}@b$`rd zm`*V;yxzr-;h@xo<}&n42(ic@H?jG+8+I9{Qw;Rig~`Xn z0TTyI9Ox?!=%33lEpzM4WAV#^yiIc%ow;Lzf9o7DN4nqlQs_?ir4f0nKaal3foOH5 zluO-rBM$}SFP8Ss-ulbYmwEI~4{R(r+3sefqDvkdwzE(kKSp!)3O;7 z-;gl9Q_6=Rd^4^_jE~V#_rzrgWyZ%ao~ql6(LZw;WVbYHp(c2`cnUA$3 zZ%Cc=9)_f)5Yp$<6;l`Ay{FMz2r*q<2@$cq#Wu{Jq}GwXn6~&fEDcjA69-HjFmd31 z;egotN#9~0*;i#WWVACROi%O}65o(8zkxj3H@y+}J`~mC18a&u7bUg^|vcyd|*?zB!roy<5%E# zqNMKL9FMQzWL4o+`cK*{hXd=%dp>FNZ2L)@8sQ{KP5Vik#Spz%Jl?LhMt+%`v{@r$ zeO-1j{9^k_n-v0~*M#>~c%vlPH5&>-3S&(1yM{HGA!?3Es?vYbCgn#DCvBdUp0p|O zqfX!loU}>#(SFiqjeH4mx?C&pLw%hIzu11#X8*DS&c@u=anfc9F6n&IW(k~NS)y~& zrihWAv?)aF=aV)+;*wD|Ical!Hpy^39NLtPO1O7r71`Nvwq|lk+q+CjGI3#W)lrv- zlZK=T)bR;ml+CBwRaEX2W3Z^fnVVJm&)ft_lQg~V&)h79=2c1`4Y&Aa)1V<|ZkA{? zCFIOaLGa+r&EoK4ICB%8?PqQZQg`LL(BAr2;0$I;cV}*v!7mPRx1ZX^J1)Hb08IBTJ?=>~YUaZSuENLa3EBI%%J@P&L80G@|@ z84L)lfk5YhEZD=dxrI2%DOncH)m7)uS5-r4r1gCJZb)4N>``mzNt^X%tyNW(m1;OM zQQfMo(pDlhoU~abS7WT!mc!AS;0a`_%gcWOK%-Uzv(%gl7147x!Nn9o1mGC&q~~m^ zWaUL_dd_A!_|o$c%bD+`4tmb!FCtEKaNi>cbo(XihzaLxz7_z-n+Ci_&)GcU>KZc5 z)6Lb{0c|Paq<`xnarFCN* z*TS)40iGe8n=I|^G(fma0fe)^CmGOgEFp%Q ztBcDRlE&JA=QvlIh6`h#NeY@TTX!DmcuDMZNUsY59 zCukNmH@6a?@)QV7k(z5%08kEqRZ+cK-O^HBS^g0KSBt8v)#}RfQxL}z7Zg>h)#a!D zO%K{ExTscN{D>T>syS?pBse zJ@cg|hl`43CI>=Zg2~)Fy9}c}A7uU%NdFmV1?S)Z*CLokz6|*n!?Bdt*fPp}(ssml zbhqDzm7*h*bW;BoNE4Y%CVZ`cvJ^wf2I}gdut%5an6xhJfuD({W71$&P&^{ebW9pd ziRzsD)p_&%ZcYyC=6o@TWjZEJdInrqcORSz*Z#FG?U>0hPX@f}px-0sA72?jUF%Qn z6n5!(bbNSiE3btVwXNjiv4B0ze#IVV{{!cof5Lt+U{}x7OMP{ zQW$$hm1h@ysDd1Fsu8K{tWIsj^52rSwE|QX6+LTP&q=hcRO6x6r){m}wXLIDSG1jBDmD`r23Iq6i8yIUnm{w307m=yRP~Qzx9elD zVzFm!D@dB8>2ki4F?t%B6GYg_wQ;0$I;ciPqp(6(0es%`Dc z4A8cc1_=M9`n9d3Qvz+Pzz!X4YyYxDDqkjTt4Z4`l?SOCw5=zIwlx#uvnNg*J9ZZ1 zOwfArAa_i0m>@vgx(~dMsm>hZ4$IEseN@{@;lqb>b9Yjm>M=P!bNDcqi?;C~qdLRo z;sYp?f`?@n&*X9kn0*wKAI?2x(m4p6xseMuX|ymXYRT#rU^(TW98VO~dx%Jpbebo2r) z1BWqQM}a&7hFt(H;ug*e9R-!^x@F74E`S0t1Kx?o$>*_Va6$<+jr~ns0+VU+U1}y{l zC^v$MhP)M91`V==ycv8{I|7F(oC!$vu18x2F_u6!=v|LKZEb03{WKIwTI09x24z>V zwty)trh3-`v!XA*%+D_b6%sOELEh!Y*$%LoG9e%U%= zg64H&FgKA2-bgjC`9402o(c~1nW)Ssn%De^i&BCQ-~)kyO6Po{dG%SeG%&CL7jS`$ zauOgm2Coec3|tfwqYY%7*QqcLMvJ&W*@nFv0HK@&TGNS5`TF!^2p=9jRiRN|EqF|+x(4k};?1<(y-@#d_ z+*`0$sdTVANHwqdlN_8UDJMDG*&U>s*L9OPJ7!XPABsnTHV=JAG_PNtu2!8tk#`U@ zuLY;Is^aqnU*;VGm1IMPwvq5a~&U3{I0CEAa$}2d3zM|qpe(nYUzRNpt;=+ae z+-!(ri4W%GU$~H)okcaT2lrmMuy+I1w|=eNi?Re)8t-boNHwpA)AIJFQ7^NL8?v+0 z4pTu&>od)39Zd1@ml~#+$RtxOdlROa$V5{m=#z*(mP|BVh3UVG18^DI5K>tFN@kPU zBsP&<&Mt#1o{eK;*l6|z_V;i-%|@|Lun}z709=NaLmE!hK>n6BuPyDGS2aw3@>9{* zsE+VX7yd{&t>66<$ov(MexheBryABupn|lIo3yR)twwA^cmJ)Q^6q`46Z}M{%`d1T zT70sg>dJs!-Ba5I3!2xwrAza!;Wlhmv~+v+Qfm8Tw(X5mx#`=;2yF4~(p+4#Y3a9R z1X#P}6vms<;nR$RemQ+_E=8?|}rYfD=ZVo{=t&XlDgNpeFtM_i&ge$mBO!QVV z9#$;f{>G+F6{omOvbB*#DlEs_R%e6n_ALanXeA6@KmxZ(zNP5fwcHw6rZTS*Guu{c z*UENc+_r{UG!5YBbZ~u}2aj~iN-SHsXpuIuRf#PTcy zR}9nByV}pVCv(-+)nvk&M|D<4chXhYf^q1sU7A{nLZ6qcF3&7NS7v4`1zu?Gh1GOQFN6t8?0zdahL zeG;#HC5v5&#akKuDkdczh%wWkl9-gQ`bSlh@>QyEmAdaYI8nkQdhF_uB3gbD^SFSRdq?O%3)^7Y-0rLLv8wDVHeQdsI*slI2Y3U!mZr8_P?INgLtMxB%1^JRR zID=KLjbwrAwZ=whf8h;+xWNL~lJF8(;0n+71+My3t^?fax>LETK;^2s9hGaN1?h(1 z|5|-}%QJ(P2Tf1xiqxbla=Ic>xn62t;M%_}Pbyy~m8(hRDwPMR8&s~|MCIy$@pf-- zAD`_QJAhh|2RR>wFF}CHbvk(a9E$Mad}Z75bTZjyMPXlGfBzt=RP~YL2wz{$AI;=J z=1>IZj{}ec1$||&MEG+7%ybIMef=XMxBxtz_?qKG{)Zw00=Vh2AcsScxd?JWjKd+& zGdghKrwzh05m15xG!AGcRk=F!jgF15gQ#3HwP8%ApmGi4o>wdg6IHHZ&p$6!xdPau z$~CN$$`xR#%9Vhk%9YVkxdJ3nxw=7NGrLi_J};kE4UbQhyp5C-bq!i4zdyE3#rO=1o%=-*$Bp3>YyrDI}s;3IBNuf zq>_ERZcw=%-@$EVb{wZF*P@*}^A6?Y?A)4FL{zRtTl2ooxr8s}YPIEc3JWw|0Fza(*f_XDGrH=(Gtg$)HMg`QT6@0mh94sc{MA<|zOe4Sd+_Q9bJ$T3a+*aM|&$*5g#; zy3x+X){c6a9d{Zz(rzP_BfCD+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>% diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/tabview.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/tabview.css deleted file mode 100644 index eb79574672..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/tabview.css +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 .5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 .5em;}.yui-navset .yui-content .yui-hidden{border:0;height:0;width:0;padding:0;position:absolute;left:-999999px;overflow:hidden;visibility:hidden;}.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,.yui-navset .yui-content div{zoom:1;}.yui-navset .yui-content:after{content:'';display:block;clear:both;}.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;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin: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 .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:.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:.35em .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:.25em .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 .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 .16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin: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:.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 .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 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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview-loading.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview-loading.gif deleted file mode 100644 index 0bbf3bc0c0e5e635553e8d1bf9ceddefbc402396..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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^`=~9EL;yL&>*dd5*+XG=_`^3=CG25PbLa+LJ%N(PW_s z=_-TaM{SB!w(n7k+dMDN2G6VPqUA$u7F4m@ABAZ1D`*UMfe}E6csJU}J1Trmp#~7hZ5QSGpNvd1Uz$!Rf3q28pgSj9o zx?zwoWa8GYK@TOz^)mp#V2_VR5WfJ0W9BSSbn+cKb z7B9l9)K#s!?PSt;g%c8u;y7rd?hkP%>vq5BY=N>c=98V=+T&RSPgSu|E(FAK>B?vNN1 zPszwcbxJ?Oh|1pGd!9?gxzSWOR8o=x5!rGh+6r3hBL-14aTaAQxvJ|Y-S_m4niV2S zK@?}-9Dkhg<+w{Ny!vjyp-QmjyGmIW1DFB{k>P2=8cm~9M^_P#8?JFDumGEPaqJvf zZ{f;B#CG;H7q8a_hQ$pR6%%6So8vKM+W+cNPE_TI46^dn9q@qBr@1bUgxcPGB*b-i z3Hx_0(Esy5KKx^Y0yfgB6~}t>@!ctk>J|!vgVRhE2CPQ;AOKY2y%5nM@YF^ZMS~q}%L-n>Lpor#4w48UHYViOt={{43LMRvkIp+rkbs*s; z14}4q0y6`s8DL?uo-~*R@5tnFsC1DR#BGxT8fA20u_o?`0iDNI6lf;^$@AkR1dPTz z>XF1ZAqNjU95c@Vn59Wo;Z6b(YG+L$xy3(?j2I*vQ>PmzMEdh`yw3=)E}JYMDG|*x mDkGVJ;D)fXhxDI?kcM(ish)HppA z|KIKZ;^O4y=I80^>g(+6?eFj4?f>KM|K#xh=JEgV@$vHV^!4@i_V)Mp`T6?#`uqF) z|Ns900000000000A^8LW0012TEC2ui01^PWA^-*cU?+}bX_CaLu56dKMJ&&8S!{T& z;{|zVyNyP}^JR`lOa_A)YI>srb4tZrE>Kb7GQE1e*-pV?37F63OQkSyi7OQ}8g7Hw z?~lsk9xgl_4}pS%eGZ0)h<|+zjE#07FJR?dF`%c< zpFK+qpg^>!QKD@|3_Z#;sfeKxh(@I_HLBAN1EOlxI-%=?t63$8l@MX*~B&;C>oFt6t5zwd>cgW6PdRySDAyxO3~?&AYen-@t4~RHm#vzLM@W_}AL{iC_m#oNQiEOs%=9_TFDd(JY z)@kRRc;>0+o_zM{=bwNED(Iku7Ha6Bh$gD&qKr1`=%bKED(R$@R%+>`&!l*YrkioL z7*kDs3aU|HQ6-fbQX%!}R%S%y6+QGThAZy4+ZYo z#w+i<^ww+dz4+#<@4o!@>+ipGYHCUVo2WTMi!tT^V-7&P=mQQ&ED>=AJ62&akY8M3 z1sFb9aKVve^Z`K`bB$bpdj;50B?NllapfQ|2T}-_U4|J2nU9!xCM9VaT!VVD2waNL zq!2xd(V`$7iqfDk{fX0_K;4PdoKU@q)h%Gng4Qc=t%BDlfNg@ z(6$?Dr>&FRue@zH-Q?kIp5Ey34RqXq&mDN(ezR9Niie|e_uzRmzPICjL;knmloKww z;g=(xx#Ed$+PNwIi&x&b=#P^gx#^QzjymS6Yu-BNn|mHR=${W=d(pQaoqN)|FWr07 zzds#()Wc6*eAUNaoqX2IZ{2*?&wm|#*wc?)ec9KaJ-hAOY4<<2WzT>GblU+Hm_WD1rd2GO@c^>vVaA9P;`;WtA0m5_cXv|kGGw?h53kbf`qUkm}Lx*Cqo zhNZ*d>2#R78~QMZKipvudkDlL3eku}Jfael$VArh(1}BYA`+#zL@GAXbx*`%6ty@- zE>_WtSA_oE3=ud+2A0u*SrlU$1-M26o-uT7gkT&cI7bTB(SmoxU>-HNM-KMUgMS2J zAVoMx5*E^gheTl_Rk%nNHqwQUgkdCQI7u3AQH_^mV6WW)+ICLMP-(hq$71EIaRq*R<_iYFNI}HWjRw?*3_0a#br))xzll; zRHZ+)W>8JpQ(qPpm`4?6Qi-`#V>T6;LoH`iSvpmhRu!gKm1$OKx>cKY6{la-X;^tW zR-dL+sAnZ=S&h0@q_$P5Z)Iv+ojO;jrd6tUrD|TSx>v0BRjYsHYGA!OSg;mWtcN9Q zV$EvB#)8qYCS5FBCF@qo!qu{J#VlPlYgfpk)U!b4EHs}w+Paojw9+JPYE8RZ)QZ!! zaGYjrRr^}dqSdx)h3x`s``F$_7Poi>u3m-9SK|8BxPV2jV3kW)<{H+yh=s0V{-w)U z-+tD*p{4F*wOd*4Ue>#r1@C6X+ga@1*1WkT?`hTBTK4kxx9AOSe1|*V;@0=L_f2ko zm%HEQ_V>B}jc$OaJK*ZV_rTXhaCQs4T?Tj8!QX{&cqKeu3YS;G=f!Y(ExcY1x7Wk( zO|Xa;tYP_(CjI?wsTb;k3ZLmX!&_u0vRhH{{#JZLHx+RBH=I&UL)GqiUu~Lh3#l!L)zGqzO}ObjO!pzO}t?Zui^U{|0x! z#XWFx7u?(jM|Z;2y>NE(`{DkEIKU+?aEcS$;s(b!!ZogNjx*fj4v)CVCqD9um;B-< z&v?o=zVeQ@{NpbVImu^ka+;&u<|@ZI%XRK@p2OVdGOxMNZ$AF?oELrPNAG#kf4=mf z6aDE%hdR=wu5_w1-Re${y4I(@^{RLM>R-<~*T?R4vV-01VlTVe&%XAwv;FOEkNdkD zK6jAUJ?3`@dfuD9cdYk4?0-jl;M+cUxEEgT@uqv??Y?-tH(u|L=X>P+K6$`bUhtPE zeC7?mdBo3K@tA`CEx&rqw_fwF=X~rvUvJRYUi7yoeeO-ad(`({ z^}lC*@LfNA*cV^+$EW?hZNGfnH(&S9=Y8~jKYid=U-;K2e)f&OedKpv`T2H!_@O_3 z>6f4S=eK_PvA=%px1am(_kR4ruj*^pAK&+9{`?Qm|NhSRfA;^Ed;$1<1Gs6opeBO_XoC)jgW5xCC}e8x!-Fd1gDFUZr9dz+;4^8GFbeZ94C5jT zg9K(^BNXEUJQ4s^fH7XsBO6mBA2Syr10^K07I1JfOQJGT5&$dn056jzXt*U&kO*Ib z2#bI-jNkw|von@p14!sH~{iM*(bkLZh$2#k{`i=jx2qiBq!h>WMGjHyVAi^z<(2#vWYjk_p}y-1C} zh>gLhjl<}SpU92Z=#8r=j;%o+kTk2Sh?Rbpun2hnbjPuxx?0AoVh>vfi zkD*kL(dduU2$0nXj@DR^1bL7GnT-j#jSJb0{3u%wNm~sWjuFX+73qijn2#EnksR5N z7a52jIfx-yh$DH3C7Fl_d6Ko5k{jufEeVk?DUmAqj1y^)HOZ1436nV~lQC(LJ&BPn zxsyIAlt8JIL3xx$nUp+9lpy(&P05u0BI%S-36&%%l~qZVCTW#fiIpgMlU_NK-}seU z*_B{9j%8VnXL*iknT~6@j$^r!V#$?o*_Q4|m+)vgK*&Nu=uLXIO~%7&B^gp8r4;R? zDuh{>utEV7KoqEAD)U5`6W}Ula8F;6PiE07W)VG157#(#PAQe(WiIhvpo4cu$zuB9>S(L(AoWXgV#EG0w z>6^*foXa_!&uN^_IhD*Aoytj_(21SWX`Rz~mDQ=8*Xf{Y=Sh}tNt1RdkM&89_i6r*^BI=;`H%e>kpDT5ahaa(xt{VVm-M-xW~rcP$)IZK zplk`DZi%4$DWP>~p?8U)_Nk%x$)Wm5p$iJ44Jx7!N}>^Jq7zD>2dbiT>7oAVq5uk` z0vezSNuvyDqYf#fHL9aG%A+}oq8AFJ87ib3N~9fXq#w$n35ujI%A_&sq%-QH6e*=P ziK9~rr8|nHJ*uTYs-zXlrB~{uAu6ULN~R@hrYDM~DcYVZ%BC#}rd3L%IH{&VN~c3= zr$vgVM_Ng!22OwZgMC?l-E^mJx}Any0V2r?HBtt!k*V%BZ*MsJRNM zr5dKYDyqLqs=;ciwW_GY>Z`>{smW@o%ZjPZs;SS)sRrt*(Tb|os;bj!tJeyv+bXNw zN~_swtlx^OuMx|y6YH#_vvvDC`4CkwL(YqJWAvkWV<0IRbh>$4*Zv?WWk>e{PC z+pZ1Sr=|9%{_vBRF0_}&2nHL!OSV?)wP*{sZL0-VJGOEQwrX3od&{?O`?Yi1w}RUF7eEFUAToD=26qs;P;!Q(3ju2A1A%Y` zt*a$76NiQ{C3Yw#bO;GPfQLMzhlfiN0PwrO8@#_;0sx?dH~;`7P`phT1jsuA${R6C z5HZaw0svq!Q}DYOFuffB02!k(zk3DR3jmz^1-}cr;R^x3dk5)j2NrO?=nDYv8zm1A zzJdUAyfG8LhyVaJ;{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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview.css deleted file mode 100644 index 3843d4bdb2..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/treeview.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -table.ygtvtable{margin-bottom:0;border:none;border-collapse:collapse;}td.ygtvcell{border:none;padding:0;}a.ygtvspacer{text-decoration:none;outline-style:none;display:block;}.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;cursor:pointer;}.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;cursor:pointer;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0 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;cursor:pointer;}.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;}* 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:18px;}.ygtvfocus{background-color:#c0e0e0;border:none;}.ygtvfocus .ygtvlabel,.ygtvfocus .ygtvlabel:link,.ygtvfocus .ygtvlabel:visited,.ygtvfocus .ygtvlabel:hover{background-color:#c0e0e0;}.ygtvfocus 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;}.ygtv-highlight .ygtv-highlight1,.ygtv-highlight .ygtv-highlight1 .ygtvlabel{background-color:blue;color:white;}.ygtv-highlight .ygtv-highlight2,.ygtv-highlight .ygtv-highlight2 .ygtvlabel{background-color:silver;}.ygtv-highlight .ygtv-highlight0 .ygtvfocus .ygtvlabel,.ygtv-highlight .ygtv-highlight1 .ygtvfocus .ygtvlabel,.ygtv-highlight .ygtv-highlight2 .ygtvfocus .ygtvlabel{background-color:#c0e0e0;}.ygtv-highlight .ygtvcontent{padding-right:1em;}.ygtv-checkbox .ygtv-highlight0 .ygtvcontent{padding-left:1em;background:url(check0.gif) no-repeat;}.ygtv-checkbox .ygtv-highlight0 .ygtvfocus.ygtvcontent,.ygtv-checkbox .ygtv-highlight1 .ygtvfocus.ygtvcontent,.ygtv-checkbox .ygtv-highlight2 .ygtvfocus.ygtvcontent{background-color:#c0e0e0;}.ygtv-checkbox .ygtv-highlight1 .ygtvcontent{padding-left:1em;background:url(check1.gif) no-repeat;}.ygtv-checkbox .ygtv-highlight2 .ygtvcontent{padding-left:1em;background:url(check2.gif) no-repeat;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/wait.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/assets/skins/sam/wait.gif deleted file mode 100644 index 471c1a4f93f2cabf0b3a85c3ff8e0a8aadefc548..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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;HAX0@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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/callt.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/callt.gif deleted file mode 100644 index a6cc8da5b221d372ea075b3a4a10211d3a23cb51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 93 zcmZ?wbhEHb|1*Gr;!hSv1_o9J9S{$smVsF* qV%6o-OdT896eo&R8_GI9Z+s-tb-65V<*lvjzBf272=!xPum%9G>mWw} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calrt.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calrt.gif deleted file mode 100644 index ee137b2ff769d99132234b67f1e528daf65cb397..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 94 zcmZ?wbhEHb|1*Gr;!hSv1_o9J9S{$smVsG0 rV)Ip7rjCbGR9fsBH@3+N1|(QayL)o!6Ro<}FL)f+p7oi^z+epk(%c}| diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calx.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/calx.gif deleted file mode 100644 index 27e7bc36e4524623db3c43f4d86717a703f37406..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 88 zcmZ?wbhEHb6lCCKn8?J?-rj!k;>G{}|1&T!DE?$&WME)o&;ha;K=KSsnmzrMhu-GT qE4kQMmbu}I7_0#*o**Fr diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar-skin.css deleted file mode 100644 index f659c32640..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar-skin.css +++ /dev/null @@ -1,361 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * 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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar.css deleted file mode 100644 index b72d26289b..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/assets/skins/sam/calendar.css +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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:0;top:0;}.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 #ccc;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 #ccc;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:#06c;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:#ccc;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:#cf9;}.yui-skin-sam .yui-calendar td.calcell.highlight2{background-color:#9cf;}.yui-skin-sam .yui-calendar td.calcell.highlight3{background-color:#fcc;}.yui-skin-sam .yui-calendar td.calcell.highlight4{background-color:#cf9;}.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:.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/calendar-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/calendar-debug.js deleted file mode 100644 index 5015844921..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/calendar/calendar-debug.js +++ /dev/null @@ -1,7324 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(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; - - // Clear out queue entry, to avoid it being - // re-added to the queue by any queueProperty/supercedes - // calls which are invoked during fireEvent - this.eventQueue[i] = null; - - 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} overrideContext 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, overrideContext) { - - var property = this.config[key.toLowerCase()]; - - if (property && property.event) { - if (!Config.alreadySubscribed(property.event, handler, obj)) { - property.event.subscribe(handler, obj, overrideContext); - } - 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); - -}()); -/** -* The datemath module provides utility methods for basic JavaScript Date object manipulation and -* comparison. -* -* @module datemath -*/ - -/** -* 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(); - - // 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. -* -*

-* NOTE: This property is made public in order to allow users to change -* the default values of configuration properties. Users should not -* modify the key string, unless they are overriding the Calendar implementation -*

-* -*

-* The property is an object with key/value pairs, the key being the -* uppercase configuration property name and the value being an object -* literal with a key string property, and a value property, specifying the -* default value of the property. To override a default value, you can set -* the value property, for example, YAHOO.widget.Calendar.DEFAULT_CONFIG.MULTI_SELECT.value = true; -* -* @property YAHOO.widget.Calendar.DEFAULT_CONFIG -* @static -* @type Object -*/ - -Calendar.DEFAULT_CONFIG = { - YEAR_OFFSET : {key:"year_offset", value:0, supercedes:["pagedate", "selected", "mindate","maxdate"]}, - TODAY : {key:"today", value:new Date(), supercedes:["pagedate"]}, - PAGEDATE : {key:"pagedate", value:null}, - SELECTED : {key:"selected", value:[]}, - 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"] - } -}; - -/** -* The set of default Config property keys and values for the Calendar -* @property YAHOO.widget.Calendar._DEFAULT_CONFIG -* @deprecated Made public. See the public DEFAULT_CONFIG property for details -* @final -* @static -* @private -* @type Object -*/ -Calendar._DEFAULT_CONFIG = Calendar.DEFAULT_CONFIG; - -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 -* @static -* @type Object An object with name/value pairs for the class name identifier/value. -*/ -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", - CSS_WITH_TITLE: "withtitle", - CSS_FIXED_SIZE: "fixedsize", - CSS_LINK_CLOSE: "link-close" -}; - -/** -* The set of default style constants for the Calendar -* @property YAHOO.widget.Calendar._STYLES -* @deprecated Made public. See the public STYLES property for details -* @final -* @static -* @private -* @type Object -*/ -Calendar._STYLES = Calendar.STYLES; - -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. - * @deprecated Use the "today" configuration property - * @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(); - - /** - * 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(); - - this.today = this.cfg.getProperty("today"); - }, - - /** - * 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, this.Style.CSS_FIXED_SIZE); - } - - 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 date selection is made - * @event beforeSelectEvent - */ - cal.beforeSelectEvent = new CE(defEvents.BEFORE_SELECT); - - /** - * Fired when a date 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 date or set of dates is deselected - * @event beforeDeselectEvent - */ - cal.beforeDeselectEvent = new CE(defEvents.BEFORE_DESELECT); - - /** - * Fired when a date or set of dates is deselected - * @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 - * @param {Date} prevDate The date before the page was changed - * @param {Date} newDate The date after the page was changed - */ - 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 (ex) { - // 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 (ex) { - // 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 date to use to represent "Today". - * - * @config today - * @type Date - * @default The client side date (new Date()) when the Calendar is instantiated. - */ - cfg.addProperty(DEF_CFG.TODAY.key, { value: new Date(DEF_CFG.TODAY.value.getTime()), supercedes:DEF_CFG.TODAY.supercedes, handler:this.configToday, suppressEvent:true } ); - - /** - * 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: DEF_CFG.PAGEDATE.value || new Date(DEF_CFG.TODAY.value.getTime()), 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:DEF_CFG.SELECTED.value.concat(), 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 positive or negative year offset from the Gregorian calendar year (assuming a January 1st rollover) to - * be used when displaying and parsing dates. NOTE: All JS Date objects returned by methods, or expected as input by - * methods will always represent the Gregorian year, in order to maintain date/month/week values. - * - * @config YEAR_OFFSET - * @type Number - * @default 0 - */ - cfg.addProperty(DEF_CFG.YEAR_OFFSET.key, { value:DEF_CFG.YEAR_OFFSET.value, supercedes:DEF_CFG.YEAR_OFFSET.supercedes, handler:this.configLocale } ); - - /** - * 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 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 "today" property - * @method configToday - */ - configToday : function(type, args, obj) { - // Only do this for initial set. Changing the today property after the initial - // set, doesn't affect pagedate - var val = args[0]; - if (Lang.isString(val)) { - val = this._parseDate(val); - } - var today = DateMath.clearTime(val); - if (!this.cfg.initialConfig[DEF_CFG.PAGEDATE.key]) { - this.cfg.setProperty(DEF_CFG.PAGEDATE.key, today); - } - this.today = today; - this.cfg.setProperty(DEF_CFG.TODAY.key, today, true); - }, - - /** - * 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, - /** - * @property Style.CSS_WITH_TITLE - */ - CSS_WITH_TITLE : defStyle.CSS_WITH_TITLE, - /** - * @property Style.CSS_FIXED_SIZE - */ - CSS_FIXED_SIZE : defStyle.CSS_FIXED_SIZE, - /** - * @property Style.CSS_LINK_CLOSE - */ - CSS_LINK_CLOSE : defStyle.CSS_LINK_CLOSE - }; - }, - - /** - * 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.YEAR_OFFSET) + 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, this.Style.CSS_WITH_TITLE); - - 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, this.Style.CSS_WITH_TITLE); - }, - - /** - * 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, - cssLinkClose = this.Style.CSS_LINK_CLOSE, - DEPR_CLOSE_PATH = "us/my/bn/x_d.gif", - - lnk = Dom.getElementsByClassName(cssLinkClose, "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 = cssLinkClose; - - 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(this.Style.CSS_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), - yearOffset = this.Locale.YEAR_OFFSET; - - 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() + yearOffset + "-" + (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() + yearOffset + "-" + (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 = Dom.getElementsByClassName(this.Style.CSS_CELL, "td", this.id); - - 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() + cal.Locale.YEAR_OFFSET); - 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, - - prevDate = this.cfg.getProperty(cfgPageDate), - newDate = DateMath.add(prevDate, DateMath.MONTH, count); - - this.cfg.setProperty(cfgPageDate, newDate); - this.resetRenderers(); - this.changePageEvent.fire(prevDate, newDate); - }, - - /** - * 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) { - this.addMonths(-1*count); - }, - - /** - * 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, - - prevDate = this.cfg.getProperty(cfgPageDate), - newDate = DateMath.add(prevDate, DateMath.YEAR, count); - - this.cfg.setProperty(cfgPageDate, newDate); - this.resetRenderers(); - this.changePageEvent.fire(prevDate, newDate); - }, - - /** - * 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) { - this.addYears(-1*count); - }, - - /** - * 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.addMonths(-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.addYears(-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) - this.Locale.YEAR_OFFSET; - - 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] - this.Locale.YEAR_OFFSET, 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. -* -*

-* NOTE: This property is made public in order to allow users to change -* the default values of configuration properties. Users should not -* modify the key string, unless they are overriding the Calendar implementation -*

-* -* @property YAHOO.widget.CalendarGroup.DEFAULT_CONFIG -* @static -* @type Object An object with key/value pairs, the key being the -* uppercase configuration property name and the value being an objec -* literal with a key string property, and a value property, specifying the -* default value of the property -*/ - -/** -* The set of default Config property keys and values for the CalendarGroup -* @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG -* @deprecated Made public. See the public DEFAULT_CONFIG property for details -* @private -* @static -* @type Object -*/ -CalendarGroup.DEFAULT_CONFIG = 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 positive or negative year offset from the Gregorian calendar year (assuming a January 1st rollover) to - * be used when displaying or parsing dates. NOTE: All JS Date objects returned by methods, or expected as input by - * methods will always represent the Gregorian year, in order to maintain date/month/week values. - * - * @config year_offset - * @type Number - * @default 0 - */ - cfg.addProperty(DEF_CFG.YEAR_OFFSET.key, { value:DEF_CFG.YEAR_OFFSET.value, handler: this.delegateConfig, supercedes:DEF_CFG.YEAR_OFFSET.supercedes, suppressEvent:true } ); - - /** - * The date to use to represent "Today". - * - * @config today - * @type Date - * @default Today's date - */ - cfg.addProperty(DEF_CFG.TODAY.key, { value: new Date(DEF_CFG.TODAY.value.getTime()), supercedes:DEF_CFG.TODAY.supercedes, handler: this.configToday, suppressEvent:false } ); - - /** - * 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: DEF_CFG.PAGEDATE.value || new Date(DEF_CFG.TODAY.value.getTime()), 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
    /gi, "
      "); - html = html.replace(/
        /gi, "
          "); - return html; - }, - /** - * @method filter_safari - * @param String html The HTML string to filter - * @description Filters strings specific to Safari - * @return String - */ - filter_safari: function(html) { - if (this.browser.webkit) { - // - html = html.replace(/([^>])<\/span>/gi, '    '); - html = html.replace(/Apple-style-span/gi, ''); - html = html.replace(/style="line-height: normal;"/gi, ''); - html = html.replace(/yui-wk-div/gi, ''); - html = html.replace(/yui-wk-p/gi, ''); - - - //Remove bogus LI's - html = html.replace(/
        • <\/li>/gi, ''); - html = html.replace(/
        • <\/li>/gi, ''); - html = html.replace(/
        • <\/li>/gi, ''); - //Remove bogus DIV's - updated from just removing the div's to replacing /div with a break - if (this.get('ptags')) { - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/div>/gi, '

          '); - } else { - //html = html.replace(/
          /gi, '
          '); - html = html.replace(/]*)>([ tnr]*)<\/div>/gi, '
          '); - html = html.replace(/<\/div>/gi, ''); - } - } - return html; - }, - /** - * @method filter_internals - * @param String html The HTML string to filter - * @description Filters internal RTE strings and bogus attrs we don't want - * @return String - */ - filter_internals: function(html) { - html = html.replace(/\r/g, ''); - //Fix stuff we don't want - html = html.replace(/<\/?(body|head|html)[^>]*>/gi, ''); - //Fix last BR in LI - html = html.replace(/<\/li>/gi, '
        • '); - - html = html.replace(/yui-tag-span/gi, ''); - html = html.replace(/yui-tag/gi, ''); - html = html.replace(/yui-non/gi, ''); - html = html.replace(/yui-img/gi, ''); - html = html.replace(/ tag="span"/gi, ''); - html = html.replace(/ class=""/gi, ''); - html = html.replace(/ style=""/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ target=""/gi, ''); - html = html.replace(/ title=""/gi, ''); - - if (this.browser.ie) { - html = html.replace(/ class= /gi, ''); - html = html.replace(/ class= >/gi, ''); - } - - return html; - }, - /** - * @method filter_all_rgb - * @param String str The HTML string to filter - * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00" - * @return String - */ - filter_all_rgb: function(str) { - var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi"); - var arr = str.match(exp); - if (Lang.isArray(arr)) { - for (var i = 0; i < arr.length; i++) { - var color = this.filter_rgb(arr[i]); - str = str.replace(arr[i].toString(), color); - } - } - - return str; - }, - /** - * @method filter_rgb - * @param String css The CSS string containing rgb(#,#,#); - * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00 - * @return String - */ - filter_rgb: function(css) { - if (css.toLowerCase().indexOf('rgb') != -1) { - var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"); - var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(','); - - if (rgb.length == 5) { - var r = parseInt(rgb[1], 10).toString(16); - var g = parseInt(rgb[2], 10).toString(16); - var b = parseInt(rgb[3], 10).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - css = "#" + r + g + b; - } - } - return css; - }, - /** - * @method pre_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - pre_filter_linebreaks: function(html, markup) { - if (this.browser.webkit) { - html = html.replace(/
          /gi, ''); - html = html.replace(/
          /gi, ''); - } - html = html.replace(/
          /gi, ''); - html = html.replace(/
          /gi, ''); - html = html.replace(//gi, ''); - html = html.replace(/
          /gi, ''); - html = html.replace(/
          <\/div>/gi, ''); - html = html.replace(/

          ( | )<\/p>/g, ''); - html = html.replace(/


           <\/p>/gi, ''); - html = html.replace(/

           <\/p>/gi, ''); - //Fix last BR - html = html.replace(/$/, ''); - //Fix last BR in P - html = html.replace(/<\/p>/g, '

          '); - if (this.browser.ie) { - html = html.replace(/    /g, '\t'); - } - return html; - }, - /** - * @method post_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - post_filter_linebreaks: function(html, markup) { - if (markup == 'xhtml') { - html = html.replace(//g, '
          '); - } else { - html = html.replace(//g, '
          '); - } - return html; - }, - /** - * @method clearEditorDoc - * @description Clear the doc of the Editor - */ - clearEditorDoc: function() { - this._getDoc().body.innerHTML = ' '; - }, - /** - * @method openWindow - * @description Override Method for Advanced Editor - */ - openWindow: function(win) { - }, - /** - * @method moveWindow - * @description Override Method for Advanced Editor - */ - moveWindow: function() { - }, - /** - * @private - * @method _closeWindow - * @description Override Method for Advanced Editor - */ - _closeWindow: function() { - }, - /** - * @method closeWindow - * @description Override Method for Advanced Editor - */ - closeWindow: function() { - //this.unsubscribeAll('afterExecCommand'); - this.toolbar.resetAllButtons(); - this.focus(); - }, - /** - * @method destroy - * @description Destroys the editor, all of it's elements and objects. - * @return {Boolean} - */ - destroy: function() { - if (this._nodeChangeDelayTimer) { - clearTimeout(this._nodeChangeDelayTimer); - } - this.hide(); - - YAHOO.log('Destroying Editor', 'warn', 'SimpleEditor'); - if (this.resize) { - YAHOO.log('Destroying Resize', 'warn', 'SimpleEditor'); - this.resize.destroy(); - } - if (this.dd) { - YAHOO.log('Unreg DragDrop Instance', 'warn', 'SimpleEditor'); - this.dd.unreg(); - } - if (this.get('panel')) { - YAHOO.log('Destroying Editor Panel', 'warn', 'SimpleEditor'); - this.get('panel').destroy(); - } - this.saveHTML(); - this.toolbar.destroy(); - YAHOO.log('Restoring TextArea', 'info', 'SimpleEditor'); - this.setStyle('visibility', 'visible'); - this.setStyle('position', 'static'); - this.setStyle('top', ''); - this.setStyle('left', ''); - var textArea = this.get('element'); - this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element')); - this.get('element_cont').get('element').innerHTML = ''; - this.set('handleSubmit', false); //Remove the submit handler - return true; - }, - /** - * @method toString - * @description Returns a string representing the editor. - * @return {String} - */ - toString: function() { - var str = 'SimpleEditor'; - if (this.get && this.get('element_cont')) { - str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : '')); - } - return str; - } - }); - -/** -* @event toolbarLoaded -* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event cleanHTML -* @description Event is fired after the cleanHTML method is called. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterRender -* @description Event is fired after the render process finishes. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorContentLoaded -* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeNodeChange -* @description Event fires at the beginning of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterNodeChange -* @description Event fires at the end of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeExecCommand -* @description Event fires at the beginning of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterExecCommand -* @description Event fires at the end of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ - -/** -* @event editorWindowFocus -* @description Fires when the iframe is focused. Note, this is window focus event, not an Editor focus event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorWindowBlur -* @description Fires when the iframe is blurred. Note, this is window blur event, not an Editor blur event. -* @type YAHOO.util.CustomEvent -*/ - - -/** - * @description Singleton object used to track the open window objects and panels across the various open editors - * @class EditorInfo - * @static -*/ -YAHOO.widget.EditorInfo = { - /** - * @private - * @property _instances - * @description A reference to all editors on the page. - * @type Object - */ - _instances: {}, - /** - * @private - * @property blankImage - * @description A reference to the blankImage url - * @type String - */ - blankImage: '', - /** - * @private - * @property window - * @description A reference to the currently open window object in any editor on the page. - * @type Object YAHOO.widget.EditorWindow - */ - window: {}, - /** - * @private - * @property panel - * @description A reference to the currently open panel in any editor on the page. - * @type Object YAHOO.widget.Overlay - */ - panel: null, - /** - * @method getEditorById - * @description Returns a reference to the Editor object associated with the given textarea - * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of - * @return Object YAHOO.widget.Editor - */ - getEditorById: function(id) { - if (!YAHOO.lang.isString(id)) { - //Not a string, assume a node Reference - id = id.id; - } - if (this._instances[id]) { - return this._instances[id]; - } - return false; - }, - /** - * @method saveAll - * @description Saves all Editor instances on the page. If a form reference is passed, only Editor's bound to this form will be saved. - * @param {HTMLElement} form The form to check if this Editor instance belongs to - */ - saveAll: function(form) { - var i, e, items = YAHOO.widget.EditorInfo._instances; - if (form) { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - e = items[i]; - if (e.get('element').form && (e.get('element').form == form)) { - e.saveHTML(); - } - } - } - } else { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - items[i].saveHTML(); - } - } - } - }, - /** - * @method toString - * @description Returns a string representing the EditorInfo. - * @return {String} - */ - toString: function() { - var len = 0; - for (var i in this._instances) { - if (Lang.hasOwnProperty(this._instances, i)) { - len++; - } - } - return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')'; - } -}; - - - - -})(); -/** - * @module editor - * @description

          The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.

          - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, container_core, simpleeditor - * @optional dragdrop, animation, menu, button, resize - */ - -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang, - Toolbar = YAHOO.widget.Toolbar; - - /** - * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization. - * @constructor - * @class Editor - * @extends YAHOO.widget.SimpleEditor - * @param {String/HTMLElement} el The textarea element to turn into an editor. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.Editor = function(el, attrs) { - YAHOO.log('Editor Initalizing', 'info', 'Editor'); - YAHOO.widget.Editor.superclass.constructor.call(this, el, attrs); - }; - - YAHOO.extend(YAHOO.widget.Editor, YAHOO.widget.SimpleEditor, { - /** - * @private - * @property _undoCache - * @description An Array hash of the Undo Levels. - * @type Array - */ - _undoCache: null, - /** - * @private - * @property _undoLevel - * @description The index of the current undo state. - * @type Number - */ - _undoLevel: null, - /** - * @private - * @method _hasUndoLevel - * @description Checks to see if we have an undo level available - * @return Boolean - */ - _hasUndoLevel: function() { - return ((this._undoCache.length > 1) && this._undoLevel); - }, - /** - * @private - * @method _undoNodeChange - * @description nodeChange listener for undo processing - */ - _undoNodeChange: function() { - var undo_button = this.toolbar.getButtonByValue('undo'), - redo_button = this.toolbar.getButtonByValue('redo'); - if (undo_button && redo_button) { - if (this._hasUndoLevel()) { - this.toolbar.enableButton(undo_button); - } - if (this._undoLevel < this._undoCache.length) { - this.toolbar.enableButton(redo_button); - } - } - this._lastCommand = null; - }, - /** - * @private - * @method _checkUndo - * @description Prunes the undo cache when it reaches the maxUndo config - */ - _checkUndo: function() { - var len = this._undoCache.length, - tmp = []; - if (len >= this.get('maxUndo')) { - //YAHOO.log('Undo cache too large (' + len + '), pruning..', 'info', 'SimpleEditor'); - for (var i = (len - this.get('maxUndo')); i < len; i++) { - tmp.push(this._undoCache[i]); - } - this._undoCache = tmp; - } - }, - /** - * @private - * @method _putUndo - * @description Puts the content of the Editor into the _undoCache. - * //TODO Convert the hash to a series of TEXTAREAS to store state in. - * @param {String} str The content of the Editor - */ - _putUndo: function(str) { - if (this._undoLevel === this._undoCache.length) { - this._undoCache.push(str); - this._undoLevel = this._undoCache.length; - } else { - var str = this.getEditorHTML(); - var last = this._undoCache[this._undoLevel]; - if (last) { - if (str !== last) { - this._undoCache = []; - this._undoLevel = 0; - } - } - } - }, - /** - * @private - * @method _getUndo - * @description Get's a level from the undo cache. - * @param {Number} index The index of the undo level we want to get. - * @return {String} - */ - _getUndo: function(index) { - this._undoLevel = index; - return this._undoCache[index]; - }, - /** - * @private - * @method _storeUndo - * @description Method to call when you want to store an undo state. Currently called from nodeChange and _handleKeyUp - */ - _storeUndo: function() { - if (this._lastCommand === 'undo' || this._lastCommand === 'redo') { - return false; - } - if (!this._undoCache) { - this._undoCache = []; - this._undoLevel = 0; - } - this._checkUndo(); - var str = this.getEditorHTML(); - //var last = this._undoCache[this._undoCache.length - 1]; - var last = this._undoCache[this._undoLevel - 1]; - if (last) { - if (str !== last) { - //YAHOO.log('Storing Undo', 'info', 'SimpleEditor'); - this._putUndo(str); - } - } else { - //YAHOO.log('Storing Undo', 'info', 'SimpleEditor'); - this._putUndo(str); - } - this._undoNodeChange(); - }, - /** - * @property STR_BEFORE_EDITOR - * @description The accessibility string for the element before the iFrame - * @type String - */ - STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names.

          Common formatting keyboard shortcuts:

          • Control Shift B sets text to bold
          • Control Shift I sets text to italic
          • Control Shift U underlines text
          • Control Shift [ aligns text left
          • Control Shift | centers text
          • Control Shift ] aligns text right
          • Control Shift L adds an HTML link
          • To exit this text editor use the keyboard shortcut Control + Shift + ESC.
          ', - /** - * @property STR_CLOSE_WINDOW - * @description The Title of the close button in the Editor Window - * @type String - */ - STR_CLOSE_WINDOW: 'Close Window', - /** - * @property STR_CLOSE_WINDOW_NOTE - * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window - * @type String - */ - STR_CLOSE_WINDOW_NOTE: 'To close this window use the Control + Shift + W key', - /** - * @property STR_IMAGE_PROP_TITLE - * @description The title for the Image Property Editor Window - * @type String - */ - STR_IMAGE_PROP_TITLE: 'Image Options', - /** - * @property STR_IMAGE_TITLE - * @description The label string for Image Description - * @type String - */ - STR_IMAGE_TITLE: 'Description', - /** - * @property STR_IMAGE_SIZE - * @description The label string for Image Size - * @type String - */ - STR_IMAGE_SIZE: 'Size', - /** - * @property STR_IMAGE_ORIG_SIZE - * @description The label string for Original Image Size - * @type String - */ - STR_IMAGE_ORIG_SIZE: 'Original Size', - /** - * @property STR_IMAGE_COPY - * @description The label string for the image copy and paste message for Opera and Safari - * @type String - */ - STR_IMAGE_COPY: 'Note:To move this image just highlight it, cut, and paste where ever you\'d like.', - /** - * @property STR_IMAGE_PADDING - * @description The label string for the image padding. - * @type String - */ - STR_IMAGE_PADDING: 'Padding', - /** - * @property STR_IMAGE_BORDER - * @description The label string for the image border. - * @type String - */ - STR_IMAGE_BORDER: 'Border', - /** - * @property STR_IMAGE_BORDER_SIZE - * @description The label string for the image border size. - * @type String - */ - STR_IMAGE_BORDER_SIZE: 'Border Size', - /** - * @property STR_IMAGE_BORDER_TYPE - * @description The label string for the image border type. - * @type String - */ - STR_IMAGE_BORDER_TYPE: 'Border Type', - /** - * @property STR_IMAGE_TEXTFLOW - * @description The label string for the image text flow. - * @type String - */ - STR_IMAGE_TEXTFLOW: 'Text Flow', - /** - * @property STR_LOCAL_FILE_WARNING - * @description The label string for the local file warning. - * @type String - */ - STR_LOCAL_FILE_WARNING: 'Note:This image/link points to a file on your computer and will not be accessible to others on the internet.', - /** - * @property STR_LINK_PROP_TITLE - * @description The label string for the Link Property Editor Window. - * @type String - */ - STR_LINK_PROP_TITLE: 'Link Options', - /** - * @property STR_LINK_PROP_REMOVE - * @description The label string for the Remove link from text link inside the property editor. - * @type String - */ - STR_LINK_PROP_REMOVE: 'Remove link from text', - /** - * @property STR_LINK_NEW_WINDOW - * @description The string for the open in a new window label. - * @type String - */ - STR_LINK_NEW_WINDOW: 'Open in a new window.', - /** - * @property STR_LINK_TITLE - * @description The string for the link description. - * @type String - */ - STR_LINK_TITLE: 'Description', - /** - * @property STR_NONE - * @description The string for the word none. - * @type String - */ - STR_NONE: 'none', - /** - * @protected - * @property CLASS_LOCAL_FILE - * @description CSS class applied to an element when it's found to have a local url. - * @type String - */ - CLASS_LOCAL_FILE: 'warning-localfile', - /** - * @protected - * @property CLASS_HIDDEN - * @description CSS class applied to the body when the hiddenelements button is pressed. - * @type String - */ - CLASS_HIDDEN: 'yui-hidden', - /** - * @method init - * @description The Editor class' initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.log('init', 'info', 'Editor'); - - this._windows = {}; - if (!this._defaultToolbar) { - this._defaultToolbar = { - collapse: true, - titlebar: 'Text Editing Tools', - draggable: false, - buttonType: 'advanced', - buttons: [ - { group: 'fontstyle', label: 'Font Name and Size', - buttons: [ - { type: 'select', label: 'Arial', value: 'fontname', disabled: true, - menu: [ - { text: 'Arial', checked: true }, - { text: 'Arial Black' }, - { text: 'Comic Sans MS' }, - { text: 'Courier New' }, - { text: 'Lucida Console' }, - { text: 'Tahoma' }, - { text: 'Times New Roman' }, - { text: 'Trebuchet MS' }, - { text: 'Verdana' } - ] - }, - { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true } - ] - }, - { type: 'separator' }, - { group: 'textstyle', label: 'Font Style', - buttons: [ - { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' }, - { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' }, - { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' }, - { type: 'separator' }, - { type: 'push', label: 'Subscript', value: 'subscript', disabled: true }, - { type: 'push', label: 'Superscript', value: 'superscript', disabled: true } - ] - }, - { type: 'separator' }, - { group: 'textstyle2', label: ' ', - buttons: [ - { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true }, - { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true }, - { type: 'separator' }, - { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true }, - { type: 'push', label: 'Show/Hide Hidden Elements', value: 'hiddenelements' } - ] - }, - { type: 'separator' }, - { group: 'undoredo', label: 'Undo/Redo', - buttons: [ - { type: 'push', label: 'Undo', value: 'undo', disabled: true }, - { type: 'push', label: 'Redo', value: 'redo', disabled: true } - - ] - }, - { type: 'separator' }, - { group: 'alignment', label: 'Alignment', - buttons: [ - { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' }, - { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' }, - { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' }, - { type: 'push', label: 'Justify', value: 'justifyfull' } - ] - }, - { type: 'separator' }, - { group: 'parastyle', label: 'Paragraph Style', - buttons: [ - { type: 'select', label: 'Normal', value: 'heading', disabled: true, - menu: [ - { text: 'Normal', value: 'none', checked: true }, - { text: 'Header 1', value: 'h1' }, - { text: 'Header 2', value: 'h2' }, - { text: 'Header 3', value: 'h3' }, - { text: 'Header 4', value: 'h4' }, - { text: 'Header 5', value: 'h5' }, - { text: 'Header 6', value: 'h6' } - ] - } - ] - }, - { type: 'separator' }, - - { group: 'indentlist2', label: 'Indenting and Lists', - buttons: [ - { type: 'push', label: 'Indent', value: 'indent', disabled: true }, - { type: 'push', label: 'Outdent', value: 'outdent', disabled: true }, - { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' }, - { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' } - ] - }, - { type: 'separator' }, - { group: 'insertitem', label: 'Insert Item', - buttons: [ - { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true }, - { type: 'push', label: 'Insert Image', value: 'insertimage' } - ] - } - ] - }; - } - - if (!this._defaultImageToolbarConfig) { - this._defaultImageToolbarConfig = { - buttonType: this._defaultToolbar.buttonType, - buttons: [ - { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':', - buttons: [ - { type: 'push', label: 'Left', value: 'left' }, - { type: 'push', label: 'Inline', value: 'inline' }, - { type: 'push', label: 'Block', value: 'block' }, - { type: 'push', label: 'Right', value: 'right' } - ] - }, - { type: 'separator' }, - { group: 'padding', label: this.STR_IMAGE_PADDING + ':', - buttons: [ - { type: 'spin', label: '0', value: 'padding', range: [0, 50] } - ] - }, - { type: 'separator' }, - { group: 'border', label: this.STR_IMAGE_BORDER + ':', - buttons: [ - { type: 'select', label: this.STR_IMAGE_BORDER_SIZE, value: 'bordersize', - menu: [ - { text: 'none', value: '0', checked: true }, - { text: '1px', value: '1' }, - { text: '2px', value: '2' }, - { text: '3px', value: '3' }, - { text: '4px', value: '4' }, - { text: '5px', value: '5' } - ] - }, - { type: 'select', label: this.STR_IMAGE_BORDER_TYPE, value: 'bordertype', disabled: true, - menu: [ - { text: 'Solid', value: 'solid', checked: true }, - { text: 'Dashed', value: 'dashed' }, - { text: 'Dotted', value: 'dotted' } - ] - }, - { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true } - ] - } - ] - }; - } - - YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes); - }, - _render: function() { - YAHOO.widget.Editor.superclass._render.apply(this, arguments); - var self = this; - //Render the panel in another thread and delay it a little.. - window.setTimeout(function() { - self._renderPanel.call(self); - }, 800); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the editor. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the editor. - */ - initAttributes: function(attr) { - YAHOO.widget.Editor.superclass.initAttributes.call(this, attr); - - /** - * @attribute localFileWarning - * @description Should we throw the warning if we detect a file that is local to their machine? - * @default true - * @type Boolean - */ - this.setAttributeConfig('localFileWarning', { - value: attr.locaFileWarning || true - }); - - /** - * @attribute hiddencss - * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in this.CLASS_HIDDEN - * @default
          -            .yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u,
          -            .yui-hidden div, .yui-hidden p, .yui-hidden span, .yui-hidden img, .yui-hidden ul, .yui-hidden ol,
          -            .yui-hidden li, .yui-hidden table {
          -                border: 1px dotted #ccc;
          -            }
          -            .yui-hidden .yui-non {
          -                border: none;
          -            }
          -            .yui-hidden img {
          -                padding: 2px;
          -            }
          - * @type String - */ - this.setAttributeConfig('hiddencss', { - value: attr.hiddencss || '.yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div,.yui-hidden p,.yui-hidden span,.yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table { border: 1px dotted #ccc; } .yui-hidden .yui-non { border: none; } .yui-hidden img { padding: 2px; }', - writeOnce: true - }); - - }, - /** - * @private - * @method _windows - * @description A reference to the HTML elements used for the body of Editor Windows. - */ - _windows: null, - /** - * @private - * @method _defaultImageToolbar - * @description A reference to the Toolbar Object inside Image Editor Window. - */ - _defaultImageToolbar: null, - /** - * @private - * @method _defaultImageToolbarConfig - * @description Config to be used for the default Image Editor Window. - */ - _defaultImageToolbarConfig: null, - /** - * @private - * @method _fixNodes - * @description Fix href and imgs as well as remove invalid HTML. - */ - _fixNodes: function() { - YAHOO.widget.Editor.superclass._fixNodes.call(this); - try { - var url = ''; - - var imgs = this._getDoc().getElementsByTagName('img'); - for (var im = 0; im < imgs.length; im++) { - if (imgs[im].getAttribute('href', 2)) { - url = imgs[im].getAttribute('src', 2); - if (this._isLocalFile(url)) { - Dom.addClass(imgs[im], this.CLASS_LOCAL_FILE); - } else { - Dom.removeClass(imgs[im], this.CLASS_LOCAL_FILE); - } - } - } - var fakeAs = this._getDoc().body.getElementsByTagName('a'); - for (var a = 0; a < fakeAs.length; a++) { - if (fakeAs[a].getAttribute('href', 2)) { - url = fakeAs[a].getAttribute('href', 2); - if (this._isLocalFile(url)) { - Dom.addClass(fakeAs[a], this.CLASS_LOCAL_FILE); - } else { - Dom.removeClass(fakeAs[a], this.CLASS_LOCAL_FILE); - } - } - } - } catch(e) {} - }, - /** - * @private - * @property _disabled - * @description The Toolbar items that should be disabled if there is no selection present in the editor. - * @type Array - */ - _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent' ], - /** - * @private - * @property _alwaysDisabled - * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor. - * @type Object - */ - _alwaysDisabled: { 'outdent': true }, - /** - * @private - * @property _alwaysEnabled - * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor. - * @type Object - */ - _alwaysEnabled: { hiddenelements: true }, - /** - * @private - * @method _handleKeyDown - * @param {Event} ev The event we are working on. - * @description Override method that handles some new keydown events inside the iFrame document. - */ - _handleKeyDown: function(ev) { - YAHOO.widget.Editor.superclass._handleKeyDown.call(this, ev); - var doExec = false, - action = null, - exec = false; - - switch (ev.keyCode) { - //case 219: //Left - case this._keyMap.JUSTIFY_LEFT.key: //Left - if (this._checkKey(this._keyMap.JUSTIFY_LEFT, ev)) { - action = 'justifyleft'; - doExec = true; - } - break; - //case 220: //Center - case this._keyMap.JUSTIFY_CENTER.key: - if (this._checkKey(this._keyMap.JUSTIFY_CENTER, ev)) { - action = 'justifycenter'; - doExec = true; - } - break; - case 221: //Right - case this._keyMap.JUSTIFY_RIGHT.key: - if (this._checkKey(this._keyMap.JUSTIFY_RIGHT, ev)) { - action = 'justifyright'; - doExec = true; - } - break; - } - if (doExec && action) { - this.execCommand(action, null); - Event.stopEvent(ev); - this.nodeChange(); - } - }, - /** - * @private - * @method _renderCreateLinkWindow - * @description Pre renders the CreateLink window so we get faster window opening. - */ - _renderCreateLinkWindow: function() { - var str = ''; - str += ''; - str += ''; - - var body = document.createElement('div'); - body.innerHTML = str; - - var unlinkCont = document.createElement('div'); - unlinkCont.className = 'removeLink'; - var unlink = document.createElement('a'); - unlink.href = '#'; - unlink.innerHTML = this.STR_LINK_PROP_REMOVE; - unlink.title = this.STR_LINK_PROP_REMOVE; - Event.on(unlink, 'click', function(ev) { - Event.stopEvent(ev); - this.unsubscribeAll('afterExecCommand'); - this.execCommand('unlink'); - this.closeWindow(); - }, this, true); - unlinkCont.appendChild(unlink); - body.appendChild(unlinkCont); - - this._windows.createlink = {}; - this._windows.createlink.body = body; - //body.style.display = 'none'; - Event.on(body, 'keyup', function(e) { - Event.stopPropagation(e); - }); - this.get('panel').editor_form.appendChild(body); - this.fireEvent('windowCreateLinkRender', { type: 'windowCreateLinkRender', panel: this.get('panel'), body: body }); - return body; - }, - _handleCreateLinkClick: function() { - var el = this._getSelectedElement(); - if (this._isElement(el, 'img')) { - this.STOP_EXEC_COMMAND = true; - this.currentElement[0] = el; - this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - return false; - } - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'Editor'); - return false; - } - } - - this.on('afterExecCommand', function() { - var win = new YAHOO.widget.EditorWindow('createlink', { - width: '350px' - }); - - var el = this.currentElement[0], - url = '', - title = '', - target = '', - localFile = false; - if (el) { - win.el = el; - if (el.getAttribute('href', 2) !== null) { - url = el.getAttribute('href', 2); - if (this._isLocalFile(url)) { - //Local File throw Warning - YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor'); - win.setFooter(this.STR_LOCAL_FILE_WARNING); - localFile = true; - } else { - win.setFooter(' '); - } - } - if (el.getAttribute('title') !== null) { - title = el.getAttribute('title'); - } - if (el.getAttribute('target') !== null) { - target = el.getAttribute('target'); - } - } - var body = null; - if (this._windows.createlink && this._windows.createlink.body) { - body = this._windows.createlink.body; - } else { - body = this._renderCreateLinkWindow(); - } - - win.setHeader(this.STR_LINK_PROP_TITLE); - win.setBody(body); - - Event.purgeElement(this.get('id') + '_createlink_url'); - - Dom.get(this.get('id') + '_createlink_url').value = url; - Dom.get(this.get('id') + '_createlink_title').value = title; - Dom.get(this.get('id') + '_createlink_target').checked = ((target) ? true : false); - - - Event.onAvailable(this.get('id') + '_createlink_url', function() { - var id = this.get('id'); - window.setTimeout(function() { - try { - YAHOO.util.Dom.get(id + '_createlink_url').focus(); - } catch (e) {} - }, 50); - - if (this._isLocalFile(url)) { - //Local File throw Warning - Dom.addClass(this.get('id') + '_createlink_url', 'warning'); - YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else { - Dom.removeClass(this.get('id') + '_createlink_url', 'warning'); - this.get('panel').setFooter(' '); - } - Event.on(this.get('id') + '_createlink_url', 'blur', function() { - var url = Dom.get(this.get('id') + '_createlink_url'); - if (this._isLocalFile(url.value)) { - //Local File throw Warning - Dom.addClass(url, 'warning'); - YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else { - Dom.removeClass(url, 'warning'); - this.get('panel').setFooter(' '); - } - }, this, true); - }, this, true); - - this.openWindow(win); - - }); - }, - /** - * @private - * @method _handleCreateLinkWindowClose - * @description Handles the closing of the Link Properties Window. - */ - _handleCreateLinkWindowClose: function() { - - var url = Dom.get(this.get('id') + '_createlink_url'), - target = Dom.get(this.get('id') + '_createlink_target'), - title = Dom.get(this.get('id') + '_createlink_title'), - el = arguments[0].win.el, - a = el; - - if (url && url.value) { - var urlValue = url.value; - if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - //Found an @ sign, prefix with mailto: - urlValue = 'mailto:' + urlValue; - } else { - // :// not found adding - if (urlValue.substring(0, 1) != '#') { - urlValue = 'http:/'+'/' + urlValue; - } - - } - } - el.setAttribute('href', urlValue); - if (target.checked) { - el.setAttribute('target', target.value); - } else { - el.setAttribute('target', ''); - } - el.setAttribute('title', ((title.value) ? title.value : '')); - - } else { - var _span = this._getDoc().createElement('span'); - _span.innerHTML = el.innerHTML; - Dom.addClass(_span, 'yui-non'); - el.parentNode.replaceChild(_span, el); - } - Dom.removeClass(url, 'warning'); - Dom.get(this.get('id') + '_createlink_url').value = ''; - Dom.get(this.get('id') + '_createlink_title').value = ''; - Dom.get(this.get('id') + '_createlink_target').checked = false; - this.nodeChange(); - this.currentElement = []; - - }, - /** - * @private - * @method _renderInsertImageWindow - * @description Pre renders the InsertImage window so we get faster window opening. - */ - _renderInsertImageWindow: function() { - var el = this.currentElement[0]; - var str = ''; - var body = document.createElement('div'); - body.innerHTML = str; - - var tbarCont = document.createElement('div'); - tbarCont.id = this.get('id') + '_img_toolbar'; - body.appendChild(tbarCont); - - var str2 = ''; - str2 += ''; - str2 += ''; - var div = document.createElement('div'); - div.innerHTML = str2; - body.appendChild(div); - - var o = {}; - Lang.augmentObject(o, this._defaultImageToolbarConfig); //Break the config reference - - var tbar = new YAHOO.widget.Toolbar(tbarCont, o); - tbar.editor_el = el; - this._defaultImageToolbar = tbar; - - var cont = tbar.get('cont'); - var hw = document.createElement('div'); - hw.className = 'yui-toolbar-group yui-toolbar-group-height-width height-width'; - hw.innerHTML = '

          ' + this.STR_IMAGE_SIZE + ':

          '; - hw.innerHTML += ' x '; - cont.insertBefore(hw, cont.firstChild); - - Event.onAvailable(this.get('id') + '_insertimage_width', function() { - Event.on(this.get('id') + '_insertimage_width', 'blur', function() { - var value = parseInt(Dom.get(this.get('id') + '_insertimage_width').value, 10); - if (value > 5) { - this._defaultImageToolbar.editor_el.style.width = value + 'px'; - //Removed moveWindow call so the window doesn't jump - //this.moveWindow(); - } - }, this, true); - }, this, true); - Event.onAvailable(this.get('id') + '_insertimage_height', function() { - Event.on(this.get('id') + '_insertimage_height', 'blur', function() { - var value = parseInt(Dom.get(this.get('id') + '_insertimage_height').value, 10); - if (value > 5) { - this._defaultImageToolbar.editor_el.style.height = value + 'px'; - //Removed moveWindow call so the window doesn't jump - //this.moveWindow(); - } - }, this, true); - }, this, true); - - - tbar.on('colorPickerClicked', function(o) { - var size = '1', type = 'solid', color = 'black', el = this._defaultImageToolbar.editor_el; - - if (el.style.borderLeftWidth) { - size = parseInt(el.style.borderLeftWidth, 10); - } - if (el.style.borderLeftStyle) { - type = el.style.borderLeftStyle; - } - if (el.style.borderLeftColor) { - color = el.style.borderLeftColor; - } - var borderString = size + 'px ' + type + ' #' + o.color; - el.style.border = borderString; - }, this, true); - - tbar.on('buttonClick', function(o) { - var value = o.button.value, - el = this._defaultImageToolbar.editor_el, - borderString = ''; - if (o.button.menucmd) { - value = o.button.menucmd; - } - var size = '1', type = 'solid', color = 'black'; - - /* All border calcs are done on the left border - since our default interface only supports - one border size/type and color */ - if (el.style.borderLeftWidth) { - size = parseInt(el.style.borderLeftWidth, 10); - } - if (el.style.borderLeftStyle) { - type = el.style.borderLeftStyle; - } - if (el.style.borderLeftColor) { - color = el.style.borderLeftColor; - } - switch(value) { - case 'bordersize': - if (this.browser.webkit && this._lastImage) { - Dom.removeClass(this._lastImage, 'selected'); - this._lastImage = null; - } - - borderString = parseInt(o.button.value, 10) + 'px ' + type + ' ' + color; - el.style.border = borderString; - if (parseInt(o.button.value, 10) > 0) { - tbar.enableButton('bordertype'); - tbar.enableButton('bordercolor'); - } else { - tbar.disableButton('bordertype'); - tbar.disableButton('bordercolor'); - } - break; - case 'bordertype': - if (this.browser.webkit && this._lastImage) { - Dom.removeClass(this._lastImage, 'selected'); - this._lastImage = null; - } - borderString = size + 'px ' + o.button.value + ' ' + color; - el.style.border = borderString; - break; - case 'right': - case 'left': - tbar.deselectAllButtons(); - el.style.display = ''; - el.align = o.button.value; - break; - case 'inline': - tbar.deselectAllButtons(); - el.style.display = ''; - el.align = ''; - break; - case 'block': - tbar.deselectAllButtons(); - el.style.display = 'block'; - el.align = 'center'; - break; - case 'padding': - var _button = tbar.getButtonById(o.button.id); - el.style.margin = _button.get('label') + 'px'; - break; - } - tbar.selectButton(o.button.value); - if (value !== 'padding') { - this.moveWindow(); - } - }, this, true); - - - - if (this.get('localFileWarning')) { - Event.on(this.get('id') + '_insertimage_link', 'blur', function() { - var url = Dom.get(this.get('id') + '_insertimage_link'); - if (this._isLocalFile(url.value)) { - //Local File throw Warning - Dom.addClass(url, 'warning'); - YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else { - Dom.removeClass(url, 'warning'); - this.get('panel').setFooter(' '); - //Adobe AIR Code - if ((this.browser.webkit && !this.browser.webkit3 || this.browser.air) || this.browser.opera) { - this.get('panel').setFooter(this.STR_IMAGE_COPY); - } - } - }, this, true); - } - - Event.on(this.get('id') + '_insertimage_url', 'blur', function() { - var url = Dom.get(this.get('id') + '_insertimage_url'), - el = this.currentElement[0]; - - if (url.value && el) { - if (url.value == el.getAttribute('src', 2)) { - YAHOO.log('Images are the same, bail on blur handler', 'info', 'Editor'); - return false; - } - } - YAHOO.log('Images are different, process blur handler', 'info', 'Editor'); - if (this._isLocalFile(url.value)) { - //Local File throw Warning - Dom.addClass(url, 'warning'); - YAHOO.log('Local file reference found, show local warning', 'warn', 'Editor'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else if (this.currentElement[0]) { - Dom.removeClass(url, 'warning'); - this.get('panel').setFooter(' '); - //Adobe AIR Code - if ((this.browser.webkit && !this.browser.webkit3 || this.browser.air) || this.browser.opera) { - this.get('panel').setFooter(this.STR_IMAGE_COPY); - } - - if (url && url.value && (url.value != this.STR_IMAGE_HERE)) { - this.currentElement[0].setAttribute('src', url.value); - var self = this, - img = new Image(); - - img.onerror = function() { - url.value = self.STR_IMAGE_HERE; - img.setAttribute('src', self.get('blankimage')); - self.currentElement[0].setAttribute('src', self.get('blankimage')); - YAHOO.util.Dom.get(self.get('id') + '_insertimage_height').value = img.height; - YAHOO.util.Dom.get(self.get('id') + '_insertimage_width').value = img.width; - }; - var id = this.get('id'); - window.setTimeout(function() { - YAHOO.util.Dom.get(id + '_insertimage_height').value = img.height; - YAHOO.util.Dom.get(id + '_insertimage_width').value = img.width; - if (self.currentElement && self.currentElement[0]) { - if (!self.currentElement[0]._height) { - self.currentElement[0]._height = img.height; - } - if (!self.currentElement[0]._width) { - self.currentElement[0]._width = img.width; - } - } - //Removed moveWindow call so the window doesn't jump - //self.moveWindow(); - }, 800); //Bumped the timeout up to account for larger images.. - - if (url.value != this.STR_IMAGE_HERE) { - img.src = url.value; - } - } - } - }, this, true); - - - - this._windows.insertimage = {}; - this._windows.insertimage.body = body; - //body.style.display = 'none'; - this.get('panel').editor_form.appendChild(body); - this.fireEvent('windowInsertImageRender', { type: 'windowInsertImageRender', panel: this.get('panel'), body: body, toolbar: tbar }); - return body; - }, - /** - * @private - * @method _handleInsertImageClick - * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked. - */ - _handleInsertImageClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('insertimage')) { - YAHOO.log('Toolbar Button for (insertimage) was not found, skipping exec.', 'info', 'Editor'); - return false; - } - } - this.on('afterExecCommand', function() { - YAHOO.log('afterExecCommand :: _handleInsertImageClick', 'info', 'Editor'); - var el = this.currentElement[0], - body = null, - link = '', - target = '', - tbar = null, - title = '', - src = '', - align = '', - height = 75, - width = 75, - padding = 0, - oheight = 0, - owidth = 0, - blankimage = false, - win = new YAHOO.widget.EditorWindow('insertimage', { - width: '415px' - }); - - if (!el) { - el = this._getSelectedElement(); - } - if (el) { - win.el = el; - if (el.getAttribute('src')) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - src = this.STR_IMAGE_HERE; - blankimage = true; - } - } - if (el.getAttribute('alt', 2)) { - title = el.getAttribute('alt', 2); - } - if (el.getAttribute('title', 2)) { - title = el.getAttribute('title', 2); - } - - if (el.parentNode && this._isElement(el.parentNode, 'a')) { - link = el.parentNode.getAttribute('href', 2); - if (el.parentNode.getAttribute('target') !== null) { - target = el.parentNode.getAttribute('target'); - } - } - height = parseInt(el.height, 10); - width = parseInt(el.width, 10); - if (el.style.height) { - height = parseInt(el.style.height, 10); - } - if (el.style.width) { - width = parseInt(el.style.width, 10); - } - if (el.style.margin) { - padding = parseInt(el.style.margin, 10); - } - if (!blankimage) { - if (!el._height) { - el._height = height; - } - if (!el._width) { - el._width = width; - } - oheight = el._height; - owidth = el._width; - } - } - if (this._windows.insertimage && this._windows.insertimage.body) { - body = this._windows.insertimage.body; - this._defaultImageToolbar.resetAllButtons(); - } else { - body = this._renderInsertImageWindow(); - } - - tbar = this._defaultImageToolbar; - tbar.editor_el = el; - - - var bsize = '0', - btype = 'solid'; - - if (el.style.borderLeftWidth) { - bsize = parseInt(el.style.borderLeftWidth, 10); - } - if (el.style.borderLeftStyle) { - btype = el.style.borderLeftStyle; - } - var bs_button = tbar.getButtonByValue('bordersize'), - bSizeStr = ((parseInt(bsize, 10) > 0) ? '' : this.STR_NONE); - bs_button.set('label', '' + bSizeStr + ''); - this._updateMenuChecked('bordersize', bsize, tbar); - - var bt_button = tbar.getButtonByValue('bordertype'); - bt_button.set('label', 'asdfa'); - this._updateMenuChecked('bordertype', btype, tbar); - if (parseInt(bsize, 10) > 0) { - tbar.enableButton(bt_button); - tbar.enableButton(bs_button); - tbar.enableButton('bordercolor'); - } - - if ((el.align == 'right') || (el.align == 'left')) { - tbar.selectButton(el.align); - } else if (el.style.display == 'block') { - tbar.selectButton('block'); - } else { - tbar.selectButton('inline'); - } - if (parseInt(el.style.marginLeft, 10) > 0) { - tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft, 10)); - } - if (el.style.borderSize) { - tbar.selectButton('bordersize'); - tbar.selectButton(parseInt(el.style.borderSize, 10)); - } - tbar.getButtonByValue('padding').set('label', ''+padding); - - - - win.setHeader(this.STR_IMAGE_PROP_TITLE); - win.setBody(body); - //Adobe AIR Code - if ((this.browser.webkit && !this.browser.webkit3 || this.browser.air) || this.browser.opera) { - win.setFooter(this.STR_IMAGE_COPY); - } - this.openWindow(win); - Dom.get(this.get('id') + '_insertimage_url').value = src; - Dom.get(this.get('id') + '_insertimage_title').value = title; - Dom.get(this.get('id') + '_insertimage_link').value = link; - Dom.get(this.get('id') + '_insertimage_target').checked = ((target) ? true : false); - Dom.get(this.get('id') + '_insertimage_width').value = width; - Dom.get(this.get('id') + '_insertimage_height').value = height; - - - if (((height != oheight) || (width != owidth)) && (!blankimage)) { - var s = document.createElement('span'); - s.className = 'info'; - s.innerHTML = this.STR_IMAGE_ORIG_SIZE + ': ('+ owidth +' x ' + oheight + ')'; - if (Dom.get(this.get('id') + '_insertimage_height').nextSibling) { - var old = Dom.get(this.get('id') + '_insertimage_height').nextSibling; - old.parentNode.removeChild(old); - } - Dom.get(this.get('id') + '_insertimage_height').parentNode.appendChild(s); - } - - this.toolbar.selectButton('insertimage'); - var id = this.get('id'); - window.setTimeout(function() { - try { - YAHOO.util.Dom.get(id + '_insertimage_url').focus(); - if (blankimage) { - YAHOO.util.Dom.get(id + '_insertimage_url').select(); - } - } catch (e) {} - }, 50); - - }); - }, - /** - * @private - * @method _handleInsertImageWindowClose - * @description Handles the closing of the Image Properties Window. - */ - _handleInsertImageWindowClose: function() { - var url = Dom.get(this.get('id') + '_insertimage_url'), - title = Dom.get(this.get('id') + '_insertimage_title'), - link = Dom.get(this.get('id') + '_insertimage_link'), - target = Dom.get(this.get('id') + '_insertimage_target'), - el = arguments[0].win.el; - - if (url && url.value && (url.value != this.STR_IMAGE_HERE)) { - el.setAttribute('src', url.value); - el.setAttribute('title', title.value); - el.setAttribute('alt', title.value); - var par = el.parentNode; - if (link.value) { - var urlValue = link.value; - if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - //Found an @ sign, prefix with mailto: - urlValue = 'mailto:' + urlValue; - } else { - // :// not found adding - urlValue = 'http:/'+'/' + urlValue; - } - } - if (par && this._isElement(par, 'a')) { - par.setAttribute('href', urlValue); - if (target.checked) { - par.setAttribute('target', target.value); - } else { - par.setAttribute('target', ''); - } - } else { - var _a = this._getDoc().createElement('a'); - _a.setAttribute('href', urlValue); - if (target.checked) { - _a.setAttribute('target', target.value); - } else { - _a.setAttribute('target', ''); - } - el.parentNode.replaceChild(_a, el); - _a.appendChild(el); - } - } else { - if (par && this._isElement(par, 'a')) { - par.parentNode.replaceChild(el, par); - } - } - } else { - //No url/src given, remove the node from the document - el.parentNode.removeChild(el); - } - Dom.get(this.get('id') + '_insertimage_url').value = ''; - Dom.get(this.get('id') + '_insertimage_title').value = ''; - Dom.get(this.get('id') + '_insertimage_link').value = ''; - Dom.get(this.get('id') + '_insertimage_target').checked = false; - Dom.get(this.get('id') + '_insertimage_width').value = 0; - Dom.get(this.get('id') + '_insertimage_height').value = 0; - this._defaultImageToolbar.resetAllButtons(); - this.currentElement = []; - this.nodeChange(); - }, - /** - * @property EDITOR_PANEL_ID - * @description HTML id to give the properties window in the DOM. - * @type String - */ - EDITOR_PANEL_ID: '-panel', - /** - * @private - * @method _renderPanel - * @description Renders the panel used for Editor Windows to the document so we can start using it.. - * @return {YAHOO.widget.Overlay} - */ - _renderPanel: function() { - var panelEl = document.createElement('div'); - Dom.addClass(panelEl, 'yui-editor-panel'); - panelEl.id = this.get('id') + this.EDITOR_PANEL_ID; - panelEl.style.position = 'absolute'; - panelEl.style.top = '-9999px'; - panelEl.style.left = '-9999px'; - document.body.appendChild(panelEl); - this.get('element_cont').insertBefore(panelEl, this.get('element_cont').get('firstChild')); - - - - var panel = new YAHOO.widget.Overlay(this.get('id') + this.EDITOR_PANEL_ID, { - width: '300px', - iframe: true, - visible: false, - underlay: 'none', - draggable: false, - close: false - }); - this.set('panel', panel); - - panel.setBody('---'); - panel.setHeader(' '); - panel.setFooter(' '); - - - var body = document.createElement('div'); - body.className = this.CLASS_PREFIX + '-body-cont'; - for (var b in this.browser) { - if (this.browser[b]) { - Dom.addClass(body, b); - break; - } - } - Dom.addClass(body, ((YAHOO.widget.Button && (this._defaultToolbar.buttonType == 'advanced')) ? 'good-button' : 'no-button')); - - var _note = document.createElement('h3'); - _note.className = 'yui-editor-skipheader'; - _note.innerHTML = this.STR_CLOSE_WINDOW_NOTE; - body.appendChild(_note); - var form = document.createElement('fieldset'); - panel.editor_form = form; - - body.appendChild(form); - var _close = document.createElement('span'); - _close.innerHTML = 'X'; - _close.title = this.STR_CLOSE_WINDOW; - _close.className = 'close'; - - Event.on(_close, 'click', this.closeWindow, this, true); - - var _knob = document.createElement('span'); - _knob.innerHTML = '^'; - _knob.className = 'knob'; - panel.editor_knob = _knob; - - var _header = document.createElement('h3'); - panel.editor_header = _header; - _header.innerHTML = ''; - - panel.setHeader(' '); //Clear the current header - panel.appendToHeader(_header); - _header.appendChild(_close); - _header.appendChild(_knob); - panel.setBody(' '); //Clear the current body - panel.setFooter(' '); //Clear the current footer - panel.appendToBody(body); //Append the new DOM node to it - - Event.on(panel.element, 'click', function(ev) { - Event.stopPropagation(ev); - }); - - var fireShowEvent = function() { - panel.bringToTop(); - YAHOO.util.Dom.setStyle(this.element, 'display', 'block'); - this._handleWindowInputs(false); - }; - panel.showEvent.subscribe(fireShowEvent, this, true); - panel.hideEvent.subscribe(function() { - this._handleWindowInputs(true); - }, this, true); - panel.renderEvent.subscribe(function() { - this._renderInsertImageWindow(); - this._renderCreateLinkWindow(); - this.fireEvent('windowRender', { type: 'windowRender', panel: panel }); - this._handleWindowInputs(true); - }, this, true); - - if (this.DOMReady) { - this.get('panel').render(); - } else { - Event.onDOMReady(function() { - this.get('panel').render(); - }, this, true); - } - return this.get('panel'); - }, - /** - * @method _handleWindowInputs - * @param {Boolean} disable The state to set all inputs in all Editor windows to. Defaults to: false. - * @description Disables/Enables all fields inside Editor windows. Used in show/hide events to keep window fields from submitting when the parent form is submitted. - */ - _handleWindowInputs: function(disable) { - if (!Lang.isBoolean(disable)) { - disable = false; - } - var inputs = this.get('panel').element.getElementsByTagName('input'); - for (var i = 0; i < inputs.length; i++) { - try { - inputs[i].disabled = disable; - } catch (e) {} - } - }, - /** - * @method openWindow - * @param {YAHOO.widget.EditorWindow} win A YAHOO.widget.EditorWindow instance - * @description Opens a new "window/panel" - */ - openWindow: function(win) { - - YAHOO.log('openWindow: ' + win.name, 'info', 'Editor'); - var self = this; - window.setTimeout(function() { - self.toolbar.set('disabled', true); //Disable the toolbar when an editor window is open.. - }, 10); - Event.on(document, 'keydown', this._closeWindow, this, true); - - if (this.currentWindow) { - this.closeWindow(); - } - - var xy = Dom.getXY(this.currentElement[0]), - elXY = Dom.getXY(this.get('iframe').get('element')), - panel = this.get('panel'), - newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)], - wWidth = (parseInt(win.attrs.width, 10) / 2), - align = 'center', - body = null; - - this.fireEvent('beforeOpenWindow', { type: 'beforeOpenWindow', win: win, panel: panel }); - - var form = panel.editor_form; - - var wins = this._windows; - for (var b in wins) { - if (Lang.hasOwnProperty(wins, b)) { - if (wins[b] && wins[b].body) { - if (b == win.name) { - Dom.setStyle(wins[b].body, 'display', 'block'); - } else { - Dom.setStyle(wins[b].body, 'display', 'none'); - } - } - } - } - - if (this._windows[win.name].body) { - Dom.setStyle(this._windows[win.name].body, 'display', 'block'); - form.appendChild(this._windows[win.name].body); - } else { - if (Lang.isObject(win.body)) { //Assume it's a reference - form.appendChild(win.body); - } else { //Assume it's a string - var _tmp = document.createElement('div'); - _tmp.innerHTML = win.body; - form.appendChild(_tmp); - } - } - panel.editor_header.firstChild.innerHTML = win.header; - if (win.footer !== null) { - panel.setFooter(win.footer); - } - panel.cfg.setProperty('width', win.attrs.width); - - this.currentWindow = win; - this.moveWindow(true); - panel.show(); - this.fireEvent('afterOpenWindow', { type: 'afterOpenWindow', win: win, panel: panel }); - }, - /** - * @method moveWindow - * @param {Boolean} force Boolean to tell it to move but not use any animation (Usually done the first time the window is loaded.) - * @description Realign the window with the currentElement and reposition the knob above the panel. - */ - moveWindow: function(force) { - if (!this.currentWindow) { - return false; - } - var win = this.currentWindow, - xy = Dom.getXY(this.currentElement[0]), - elXY = Dom.getXY(this.get('iframe').get('element')), - panel = this.get('panel'), - //newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)], - newXY = [(xy[0] + elXY[0]), (xy[1] + elXY[1])], - wWidth = (parseInt(win.attrs.width, 10) / 2), - align = 'center', - orgXY = panel.cfg.getProperty('xy') || [0,0], - _knob = panel.editor_knob, - xDiff = 0, - yDiff = 0, - anim = false; - - - newXY[0] = ((newXY[0] - wWidth) + 20); - //Account for the Scroll bars in a scrolled editor window. - newXY[0] = newXY[0] - Dom.getDocumentScrollLeft(this._getDoc()); - newXY[1] = newXY[1] - Dom.getDocumentScrollTop(this._getDoc()); - - if (this._isElement(this.currentElement[0], 'img')) { - if (this.currentElement[0].src.indexOf(this.get('blankimage')) != -1) { - newXY[0] = (newXY[0] + (75 / 2)); //Placeholder size - newXY[1] = (newXY[1] + 75); //Placeholder sizea - } else { - var w = parseInt(this.currentElement[0].width, 10); - var h = parseInt(this.currentElement[0].height, 10); - newXY[0] = (newXY[0] + (w / 2)); - newXY[1] = (newXY[1] + h); - } - newXY[1] = newXY[1] + 15; - } else { - var fs = Dom.getStyle(this.currentElement[0], 'fontSize'); - if (fs && fs.indexOf && fs.indexOf('px') != -1) { - newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize'), 10) + 5; - } else { - newXY[1] = newXY[1] + 20; - } - } - if (newXY[0] < elXY[0]) { - newXY[0] = elXY[0] + 5; - align = 'left'; - } - - if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10))) { - newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10)) - (wWidth * 2) - 5); - align = 'right'; - } - - try { - xDiff = (newXY[0] - orgXY[0]); - yDiff = (newXY[1] - orgXY[1]); - } catch (e) {} - - - var iTop = elXY[1] + parseInt(this.get('height'), 10); - var iLeft = elXY[0] + parseInt(this.get('width'), 10); - if (newXY[1] > iTop) { - newXY[1] = iTop; - } - if (newXY[0] > iLeft) { - newXY[0] = (iLeft / 2); - } - - //Convert negative numbers to positive so we can get the difference in distance - xDiff = ((xDiff < 0) ? (xDiff * -1) : xDiff); - yDiff = ((yDiff < 0) ? (yDiff * -1) : yDiff); - - if (((xDiff > 10) || (yDiff > 10)) || force) { //Only move the window if it's supposed to move more than 10px or force was passed (new window) - var _knobLeft = 0, - elW = 0; - - if (this.currentElement[0].width) { - elW = (parseInt(this.currentElement[0].width, 10) / 2); - } - - var leftOffset = xy[0] + elXY[0] + elW; - _knobLeft = leftOffset - newXY[0]; - //Check to see if the knob will go off either side & reposition it - if (_knobLeft > (parseInt(win.attrs.width, 10) - 1)) { - _knobLeft = ((parseInt(win.attrs.width, 10) - 30) - 1); - } else if (_knobLeft < 40) { - _knobLeft = 1; - } - if (isNaN(_knobLeft)) { - _knobLeft = 1; - } - if (force) { - if (_knob) { - _knob.style.left = _knobLeft + 'px'; - } - //Removed Animation from a forced move.. - panel.cfg.setProperty('xy', newXY); - } else { - if (this.get('animate')) { - anim = new YAHOO.util.Anim(panel.element, {}, 0.5, YAHOO.util.Easing.easeOut); - anim.attributes = { - top: { - to: newXY[1] - }, - left: { - to: newXY[0] - } - }; - anim.onComplete.subscribe(function() { - panel.cfg.setProperty('xy', newXY); - }); - //We have to animate the iframe shim at the same time as the panel or we get scrollbar bleed .. - var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, 0.5, YAHOO.util.Easing.easeOut); - - var _knobAnim = new YAHOO.util.Anim(_knob, { - left: { - to: _knobLeft - } - }, 0.6, YAHOO.util.Easing.easeOut); - anim.animate(); - iframeAnim.animate(); - _knobAnim.animate(); - } else { - _knob.style.left = _knobLeft + 'px'; - panel.cfg.setProperty('xy', newXY); - } - } - } - }, - /** - * @private - * @method _closeWindow - * @description Close the currently open EditorWindow with the Escape key. - * @param {Event} ev The keypress Event that we are trapping - */ - _closeWindow: function(ev) { - //if ((ev.charCode == 87) && ev.shiftKey && ev.ctrlKey) { - if (this._checkKey(this._keyMap.CLOSE_WINDOW, ev)) { - if (this.currentWindow) { - this.closeWindow(); - } - } - }, - /** - * @method closeWindow - * @description Close the currently open EditorWindow. - */ - closeWindow: function(keepOpen) { - YAHOO.log('closeWindow: ' + this.currentWindow.name, 'info', 'Editor'); - this.fireEvent('window' + this.currentWindow.name + 'Close', { type: 'window' + this.currentWindow.name + 'Close', win: this.currentWindow, el: this.currentElement[0] }); - this.fireEvent('closeWindow', { type: 'closeWindow', win: this.currentWindow }); - this.currentWindow = null; - this.get('panel').hide(); - this.get('panel').cfg.setProperty('xy', [-900,-900]); - this.get('panel').syncIframe(); //Needed to move the iframe with the hidden panel - this.unsubscribeAll('afterExecCommand'); - this.toolbar.set('disabled', false); //enable the toolbar now that the window is closed - this.toolbar.resetAllButtons(); - this.focus(); - Event.removeListener(document, 'keydown', this._closeWindow); - }, - - /* {{{ Command Overrides - These commands are only over written when we are using the advanced version */ - - /** - * @method cmd_undo - * @description Pulls an item from the Undo stack and updates the Editor - * @param value Value passed from the execCommand method - */ - cmd_undo: function(value) { - if (this._hasUndoLevel()) { - var c_html = this.getEditorHTML(), html; - if (!this._undoLevel) { - this._undoLevel = this._undoCache.length; - } - this._undoLevel = (this._undoLevel - 1); - if (this._undoCache[this._undoLevel]) { - html = this._getUndo(this._undoLevel); - if (html != c_html) { - this.setEditorHTML(html); - } else { - this._undoLevel = (this._undoLevel - 1); - html = this._getUndo(this._undoLevel); - if (html != c_html) { - this.setEditorHTML(html); - } - } - } else { - this._undoLevel = 0; - this.toolbar.disableButton('undo'); - } - } - return [false]; - }, - - /** - * @method cmd_redo - * @description Pulls an item from the Undo stack and updates the Editor - * @param value Value passed from the execCommand method - */ - cmd_redo: function(value) { - this._undoLevel = this._undoLevel + 1; - if (this._undoLevel >= this._undoCache.length) { - this._undoLevel = this._undoCache.length; - } - YAHOO.log(this._undoLevel + ' :: ' + this._undoCache.length, 'warn', 'SimpleEditor'); - if (this._undoCache[this._undoLevel]) { - var html = this._getUndo(this._undoLevel); - this.setEditorHTML(html); - } else { - this.toolbar.disableButton('redo'); - } - return [false]; - }, - - /** - * @method cmd_heading - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('heading') is used. - */ - cmd_heading: function(value) { - var exec = true, - el = null, - action = 'heading', - _sel = this._getSelection(), - _selEl = this._getSelectedElement(); - - if (_selEl) { - _sel = _selEl; - } - - if (this.browser.ie) { - action = 'formatblock'; - } - if (value == this.STR_NONE) { - if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) { - if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') { - _sel = _sel.parentNode; - } - if (this._isElement(_sel, 'html')) { - return [false]; - } - el = this._swapEl(_selEl, 'span', function(el) { - el.className = 'yui-non'; - }); - this._selectNode(el); - this.currentElement[0] = el; - } - exec = false; - } else { - if (this._isElement(_selEl, 'h1') || this._isElement(_selEl, 'h2') || this._isElement(_selEl, 'h3') || this._isElement(_selEl, 'h4') || this._isElement(_selEl, 'h5') || this._isElement(_selEl, 'h6')) { - el = this._swapEl(_selEl, value); - this._selectNode(el); - this.currentElement[0] = el; - } else { - this._createCurrentElement(value); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - return [exec, action]; - }, - /** - * @method cmd_hiddenelements - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('hiddenelements') is used. - */ - cmd_hiddenelements: function(value) { - if (this._showingHiddenElements) { - //Don't auto highlight the hidden button - this._lastButton = null; - YAHOO.log('Enabling hidden CSS File', 'info', 'SimpleEditor'); - this._showingHiddenElements = false; - this.toolbar.deselectButton('hiddenelements'); - Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN); - } else { - YAHOO.log('Disabling hidden CSS File', 'info', 'SimpleEditor'); - this._showingHiddenElements = true; - Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN); - this.toolbar.selectButton('hiddenelements'); - } - return [false]; - }, - /** - * @method cmd_removeformat - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('removeformat') is used. - */ - cmd_removeformat: function(value) { - var exec = true; - /* - * @knownissue Remove Format issue - * @browser Safari 2.x - * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected. - * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds. - * So here we are making the best possible guess and acting on it. - */ - if (this.browser.webkit && !this._getDoc().queryCommandEnabled('removeformat')) { - var _txt = this._getSelection()+''; - this._createCurrentElement('span'); - this.currentElement[0].className = 'yui-non'; - this.currentElement[0].innerHTML = _txt; - for (var i = 1; i < this.currentElement.length; i++) { - this.currentElement[i].parentNode.removeChild(this.currentElement[i]); - } - - exec = false; - } - return [exec]; - }, - /** - * @method cmd_script - * @param action action passed from the execCommand method - * @param value Value passed from the execCommand method - * @description This is a combined execCommand override method. It is called from the cmd_superscript and cmd_subscript methods. - */ - cmd_script: function(action, value) { - var exec = true, tag = action.toLowerCase().substring(0, 3), - _span = null, _selEl = this._getSelectedElement(); - - if (this.browser.webkit) { - YAHOO.log('Safari dom fun again (' + action + ')..', 'info', 'EditorSafari'); - if (this._isElement(_selEl, tag)) { - YAHOO.log('we are a child of tag (' + tag + '), reverse process', 'info', 'EditorSafari'); - _span = this._swapEl(this.currentElement[0], 'span', function(el) { - el.className = 'yui-non'; - }); - this._selectNode(_span); - } else { - this._createCurrentElement(tag); - var _sub = this._swapEl(this.currentElement[0], tag); - this._selectNode(_sub); - this.currentElement[0] = _sub; - } - exec = false; - } - return exec; - }, - /** - * @method cmd_superscript - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('superscript') is used. - */ - cmd_superscript: function(value) { - return [this.cmd_script('superscript', value)]; - }, - /** - * @method cmd_subscript - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('subscript') is used. - */ - cmd_subscript: function(value) { - return [this.cmd_script('subscript', value)]; - }, - /** - * @method cmd_indent - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('indent') is used. - */ - cmd_indent: function(value) { - var exec = true, selEl = this._getSelectedElement(), _bq = null; - - //if (this.browser.webkit || this.browser.ie || this.browser.gecko) { - //if (this.browser.webkit || this.browser.ie) { - if (this.browser.ie) { - if (this._isElement(selEl, 'blockquote')) { - _bq = this._getDoc().createElement('blockquote'); - _bq.innerHTML = selEl.innerHTML; - selEl.innerHTML = ''; - selEl.appendChild(_bq); - this._selectNode(_bq); - } else { - _bq = this._getDoc().createElement('blockquote'); - var html = this._getRange().htmlText; - _bq.innerHTML = html; - this._createCurrentElement('blockquote'); - /* - for (var i = 0; i < this.currentElement.length; i++) { - _bq = this._getDoc().createElement('blockquote'); - _bq.innerHTML = this.currentElement[i].innerHTML; - this.currentElement[i].parentNode.replaceChild(_bq, this.currentElement[i]); - this.currentElement[i] = _bq; - } - */ - this.currentElement[0].parentNode.replaceChild(_bq, this.currentElement[0]); - this.currentElement[0] = _bq; - this._selectNode(this.currentElement[0]); - } - exec = false; - } else { - value = 'blockquote'; - } - return [exec, 'formatblock', value]; - }, - /** - * @method cmd_outdent - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('outdent') is used. - */ - cmd_outdent: function(value) { - var exec = true, selEl = this._getSelectedElement(), _bq = null, _span = null; - //if (this.browser.webkit || this.browser.ie || this.browser.gecko) { - if (this.browser.webkit || this.browser.ie) { - //if (this.browser.ie) { - selEl = this._getSelectedElement(); - if (this._isElement(selEl, 'blockquote')) { - var par = selEl.parentNode; - if (this._isElement(selEl.parentNode, 'blockquote')) { - par.innerHTML = selEl.innerHTML; - this._selectNode(par); - } else { - _span = this._getDoc().createElement('span'); - _span.innerHTML = selEl.innerHTML; - YAHOO.util.Dom.addClass(_span, 'yui-non'); - par.replaceChild(_span, selEl); - this._selectNode(_span); - } - } else { - YAHOO.log('Can not outdent, we are not inside a blockquote', 'warn', 'Editor'); - } - exec = false; - } else { - value = false; - } - return [exec, 'outdent', value]; - }, - /** - * @method cmd_justify - * @param dir The direction to justify - * @description This is a factory method for the justify family of commands. - */ - cmd_justify: function(dir) { - if (this.browser.ie) { - if (this._hasSelection()) { - this._createCurrentElement('span'); - this._swapEl(this.currentElement[0], 'div', function(el) { - el.style.textAlign = dir; - }); - - return [false]; - } - } - return [true, 'justify' + dir, '']; - }, - /** - * @method cmd_justifycenter - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('justifycenter') is used. - */ - cmd_justifycenter: function() { - return [this.cmd_justify('center')]; - }, - /** - * @method cmd_justifyleft - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('justifyleft') is used. - */ - cmd_justifyleft: function() { - return [this.cmd_justify('left')]; - }, - /** - * @method cmd_justifyright - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('justifyright') is used. - */ - cmd_justifyright: function() { - return [this.cmd_justify('right')]; - }, - /* }}}*/ - /** - * @method toString - * @description Returns a string representing the editor. - * @return {String} - */ - toString: function() { - var str = 'Editor'; - if (this.get && this.get('element_cont')) { - str = 'Editor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : '')); - } - return str; - } - }); -/** -* @event beforeOpenWindow -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Event fires before an Editor Window is opened. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterOpenWindow -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Event fires after an Editor Window is opened. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event closeWindow -* @param {EditorWindow} win The EditorWindow object -* @description Event fires after an Editor Window is closed. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowCMDOpen -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Dynamic event fired when an EditorWindow is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowCMDClose -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Dynamic event fired when an EditorWindow is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowRender -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Event fired when the initial Overlay is rendered. Can be used to manipulate the content of the panel. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowInsertImageRender -* @param {Overlay} panel The Overlay object that is used to create the window. -* @param {HTMLElement} body The HTML element used as the body of the window.. -* @param {Toolbar} toolbar A reference to the toolbar object used inside this window. -* @description Event fired when the pre render of the Insert Image window has finished. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowCreateLinkRender -* @param {Overlay} panel The Overlay object that is used to create the window. -* @param {HTMLElement} body The HTML element used as the body of the window.. -* @description Event fired when the pre render of the Create Link window has finished. -* @type YAHOO.util.CustomEvent -*/ - - - - /** - * @description Class to hold Window information between uses. We use the same panel to show the windows, so using this will allow you to configure a window before it is shown. - * This is what you pass to Editor.openWindow();. These parameters will not take effect until the openWindow() is called in the editor. - * @class EditorWindow - * @param {String} name The name of the window. - * @param {Object} attrs Attributes for the window. Current attributes used are : height and width - */ - YAHOO.widget.EditorWindow = function(name, attrs) { - /** - * @private - * @property name - * @description A unique name for the window - */ - this.name = name.replace(' ', '_'); - /** - * @private - * @property attrs - * @description The window attributes - */ - this.attrs = attrs; - }; - - YAHOO.widget.EditorWindow.prototype = { - /** - * @private - * @property header - * @description Holder for the header of the window, used in Editor.openWindow - */ - header: null, - /** - * @private - * @property body - * @description Holder for the body of the window, used in Editor.openWindow - */ - body: null, - /** - * @private - * @property footer - * @description Holder for the footer of the window, used in Editor.openWindow - */ - footer: null, - /** - * @method setHeader - * @description Sets the header for the window. - * @param {String/HTMLElement} str The string or DOM reference to be used as the windows header. - */ - setHeader: function(str) { - this.header = str; - }, - /** - * @method setBody - * @description Sets the body for the window. - * @param {String/HTMLElement} str The string or DOM reference to be used as the windows body. - */ - setBody: function(str) { - this.body = str; - }, - /** - * @method setFooter - * @description Sets the footer for the window. - * @param {String/HTMLElement} str The string or DOM reference to be used as the windows footer. - */ - setFooter: function(str) { - this.footer = str; - }, - /** - * @method toString - * @description Returns a string representing the EditorWindow. - * @return {String} - */ - toString: function() { - return 'Editor Window (' + this.name + ')'; - } - }; -})(); -YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/editor-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/editor-min.js deleted file mode 100644 index 8bcbe4c309..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/editor-min.js +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var B=YAHOO.util.Dom,A=YAHOO.util.Event,C=YAHOO.lang;if(YAHOO.widget.Button){YAHOO.widget.ToolbarButtonAdvanced=YAHOO.widget.Button;YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType="rich";YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue=function(F){var E=this.getMenu().getItems();if(E.length===0){this.getMenu()._onBeforeShow();E=this.getMenu().getItems();}for(var D=0;D'+G+""; -this._titlebar.appendChild(F);A.on(F.firstChild,"click",function(H){A.stopEvent(H);});A.on([F,F.firstChild],"focus",function(){this._handleFocus();},this,true);}if(this.get("firstChild")){this.insertBefore(this._titlebar,this.get("firstChild"));}else{this.appendChild(this._titlebar);}if(this.get("collapse")){this.set("collapse",true);}}else{if(this._titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}}}}});this.setAttributeConfig("collapse",{value:false,method:function(H){if(this._titlebar){var G=null;var F=C.getElementsByClassName("collapse","span",this._titlebar);if(H){if(F.length>0){return true;}G=document.createElement("SPAN");G.innerHTML="X";G.title=this.STR_COLLAPSE;C.addClass(G,"collapse");this._titlebar.appendChild(G);A.addListener(G,"click",function(){if(C.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}else{this.collapse();}},this,true);}else{G=C.getElementsByClassName("collapse","span",this._titlebar);if(G[0]){if(C.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}G[0].parentNode.removeChild(G[0]);}}}}});this.setAttributeConfig("draggable",{value:(E.draggable||false),method:function(F){if(F&&!this.get("titlebar")){if(!this._dragHandle){this._dragHandle=document.createElement("SPAN");this._dragHandle.innerHTML="|";this._dragHandle.setAttribute("title","Click to drag the toolbar");this._dragHandle.id=this.get("id")+"_draghandle";C.addClass(this._dragHandle,this.CLASS_DRAGHANDLE);if(this.get("cont").hasChildNodes()){this.get("cont").insertBefore(this._dragHandle,this.get("cont").firstChild);}else{this.get("cont").appendChild(this._dragHandle);}this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._dragHandle.id);}}else{if(this._dragHandle){this._dragHandle.parentNode.removeChild(this._dragHandle);this._dragHandle=null;this.dd=null;}}if(this._titlebar){if(F){this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._titlebar);C.addClass(this._titlebar,"draggable");}else{C.removeClass(this._titlebar,"draggable");if(this.dd){this.dd.unreg();this.dd=null;}}}},validator:function(G){var F=true;if(!YAHOO.util.DD){F=false;}return F;}});},addButtonGroup:function(J){if(!this.get("element")){this._queue[this._queue.length]=["addButtonGroup",arguments];return false;}if(!this.hasClass(this.CLASS_PREFIX+"-grouped")){this.addClass(this.CLASS_PREFIX+"-grouped");}var L=document.createElement("DIV");C.addClass(L,this.CLASS_PREFIX+"-group");C.addClass(L,this.CLASS_PREFIX+"-group-"+J.group);if(J.label){var F=document.createElement("h3");F.innerHTML=J.label;L.appendChild(F);}if(!this.get("grouplabels")){C.addClass(this.get("cont"),this.CLASS_PREFIX,"-nogrouplabels");}this.get("cont").appendChild(L);var I=document.createElement("ul");L.appendChild(I);if(!this._buttonGroupList){this._buttonGroupList={};}this._buttonGroupList[J.group]=I;var K=[],H;for(var G=0;G'+F.replace("#","")+"";}}G+="X";window.setTimeout(function(){E.innerHTML=G;},0);A.on(E,"mouseover",function(M){var K=this._colorPicker;var L=K.getElementsByTagName("em")[0];var J=K.getElementsByTagName("strong")[0];var I=A.getTarget(M);if(I.tagName.toLowerCase()=="a"){L.style.backgroundColor=I.style.backgroundColor;J.innerHTML=this._colorData["#"+I.innerHTML]+"
          "+I.innerHTML;}},this,true);A.on(E,"focus",function(I){A.stopEvent(I);});A.on(E,"click",function(I){A.stopEvent(I);});A.on(E,"mousedown",function(J){A.stopEvent(J);var I=A.getTarget(J);if(I.tagName.toLowerCase()=="a"){var L=this.fireEvent("colorPickerClicked",{type:"colorPickerClicked",target:this,button:this._colorPicker._button,color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML]});if(L!==false){var K={color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML],value:this._colorPicker._button};this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:K});}this.getButtonByValue(this._colorPicker._button).getMenu().hide();}},this,true);},_resetColorPicker:function(){var F=this._colorPicker.getElementsByTagName("em")[0];var E=this._colorPicker.getElementsByTagName("strong")[0];F.style.backgroundColor="transparent";E.innerHTML="";},_makeColorButton:function(E){if(!this._colorPicker){this._createColorPicker(this.get("id"));}E.type="color";E.menu=new YAHOO.widget.Overlay(this.get("id")+"_"+E.value+"_menu",{visible:false,position:"absolute",iframe:true});E.menu.setBody("");E.menu.render(this.get("cont"));C.addClass(E.menu.element,"yui-button-menu");C.addClass(E.menu.element,"yui-color-button-menu");E.menu.beforeShowEvent.subscribe(function(){E.menu.cfg.setProperty("zindex",5);E.menu.cfg.setProperty("context",[this.getButtonById(E.id).get("element"),"tl","bl"]);this._resetColorPicker();var F=this._colorPicker;if(F.parentNode){F.parentNode.removeChild(F);}E.menu.setBody("");E.menu.appendToBody(F);this._colorPicker.style.display="block";},this,true);return E;},_makeSpinButton:function(R,L){R.addClass(this.CLASS_PREFIX+"-spinbutton");var S=this,N=R._button.parentNode.parentNode,I=L.range,H=document.createElement("a"),G=document.createElement("a");H.href="#";G.href="#";H.tabIndex="-1";G.tabIndex="-1";H.className="up";H.title=this.STR_SPIN_UP;H.innerHTML=this.STR_SPIN_UP;G.className="down";G.title=this.STR_SPIN_DOWN;G.innerHTML=this.STR_SPIN_DOWN;N.appendChild(H);N.appendChild(G);var M=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:R.get("label")});R.set("title",M);var Q=function(T){T=((TI[1])?I[1]:T);return T;};var P=this.browser;var F=false;var K=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){F=this._titlebar.firstChild;}var E=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V++;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var O=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10); -V--;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var J=function(T){if(T.keyCode==38){E(T);}else{if(T.keyCode==40){O(T);}else{if(T.keyCode==107&&T.shiftKey){E(T);}else{if(T.keyCode==109&&T.shiftKey){O(T);}}}}};R.on("keydown",J,this,true);A.on(H,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(G,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(H,"click",E,this,true);A.on(G,"click",O,this,true);},_buttonClick:function(L,F){var E=true;if(L&&L.type=="keypress"){if(L.keyCode==9){E=false;}else{if((L.keyCode===13)||(L.keyCode===0)||(L.keyCode===32)){}else{E=false;}}}if(E){var N=true,H=false;F.isSelected=this.isSelected(F.id);if(F.value){H=this.fireEvent(F.value+"Click",{type:F.value+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(F.menucmd&&N){H=this.fireEvent(F.menucmd+"Click",{type:F.menucmd+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(N){this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:F});}if(F.type=="select"){var K=this.getButtonById(F.id);if(K.buttonType=="rich"){var J=F.value;for(var I=0;I'+J+"");var M=K.getMenu().getItems();for(var G=0;G(this._buttonList.length-1)){this._navCounter=0;}if(this._navCounter<0){this._navCounter=(this._buttonList.length-1);}if(this._buttonList[this._navCounter]){var E=this._buttonList[this._navCounter].get("element");if(this.browser.ie){E=this._buttonList[this._navCounter].get("element").getElementsByTagName("a")[0];}if(this._buttonList[this._navCounter].get("disabled")){this._navigateButtons(F);}else{E.focus();}}break;}},_handleFocus:function(){if(!this._keyNav){var E="keypress";if(this.browser.ie){E="keydown";}A.on(this.get("element"),E,this._navigateButtons,this,true);this._keyNav=true;this._navCounter=-1;}},getButtonById:function(G){var E=this._buttonList.length;for(var F=0;F'+H[E]._oText.nodeValue+"");}else{H[E].cfg.setProperty("checked",false);}}}}}else{return false;}},deselectButton:function(F){var E=B.call(this,F);if(E){E.removeClass("yui-button-selected");E.removeClass("yui-button-"+E.get("value")+"-selected");E.removeClass("yui-button-hover");E._selected=false;}else{return false;}},deselectAllButtons:function(){var E=this._buttonList.length;for(var F=0;F0)){var I=0;for(var G=0;G',editorDirty:null,_defaultCSS:"html { height: 95%; } body { padding: 7px; background-color: #fff; font: 13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div.yui-wk-p { margin: 11px 0; } body.ptags.webkit div.yui-wk-div { margin: 0; }",_defaultToolbar:null,_lastButton:null,_baseHREF:function(){var E=document.location.href;if(E.indexOf("?")!==-1){E=E.substring(0,E.indexOf("?"));}E=E.substring(0,E.lastIndexOf("/"))+"/";return E;}(),_lastImage:null,_blankImageLoaded:null,_fixNodesTimer:null,_nodeChangeTimer:null,_nodeChangeDelayTimer:null,_lastNodeChangeEvent:null,_lastNodeChange:0,_rendered:null,DOMReady:null,_selection:null,_mask:null,_showingHiddenElements:null,currentWindow:null,currentEvent:null,operaEvent:null,currentFont:null,currentElement:null,dompath:null,beforeElement:null,afterElement:null,invalidHTML:{form:true,input:true,button:true,select:true,link:true,html:true,body:true,iframe:true,script:true,style:true,textarea:true},toolbar:null,_contentTimer:null,_contentTimerMax:500,_contentTimerCounter:0,_disabled:["createlink","fontname","fontsize","forecolor","backcolor"],_alwaysDisabled:{undo:true,redo:true},_alwaysEnabled:{},_semantic:{"bold":true,"italic":true,"underline":true},_tag2cmd:{"b":"bold","strong":"bold","i":"italic","em":"italic","u":"underline","sup":"superscript","sub":"subscript","img":"insertimage","a":"createlink","ul":"insertunorderedlist","ol":"insertorderedlist"},_createIframe:function(){var I=document.createElement("iframe");I.id=this.get("id")+"_editor";var G={border:"0",frameBorder:"0",marginWidth:"0",marginHeight:"0",leftMargin:"0",topMargin:"0",allowTransparency:"true",width:"100%"};if(this.get("autoHeight")){G.scrolling="no";}for(var H in G){if(D.hasOwnProperty(G,H)){I.setAttribute(H,G[H]);}}var F="javascript:;";if(this.browser.ie){F="javascript:false;";}I.setAttribute("src",F);var E=new YAHOO.util.Element(I); -E.setStyle("visibility","hidden");return E;},_isElement:function(F,E){if(F&&F.tagName&&(F.tagName.toLowerCase()==E)){return true;}if(F&&F.getAttribute&&(F.getAttribute("tag")==E)){return true;}return false;},_hasParent:function(F,E){if(!F||!F.parentNode){return false;}while(F.parentNode){if(this._isElement(F,E)){return F;}if(F.parentNode){F=F.parentNode;}else{return false;}}return false;},_getDoc:function(){var E=false;try{if(this.get("iframe").get("element").contentWindow.document){E=this.get("iframe").get("element").contentWindow.document;return E;}}catch(F){return false;}},_getWindow:function(){return this.get("iframe").get("element").contentWindow;},focus:function(){this._getWindow().focus();},_focusWindow:function(){this.focus();},_hasSelection:function(){var G=this._getSelection();var E=this._getRange();var F=false;if(!G||!E){return F;}if(this.browser.ie||this.browser.opera){if(E.text){F=true;}if(E.html){F=true;}}else{if(this.browser.webkit){if(G+""!==""){F=true;}}else{if(G&&(G.toString()!=="")&&(G!==undefined)){F=true;}}}return F;},_getSelection:function(){var E=null;if(this._getDoc()&&this._getWindow()){if(this._getDoc().selection){E=this._getDoc().selection;}else{E=this._getWindow().getSelection();}if(this.browser.webkit){if(E.baseNode){this._selection={};this._selection.baseNode=E.baseNode;this._selection.baseOffset=E.baseOffset;this._selection.extentNode=E.extentNode;this._selection.extentOffset=E.extentOffset;}else{if(this._selection!==null){E=this._getWindow().getSelection();E.setBaseAndExtent(this._selection.baseNode,this._selection.baseOffset,this._selection.extentNode,this._selection.extentOffset);this._selection=null;}}}}return E;},_selectNode:function(F,I){if(!F){return false;}var G=this._getSelection(),E=null;if(this.browser.ie){try{E=this._getDoc().body.createTextRange();E.moveToElementText(F);E.select();}catch(H){}}else{if(this.browser.webkit){if(I){G.setBaseAndExtent(F,1,F,F.innerText.length);}else{G.setBaseAndExtent(F,0,F,F.innerText.length);}}else{if(this.browser.opera){G=this._getWindow().getSelection();E=this._getDoc().createRange();E.selectNode(F);G.removeAllRanges();G.addRange(E);}else{E=this._getDoc().createRange();E.selectNodeContents(F);G.removeAllRanges();G.addRange(E);}}}this.nodeChange();},_getRange:function(){var E=this._getSelection();if(E===null){return null;}if(this.browser.webkit&&!E.getRangeAt){var H=this._getDoc().createRange();try{H.setStart(E.anchorNode,E.anchorOffset);H.setEnd(E.focusNode,E.focusOffset);}catch(G){H=this._getWindow().getSelection()+"";}return H;}if(this.browser.ie||this.browser.opera){try{return E.createRange();}catch(F){return null;}}if(E.rangeCount>0){return E.getRangeAt(0);}return null;},_setDesignMode:function(E){if(this.get("setDesignMode")){try{this._getDoc().designMode=((E.toLowerCase()=="off")?"off":"on");}catch(F){}}},_toggleDesignMode:function(){var F=this._getDoc().designMode,E=((F.toLowerCase()=="on")?"off":"on");this._setDesignMode(E);return E;},_focused:null,_handleFocus:function(E){if(!this._focused){this._focused=true;this.fireEvent("editorWindowFocus",{type:"editorWindowFocus",target:this});}},_handleBlur:function(E){if(this._focused){this._focused=false;this.fireEvent("editorWindowBlur",{type:"editorWindowBlur",target:this});}},_initEditorEvents:function(){var F=this._getDoc(),E=this._getWindow();A.on(F,"mouseup",this._handleMouseUp,this,true);A.on(F,"mousedown",this._handleMouseDown,this,true);A.on(F,"click",this._handleClick,this,true);A.on(F,"dblclick",this._handleDoubleClick,this,true);A.on(F,"keypress",this._handleKeyPress,this,true);A.on(F,"keyup",this._handleKeyUp,this,true);A.on(F,"keydown",this._handleKeyDown,this,true);A.on(E,"focus",this._handleFocus,this,true);A.on(E,"blur",this._handleBlur,this,true);},_removeEditorEvents:function(){var F=this._getDoc(),E=this._getWindow();A.removeListener(F,"mouseup",this._handleMouseUp,this,true);A.removeListener(F,"mousedown",this._handleMouseDown,this,true);A.removeListener(F,"click",this._handleClick,this,true);A.removeListener(F,"dblclick",this._handleDoubleClick,this,true);A.removeListener(F,"keypress",this._handleKeyPress,this,true);A.removeListener(F,"keyup",this._handleKeyUp,this,true);A.removeListener(F,"keydown",this._handleKeyDown,this,true);A.removeListener(E,"focus",this._handleFocus,this,true);A.removeListener(E,"blur",this._handleBlur,this,true);},_fixWebkitDivs:function(){if(this.browser.webkit){var E=this._getDoc().body.getElementsByTagName("div");C.addClass(E,"yui-wk-div");}},_initEditor:function(F){if(this._editorInit){return;}this._editorInit=true;if(this.browser.ie){this._getDoc().body.style.margin="0";}if(!this.get("disabled")){this._setDesignMode("on");this._contentTimerCounter=0;}if(!this._getDoc().body){this._contentTimerCounter=0;this._editorInit=false;this._checkLoaded();return false;}if(!F){this.toolbar.on("buttonClick",this._handleToolbarClick,this,true);}if(!this.get("disabled")){this._initEditorEvents();this.toolbar.set("disabled",false);}if(F){this.fireEvent("editorContentReloaded",{type:"editorreloaded",target:this});}else{this.fireEvent("editorContentLoaded",{type:"editorLoaded",target:this});}this._fixWebkitDivs();if(this.get("dompath")){var E=this;setTimeout(function(){E._writeDomPath.call(E);E._setupResize.call(E);},150);}var H=[];for(var G in this.browser){if(this.browser[G]){H.push(G);}}if(this.get("ptags")){H.push("ptags");}C.addClass(this._getDoc().body,H.join(" "));this.nodeChange(true);},_checkLoaded:function(F){this._editorInit=false;this._contentTimerCounter++;if(this._contentTimer){clearTimeout(this._contentTimer);}if(this._contentTimerCounter>this._contentTimerMax){return false;}var H=false;try{if(this._getDoc()&&this._getDoc().body){if(this.browser.ie){if(this._getDoc().body.readyState=="complete"){H=true;}}else{if(this._getDoc().body._rteLoaded===true){H=true;}}}}catch(G){H=false;}if(H===true){this._initEditor(F);}else{var E=this;this._contentTimer=setTimeout(function(){E._checkLoaded.call(E,F);},20);}},_setInitialContent:function(F){var I=((this._textarea)?this.get("element").value:this.get("element").innerHTML),K=null; -if(I===""){I="
          ";}var G=D.substitute(this.get("html"),{TITLE:this.STR_TITLE,CONTENT:this._cleanIncomingHTML(I),CSS:this.get("css"),HIDDEN_CSS:((this.get("hiddencss"))?this.get("hiddencss"):"/* No Hidden CSS */"),EXTRA_CSS:((this.get("extracss"))?this.get("extracss"):"/* No Extra CSS */")}),E=true;G=G.replace(/RIGHT_BRACKET/gi,"{");G=G.replace(/LEFT_BRACKET/gi,"}");if(document.compatMode!="BackCompat"){G=this._docType+"\n"+G;}else{}if(this.browser.ie||this.browser.webkit||this.browser.opera||(navigator.userAgent.indexOf("Firefox/1.5")!=-1)){try{if(this.browser.air){K=this._getDoc().implementation.createHTMLDocument();var L=this._getDoc();L.open();L.close();K.open();K.write(G);K.close();var H=L.importNode(K.getElementsByTagName("html")[0],true);L.replaceChild(H,L.getElementsByTagName("html")[0]);L.body._rteLoaded=true;}else{K=this._getDoc();K.open();K.write(G);K.close();}}catch(J){E=false;}}else{this.get("iframe").get("element").src="data:text/html;charset=utf-8,"+encodeURIComponent(G);}this.get("iframe").setStyle("visibility","");if(E){this._checkLoaded(F);}},_setMarkupType:function(E){switch(this.get("markup")){case"css":this._setEditorStyle(true);break;case"default":this._setEditorStyle(false);break;case"semantic":case"xhtml":if(this._semantic[E]){this._setEditorStyle(false);}else{this._setEditorStyle(true);}break;}},_setEditorStyle:function(F){try{this._getDoc().execCommand("useCSS",false,!F);}catch(E){}},_getSelectedElement:function(){var J=this._getDoc(),G=null,H=null,K=null,F=true;if(this.browser.ie){this.currentEvent=this._getWindow().event;G=this._getRange();if(G){K=G.item?G.item(0):G.parentElement();if(this._hasSelection()){}if(K===J.body){K=null;}}if((this.currentEvent!==null)&&(this.currentEvent.keyCode===0)){K=A.getTarget(this.currentEvent);}}else{H=this._getSelection();G=this._getRange();if(!H||!G){return null;}if(!this._hasSelection()&&this.browser.webkit3){}if(this.browser.gecko){if(G.startContainer){if(G.startContainer.nodeType===3){K=G.startContainer.parentNode;}else{if(G.startContainer.nodeType===1){K=G.startContainer;}}if(this.currentEvent){var E=A.getTarget(this.currentEvent);if(!this._isElement(E,"html")){if(K!==E){K=E;}}}}}if(F){if(H.anchorNode&&(H.anchorNode.nodeType==3)){if(H.anchorNode.parentNode){K=H.anchorNode.parentNode;}if(H.anchorNode.nextSibling!=H.focusNode.nextSibling){K=H.anchorNode.nextSibling;}}if(this._isElement(K,"br")){K=null;}if(!K){K=G.commonAncestorContainer;if(!G.collapsed){if(G.startContainer==G.endContainer){if(G.startOffset-G.endOffset<2){if(G.startContainer.hasChildNodes()){K=G.startContainer.childNodes[G.startOffset];}}}}}}}if(this.currentEvent!==null){try{switch(this.currentEvent.type){case"click":case"mousedown":case"mouseup":if(this.browser.webkit){K=A.getTarget(this.currentEvent);}break;default:break;}}catch(I){}}else{if((this.currentElement&&this.currentElement[0])&&(!this.browser.ie)){}}if(this.browser.opera||this.browser.webkit){if(this.currentEvent&&!K){K=YAHOO.util.Event.getTarget(this.currentEvent);}}if(!K||!K.tagName){K=J.body;}if(this._isElement(K,"html")){K=J.body;}if(this._isElement(K,"body")){K=J.body;}if(K&&!K.parentNode){K=J.body;}if(K===undefined){K=null;}return K;},_getDomPath:function(E){if(!E){E=this._getSelectedElement();}var F=[];while(E!==null){if(E.ownerDocument!=this._getDoc()){E=null;break;}if(E.nodeName&&E.nodeType&&(E.nodeType==1)){F[F.length]=E;}if(this._isElement(E,"body")){break;}E=E.parentNode;}if(F.length===0){if(this._getDoc()&&this._getDoc().body){F[0]=this._getDoc().body;}}return F.reverse();},_writeDomPath:function(){var K=this._getDomPath(),I=[],G="",L="";for(var E=0;E10){L=''+L.substring(0,10)+"..."+"";}else{L=''+L+"";}I[I.length]=L;}}var H=I.join(" "+this.SEP_DOMPATH+" ");if(this.dompath.innerHTML!=H){this.dompath.innerHTML=H;}},_fixNodes:function(){try{var K=this._getDoc(),H=[];for(var E in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,E)){if(E.toLowerCase()!="span"){var F=K.body.getElementsByTagName(E);if(F.length){for(var G=0;G-1;E--){if(C.hasClass(J[E],this.CLASS_NOEDIT)){try{this._getDoc().execCommand("enableObjectResizing",false,"false");}catch(I){}this.nodeChange();A.stopEvent(G);return true;}}try{this._getDoc().execCommand("enableObjectResizing",false,"true");}catch(H){}}return false;},_setCurrentEvent:function(E){this.currentEvent=E;},_handleClick:function(G){var F=this.fireEvent("beforeEditorClick",{type:"beforeEditorClick",target:this,ev:G});if(F===false){return false;}if(this._isNonEditable(G)){return false; -}this._setCurrentEvent(G);if(this.currentWindow){this.closeWindow();}if(this.currentWindow){this.closeWindow();}if(this.browser.webkit){var E=A.getTarget(G);if(this._isElement(E,"a")||this._isElement(E.parentNode,"a")){A.stopEvent(G);this.nodeChange();}}else{this.nodeChange();}this.fireEvent("editorClick",{type:"editorClick",target:this,ev:G});},_handleMouseUp:function(G){var F=this.fireEvent("beforeEditorMouseUp",{type:"beforeEditorMouseUp",target:this,ev:G});if(F===false){return false;}if(this._isNonEditable(G)){return false;}var E=this;if(this.browser.opera){var H=A.getTarget(G);if(this._isElement(H,"img")){this.nodeChange();if(this.operaEvent){clearTimeout(this.operaEvent);this.operaEvent=null;this._handleDoubleClick(G);}else{this.operaEvent=window.setTimeout(function(){E.operaEvent=false;},700);}}}if(this.browser.webkit||this.browser.opera){if(this.browser.webkit){A.stopEvent(G);}}this.nodeChange();this.fireEvent("editorMouseUp",{type:"editorMouseUp",target:this,ev:G});},_handleMouseDown:function(F){var E=this.fireEvent("beforeEditorMouseDown",{type:"beforeEditorMouseDown",target:this,ev:F});if(E===false){return false;}if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this.browser.webkit&&this._hasSelection()){var H=this._getSelection();if(!this.browser.webkit3){H.collapse(true);}else{H.collapseToStart();}}if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}if(this._isElement(G,"img")||this._isElement(G,"a")){if(this.browser.webkit){A.stopEvent(F);if(this._isElement(G,"img")){C.addClass(G,"selected");this._lastImage=G;}}if(this.currentWindow){this.closeWindow();}this.nodeChange();}this.fireEvent("editorMouseDown",{type:"editorMouseDown",target:this,ev:F});},_handleDoubleClick:function(F){var E=this.fireEvent("beforeEditorDoubleClick",{type:"beforeEditorDoubleClick",target:this,ev:F});if(E===false){return false;}if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this._isElement(G,"img")){this.currentElement[0]=G;this.toolbar.fireEvent("insertimageClick",{type:"insertimageClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}else{if(this._hasParent(G,"a")){this.currentElement[0]=this._hasParent(G,"a");this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}}this.nodeChange();this.fireEvent("editorDoubleClick",{type:"editorDoubleClick",target:this,ev:F});},_handleKeyUp:function(G){var F=this.fireEvent("beforeEditorKeyUp",{type:"beforeEditorKeyUp",target:this,ev:G});if(F===false){return false;}if(this._isNonEditable(G)){return false;}this._storeUndo();this._setCurrentEvent(G);switch(G.keyCode){case this._keyMap.SELECT_ALL.key:if(this._checkKey(this._keyMap.SELECT_ALL,G)){this.nodeChange();}break;case 32:case 35:case 36:case 37:case 38:case 39:case 40:case 46:case 8:case this._keyMap.CLOSE_WINDOW.key:if((G.keyCode==this._keyMap.CLOSE_WINDOW.key)&&this.currentWindow){if(this._checkKey(this._keyMap.CLOSE_WINDOW,G)){this.closeWindow();}}else{if(!this.browser.ie){if(this._nodeChangeTimer){clearTimeout(this._nodeChangeTimer);}var E=this;this._nodeChangeTimer=setTimeout(function(){E._nodeChangeTimer=null;E.nodeChange.call(E);},100);}else{this.nodeChange();}this.editorDirty=true;}break;}this.fireEvent("editorKeyUp",{type:"editorKeyUp",target:this,ev:G});},_handleKeyPress:function(G){var F=this.fireEvent("beforeEditorKeyPress",{type:"beforeEditorKeyPress",target:this,ev:G});if(F===false){return false;}if(this.get("allowNoEdit")){if(G&&G.keyCode&&(G.keyCode==63272)){A.stopEvent(G);}}if(this._isNonEditable(G)){return false;}this._setCurrentEvent(G);this._storeUndo();if(this.browser.opera){if(G.keyCode===13){var E=this._getSelectedElement();if(!this._isElement(E,"li")){this.execCommand("inserthtml","
          ");A.stopEvent(G);}}}if(this.browser.webkit){if(!this.browser.webkit3){if(G.keyCode&&(G.keyCode==122)&&(G.metaKey)){if(this._hasParent(this._getSelectedElement(),"li")){A.stopEvent(G);}}}this._listFix(G);}this._fixListDupIds();this.fireEvent("editorKeyPress",{type:"editorKeyPress",target:this,ev:G});},_handleKeyDown:function(X){var Z=this.fireEvent("beforeEditorKeyDown",{type:"beforeEditorKeyDown",target:this,ev:X});if(Z===false){return false;}var U=null,E=null;if(this._isNonEditable(X)){return false;}this._setCurrentEvent(X);if(this.currentWindow){this.closeWindow();}if(this.currentWindow){this.closeWindow();}var N=false,S=null,P=null,R=false;switch(X.keyCode){case this._keyMap.FOCUS_TOOLBAR.key:if(this._checkKey(this._keyMap.FOCUS_TOOLBAR,X)){var W=this.toolbar.getElementsByTagName("h2")[0];if(W&&W.firstChild){W.firstChild.focus();}}else{if(this._checkKey(this._keyMap.FOCUS_AFTER,X)){this.afterElement.focus();}}A.stopEvent(X);N=false;break;case this._keyMap.CREATE_LINK.key:if(this._hasSelection()){if(this._checkKey(this._keyMap.CREATE_LINK,X)){var F=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){F=false;}}if(F){this.execCommand("createlink","");this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});N=false;}}}break;case this._keyMap.UNDO.key:case this._keyMap.REDO.key:if(this._checkKey(this._keyMap.REDO,X)){S="redo";N=true;}else{if(this._checkKey(this._keyMap.UNDO,X)){S="undo";N=true;}}break;case this._keyMap.BOLD.key:if(this._checkKey(this._keyMap.BOLD,X)){S="bold";N=true;}break;case this._keyMap.FONT_SIZE_UP.key:case this._keyMap.FONT_SIZE_DOWN.key:var K=false,T=false;if(this._checkKey(this._keyMap.FONT_SIZE_UP,X)){K=true;}if(this._checkKey(this._keyMap.FONT_SIZE_DOWN,X)){T=true;}if(K||T){var H=this.toolbar.getButtonByValue("fontsize"),G=parseInt(H.get("label"),10),I=(G+1);if(T){I=(G-1);}S="fontsize";P=I+"px";N=true;}break;case this._keyMap.ITALIC.key:if(this._checkKey(this._keyMap.ITALIC,X)){S="italic"; -N=true;}break;case this._keyMap.UNDERLINE.key:if(this._checkKey(this._keyMap.UNDERLINE,X)){S="underline";N=true;}break;case 9:if(this.browser.ie){E=this._getRange();U=this._getSelectedElement();if(!this._isElement(U,"li")){if(E){E.pasteHTML("    ");E.collapse(false);E.select();}A.stopEvent(X);}}if(this.browser.gecko>1.8){U=this._getSelectedElement();if(this._isElement(U,"li")){if(X.shiftKey){this._getDoc().execCommand("outdent",null,"");}else{this._getDoc().execCommand("indent",null,"");}}else{if(!this._hasSelection()){this.execCommand("inserthtml","    ");}}A.stopEvent(X);}break;case 13:var M=null,V=0;if(this.get("ptags")&&!X.shiftKey){if(this.browser.gecko){U=this._getSelectedElement();if(!this._hasParent(U,"li")){if(this._hasParent(U,"p")){M=this._getDoc().createElement("p");M.innerHTML=" ";C.insertAfter(M,U);this._selectNode(M.firstChild);}else{if(this._isElement(U,"body")){this.execCommand("insertparagraph",null);var O=this._getDoc().body.getElementsByTagName("p");for(V=0;V');var L=this._getDoc().getElementById("yui-br"),Y=this._getDoc().createElement("br"),J=this._getDoc().createElement("span");L.parentNode.replaceChild(Y,L);J.className="yui-non";J.innerHTML=" ";C.insertAfter(J,Y);this._selectNode(J);}A.stopEvent(X);}}if(this.browser.ie){E=this._getRange();U=this._getSelectedElement();if(!this._isElement(U,"li")){if(E){E.pasteHTML("
          ");E.collapse(false);E.select();}A.stopEvent(X);}}}break;}if(this.browser.ie){this._listFix(X);}if(N&&S){this.execCommand(S,P);A.stopEvent(X);this.nodeChange();}this._storeUndo();this.fireEvent("editorKeyDown",{type:"editorKeyDown",target:this,ev:X});},_fixListRunning:null,_fixListDupIds:function(){if(this._fixListRunning){return false;}if(this._getDoc()){this._fixListRunning=true;var E=this._getDoc().body.getElementsByTagName("li"),F=0,G={};for(F=0;F'+E+" ";}else{I.innerHTML='  ';}}}else{if(E){I.innerHTML=E+" ";}else{I.innerHTML=" ";}}I.parentNode.replaceChild(J,I);J.appendChild(I);if(this.browser.webkit){this._getSelection().setBaseAndExtent(I.firstChild,1,I.firstChild,I.firstChild.innerText.length);if(!this.browser.webkit3){I.parentNode.parentNode.style.display="list-item";setTimeout(function(){I.parentNode.parentNode.style.display="block";},1);}}else{if(this.browser.ie){G=this._getDoc().body.createTextRange();G.moveToElementText(I);G.collapse(false);G.select();}else{this._selectNode(I);}}A.stopEvent(K);}if(this.browser.webkit){A.stopEvent(K);}this.nodeChange();}},nodeChange:function(E){var F=this;this._storeUndo();if(this.get("nodeChangeDelay")){this._nodeChangeDelayTimer=window.setTimeout(function(){F._nodeChangeDelayTimer=null;F._nodeChange.apply(F,arguments);},0);}else{this._nodeChange();}},_nodeChange:function(F){var H=parseInt(this.get("nodeChangeThreshold"),10),O=Math.round(new Date().getTime()/1000),R=this;if(F===true){this._lastNodeChange=0;}if((this._lastNodeChange+H)0){for(var V=0;V'+Y+"");this._updateMenuChecked("fontname",Y);}if(L){L.set("label",L._configs.label._initialConfig.value);}var K=this.toolbar.getButtonByValue("heading");if(K){K.set("label",K._configs.label._initialConfig.value);this._updateMenuChecked("heading","none");}var I=this.toolbar.getButtonByValue("insertimage");if(I&&this.currentWindow&&(this.currentWindow.name=="insertimage")){this.toolbar.disableButton(I);}if(this._lastButton&&this._lastButton.isSelected){this.toolbar.deselectButton(this._lastButton.id);}this._undoNodeChange();}}this.fireEvent("afterNodeChange",{type:"afterNodeChange",target:this});},_updateMenuChecked:function(E,F,H){if(!H){H=this.toolbar;}var G=H.getButtonByValue(E);G.checkValue(F);},_handleToolbarClick:function(F){var H="";var I="";var G=F.button.value;if(F.button.menucmd){H=G;G=F.button.menucmd;}this._lastButton=F.button;if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}else{this.execCommand(G,H);if(!this.browser.webkit){var E=this;setTimeout(function(){E.focus.call(E);},5);}}A.stopEvent(F);},_setupAfterElement:function(){if(!this.beforeElement){this.beforeElement=document.createElement("h2");this.beforeElement.className="yui-editor-skipheader";this.beforeElement.tabIndex="-1";this.beforeElement.innerHTML=this.STR_BEFORE_EDITOR;this.get("element_cont").get("firstChild").insertBefore(this.beforeElement,this.toolbar.get("nextSibling"));}if(!this.afterElement){this.afterElement=document.createElement("h2");this.afterElement.className="yui-editor-skipheader";this.afterElement.tabIndex="-1";this.afterElement.innerHTML=this.STR_LEAVE_EDITOR;this.get("element_cont").get("firstChild").appendChild(this.afterElement);}},_disableEditor:function(J){var I,H,G,E;if(!this.get("disabled_iframe")){I=this._createIframe();I.set("id","disabled_"+this.get("iframe").get("id"));I.setStyle("height","100%");I.setStyle("display","none");I.setStyle("visibility","visible");this.set("disabled_iframe",I);H=this.get("iframe").get("parentNode");H.appendChild(I.get("element"));}if(!I){I=this.get("disabled_iframe");}if(J){this._orgIframe=this.get("iframe");if(this.toolbar){this.toolbar.set("disabled",true);}G=this.getEditorHTML();E=this.get("iframe").get("offsetHeight");I.setStyle("visibility","");I.setStyle("position","");I.setStyle("top","");I.setStyle("left","");this._orgIframe.setStyle("visibility","hidden");this._orgIframe.setStyle("position","absolute");this._orgIframe.setStyle("top","-99999px");this._orgIframe.setStyle("left","-99999px");this.set("iframe",I);this._setInitialContent(true);if(!this._mask){this._mask=document.createElement("DIV");C.addClass(this._mask,"yui-editor-masked");if(this.browser.ie){this._mask.style.height=E+"px";}this.get("iframe").get("parentNode").appendChild(this._mask);}this.on("editorContentReloaded",function(){this._getDoc().body._rteLoaded=false;this.setEditorHTML(G);I.setStyle("display","block");this.unsubscribeAll("editorContentReloaded");});}else{if(this._mask){this._mask.parentNode.removeChild(this._mask);this._mask=null;if(this.toolbar){this.toolbar.set("disabled",false);}I.setStyle("visibility","hidden");I.setStyle("position","absolute");I.setStyle("top","-99999px");I.setStyle("left","-99999px");this._orgIframe.setStyle("visibility","");this._orgIframe.setStyle("position","");this._orgIframe.setStyle("top","");this._orgIframe.setStyle("left","");this.set("iframe",this._orgIframe);this.focus();var F=this;window.setTimeout(function(){F.nodeChange.call(F);},100);}}},SEP_DOMPATH:"<",STR_LEAVE_EDITOR:"You have left the Rich Text Editor.",STR_BEFORE_EDITOR:"This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Shift + Escape to place focus on the toolbar and navigate between options with your arrow keys. To exit this text editor use the Escape key and continue tabbing.

          Common formatting keyboard shortcuts:

          • Control Shift B sets text to bold
          • Control Shift I sets text to italic
          • Control Shift U underlines text
          • Control Shift L adds an HTML link
          ",STR_TITLE:"Rich Text Area.",STR_IMAGE_HERE:"Image URL Here",STR_IMAGE_URL:"Image URL",STR_LINK_URL:"Link URL",STOP_EXEC_COMMAND:false,STOP_NODE_CHANGE:false,CLASS_NOEDIT:"yui-noedit",CLASS_CONTAINER:"yui-editor-container",CLASS_EDITABLE:"yui-editor-editable",CLASS_EDITABLE_CONT:"yui-editor-editable-container",CLASS_PREFIX:"yui-editor",browser:function(){var E=YAHOO.env.ua; -if(E.webkit>=420){E.webkit3=E.webkit;}else{E.webkit3=0;}if(E.webkit>=530){E.webkit4=E.webkit;}else{E.webkit4=0;}E.mac=false;if(navigator.userAgent.indexOf("Macintosh")!==-1){E.mac=true;}return E;}(),init:function(F,E){if(!this._defaultToolbar){this._defaultToolbar={collapse:true,titlebar:"Text Editing Tools",draggable:false,buttons:[{group:"fontstyle",label:"Font Name and Size",buttons:[{type:"select",label:"Arial",value:"fontname",disabled:true,menu:[{text:"Arial",checked:true},{text:"Arial Black"},{text:"Comic Sans MS"},{text:"Courier New"},{text:"Lucida Console"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Trebuchet MS"},{text:"Verdana"}]},{type:"spin",label:"13",value:"fontsize",range:[9,75],disabled:true}]},{type:"separator"},{group:"textstyle",label:"Font Style",buttons:[{type:"push",label:"Bold CTRL + SHIFT + B",value:"bold"},{type:"push",label:"Italic CTRL + SHIFT + I",value:"italic"},{type:"push",label:"Underline CTRL + SHIFT + U",value:"underline"},{type:"push",label:"Strike Through",value:"strikethrough"},{type:"separator"},{type:"color",label:"Font Color",value:"forecolor",disabled:true},{type:"color",label:"Background Color",value:"backcolor",disabled:true}]},{type:"separator"},{group:"indentlist",label:"Lists",buttons:[{type:"push",label:"Create an Unordered List",value:"insertunorderedlist"},{type:"push",label:"Create an Ordered List",value:"insertorderedlist"}]},{type:"separator"},{group:"insertitem",label:"Insert Item",buttons:[{type:"push",label:"HTML Link CTRL + SHIFT + L",value:"createlink",disabled:true},{type:"push",label:"Insert Image",value:"insertimage"}]}]};}YAHOO.widget.SimpleEditor.superclass.init.call(this,F,E);YAHOO.widget.EditorInfo._instances[this.get("id")]=this;this.currentElement=[];this.on("contentReady",function(){this.DOMReady=true;this.fireQueue();},this,true);},initAttributes:function(E){YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this,E);var F=this;this.setAttributeConfig("setDesignMode",{value:((E.setDesignMode===false)?false:true)});this.setAttributeConfig("nodeChangeDelay",{value:((E.nodeChangeDelay===false)?false:true)});this.setAttributeConfig("maxUndo",{writeOnce:true,value:E.maxUndo||30});this.setAttributeConfig("ptags",{writeOnce:true,value:E.ptags||false});this.setAttributeConfig("insert",{writeOnce:true,value:E.insert||false,method:function(K){if(K){var J={fontname:true,fontsize:true,forecolor:true,backcolor:true};var I=this._defaultToolbar.buttons;for(var H=0;H{TITLE}{CONTENT}',writeOnce:true});this.setAttributeConfig("extracss",{value:E.extracss||"",writeOnce:true});this.setAttributeConfig("handleSubmit",{value:E.handleSubmit||false,method:function(G){if(this.get("element").form){if(!this._formButtons){this._formButtons=[];}if(G){A.on(this.get("element").form,"submit",this._handleFormSubmit,this,true);var H=this.get("element").form.getElementsByTagName("input");for(var J=0;J=parseInt(this.get("height"),10))){var I=this.get("animate");this.set("animate",false);this.set("height",G+"px");this.set("animate",I);if(this.browser.ie){this.get("iframe").setStyle("height","99%");this.get("iframe").setStyle("zoom","1");var H=this;window.setTimeout(function(){H.get("iframe").setStyle("height","100%");},1);}}},_formButtons:null,_formButtonClicked:null,_handleFormButtonClick:function(F){var E=A.getTarget(F);this._formButtonClicked=E;},_handleFormSubmit:function(H){this.saveHTML();var G=this.get("element").form,E=this._formButtonClicked||false;A.removeListener(G,"submit",this._handleFormSubmit);if(YAHOO.env.ua.ie){if(E&&!E.disabled){E.click();}}else{if(E&&!E.disabled){E.click();}var F=document.createEvent("HTMLEvents");F.initEvent("submit",true,true);G.dispatchEvent(F);if(YAHOO.env.ua.webkit){if(YAHOO.lang.isFunction(G.submit)){G.submit();}}}},_handleFontSize:function(G){var E=this.toolbar.getButtonById(G.button.id);var F=E.get("label")+"px";this.execCommand("fontsize",F);return false;},_handleColorPicker:function(G){var F=G.button;var E="#"+G.color;if((F=="forecolor")||(F=="backcolor")){this.execCommand(F,E);}},_handleAlign:function(H){var G=null;for(var E=0;E'+H+"";if(J.get("label")!=N){J.set("label",N);this._updateMenuChecked("fontname",H);}}if(K){M=parseInt(C.getStyle(L,"fontSize"),10);if((M===null)||isNaN(M)){M=K._configs.label._initialConfig.value;}K.set("label",""+M);}if(!this._isElement(L,"body")&&!this._isElement(L,"img")){this.toolbar.enableButton(J);this.toolbar.enableButton(K);this.toolbar.enableButton("forecolor");this.toolbar.enableButton("backcolor");}if(this._isElement(L,"img")){if(YAHOO.widget.Overlay){this.toolbar.enableButton("createlink");}}if(this._hasParent(L,"blockquote")){this.toolbar.selectButton("indent");this.toolbar.disableButton("indent");this.toolbar.enableButton("outdent");}if(this._hasParent(L,"ol")||this._hasParent(L,"ul")){this.toolbar.disableButton("indent");}this._lastButton=null;},_handleInsertImageClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("insertimage")){return false; -}}this.toolbar.set("disabled",true);var E=function(){var F=this.currentElement[0],H="http://";if(!F){F=this._getSelectedElement();}if(F){if(F.getAttribute("src")){H=F.getAttribute("src",2);if(H.indexOf(this.get("blankimage"))!=-1){H=this.STR_IMAGE_HERE;}}}var G=prompt(this.STR_IMAGE_URL+": ",H);if((G!=="")&&(G!==null)){F.setAttribute("src",G);}else{if(G===""){F.parentNode.removeChild(F);this.currentElement=[];this.nodeChange();}else{if((G===null)){H=F.getAttribute("src",2);if(H.indexOf(this.get("blankimage"))!=-1){F.parentNode.removeChild(F);this.currentElement=[];this.nodeChange();}}}}this.closeWindow();this.toolbar.set("disabled",false);this.unsubscribe("afterExecCommand",E,this,true);};this.on("afterExecCommand",E,this,true);},_handleInsertImageWindowClose:function(){this.nodeChange();},_isLocalFile:function(E){if((E)&&(E!=="")&&((E.indexOf("file:/")!=-1)||(E.indexOf(":\\")!=-1))){return true;}return false;},_handleCreateLinkClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){return false;}}this.toolbar.set("disabled",true);var E=function(){var H=this.currentElement[0],G="";if(H){if(H.getAttribute("href",2)!==null){G=H.getAttribute("href",2);}}var J=prompt(this.STR_LINK_URL+": ",G);if((J!=="")&&(J!==null)){var I=J;if((I.indexOf(":/"+"/")==-1)&&(I.substring(0,1)!="/")&&(I.substring(0,6).toLowerCase()!="mailto")){if((I.indexOf("@")!=-1)&&(I.substring(0,6).toLowerCase()!="mailto")){I="mailto:"+I;}else{if(I.substring(0,1)!="#"){}}}H.setAttribute("href",I);}else{if(J!==null){var F=this._getDoc().createElement("span");F.innerHTML=H.innerHTML;C.addClass(F,"yui-non");H.parentNode.replaceChild(F,H);}}this.closeWindow();this.toolbar.set("disabled",false);this.unsubscribe("afterExecCommand",E,this,true);};this.on("afterExecCommand",E,this);},_handleCreateLinkWindowClose:function(){this.nodeChange();this.currentElement=[];},render:function(){if(this._rendered){return false;}if(!this.DOMReady){this._queue[this._queue.length]=["render",arguments];return false;}if(this.get("element")){if(this.get("element").tagName){this._textarea=true;if(this.get("element").tagName.toLowerCase()!=="textarea"){this._textarea=false;}}else{return false;}}else{return false;}this._rendered=true;var E=this;window.setTimeout(function(){E._render.call(E);},4);},_render:function(){var E=this;this.set("textarea",this.get("element"));this.get("element_cont").setStyle("display","none");this.get("element_cont").addClass(this.CLASS_CONTAINER);this.set("iframe",this._createIframe());window.setTimeout(function(){E._setInitialContent.call(E);},10);this.get("editor_wrapper").appendChild(this.get("iframe").get("element"));if(this.get("disabled")){this._disableEditor(true);}var F=this.get("toolbar");if(F instanceof B){this.toolbar=F;this.toolbar.set("disabled",true);}else{F.disabled=true;this.toolbar=new B(this.get("toolbar_cont"),F);}this.fireEvent("toolbarLoaded",{type:"toolbarLoaded",target:this.toolbar});this.toolbar.on("toolbarCollapsed",function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on("toolbarExpanded",function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on("fontsizeClick",this._handleFontSize,this,true);this.toolbar.on("colorPickerClicked",function(G){this._handleColorPicker(G);return false;},this,true);this.toolbar.on("alignClick",this._handleAlign,this,true);this.on("afterNodeChange",this._handleAfterNodeChange,this,true);this.toolbar.on("insertimageClick",this._handleInsertImageClick,this,true);this.on("windowinsertimageClose",this._handleInsertImageWindowClose,this,true);this.toolbar.on("createlinkClick",this._handleCreateLinkClick,this,true);this.on("windowcreatelinkClose",this._handleCreateLinkWindowClose,this,true);this.get("parentNode").replaceChild(this.get("element_cont").get("element"),this.get("element"));this.setStyle("visibility","hidden");this.setStyle("position","absolute");this.setStyle("top","-9999px");this.setStyle("left","-9999px");this.get("element_cont").appendChild(this.get("element"));this.get("element_cont").setStyle("display","block");C.addClass(this.get("iframe").get("parentNode"),this.CLASS_EDITABLE_CONT);this.get("iframe").addClass(this.CLASS_EDITABLE);this.get("element_cont").setStyle("width",this.get("width"));C.setStyle(this.get("iframe").get("parentNode"),"height",this.get("height"));this.get("iframe").setStyle("width","100%");this.get("iframe").setStyle("height","100%");this._setupDD();window.setTimeout(function(){E._setupAfterElement.call(E);},0);this.fireEvent("afterRender",{type:"afterRender",target:this});},execCommand:function(G,F){var J=this.fireEvent("beforeExecCommand",{type:"beforeExecCommand",target:this,args:arguments});if((J===false)||(this.STOP_EXEC_COMMAND)){this.STOP_EXEC_COMMAND=false;return false;}this._lastCommand=G;this._setMarkupType(G);if(this.browser.ie){this._getWindow().focus();}var E=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue(G)){E=false;}}this.editorDirty=true;if((typeof this["cmd_"+G.toLowerCase()]=="function")&&E){var I=this["cmd_"+G.toLowerCase()](F);E=I[0];if(I[1]){G=I[1];}if(I[2]){F=I[2];}}if(E){try{this._getDoc().execCommand(G,false,F);}catch(H){}}else{}this.on("afterExecCommand",function(){this.unsubscribeAll("afterExecCommand");this.nodeChange();},this,true);this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});},cmd_bold:function(H){if(!this.browser.webkit){var G=this._getSelectedElement();if(G&&this._isElement(G,"span")&&this._hasSelection()){if(G.style.fontWeight=="bold"){G.style.fontWeight="";var E=this._getDoc().createElement("b"),F=G.parentNode;F.replaceChild(E,G);E.appendChild(G);}}}return[true];},cmd_italic:function(H){if(!this.browser.webkit){var G=this._getSelectedElement();if(G&&this._isElement(G,"span")&&this._hasSelection()){if(G.style.fontStyle=="italic"){G.style.fontStyle="";var E=this._getDoc().createElement("i"),F=G.parentNode;F.replaceChild(E,G);E.appendChild(G);}}}return[true];},cmd_underline:function(F){if(!this.browser.webkit){var E=this._getSelectedElement(); -if(E&&this._isElement(E,"span")){if(E.style.textDecoration=="underline"){E.style.textDecoration="none";}else{E.style.textDecoration="underline";}return[false];}}return[true];},cmd_backcolor:function(H){var E=true,F=this._getSelectedElement(),G="backcolor";if(this.browser.gecko||this.browser.opera){this._setEditorStyle(true);G="hilitecolor";}if(!this._isElement(F,"body")&&!this._hasSelection()){F.style.backgroundColor=H;this._selectNode(F);E=false;}else{if(this.get("insert")){F=this._createInsertElement({backgroundColor:H});}else{this._createCurrentElement("span",{backgroundColor:H,color:F.style.color,fontSize:F.style.fontSize,fontFamily:F.style.fontFamily});this._selectNode(this.currentElement[0]);}E=false;}return[E,G];},cmd_forecolor:function(G){var E=true,F=this._getSelectedElement();if(!this._isElement(F,"body")&&!this._hasSelection()){C.setStyle(F,"color",G);this._selectNode(F);E=false;}else{if(this.get("insert")){F=this._createInsertElement({color:G});}else{this._createCurrentElement("span",{color:G,fontSize:F.style.fontSize,fontFamily:F.style.fontFamily,backgroundColor:F.style.backgroundColor});this._selectNode(this.currentElement[0]);}E=false;}return[E];},cmd_unlink:function(E){this._swapEl(this.currentElement[0],"span",function(F){F.className="yui-non";});return[false];},cmd_createlink:function(G){var F=this._getSelectedElement(),E=null;if(this._hasParent(F,"a")){this.currentElement[0]=this._hasParent(F,"a");}else{if(this._isElement(F,"li")){E=this._getDoc().createElement("a");E.innerHTML=F.innerHTML;F.innerHTML="";F.appendChild(E);this.currentElement[0]=E;}else{if(!this._isElement(F,"a")){this._createCurrentElement("a");E=this._swapEl(this.currentElement[0],"a");this.currentElement[0]=E;}else{this.currentElement[0]=F;}}}return[false];},cmd_insertimage:function(J){var E=true,F=null,I="insertimage",H=this._getSelectedElement();if(J===""){J=this.get("blankimage");}if(this._isElement(H,"img")){this.currentElement[0]=H;E=false;}else{if(this._getDoc().queryCommandEnabled(I)){this._getDoc().execCommand(I,false,J);var K=this._getDoc().getElementsByTagName("img");for(var G=0;G"+F[N].innerHTML+"";}Z.innerHTML=U;this.currentElement[0]=G;this.currentElement[0].parentNode.replaceChild(Z,this.currentElement[0]);}else{this._createCurrentElement(e.toLowerCase());Z=this._getDoc().createElement(e);for(N=0;N  ';Z.appendChild(K);if(N>0){this.currentElement[N].parentNode.removeChild(this.currentElement[N]);}}var T=((this.browser.opera)?"
          ":"
          "),S=Z.firstChild.innerHTML.split(T),Y,a;if(S.length>0){Z.innerHTML="";for(Y=0;Y";}var c=this._getDoc().createElement("span");c.innerHTML=U;G.parentNode.parentNode.replaceChild(c,G.parentNode);}else{this.nodeChange();this._getDoc().execCommand(W,"",G.parentNode);this.nodeChange();}V=false;}if(this.browser.opera){var R=this;window.setTimeout(function(){var f=R._getDoc().getElementsByTagName("li");for(var g=0;g"){f[g].parentNode.parentNode.removeChild(f[g].parentNode);}}},30);}if(this.browser.ie&&V){var L="";if(this._getRange().html){L="
        • "+this._getRange().html+"
        • ";}else{var M=this._getRange().text.split("\n");if(M.length>1){L="";for(var Q=0;Q"+M[Q]+"";}}else{var P=this._getRange().text;if(P===""){L='
        • '+P+"
        • ";}else{L="
        • "+P+"
        • ";}}}this._getRange().pasteHTML("<"+e+">"+L+"");var E=this._getDoc().getElementById("new_list_item");if(E){var O=this._getDoc().body.createTextRange(); -O.moveToElementText(E);O.collapse(false);O.select();E.id="";}V=false;}}return V;},cmd_insertorderedlist:function(E){return[this.cmd_list("ol")];},cmd_insertunorderedlist:function(E){return[this.cmd_list("ul")];},cmd_fontname:function(H){var E=true,G=this._getSelectedElement();this.currentFont=H;if(G&&G.tagName&&!this._hasSelection()&&!this._isElement(G,"body")&&!this.get("insert")){YAHOO.util.Dom.setStyle(G,"font-family",H);E=false;}else{if(this.get("insert")&&!this._hasSelection()){var F=this._createInsertElement({fontFamily:H});E=false;}}return[E];},cmd_fontsize:function(H){var E=null,G=true;E=this._getSelectedElement();if(this.browser.webkit){if(this.currentElement[0]){if(E==this.currentElement[0]){G=false;YAHOO.util.Dom.setStyle(E,"fontSize",H);this._selectNode(E);this.currentElement[0]=E;}}}if(G){if(!this._isElement(this._getSelectedElement(),"body")&&(!this._hasSelection())){E=this._getSelectedElement();YAHOO.util.Dom.setStyle(E,"fontSize",H);if(this.get("insert")&&this.browser.ie){var F=this._getRange();F.collapse(false);F.select();}else{this._selectNode(E);}}else{if(this.currentElement&&(this.currentElement.length>0)&&(!this._hasSelection())&&(!this.get("insert"))){YAHOO.util.Dom.setStyle(this.currentElement,"fontSize",H);}else{if(this.get("insert")&&!this._hasSelection()){E=this._createInsertElement({fontSize:H});this.currentElement[0]=E;this._selectNode(this.currentElement[0]);}else{this._createCurrentElement("span",{"fontSize":H,fontFamily:E.style.fontFamily,color:E.style.color,backgroundColor:E.style.backgroundColor});this._selectNode(this.currentElement[0]);}}}}return[false];},_swapEl:function(F,E,H){var G=this._getDoc().createElement(E);if(F){G.innerHTML=F.innerHTML;}if(typeof H=="function"){H.call(this,G);}if(F){F.parentNode.replaceChild(G,F);}return G;},_createInsertElement:function(E){this._createCurrentElement("span",E);var F=this.currentElement[0];if(this.browser.webkit){F.innerHTML=' ';F=F.firstChild;this._getSelection().setBaseAndExtent(F,1,F,F.innerText.length);}else{if(this.browser.ie||this.browser.opera){F.innerHTML=" ";}}this.focus();this._selectNode(F,true);return F;},_createCurrentElement:function(G,J){G=((G)?G:"a");var R=null,F=[],H=this._getDoc();if(this.currentFont){if(!J){J={};}J.fontFamily=this.currentFont;this.currentFont=null;}this.currentElement=[];var M=function(X,Z){var Y=null;X=((X)?X:"span");X=X.toLowerCase();switch(X){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":Y=H.createElement(X);break;default:Y=H.createElement(X);if(X==="span"){YAHOO.util.Dom.addClass(Y,"yui-tag-"+X);YAHOO.util.Dom.addClass(Y,"yui-tag");Y.setAttribute("tag",X);}for(var W in Z){if(YAHOO.lang.hasOwnProperty(Z,W)){Y.style[W]=Z[W];}}break;}return Y;};if(!this._hasSelection()){if(this._getDoc().queryCommandEnabled("insertimage")){this._getDoc().execCommand("insertimage",false,"yui-tmp-img");var L=this._getDoc().getElementsByTagName("img");for(var Q=0;Q]*)>/gi,"");E=E.replace(/<\/strong>/gi,"
          ");E=E.replace(/]*)>/gi,"");E=E.replace(/<\/embed>/gi,"");E=E.replace(/]*)>/gi,"");E=E.replace(/<\/em>/gi,"
          ");E=E.replace(/_moz_dirty=""/gi,"");E=E.replace(/]*)>/gi,"");E=E.replace(/<\/YUI_EMBED>/gi,"");if(this.get("plainText")){E=E.replace(/\n/g,"
          ").replace(/\r/g,"
          ");E=E.replace(/ /gi,"  ");E=E.replace(/\t/gi,"    ");}E=E.replace(/]*)>/gi,"");E=E.replace(/<\/script([^>]*)>/gi,"");E=E.replace(/<script([^>]*)>/gi,"");E=E.replace(/<\/script([^>]*)>/gi,"");E=E.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\r/g,"");E=E.replace(new RegExp("]*)>(.*?)","gi"),"");E=E.replace(//g,"\n");return E;},cleanHTML:function(H){if(!H){H=this.getEditorHTML();}var F=this.get("markup");H=this.pre_filter_linebreaks(H,F);H=this.filter_msword(H);H=H.replace(/]*)\/>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/]*)\/>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/ul>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/blockquote>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/embed>/gi,"");if((F=="semantic")||(F=="xhtml")){H=H.replace(/]*)?>/gi,"");H=H.replace(/<\/i>/gi,"");H=H.replace(/]*)?>/gi,"");H=H.replace(/<\/b>/gi,"");}H=H.replace(/_moz_dirty=""/gi,"");H=H.replace(//gi,"/span>");if(this.browser.ie){H=H.replace(/text-decoration/gi,"text-decoration");H=H.replace(/font-weight/gi,"font-weight");H=H.replace(/_width="([^>]*)"/gi,"");H=H.replace(/_height="([^>]*)"/gi,"");var G=this._baseHREF.replace(/\//gi,"\\/"),I=new RegExp('src="'+G,"gi");H=H.replace(I,'src="');}H=H.replace(//gi,"");H=H.replace(//gi,"");if((F=="semantic")||(F=="xhtml")||(F=="css")){H=H.replace(new RegExp(']*)face="([^>]*)">(.*?)',"gi"),'$3');H=H.replace(/([^>]*)',"gi"),"$1");H=H.replace(new RegExp('([^>]*)',"gi"),"$1");}H=H.replace(/\/u>/gi,"/span>");if(F=="css"){H=H.replace(/]*)>/gi,"");H=H.replace(/<\/em>/gi,"
          ");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/strong>/gi,"");H=H.replace(//gi,"/span>");H=H.replace(//gi,"/span>");}H=H.replace(/ /gi," ");}else{H=H.replace(//gi,"/u>");}H=H.replace(/]*)>/gi,"");H=H.replace(/\/ol>/gi,"/ol>");H=H.replace(/
        • /gi,"/li>");H=this.filter_safari(H);H=this.filter_internals(H);H=this.filter_all_rgb(H);H=this.post_filter_linebreaks(H,F);if(F=="xhtml"){H=H.replace(/]*)>/g,"");H=H.replace(/]*)>/g,"");}else{H=H.replace(/]*)>/g,"");H=H.replace(/]*)>/g,"");}H=H.replace(/]*)>/g,"");H=H.replace(/<\/YUI_UL>/g,"
        ");H=this.filter_invalid_lists(H);H=H.replace(/]*)>/g,"");H=H.replace(/<\/YUI_BQ>/g,"");H=H.replace(/]*)>/g,"");H=H.replace(/<\/YUI_EMBED>/g,"");H=H.replace(/ & /gi," YUI_AMP ");H=H.replace(/ &/gi," YUI_AMP_F ");H=H.replace(/& /gi," YUI_AMP_R ");H=H.replace(/&/gi,"&");H=H.replace(/ YUI_AMP /gi," & ");H=H.replace(/ YUI_AMP_F /gi," &");H=H.replace(/ YUI_AMP_R /gi,"& ");H=YAHOO.lang.trim(H);if(this.get("removeLineBreaks")){H=H.replace(/\n/g,"").replace(/\r/g,"");H=H.replace(/ /gi," ");}for(var E in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,E)){if(D.isObject(E)&&E.keepContents){H=H.replace(new RegExp("<"+E+"([^>]*)>(.*?)","gi"),"$1");}else{H=H.replace(new RegExp("<"+E+"([^>]*)>(.*?)","gi"),"");}}}this.fireEvent("cleanHTML",{type:"cleanHTML",target:this,html:H});return H;},filter_msword:function(E){if(!this.get("filterWord")){return E;}E=E.replace(/\s*<\/o:p>/g,"");E=E.replace(/[\s\S]*?<\/o:p>/g," ");E=E.replace(/]*>[\s\S]*?<\/w:[^>]*>/gi,"");E=E.replace(/\s*mso-[^:]+:[^;"]+;?/gi,"");E=E.replace(/\s*MARGIN: 0cm 0cm 0pt\s*;/gi,"");E=E.replace(/\s*MARGIN: 0cm 0cm 0pt\s*"/gi,'"');E=E.replace(/\s*TEXT-INDENT: 0cm\s*;/gi,"");E=E.replace(/\s*TEXT-INDENT: 0cm\s*"/gi,'"');E=E.replace(/\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi,'"'); -E=E.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi,'"');E=E.replace(/\s*tab-stops:[^;"]*;?/gi,"");E=E.replace(/\s*tab-stops:[^"]*/gi,"");E=E.replace(/<\\?\?xml[^>]*>/gi,"");E=E.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");E=E.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,"<$1$3");E=E.replace(/<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi,"<$1$3");E=E.replace(/<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi,"<$1$3");return E;},filter_invalid_lists:function(E){E=E.replace(/<\/li>\n/gi,"");E=E.replace(/<\/li>
          /gi,"
          1. ");E=E.replace(/<\/ol>/gi,"
        1. ");E=E.replace(/<\/ol><\/li>\n/gi,"
        ");E=E.replace(/<\/li>
          /gi,"
          • ");E=E.replace(/<\/ul>/gi,"
        • ");E=E.replace(/<\/ul><\/li>\n?/gi,"
        ");E=E.replace(/<\/li>/gi,"");E=E.replace(/<\/ol>/gi,"
    ");E=E.replace(/
      /gi,"
        ");E=E.replace(/
          /gi,"
            ");return E;},filter_safari:function(E){if(this.browser.webkit){E=E.replace(/([^>])<\/span>/gi,"    ");E=E.replace(/Apple-style-span/gi,"");E=E.replace(/style="line-height: normal;"/gi,"");E=E.replace(/yui-wk-div/gi,"");E=E.replace(/yui-wk-p/gi,"");E=E.replace(/
          • <\/li>/gi,"");E=E.replace(/
          • <\/li>/gi,"");E=E.replace(/
          • <\/li>/gi,"");if(this.get("ptags")){E=E.replace(/]*)>/g,"");E=E.replace(/<\/div>/gi,"

            ");}else{E=E.replace(/]*)>([ tnr]*)<\/div>/gi,"
            ");E=E.replace(/<\/div>/gi,"");}}return E;},filter_internals:function(E){E=E.replace(/\r/g,"");E=E.replace(/<\/?(body|head|html)[^>]*>/gi,"");E=E.replace(/<\/li>/gi,"
          • ");E=E.replace(/yui-tag-span/gi,"");E=E.replace(/yui-tag/gi,"");E=E.replace(/yui-non/gi,"");E=E.replace(/yui-img/gi,"");E=E.replace(/ tag="span"/gi,"");E=E.replace(/ class=""/gi,"");E=E.replace(/ style=""/gi,"");E=E.replace(/ class=" "/gi,"");E=E.replace(/ class=" "/gi,"");E=E.replace(/ target=""/gi,"");E=E.replace(/ title=""/gi,"");if(this.browser.ie){E=E.replace(/ class= /gi,"");E=E.replace(/ class= >/gi,"");}return E;},filter_all_rgb:function(I){var H=new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)","gi");var E=I.match(H);if(D.isArray(E)){for(var G=0;G/gi,"");F=F.replace(/
            /gi,"");}F=F.replace(/
            /gi,"");F=F.replace(/
            /gi,"");F=F.replace(//gi,"");F=F.replace(/
            /gi,"");F=F.replace(/
            <\/div>/gi,"");F=F.replace(/

            ( | )<\/p>/g,"");F=F.replace(/


             <\/p>/gi,"");F=F.replace(/

             <\/p>/gi,"");F=F.replace(/$/,"");F=F.replace(/<\/p>/g,"

            ");if(this.browser.ie){F=F.replace(/    /g,"\t");}return F;},post_filter_linebreaks:function(F,E){if(E=="xhtml"){F=F.replace(//g,"
            ");}else{F=F.replace(//g,"
            ");}return F;},clearEditorDoc:function(){this._getDoc().body.innerHTML=" ";},openWindow:function(E){},moveWindow:function(){},_closeWindow:function(){},closeWindow:function(){this.toolbar.resetAllButtons();this.focus();},destroy:function(){if(this._nodeChangeDelayTimer){clearTimeout(this._nodeChangeDelayTimer);}this.hide();if(this.resize){this.resize.destroy();}if(this.dd){this.dd.unreg();}if(this.get("panel")){this.get("panel").destroy();}this.saveHTML();this.toolbar.destroy();this.setStyle("visibility","visible");this.setStyle("position","static");this.setStyle("top","");this.setStyle("left","");var E=this.get("element");this.get("element_cont").get("parentNode").replaceChild(E,this.get("element_cont").get("element"));this.get("element_cont").get("element").innerHTML="";this.set("handleSubmit",false);return true;},toString:function(){var E="SimpleEditor";if(this.get&&this.get("element_cont")){E="SimpleEditor (#"+this.get("element_cont").get("id")+")"+((this.get("disabled")?" Disabled":""));}return E;}});YAHOO.widget.EditorInfo={_instances:{},blankImage:"",window:{},panel:null,getEditorById:function(E){if(!YAHOO.lang.isString(E)){E=E.id;}if(this._instances[E]){return this._instances[E];}return false;},saveAll:function(G){var F,H,E=YAHOO.widget.EditorInfo._instances;if(G){for(F in E){if(D.hasOwnProperty(E,F)){H=E[F];if(H.get("element").form&&(H.get("element").form==G)){H.saveHTML();}}}}else{for(F in E){if(D.hasOwnProperty(E,F)){E[F].saveHTML();}}}},toString:function(){var E=0;for(var F in this._instances){if(D.hasOwnProperty(this._instances,F)){E++;}}return"Editor Info ("+E+" registered intance"+((E>1)?"s":"")+")";}};})();(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang,B=YAHOO.widget.Toolbar;YAHOO.widget.Editor=function(F,E){YAHOO.widget.Editor.superclass.constructor.call(this,F,E);};YAHOO.extend(YAHOO.widget.Editor,YAHOO.widget.SimpleEditor,{_undoCache:null,_undoLevel:null,_hasUndoLevel:function(){return((this._undoCache.length>1)&&this._undoLevel);},_undoNodeChange:function(){var E=this.toolbar.getButtonByValue("undo"),F=this.toolbar.getButtonByValue("redo");if(E&&F){if(this._hasUndoLevel()){this.toolbar.enableButton(E);}if(this._undoLevel=this.get("maxUndo")){for(var F=(E-this.get("maxUndo"));FCommon formatting keyboard shortcuts:
            • Control Shift B sets text to bold
            • Control Shift I sets text to italic
            • Control Shift U underlines text
            • Control Shift [ aligns text left
            • Control Shift | centers text
            • Control Shift ] aligns text right
            • Control Shift L adds an HTML link
            • To exit this text editor use the keyboard shortcut Control + Shift + ESC.
            ",STR_CLOSE_WINDOW:"Close Window",STR_CLOSE_WINDOW_NOTE:"To close this window use the Control + Shift + W key",STR_IMAGE_PROP_TITLE:"Image Options",STR_IMAGE_TITLE:"Description",STR_IMAGE_SIZE:"Size",STR_IMAGE_ORIG_SIZE:"Original Size",STR_IMAGE_COPY:'Note:To move this image just highlight it, cut, and paste where ever you\'d like.',STR_IMAGE_PADDING:"Padding",STR_IMAGE_BORDER:"Border",STR_IMAGE_BORDER_SIZE:"Border Size",STR_IMAGE_BORDER_TYPE:"Border Type",STR_IMAGE_TEXTFLOW:"Text Flow",STR_LOCAL_FILE_WARNING:'Note:This image/link points to a file on your computer and will not be accessible to others on the internet.',STR_LINK_PROP_TITLE:"Link Options",STR_LINK_PROP_REMOVE:"Remove link from text",STR_LINK_NEW_WINDOW:"Open in a new window.",STR_LINK_TITLE:"Description",STR_NONE:"none",CLASS_LOCAL_FILE:"warning-localfile",CLASS_HIDDEN:"yui-hidden",init:function(F,E){this._windows={};if(!this._defaultToolbar){this._defaultToolbar={collapse:true,titlebar:"Text Editing Tools",draggable:false,buttonType:"advanced",buttons:[{group:"fontstyle",label:"Font Name and Size",buttons:[{type:"select",label:"Arial",value:"fontname",disabled:true,menu:[{text:"Arial",checked:true},{text:"Arial Black"},{text:"Comic Sans MS"},{text:"Courier New"},{text:"Lucida Console"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Trebuchet MS"},{text:"Verdana"}]},{type:"spin",label:"13",value:"fontsize",range:[9,75],disabled:true}]},{type:"separator"},{group:"textstyle",label:"Font Style",buttons:[{type:"push",label:"Bold CTRL + SHIFT + B",value:"bold"},{type:"push",label:"Italic CTRL + SHIFT + I",value:"italic"},{type:"push",label:"Underline CTRL + SHIFT + U",value:"underline"},{type:"separator"},{type:"push",label:"Subscript",value:"subscript",disabled:true},{type:"push",label:"Superscript",value:"superscript",disabled:true}]},{type:"separator"},{group:"textstyle2",label:" ",buttons:[{type:"color",label:"Font Color",value:"forecolor",disabled:true},{type:"color",label:"Background Color",value:"backcolor",disabled:true},{type:"separator"},{type:"push",label:"Remove Formatting",value:"removeformat",disabled:true},{type:"push",label:"Show/Hide Hidden Elements",value:"hiddenelements"}]},{type:"separator"},{group:"undoredo",label:"Undo/Redo",buttons:[{type:"push",label:"Undo",value:"undo",disabled:true},{type:"push",label:"Redo",value:"redo",disabled:true}]},{type:"separator"},{group:"alignment",label:"Alignment",buttons:[{type:"push",label:"Align Left CTRL + SHIFT + [",value:"justifyleft"},{type:"push",label:"Align Center CTRL + SHIFT + |",value:"justifycenter"},{type:"push",label:"Align Right CTRL + SHIFT + ]",value:"justifyright"},{type:"push",label:"Justify",value:"justifyfull"}]},{type:"separator"},{group:"parastyle",label:"Paragraph Style",buttons:[{type:"select",label:"Normal",value:"heading",disabled:true,menu:[{text:"Normal",value:"none",checked:true},{text:"Header 1",value:"h1"},{text:"Header 2",value:"h2"},{text:"Header 3",value:"h3"},{text:"Header 4",value:"h4"},{text:"Header 5",value:"h5"},{text:"Header 6",value:"h6"}]}]},{type:"separator"},{group:"indentlist2",label:"Indenting and Lists",buttons:[{type:"push",label:"Indent",value:"indent",disabled:true},{type:"push",label:"Outdent",value:"outdent",disabled:true},{type:"push",label:"Create an Unordered List",value:"insertunorderedlist"},{type:"push",label:"Create an Ordered List",value:"insertorderedlist"}]},{type:"separator"},{group:"insertitem",label:"Insert Item",buttons:[{type:"push",label:"HTML Link CTRL + SHIFT + L",value:"createlink",disabled:true},{type:"push",label:"Insert Image",value:"insertimage"}]}]};}if(!this._defaultImageToolbarConfig){this._defaultImageToolbarConfig={buttonType:this._defaultToolbar.buttonType,buttons:[{group:"textflow",label:this.STR_IMAGE_TEXTFLOW+":",buttons:[{type:"push",label:"Left",value:"left"},{type:"push",label:"Inline",value:"inline"},{type:"push",label:"Block",value:"block"},{type:"push",label:"Right",value:"right"}]},{type:"separator"},{group:"padding",label:this.STR_IMAGE_PADDING+":",buttons:[{type:"spin",label:"0",value:"padding",range:[0,50]}]},{type:"separator"},{group:"border",label:this.STR_IMAGE_BORDER+":",buttons:[{type:"select",label:this.STR_IMAGE_BORDER_SIZE,value:"bordersize",menu:[{text:"none",value:"0",checked:true},{text:"1px",value:"1"},{text:"2px",value:"2"},{text:"3px",value:"3"},{text:"4px",value:"4"},{text:"5px",value:"5"}]},{type:"select",label:this.STR_IMAGE_BORDER_TYPE,value:"bordertype",disabled:true,menu:[{text:"Solid",value:"solid",checked:true},{text:"Dashed",value:"dashed"},{text:"Dotted",value:"dotted"}]},{type:"color",label:"Border Color",value:"bordercolor",disabled:true}]}]}; -}YAHOO.widget.Editor.superclass.init.call(this,F,E);},_render:function(){YAHOO.widget.Editor.superclass._render.apply(this,arguments);var E=this;window.setTimeout(function(){E._renderPanel.call(E);},800);},initAttributes:function(E){YAHOO.widget.Editor.superclass.initAttributes.call(this,E);this.setAttributeConfig("localFileWarning",{value:E.locaFileWarning||true});this.setAttributeConfig("hiddencss",{value:E.hiddencss||".yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div,.yui-hidden p,.yui-hidden span,.yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table { border: 1px dotted #ccc; } .yui-hidden .yui-non { border: none; } .yui-hidden img { padding: 2px; }",writeOnce:true});},_windows:null,_defaultImageToolbar:null,_defaultImageToolbarConfig:null,_fixNodes:function(){YAHOO.widget.Editor.superclass._fixNodes.call(this);try{var H="";var J=this._getDoc().getElementsByTagName("img");for(var F=0;F'+this.STR_LINK_URL+': ';H+='";H+='';var E=document.createElement("div");E.innerHTML=H;var G=document.createElement("div");G.className="removeLink";var F=document.createElement("a");F.href="#";F.innerHTML=this.STR_LINK_PROP_REMOVE;F.title=this.STR_LINK_PROP_REMOVE;A.on(F,"click",function(I){A.stopEvent(I);this.unsubscribeAll("afterExecCommand");this.execCommand("unlink");this.closeWindow();},this,true);G.appendChild(F);E.appendChild(G);this._windows.createlink={};this._windows.createlink.body=E;A.on(E,"keyup",function(I){A.stopPropagation(I);});this.get("panel").editor_form.appendChild(E);this.fireEvent("windowCreateLinkRender",{type:"windowCreateLinkRender",panel:this.get("panel"),body:E});return E;},_handleCreateLinkClick:function(){var E=this._getSelectedElement();if(this._isElement(E,"img")){this.STOP_EXEC_COMMAND=true;this.currentElement[0]=E;this.toolbar.fireEvent("insertimageClick",{type:"insertimageClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});return false;}if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){return false;}}this.on("afterExecCommand",function(){var K=new YAHOO.widget.EditorWindow("createlink",{width:"350px"});var I=this.currentElement[0],H="",L="",J="",G=false;if(I){K.el=I;if(I.getAttribute("href",2)!==null){H=I.getAttribute("href",2);if(this._isLocalFile(H)){K.setFooter(this.STR_LOCAL_FILE_WARNING);G=true;}else{K.setFooter(" ");}}if(I.getAttribute("title")!==null){L=I.getAttribute("title");}if(I.getAttribute("target")!==null){J=I.getAttribute("target");}}var F=null;if(this._windows.createlink&&this._windows.createlink.body){F=this._windows.createlink.body;}else{F=this._renderCreateLinkWindow();}K.setHeader(this.STR_LINK_PROP_TITLE);K.setBody(F);A.purgeElement(this.get("id")+"_createlink_url");C.get(this.get("id")+"_createlink_url").value=H;C.get(this.get("id")+"_createlink_title").value=L;C.get(this.get("id")+"_createlink_target").checked=((J)?true:false);A.onAvailable(this.get("id")+"_createlink_url",function(){var M=this.get("id");window.setTimeout(function(){try{YAHOO.util.Dom.get(M+"_createlink_url").focus();}catch(N){}},50);if(this._isLocalFile(H)){C.addClass(this.get("id")+"_createlink_url","warning");this.get("panel").setFooter(this.STR_LOCAL_FILE_WARNING);}else{C.removeClass(this.get("id")+"_createlink_url","warning");this.get("panel").setFooter(" ");}A.on(this.get("id")+"_createlink_url","blur",function(){var N=C.get(this.get("id")+"_createlink_url");if(this._isLocalFile(N.value)){C.addClass(N,"warning");this.get("panel").setFooter(this.STR_LOCAL_FILE_WARNING);}else{C.removeClass(N,"warning");this.get("panel").setFooter(" ");}},this,true);},this,true);this.openWindow(K);});},_handleCreateLinkWindowClose:function(){var G=C.get(this.get("id")+"_createlink_url"),I=C.get(this.get("id")+"_createlink_target"),K=C.get(this.get("id")+"_createlink_title"),H=arguments[0].win.el,E=H;if(G&&G.value){var J=G.value;if((J.indexOf(":/"+"/")==-1)&&(J.substring(0,1)!="/")&&(J.substring(0,6).toLowerCase()!="mailto")){if((J.indexOf("@")!=-1)&&(J.substring(0,6).toLowerCase()!="mailto")){J="mailto:"+J; -}else{if(J.substring(0,1)!="#"){J="http:/"+"/"+J;}}}H.setAttribute("href",J);if(I.checked){H.setAttribute("target",I.value);}else{H.setAttribute("target","");}H.setAttribute("title",((K.value)?K.value:""));}else{var F=this._getDoc().createElement("span");F.innerHTML=H.innerHTML;C.addClass(F,"yui-non");H.parentNode.replaceChild(F,H);}C.removeClass(G,"warning");C.get(this.get("id")+"_createlink_url").value="";C.get(this.get("id")+"_createlink_title").value="";C.get(this.get("id")+"_createlink_target").checked=false;this.nodeChange();this.currentElement=[];},_renderInsertImageWindow:function(){var G=this.currentElement[0];var M='';var K=document.createElement("div");K.innerHTML=M;var J=document.createElement("div");J.id=this.get("id")+"_img_toolbar";K.appendChild(J);var I='';I+='';I+='";var E=document.createElement("div");E.innerHTML=I;K.appendChild(E);var F={};D.augmentObject(F,this._defaultImageToolbarConfig);var H=new YAHOO.widget.Toolbar(J,F);H.editor_el=G;this._defaultImageToolbar=H;var N=H.get("cont");var L=document.createElement("div");L.className="yui-toolbar-group yui-toolbar-group-height-width height-width";L.innerHTML="

            "+this.STR_IMAGE_SIZE+":

            ";L.innerHTML+=' x ';N.insertBefore(L,N.firstChild);A.onAvailable(this.get("id")+"_insertimage_width",function(){A.on(this.get("id")+"_insertimage_width","blur",function(){var O=parseInt(C.get(this.get("id")+"_insertimage_width").value,10);if(O>5){this._defaultImageToolbar.editor_el.style.width=O+"px";}},this,true);},this,true);A.onAvailable(this.get("id")+"_insertimage_height",function(){A.on(this.get("id")+"_insertimage_height","blur",function(){var O=parseInt(C.get(this.get("id")+"_insertimage_height").value,10);if(O>5){this._defaultImageToolbar.editor_el.style.height=O+"px";}},this,true);},this,true);H.on("colorPickerClicked",function(T){var P="1",S="solid",O="black",R=this._defaultImageToolbar.editor_el;if(R.style.borderLeftWidth){P=parseInt(R.style.borderLeftWidth,10);}if(R.style.borderLeftStyle){S=R.style.borderLeftStyle;}if(R.style.borderLeftColor){O=R.style.borderLeftColor;}var Q=P+"px "+S+" #"+T.color;R.style.border=Q;},this,true);H.on("buttonClick",function(V){var T=V.button.value,S=this._defaultImageToolbar.editor_el,R="";if(V.button.menucmd){T=V.button.menucmd;}var P="1",Q="solid",O="black";if(S.style.borderLeftWidth){P=parseInt(S.style.borderLeftWidth,10);}if(S.style.borderLeftStyle){Q=S.style.borderLeftStyle;}if(S.style.borderLeftColor){O=S.style.borderLeftColor;}switch(T){case"bordersize":if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}R=parseInt(V.button.value,10)+"px "+Q+" "+O;S.style.border=R;if(parseInt(V.button.value,10)>0){H.enableButton("bordertype");H.enableButton("bordercolor");}else{H.disableButton("bordertype");H.disableButton("bordercolor");}break;case"bordertype":if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}R=P+"px "+V.button.value+" "+O;S.style.border=R;break;case"right":case"left":H.deselectAllButtons();S.style.display="";S.align=V.button.value;break;case"inline":H.deselectAllButtons();S.style.display="";S.align="";break;case"block":H.deselectAllButtons();S.style.display="block";S.align="center";break;case"padding":var U=H.getButtonById(V.button.id);S.style.margin=U.get("label")+"px";break;}H.selectButton(V.button.value);if(T!=="padding"){this.moveWindow();}},this,true);if(this.get("localFileWarning")){A.on(this.get("id")+"_insertimage_link","blur",function(){var O=C.get(this.get("id")+"_insertimage_link");if(this._isLocalFile(O.value)){C.addClass(O,"warning");this.get("panel").setFooter(this.STR_LOCAL_FILE_WARNING);}else{C.removeClass(O,"warning");this.get("panel").setFooter(" ");if((this.browser.webkit&&!this.browser.webkit3||this.browser.air)||this.browser.opera){this.get("panel").setFooter(this.STR_IMAGE_COPY);}}},this,true);}A.on(this.get("id")+"_insertimage_url","blur",function(){var Q=C.get(this.get("id")+"_insertimage_url"),R=this.currentElement[0];if(Q.value&&R){if(Q.value==R.getAttribute("src",2)){return false;}}if(this._isLocalFile(Q.value)){C.addClass(Q,"warning");this.get("panel").setFooter(this.STR_LOCAL_FILE_WARNING);}else{if(this.currentElement[0]){C.removeClass(Q,"warning");this.get("panel").setFooter(" ");if((this.browser.webkit&&!this.browser.webkit3||this.browser.air)||this.browser.opera){this.get("panel").setFooter(this.STR_IMAGE_COPY);}if(Q&&Q.value&&(Q.value!=this.STR_IMAGE_HERE)){this.currentElement[0].setAttribute("src",Q.value);var P=this,O=new Image();O.onerror=function(){Q.value=P.STR_IMAGE_HERE;O.setAttribute("src",P.get("blankimage"));P.currentElement[0].setAttribute("src",P.get("blankimage"));YAHOO.util.Dom.get(P.get("id")+"_insertimage_height").value=O.height;YAHOO.util.Dom.get(P.get("id")+"_insertimage_width").value=O.width;};var S=this.get("id");window.setTimeout(function(){YAHOO.util.Dom.get(S+"_insertimage_height").value=O.height;YAHOO.util.Dom.get(S+"_insertimage_width").value=O.width; -if(P.currentElement&&P.currentElement[0]){if(!P.currentElement[0]._height){P.currentElement[0]._height=O.height;}if(!P.currentElement[0]._width){P.currentElement[0]._width=O.width;}}},800);if(Q.value!=this.STR_IMAGE_HERE){O.src=Q.value;}}}}},this,true);this._windows.insertimage={};this._windows.insertimage.body=K;this.get("panel").editor_form.appendChild(K);this.fireEvent("windowInsertImageRender",{type:"windowInsertImageRender",panel:this.get("panel"),body:K,toolbar:H});return K;},_handleInsertImageClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("insertimage")){return false;}}this.on("afterExecCommand",function(){var H=this.currentElement[0],O=null,L="",Z="",G=null,a="",K="",X="",R=75,V=75,Q=0,M=0,J=0,S=false,I=new YAHOO.widget.EditorWindow("insertimage",{width:"415px"});if(!H){H=this._getSelectedElement();}if(H){I.el=H;if(H.getAttribute("src")){K=H.getAttribute("src",2);if(K.indexOf(this.get("blankimage"))!=-1){K=this.STR_IMAGE_HERE;S=true;}}if(H.getAttribute("alt",2)){a=H.getAttribute("alt",2);}if(H.getAttribute("title",2)){a=H.getAttribute("title",2);}if(H.parentNode&&this._isElement(H.parentNode,"a")){L=H.parentNode.getAttribute("href",2);if(H.parentNode.getAttribute("target")!==null){Z=H.parentNode.getAttribute("target");}}R=parseInt(H.height,10);V=parseInt(H.width,10);if(H.style.height){R=parseInt(H.style.height,10);}if(H.style.width){V=parseInt(H.style.width,10);}if(H.style.margin){Q=parseInt(H.style.margin,10);}if(!S){if(!H._height){H._height=R;}if(!H._width){H._width=V;}M=H._height;J=H._width;}}if(this._windows.insertimage&&this._windows.insertimage.body){O=this._windows.insertimage.body;this._defaultImageToolbar.resetAllButtons();}else{O=this._renderInsertImageWindow();}G=this._defaultImageToolbar;G.editor_el=H;var F="0",U="solid";if(H.style.borderLeftWidth){F=parseInt(H.style.borderLeftWidth,10);}if(H.style.borderLeftStyle){U=H.style.borderLeftStyle;}var Y=G.getButtonByValue("bordersize"),W=((parseInt(F,10)>0)?"":this.STR_NONE);Y.set("label",''+W+"");this._updateMenuChecked("bordersize",F,G);var N=G.getButtonByValue("bordertype");N.set("label",'asdfa');this._updateMenuChecked("bordertype",U,G);if(parseInt(F,10)>0){G.enableButton(N);G.enableButton(Y);G.enableButton("bordercolor");}if((H.align=="right")||(H.align=="left")){G.selectButton(H.align);}else{if(H.style.display=="block"){G.selectButton("block");}else{G.selectButton("inline");}}if(parseInt(H.style.marginLeft,10)>0){G.getButtonByValue("padding").set("label",""+parseInt(H.style.marginLeft,10));}if(H.style.borderSize){G.selectButton("bordersize");G.selectButton(parseInt(H.style.borderSize,10));}G.getButtonByValue("padding").set("label",""+Q);I.setHeader(this.STR_IMAGE_PROP_TITLE);I.setBody(O);if((this.browser.webkit&&!this.browser.webkit3||this.browser.air)||this.browser.opera){I.setFooter(this.STR_IMAGE_COPY);}this.openWindow(I);C.get(this.get("id")+"_insertimage_url").value=K;C.get(this.get("id")+"_insertimage_title").value=a;C.get(this.get("id")+"_insertimage_link").value=L;C.get(this.get("id")+"_insertimage_target").checked=((Z)?true:false);C.get(this.get("id")+"_insertimage_width").value=V;C.get(this.get("id")+"_insertimage_height").value=R;if(((R!=M)||(V!=J))&&(!S)){var P=document.createElement("span");P.className="info";P.innerHTML=this.STR_IMAGE_ORIG_SIZE+": ("+J+" x "+M+")";if(C.get(this.get("id")+"_insertimage_height").nextSibling){var E=C.get(this.get("id")+"_insertimage_height").nextSibling;E.parentNode.removeChild(E);}C.get(this.get("id")+"_insertimage_height").parentNode.appendChild(P);}this.toolbar.selectButton("insertimage");var T=this.get("id");window.setTimeout(function(){try{YAHOO.util.Dom.get(T+"_insertimage_url").focus();if(S){YAHOO.util.Dom.get(T+"_insertimage_url").select();}}catch(c){}},50);});},_handleInsertImageWindowClose:function(){var E=C.get(this.get("id")+"_insertimage_url"),L=C.get(this.get("id")+"_insertimage_title"),I=C.get(this.get("id")+"_insertimage_link"),J=C.get(this.get("id")+"_insertimage_target"),H=arguments[0].win.el;if(E&&E.value&&(E.value!=this.STR_IMAGE_HERE)){H.setAttribute("src",E.value);H.setAttribute("title",L.value);H.setAttribute("alt",L.value);var G=H.parentNode;if(I.value){var K=I.value;if((K.indexOf(":/"+"/")==-1)&&(K.substring(0,1)!="/")&&(K.substring(0,6).toLowerCase()!="mailto")){if((K.indexOf("@")!=-1)&&(K.substring(0,6).toLowerCase()!="mailto")){K="mailto:"+K;}else{K="http:/"+"/"+K;}}if(G&&this._isElement(G,"a")){G.setAttribute("href",K);if(J.checked){G.setAttribute("target",J.value);}else{G.setAttribute("target","");}}else{var F=this._getDoc().createElement("a");F.setAttribute("href",K);if(J.checked){F.setAttribute("target",J.value);}else{F.setAttribute("target","");}H.parentNode.replaceChild(F,H);F.appendChild(H);}}else{if(G&&this._isElement(G,"a")){G.parentNode.replaceChild(H,G);}}}else{H.parentNode.removeChild(H);}C.get(this.get("id")+"_insertimage_url").value="";C.get(this.get("id")+"_insertimage_title").value="";C.get(this.get("id")+"_insertimage_link").value="";C.get(this.get("id")+"_insertimage_target").checked=false;C.get(this.get("id")+"_insertimage_width").value=0;C.get(this.get("id")+"_insertimage_height").value=0;this._defaultImageToolbar.resetAllButtons();this.currentElement=[];this.nodeChange();},EDITOR_PANEL_ID:"-panel",_renderPanel:function(){var H=document.createElement("div");C.addClass(H,"yui-editor-panel");H.id=this.get("id")+this.EDITOR_PANEL_ID;H.style.position="absolute";H.style.top="-9999px";H.style.left="-9999px";document.body.appendChild(H);this.get("element_cont").insertBefore(H,this.get("element_cont").get("firstChild"));var E=new YAHOO.widget.Overlay(this.get("id")+this.EDITOR_PANEL_ID,{width:"300px",iframe:true,visible:false,underlay:"none",draggable:false,close:false});this.set("panel",E);E.setBody("---");E.setHeader(" ");E.setFooter(" ");var K=document.createElement("div");K.className=this.CLASS_PREFIX+"-body-cont"; -for(var L in this.browser){if(this.browser[L]){C.addClass(K,L);break;}}C.addClass(K,((YAHOO.widget.Button&&(this._defaultToolbar.buttonType=="advanced"))?"good-button":"no-button"));var I=document.createElement("h3");I.className="yui-editor-skipheader";I.innerHTML=this.STR_CLOSE_WINDOW_NOTE;K.appendChild(I);var F=document.createElement("fieldset");E.editor_form=F;K.appendChild(F);var G=document.createElement("span");G.innerHTML="X";G.title=this.STR_CLOSE_WINDOW;G.className="close";A.on(G,"click",this.closeWindow,this,true);var M=document.createElement("span");M.innerHTML="^";M.className="knob";E.editor_knob=M;var N=document.createElement("h3");E.editor_header=N;N.innerHTML="";E.setHeader(" ");E.appendToHeader(N);N.appendChild(G);N.appendChild(M);E.setBody(" ");E.setFooter(" ");E.appendToBody(K);A.on(E.element,"click",function(O){A.stopPropagation(O);});var J=function(){E.bringToTop();YAHOO.util.Dom.setStyle(this.element,"display","block");this._handleWindowInputs(false);};E.showEvent.subscribe(J,this,true);E.hideEvent.subscribe(function(){this._handleWindowInputs(true);},this,true);E.renderEvent.subscribe(function(){this._renderInsertImageWindow();this._renderCreateLinkWindow();this.fireEvent("windowRender",{type:"windowRender",panel:E});this._handleWindowInputs(true);},this,true);if(this.DOMReady){this.get("panel").render();}else{A.onDOMReady(function(){this.get("panel").render();},this,true);}return this.get("panel");},_handleWindowInputs:function(F){if(!D.isBoolean(F)){F=false;}var E=this.get("panel").element.getElementsByTagName("input");for(var G=0;G(a[0]+parseInt(this.get("iframe").get("element").clientWidth,10))){Y[0]=((a[0]+parseInt(this.get("iframe").get("element").clientWidth,10))-(R*2)-5);U="right";}try{X=(Y[0]-Q[0]);L=(Y[1]-Q[1]);}catch(c){}var P=a[1]+parseInt(this.get("height"),10);var H=a[0]+parseInt(this.get("width"),10);if(Y[1]>P){Y[1]=P;}if(Y[0]>H){Y[0]=(H/2);}X=((X<0)?(X*-1):X);L=((L<0)?(L*-1):L);if(((X>10)||(L>10))||F){var S=0,V=0;if(this.currentElement[0].width){V=(parseInt(this.currentElement[0].width,10)/2);}var M=J[0]+a[0]+V;S=M-Y[0];if(S>(parseInt(I.attrs.width,10)-1)){S=((parseInt(I.attrs.width,10)-30)-1);}else{if(S<40){S=1;}}if(isNaN(S)){S=1;}if(F){if(G){G.style.left=S+"px";}O.cfg.setProperty("xy",Y);}else{if(this.get("animate")){T=new YAHOO.util.Anim(O.element,{},0.5,YAHOO.util.Easing.easeOut);T.attributes={top:{to:Y[1]},left:{to:Y[0]}};T.onComplete.subscribe(function(){O.cfg.setProperty("xy",Y);});var Z=new YAHOO.util.Anim(O.iframe,T.attributes,0.5,YAHOO.util.Easing.easeOut);var E=new YAHOO.util.Anim(G,{left:{to:S}},0.6,YAHOO.util.Easing.easeOut);T.animate();Z.animate();E.animate();}else{G.style.left=S+"px";O.cfg.setProperty("xy",Y);}}}},_closeWindow:function(E){if(this._checkKey(this._keyMap.CLOSE_WINDOW,E)){if(this.currentWindow){this.closeWindow();}}},closeWindow:function(E){this.fireEvent("window"+this.currentWindow.name+"Close",{type:"window"+this.currentWindow.name+"Close",win:this.currentWindow,el:this.currentElement[0]});this.fireEvent("closeWindow",{type:"closeWindow",win:this.currentWindow});this.currentWindow=null;this.get("panel").hide();this.get("panel").cfg.setProperty("xy",[-900,-900]);this.get("panel").syncIframe();this.unsubscribeAll("afterExecCommand");this.toolbar.set("disabled",false);this.toolbar.resetAllButtons();this.focus();A.removeListener(document,"keydown",this._closeWindow);},cmd_undo:function(G){if(this._hasUndoLevel()){var F=this.getEditorHTML(),E;if(!this._undoLevel){this._undoLevel=this._undoCache.length;}this._undoLevel=(this._undoLevel-1);if(this._undoCache[this._undoLevel]){E=this._getUndo(this._undoLevel);if(E!=F){this.setEditorHTML(E);}else{this._undoLevel=(this._undoLevel-1);E=this._getUndo(this._undoLevel);if(E!=F){this.setEditorHTML(E);}}}else{this._undoLevel=0; -this.toolbar.disableButton("undo");}}return[false];},cmd_redo:function(F){this._undoLevel=this._undoLevel+1;if(this._undoLevel>=this._undoCache.length){this._undoLevel=this._undoCache.length;}if(this._undoCache[this._undoLevel]){var E=this._getUndo(this._undoLevel);this.setEditorHTML(E);}else{this.toolbar.disableButton("redo");}return[false];},cmd_heading:function(I){var F=true,G=null,H="heading",J=this._getSelection(),E=this._getSelectedElement();if(E){J=E;}if(this.browser.ie){H="formatblock";}if(I==this.STR_NONE){if((J&&J.tagName&&(J.tagName.toLowerCase().substring(0,1)=="h"))||(J&&J.parentNode&&J.parentNode.tagName&&(J.parentNode.tagName.toLowerCase().substring(0,1)=="h"))){if(J.parentNode.tagName.toLowerCase().substring(0,1)=="h"){J=J.parentNode;}if(this._isElement(J,"html")){return[false];}G=this._swapEl(E,"span",function(K){K.className="yui-non";});this._selectNode(G);this.currentElement[0]=G;}F=false;}else{if(this._isElement(E,"h1")||this._isElement(E,"h2")||this._isElement(E,"h3")||this._isElement(E,"h4")||this._isElement(E,"h5")||this._isElement(E,"h6")){G=this._swapEl(E,I);this._selectNode(G);this.currentElement[0]=G;}else{this._createCurrentElement(I);this._selectNode(this.currentElement[0]);}F=false;}return[F,H];},cmd_hiddenelements:function(E){if(this._showingHiddenElements){this._lastButton=null;this._showingHiddenElements=false;this.toolbar.deselectButton("hiddenelements");C.removeClass(this._getDoc().body,this.CLASS_HIDDEN);}else{this._showingHiddenElements=true;C.addClass(this._getDoc().body,this.CLASS_HIDDEN);this.toolbar.selectButton("hiddenelements");}return[false];},cmd_removeformat:function(H){var F=true;if(this.browser.webkit&&!this._getDoc().queryCommandEnabled("removeformat")){var E=this._getSelection()+"";this._createCurrentElement("span");this.currentElement[0].className="yui-non";this.currentElement[0].innerHTML=E;for(var G=1;GCreates a rich custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar

            - * @class ToolbarButtonAdvanced - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, container_core, menu, button - * - * Provides a toolbar button based on the button and menu widgets. - * @constructor - * @class ToolbarButtonAdvanced - * @param {String/HTMLElement} el The element to turn into a button. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - if (YAHOO.widget.Button) { - YAHOO.widget.ToolbarButtonAdvanced = YAHOO.widget.Button; - /** - * @property buttonType - * @private - * @description Tells if the Button is a Rich Button or a Simple Button - */ - YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType = 'rich'; - /** - * @method checkValue - * @param {String} value The value of the option that we want to mark as selected - * @description Select an option by value - */ - YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue = function(value) { - var _menuItems = this.getMenu().getItems(); - if (_menuItems.length === 0) { - this.getMenu()._onBeforeShow(); - _menuItems = this.getMenu().getItems(); - } - for (var i = 0; i < _menuItems.length; i++) { - _menuItems[i].cfg.setProperty('checked', false); - if (_menuItems[i].value == value) { - _menuItems[i].cfg.setProperty('checked', true); - } - } - }; - } else { - YAHOO.widget.ToolbarButtonAdvanced = function() {}; - } - - - /** - * @description

            Creates a basic custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar

            Provides a toolbar button based on the button and menu widgets, <select> elements are used in place of menu's.

            - * @class ToolbarButton - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event - * @extends YAHOO.util.Element - * - * - * @constructor - * @param {String/HTMLElement} el The element to turn into a button. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.ToolbarButton = function(el, attrs) { - - if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) { - attrs = el; - } - var local_attrs = (attrs || {}); - - var oConfig = { - element: null, - attributes: local_attrs - }; - - if (!oConfig.attributes.type) { - oConfig.attributes.type = 'push'; - } - - oConfig.element = document.createElement('span'); - oConfig.element.setAttribute('unselectable', 'on'); - oConfig.element.className = 'yui-button yui-' + oConfig.attributes.type + '-button'; - oConfig.element.innerHTML = 'LABEL'; - oConfig.element.firstChild.firstChild.tabIndex = '-1'; - oConfig.attributes.id = (oConfig.attributes.id || Dom.generateId()); - oConfig.element.id = oConfig.attributes.id; - - YAHOO.widget.ToolbarButton.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - YAHOO.extend(YAHOO.widget.ToolbarButton, YAHOO.util.Element, { - /** - * @property buttonType - * @private - * @description Tells if the Button is a Rich Button or a Simple Button - */ - buttonType: 'normal', - /** - * @method _handleMouseOver - * @private - * @description Adds classes to the button elements on mouseover (hover) - */ - _handleMouseOver: function() { - if (!this.get('disabled')) { - this.addClass('yui-button-hover'); - this.addClass('yui-' + this.get('type') + '-button-hover'); - } - }, - /** - * @method _handleMouseOut - * @private - * @description Removes classes from the button elements on mouseout (hover) - */ - _handleMouseOut: function() { - this.removeClass('yui-button-hover'); - this.removeClass('yui-' + this.get('type') + '-button-hover'); - }, - /** - * @method checkValue - * @param {String} value The value of the option that we want to mark as selected - * @description Select an option by value - */ - checkValue: function(value) { - if (this.get('type') == 'menu') { - var opts = this._button.options; - for (var i = 0; i < opts.length; i++) { - if (opts[i].value == value) { - opts.selectedIndex = i; - } - } - } - }, - /** - * @method init - * @description The ToolbarButton class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.widget.ToolbarButton.superclass.init.call(this, p_oElement, p_oAttributes); - - this.on('mouseover', this._handleMouseOver, this, true); - this.on('mouseout', this._handleMouseOut, this, true); - this.on('click', function(ev) { - Event.stopEvent(ev); - return false; - }, this, true); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the toolbar. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the toolbar. - */ - initAttributes: function(attr) { - YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this, attr); - /** - * @attribute value - * @description The value of the button - * @type String - */ - this.setAttributeConfig('value', { - value: attr.value - }); - /** - * @attribute menu - * @description The menu attribute, see YAHOO.widget.Button - * @type Object - */ - this.setAttributeConfig('menu', { - value: attr.menu || false - }); - /** - * @attribute type - * @description The type of button to create: push, menu, color, select, spin - * @type String - */ - this.setAttributeConfig('type', { - value: attr.type, - writeOnce: true, - method: function(type) { - var el, opt; - if (!this._button) { - this._button = this.get('element').getElementsByTagName('a')[0]; - } - switch (type) { - case 'select': - case 'menu': - el = document.createElement('select'); - el.id = this.get('id'); - var menu = this.get('menu'); - for (var i = 0; i < menu.length; i++) { - opt = document.createElement('option'); - opt.innerHTML = menu[i].text; - opt.value = menu[i].value; - if (menu[i].checked) { - opt.selected = true; - } - el.appendChild(opt); - } - this._button.parentNode.replaceChild(el, this._button); - Event.on(el, 'change', this._handleSelect, this, true); - this._button = el; - break; - } - } - }); - - /** - * @attribute disabled - * @description Set the button into a disabled state - * @type String - */ - this.setAttributeConfig('disabled', { - value: attr.disabled || false, - method: function(disabled) { - if (disabled) { - this.addClass('yui-button-disabled'); - this.addClass('yui-' + this.get('type') + '-button-disabled'); - } else { - this.removeClass('yui-button-disabled'); - this.removeClass('yui-' + this.get('type') + '-button-disabled'); - } - if ((this.get('type') == 'menu') || (this.get('type') == 'select')) { - this._button.disabled = disabled; - } - } - }); - - /** - * @attribute label - * @description The text label for the button - * @type String - */ - this.setAttributeConfig('label', { - value: attr.label, - method: function(label) { - if (!this._button) { - this._button = this.get('element').getElementsByTagName('a')[0]; - } - if (this.get('type') == 'push') { - this._button.innerHTML = label; - } - } - }); - - /** - * @attribute title - * @description The title of the button - * @type String - */ - this.setAttributeConfig('title', { - value: attr.title - }); - - /** - * @config container - * @description The container that the button is rendered to, handled by Toolbar - * @type String - */ - this.setAttributeConfig('container', { - value: null, - writeOnce: true, - method: function(cont) { - this.appendTo(cont); - } - }); - - }, - /** - * @private - * @method _handleSelect - * @description The event fired when a change event gets fired on a select element - * @param {Event} ev The change event. - */ - _handleSelect: function(ev) { - var tar = Event.getTarget(ev); - var value = tar.options[tar.selectedIndex].value; - this.fireEvent('change', {type: 'change', value: value }); - }, - /** - * @method getMenu - * @description A stub function to mimic YAHOO.widget.Button's getMenu method - */ - getMenu: function() { - return this.get('menu'); - }, - /** - * @method destroy - * @description Destroy the button - */ - destroy: function() { - Event.purgeElement(this.get('element'), true); - this.get('element').parentNode.removeChild(this.get('element')); - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - }, - /** - * @method fireEvent - * @description Overridden fireEvent method to prevent DOM events from firing if the button is disabled. - */ - fireEvent: function(p_sType, p_aArgs) { - // Disabled buttons should not respond to DOM events - if (this.DOM_EVENTS[p_sType] && this.get('disabled')) { - Event.stopEvent(p_aArgs); - return; - } - - YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this, p_sType, p_aArgs); - }, - /** - * @method toString - * @description Returns a string representing the toolbar. - * @return {String} - */ - toString: function() { - return 'ToolbarButton (' + this.get('id') + ')'; - } - - }); -})(); -/** - * @module editor - * @description

            Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor

            - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, toolbarbutton - * @optional container_core, dragdrop - */ -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - var getButton = function(id) { - var button = id; - if (Lang.isString(id)) { - button = this.getButtonById(id); - } - if (Lang.isNumber(id)) { - button = this.getButtonByIndex(id); - } - if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) { - button = this.getButtonByValue(id); - } - if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) { - return button; - } - return false; - }; - - /** - * Provides a rich toolbar widget based on the button and menu widgets - * @constructor - * @class Toolbar - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The element to turn into a toolbar. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - YAHOO.widget.Toolbar = function(el, attrs) { - - if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) { - attrs = el; - } - var local_attrs = {}; - if (attrs) { - Lang.augmentObject(local_attrs, attrs); //Break the config reference - } - - - var oConfig = { - element: null, - attributes: local_attrs - }; - - - if (Lang.isString(el) && Dom.get(el)) { - oConfig.element = Dom.get(el); - } else if (Lang.isObject(el) && Dom.get(el) && Dom.get(el).nodeType) { - oConfig.element = Dom.get(el); - } - - - if (!oConfig.element) { - oConfig.element = document.createElement('DIV'); - oConfig.element.id = Dom.generateId(); - - if (local_attrs.container && Dom.get(local_attrs.container)) { - Dom.get(local_attrs.container).appendChild(oConfig.element); - } - } - - - if (!oConfig.element.id) { - oConfig.element.id = ((Lang.isString(el)) ? el : Dom.generateId()); - } - - var fs = document.createElement('fieldset'); - var lg = document.createElement('legend'); - lg.innerHTML = 'Toolbar'; - fs.appendChild(lg); - - var cont = document.createElement('DIV'); - oConfig.attributes.cont = cont; - Dom.addClass(cont, 'yui-toolbar-subcont'); - fs.appendChild(cont); - oConfig.element.appendChild(fs); - - oConfig.element.tabIndex = -1; - - - oConfig.attributes.element = oConfig.element; - oConfig.attributes.id = oConfig.element.id; - - this._configuredButtons = []; - - YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - - }; - - YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, { - /** - * @protected - * @property _configuredButtons - * @type Array - */ - _configuredButtons: null, - /** - * @method _addMenuClasses - * @private - * @description This method is called from Menu's renderEvent to add a few more classes to the menu items - * @param {String} ev The event that fired. - * @param {Array} na Array of event information. - * @param {Object} o Button config object. - */ - _addMenuClasses: function(ev, na, o) { - Dom.addClass(this.element, 'yui-toolbar-' + o.get('value') + '-menu'); - if (Dom.hasClass(o._button.parentNode.parentNode, 'yui-toolbar-select')) { - Dom.addClass(this.element, 'yui-toolbar-select-menu'); - } - var items = this.getItems(); - for (var i = 0; i < items.length; i++) { - Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase())); - Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-'))); - } - }, - /** - * @property buttonType - * @description The default button to use - * @type Object - */ - buttonType: YAHOO.widget.ToolbarButton, - /** - * @property dd - * @description The DragDrop instance associated with the Toolbar - * @type Object - */ - dd: null, - /** - * @property _colorData - * @description Object reference containing colors hex and text values. - * @type Object - */ - _colorData: { -/* {{{ _colorData */ - '#111111': 'Obsidian', - '#2D2D2D': 'Dark Gray', - '#434343': 'Shale', - '#5B5B5B': 'Flint', - '#737373': 'Gray', - '#8B8B8B': 'Concrete', - '#A2A2A2': 'Gray', - '#B9B9B9': 'Titanium', - '#000000': 'Black', - '#D0D0D0': 'Light Gray', - '#E6E6E6': 'Silver', - '#FFFFFF': 'White', - '#BFBF00': 'Pumpkin', - '#FFFF00': 'Yellow', - '#FFFF40': 'Banana', - '#FFFF80': 'Pale Yellow', - '#FFFFBF': 'Butter', - '#525330': 'Raw Siena', - '#898A49': 'Mildew', - '#AEA945': 'Olive', - '#7F7F00': 'Paprika', - '#C3BE71': 'Earth', - '#E0DCAA': 'Khaki', - '#FCFAE1': 'Cream', - '#60BF00': 'Cactus', - '#80FF00': 'Chartreuse', - '#A0FF40': 'Green', - '#C0FF80': 'Pale Lime', - '#DFFFBF': 'Light Mint', - '#3B5738': 'Green', - '#668F5A': 'Lime Gray', - '#7F9757': 'Yellow', - '#407F00': 'Clover', - '#8A9B55': 'Pistachio', - '#B7C296': 'Light Jade', - '#E6EBD5': 'Breakwater', - '#00BF00': 'Spring Frost', - '#00FF80': 'Pastel Green', - '#40FFA0': 'Light Emerald', - '#80FFC0': 'Sea Foam', - '#BFFFDF': 'Sea Mist', - '#033D21': 'Dark Forrest', - '#438059': 'Moss', - '#7FA37C': 'Medium Green', - '#007F40': 'Pine', - '#8DAE94': 'Yellow Gray Green', - '#ACC6B5': 'Aqua Lung', - '#DDEBE2': 'Sea Vapor', - '#00BFBF': 'Fog', - '#00FFFF': 'Cyan', - '#40FFFF': 'Turquoise Blue', - '#80FFFF': 'Light Aqua', - '#BFFFFF': 'Pale Cyan', - '#033D3D': 'Dark Teal', - '#347D7E': 'Gray Turquoise', - '#609A9F': 'Green Blue', - '#007F7F': 'Seaweed', - '#96BDC4': 'Green Gray', - '#B5D1D7': 'Soapstone', - '#E2F1F4': 'Light Turquoise', - '#0060BF': 'Summer Sky', - '#0080FF': 'Sky Blue', - '#40A0FF': 'Electric Blue', - '#80C0FF': 'Light Azure', - '#BFDFFF': 'Ice Blue', - '#1B2C48': 'Navy', - '#385376': 'Biscay', - '#57708F': 'Dusty Blue', - '#00407F': 'Sea Blue', - '#7792AC': 'Sky Blue Gray', - '#A8BED1': 'Morning Sky', - '#DEEBF6': 'Vapor', - '#0000BF': 'Deep Blue', - '#0000FF': 'Blue', - '#4040FF': 'Cerulean Blue', - '#8080FF': 'Evening Blue', - '#BFBFFF': 'Light Blue', - '#212143': 'Deep Indigo', - '#373E68': 'Sea Blue', - '#444F75': 'Night Blue', - '#00007F': 'Indigo Blue', - '#585E82': 'Dockside', - '#8687A4': 'Blue Gray', - '#D2D1E1': 'Light Blue Gray', - '#6000BF': 'Neon Violet', - '#8000FF': 'Blue Violet', - '#A040FF': 'Violet Purple', - '#C080FF': 'Violet Dusk', - '#DFBFFF': 'Pale Lavender', - '#302449': 'Cool Shale', - '#54466F': 'Dark Indigo', - '#655A7F': 'Dark Violet', - '#40007F': 'Violet', - '#726284': 'Smoky Violet', - '#9E8FA9': 'Slate Gray', - '#DCD1DF': 'Violet White', - '#BF00BF': 'Royal Violet', - '#FF00FF': 'Fuchsia', - '#FF40FF': 'Magenta', - '#FF80FF': 'Orchid', - '#FFBFFF': 'Pale Magenta', - '#4A234A': 'Dark Purple', - '#794A72': 'Medium Purple', - '#936386': 'Cool Granite', - '#7F007F': 'Purple', - '#9D7292': 'Purple Moon', - '#C0A0B6': 'Pale Purple', - '#ECDAE5': 'Pink Cloud', - '#BF005F': 'Hot Pink', - '#FF007F': 'Deep Pink', - '#FF409F': 'Grape', - '#FF80BF': 'Electric Pink', - '#FFBFDF': 'Pink', - '#451528': 'Purple Red', - '#823857': 'Purple Dino', - '#A94A76': 'Purple Gray', - '#7F003F': 'Rose', - '#BC6F95': 'Antique Mauve', - '#D8A5BB': 'Cool Marble', - '#F7DDE9': 'Pink Granite', - '#C00000': 'Apple', - '#FF0000': 'Fire Truck', - '#FF4040': 'Pale Red', - '#FF8080': 'Salmon', - '#FFC0C0': 'Warm Pink', - '#441415': 'Sepia', - '#82393C': 'Rust', - '#AA4D4E': 'Brick', - '#800000': 'Brick Red', - '#BC6E6E': 'Mauve', - '#D8A3A4': 'Shrimp Pink', - '#F8DDDD': 'Shell Pink', - '#BF5F00': 'Dark Orange', - '#FF7F00': 'Orange', - '#FF9F40': 'Grapefruit', - '#FFBF80': 'Canteloupe', - '#FFDFBF': 'Wax', - '#482C1B': 'Dark Brick', - '#855A40': 'Dirt', - '#B27C51': 'Tan', - '#7F3F00': 'Nutmeg', - '#C49B71': 'Mustard', - '#E1C4A8': 'Pale Tan', - '#FDEEE0': 'Marble' -/* }}} */ - }, - /** - * @property _colorPicker - * @description The HTML Element containing the colorPicker - * @type HTMLElement - */ - _colorPicker: null, - /** - * @property STR_COLLAPSE - * @description String for Toolbar Collapse Button - * @type String - */ - STR_COLLAPSE: 'Collapse Toolbar', - /** - * @property STR_EXPAND - * @description String for Toolbar Collapse Button - Expand - * @type String - */ - STR_EXPAND: 'Expand Toolbar', - /** - * @property STR_SPIN_LABEL - * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute - * @type String - */ - STR_SPIN_LABEL: 'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.', - /** - * @property STR_SPIN_UP - * @description String for spinbutton up - * @type String - */ - STR_SPIN_UP: 'Click to increase the value of this input', - /** - * @property STR_SPIN_DOWN - * @description String for spinbutton down - * @type String - */ - STR_SPIN_DOWN: 'Click to decrease the value of this input', - /** - * @property _titlebar - * @description Object reference to the titlebar - * @type HTMLElement - */ - _titlebar: null, - /** - * @property browser - * @description Standard browser detection - * @type Object - */ - browser: YAHOO.env.ua, - /** - * @protected - * @property _buttonList - * @description Internal property list of current buttons in the toolbar - * @type Array - */ - _buttonList: null, - /** - * @protected - * @property _buttonGroupList - * @description Internal property list of current button groups in the toolbar - * @type Array - */ - _buttonGroupList: null, - /** - * @protected - * @property _sep - * @description Internal reference to the separator HTML Element for cloning - * @type HTMLElement - */ - _sep: null, - /** - * @protected - * @property _sepCount - * @description Internal refernce for counting separators, so we can give them a useful class name for styling - * @type Number - */ - _sepCount: null, - /** - * @protected - * @property draghandle - * @type HTMLElement - */ - _dragHandle: null, - /** - * @protected - * @property _toolbarConfigs - * @type Object - */ - _toolbarConfigs: { - renderer: true - }, - /** - * @protected - * @property CLASS_CONTAINER - * @description Default CSS class to apply to the toolbar container element - * @type String - */ - CLASS_CONTAINER: 'yui-toolbar-container', - /** - * @protected - * @property CLASS_DRAGHANDLE - * @description Default CSS class to apply to the toolbar's drag handle element - * @type String - */ - CLASS_DRAGHANDLE: 'yui-toolbar-draghandle', - /** - * @protected - * @property CLASS_SEPARATOR - * @description Default CSS class to apply to all separators in the toolbar - * @type String - */ - CLASS_SEPARATOR: 'yui-toolbar-separator', - /** - * @protected - * @property CLASS_DISABLED - * @description Default CSS class to apply when the toolbar is disabled - * @type String - */ - CLASS_DISABLED: 'yui-toolbar-disabled', - /** - * @protected - * @property CLASS_PREFIX - * @description Default prefix for dynamically created class names - * @type String - */ - CLASS_PREFIX: 'yui-toolbar', - /** - * @method init - * @description The Toolbar class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.widget.Toolbar.superclass.init.call(this, p_oElement, p_oAttributes); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the toolbar. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the toolbar. - */ - initAttributes: function(attr) { - YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr); - this.addClass(this.CLASS_CONTAINER); - - /** - * @attribute buttonType - * @description The buttonType to use (advanced or basic) - * @type String - */ - this.setAttributeConfig('buttonType', { - value: attr.buttonType || 'basic', - writeOnce: true, - validator: function(type) { - switch (type) { - case 'advanced': - case 'basic': - return true; - } - return false; - }, - method: function(type) { - if (type == 'advanced') { - if (YAHOO.widget.Button) { - this.buttonType = YAHOO.widget.ToolbarButtonAdvanced; - } else { - this.buttonType = YAHOO.widget.ToolbarButton; - } - } else { - this.buttonType = YAHOO.widget.ToolbarButton; - } - } - }); - - - /** - * @attribute buttons - * @description Object specifying the buttons to include in the toolbar - * Example: - *
            -            * {
            -            *   { id: 'b3', type: 'button', label: 'Underline', value: 'underline' },
            -            *   { type: 'separator' },
            -            *   { id: 'b4', type: 'menu', label: 'Align', value: 'align',
            -            *       menu: [
            -            *           { text: "Left", value: 'alignleft' },
            -            *           { text: "Center", value: 'aligncenter' },
            -            *           { text: "Right", value: 'alignright' }
            -            *       ]
            -            *   }
            -            * }
            -            * 
            - * @type Array - */ - - this.setAttributeConfig('buttons', { - value: [], - writeOnce: true, - method: function(data) { - var i, button, buttons, len, b; - for (i in data) { - if (Lang.hasOwnProperty(data, i)) { - if (data[i].type == 'separator') { - this.addSeparator(); - } else if (data[i].group !== undefined) { - buttons = this.addButtonGroup(data[i]); - if (buttons) { - len = buttons.length; - for(b = 0; b < len; b++) { - if (buttons[b]) { - this._configuredButtons[this._configuredButtons.length] = buttons[b].id; - } - } - } - - } else { - button = this.addButton(data[i]); - if (button) { - this._configuredButtons[this._configuredButtons.length] = button.id; - } - } - } - } - } - }); - - /** - * @attribute disabled - * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on. - * @default false - * @type Boolean - */ - this.setAttributeConfig('disabled', { - value: false, - method: function(disabled) { - if (this.get('disabled') === disabled) { - return false; - } - if (disabled) { - this.addClass(this.CLASS_DISABLED); - this.set('draggable', false); - this.disableAllButtons(); - } else { - this.removeClass(this.CLASS_DISABLED); - if (this._configs.draggable._initialConfig.value) { - //Draggable by default, set it back - this.set('draggable', true); - } - this.resetAllButtons(); - } - } - }); - - /** - * @config cont - * @description The container for the toolbar. - * @type HTMLElement - */ - this.setAttributeConfig('cont', { - value: attr.cont, - readOnly: true - }); - - - /** - * @attribute grouplabels - * @description Boolean indicating if the toolbar should show the group label's text string. - * @default true - * @type Boolean - */ - this.setAttributeConfig('grouplabels', { - value: ((attr.grouplabels === false) ? false : true), - method: function(grouplabels) { - if (grouplabels) { - Dom.removeClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels')); - } else { - Dom.addClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels')); - } - } - }); - /** - * @attribute titlebar - * @description Boolean indicating if the toolbar should have a titlebar. If - * passed a string, it will use that as the titlebar text - * @default false - * @type Boolean or String - */ - this.setAttributeConfig('titlebar', { - value: false, - method: function(titlebar) { - if (titlebar) { - if (this._titlebar && this._titlebar.parentNode) { - this._titlebar.parentNode.removeChild(this._titlebar); - } - this._titlebar = document.createElement('DIV'); - this._titlebar.tabIndex = '-1'; - Event.on(this._titlebar, 'focus', function() { - this._handleFocus(); - }, this, true); - Dom.addClass(this._titlebar, this.CLASS_PREFIX + '-titlebar'); - if (Lang.isString(titlebar)) { - var h2 = document.createElement('h2'); - h2.tabIndex = '-1'; - h2.innerHTML = '' + titlebar + ''; - this._titlebar.appendChild(h2); - Event.on(h2.firstChild, 'click', function(ev) { - Event.stopEvent(ev); - }); - Event.on([h2, h2.firstChild], 'focus', function() { - this._handleFocus(); - }, this, true); - } - if (this.get('firstChild')) { - this.insertBefore(this._titlebar, this.get('firstChild')); - } else { - this.appendChild(this._titlebar); - } - if (this.get('collapse')) { - this.set('collapse', true); - } - } else if (this._titlebar) { - if (this._titlebar && this._titlebar.parentNode) { - this._titlebar.parentNode.removeChild(this._titlebar); - } - } - } - }); - - - /** - * @attribute collapse - * @description Boolean indicating if the titlebar should have a collapse button. - * The collapse button will not remove the toolbar, it will minimize it to the titlebar - * @default false - * @type Boolean - */ - this.setAttributeConfig('collapse', { - value: false, - method: function(collapse) { - if (this._titlebar) { - var collapseEl = null; - var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapse) { - if (el.length > 0) { - //There is already a collapse button - return true; - } - collapseEl = document.createElement('SPAN'); - collapseEl.innerHTML = 'X'; - collapseEl.title = this.STR_COLLAPSE; - - Dom.addClass(collapseEl, 'collapse'); - this._titlebar.appendChild(collapseEl); - Event.addListener(collapseEl, 'click', function() { - if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) { - this.collapse(false); //Expand Toolbar - } else { - this.collapse(); //Collapse Toolbar - } - }, this, true); - } else { - collapseEl = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapseEl[0]) { - if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) { - //We are closed, reopen the titlebar.. - this.collapse(false); //Expand Toolbar - } - collapseEl[0].parentNode.removeChild(collapseEl[0]); - } - } - } - } - }); - - /** - * @attribute draggable - * @description Boolean indicating if the toolbar should be draggable. - * @default false - * @type Boolean - */ - - this.setAttributeConfig('draggable', { - value: (attr.draggable || false), - method: function(draggable) { - if (draggable && !this.get('titlebar')) { - if (!this._dragHandle) { - this._dragHandle = document.createElement('SPAN'); - this._dragHandle.innerHTML = '|'; - this._dragHandle.setAttribute('title', 'Click to drag the toolbar'); - this._dragHandle.id = this.get('id') + '_draghandle'; - Dom.addClass(this._dragHandle, this.CLASS_DRAGHANDLE); - if (this.get('cont').hasChildNodes()) { - this.get('cont').insertBefore(this._dragHandle, this.get('cont').firstChild); - } else { - this.get('cont').appendChild(this._dragHandle); - } - this.dd = new YAHOO.util.DD(this.get('id')); - this.dd.setHandleElId(this._dragHandle.id); - - } - } else { - if (this._dragHandle) { - this._dragHandle.parentNode.removeChild(this._dragHandle); - this._dragHandle = null; - this.dd = null; - } - } - if (this._titlebar) { - if (draggable) { - this.dd = new YAHOO.util.DD(this.get('id')); - this.dd.setHandleElId(this._titlebar); - Dom.addClass(this._titlebar, 'draggable'); - } else { - Dom.removeClass(this._titlebar, 'draggable'); - if (this.dd) { - this.dd.unreg(); - this.dd = null; - } - } - } - }, - validator: function(value) { - var ret = true; - if (!YAHOO.util.DD) { - ret = false; - } - return ret; - } - }); - - }, - /** - * @method addButtonGroup - * @description Add a new button group to the toolbar. (uses addButton) - * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs as well as the group label) - */ - addButtonGroup: function(oGroup) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addButtonGroup', arguments]; - return false; - } - - if (!this.hasClass(this.CLASS_PREFIX + '-grouped')) { - this.addClass(this.CLASS_PREFIX + '-grouped'); - } - var div = document.createElement('DIV'); - Dom.addClass(div, this.CLASS_PREFIX + '-group'); - Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group); - if (oGroup.label) { - var label = document.createElement('h3'); - label.innerHTML = oGroup.label; - div.appendChild(label); - } - if (!this.get('grouplabels')) { - Dom.addClass(this.get('cont'), this.CLASS_PREFIX, '-nogrouplabels'); - } - - this.get('cont').appendChild(div); - - //For accessibility, let's put all of the group buttons in an Unordered List - var ul = document.createElement('ul'); - div.appendChild(ul); - - if (!this._buttonGroupList) { - this._buttonGroupList = {}; - } - - this._buttonGroupList[oGroup.group] = ul; - - //An array of the button ids added to this group - //This is used for destruction later... - var addedButtons = [], - button; - - - for (var i = 0; i < oGroup.buttons.length; i++) { - var li = document.createElement('li'); - li.className = this.CLASS_PREFIX + '-groupitem'; - ul.appendChild(li); - if ((oGroup.buttons[i].type !== undefined) && oGroup.buttons[i].type == 'separator') { - this.addSeparator(li); - } else { - oGroup.buttons[i].container = li; - button = this.addButton(oGroup.buttons[i]); - if (button) { - addedButtons[addedButtons.length] = button.id; - } - } - } - return addedButtons; - }, - /** - * @method addButtonToGroup - * @description Add a new button to a toolbar group. Buttons supported: - * push, split, menu, select, color, spin - * @param {Object} oButton Object literal reference to the Button's Config - * @param {String} group The Group identifier passed into the initial config - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addButtonToGroup: function(oButton, group, after) { - var groupCont = this._buttonGroupList[group], - li = document.createElement('li'); - - li.className = this.CLASS_PREFIX + '-groupitem'; - oButton.container = li; - this.addButton(oButton, after); - groupCont.appendChild(li); - }, - /** - * @method addButton - * @description Add a new button to the toolbar. Buttons supported: - * push, split, menu, select, color, spin - * @param {Object} oButton Object literal reference to the Button's Config - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addButton: function(oButton, after) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addButton', arguments]; - return false; - } - if (!this._buttonList) { - this._buttonList = []; - } - if (!oButton.container) { - oButton.container = this.get('cont'); - } - - if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) { - if (Lang.isArray(oButton.menu)) { - for (var i in oButton.menu) { - if (Lang.hasOwnProperty(oButton.menu, i)) { - var funcObject = { - fn: function(ev, x, oMenu) { - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue); - }, - scope: this - }; - oButton.menu[i].onclick = funcObject; - } - } - } - } - var _oButton = {}, skip = false; - for (var o in oButton) { - if (Lang.hasOwnProperty(oButton, o)) { - if (!this._toolbarConfigs[o]) { - _oButton[o] = oButton[o]; - } - } - } - if (oButton.type == 'select') { - _oButton.type = 'menu'; - } - if (oButton.type == 'spin') { - _oButton.type = 'push'; - } - if (_oButton.type == 'color') { - if (YAHOO.widget.Overlay) { - _oButton = this._makeColorButton(_oButton); - } else { - skip = true; - } - } - if (_oButton.menu) { - if ((YAHOO.widget.Overlay) && (oButton.menu instanceof YAHOO.widget.Overlay)) { - oButton.menu.showEvent.subscribe(function() { - this._button = _oButton; - }); - } else { - for (var m = 0; m < _oButton.menu.length; m++) { - if (!_oButton.menu[m].value) { - _oButton.menu[m].value = _oButton.menu[m].text; - } - } - if (this.browser.webkit) { - _oButton.focusmenu = false; - } - } - } - if (skip) { - oButton = false; - } else { - //Add to .get('buttons') manually - this._configs.buttons.value[this._configs.buttons.value.length] = oButton; - - var tmp = new this.buttonType(_oButton); - tmp.get('element').tabIndex = '-1'; - tmp.get('element').setAttribute('role', 'button'); - tmp._selected = true; - - if (this.get('disabled')) { - //Toolbar is disabled, disable the new button too! - tmp.set('disabled', true); - } - if (!oButton.id) { - oButton.id = tmp.get('id'); - } - - if (after) { - var el = tmp.get('element'); - var nextSib = null; - if (after.get) { - nextSib = after.get('element').nextSibling; - } else if (after.nextSibling) { - nextSib = after.nextSibling; - } - if (nextSib) { - nextSib.parentNode.insertBefore(el, nextSib); - } - } - tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value')); - - var icon = document.createElement('span'); - icon.className = this.CLASS_PREFIX + '-icon'; - tmp.get('element').insertBefore(icon, tmp.get('firstChild')); - if (tmp._button.tagName.toLowerCase() == 'button') { - tmp.get('element').setAttribute('unselectable', 'on'); - //Replace the Button HTML Element with an a href if it exists - var a = document.createElement('a'); - a.innerHTML = tmp._button.innerHTML; - a.href = '#'; - a.tabIndex = '-1'; - Event.on(a, 'click', function(ev) { - Event.stopEvent(ev); - }); - tmp._button.parentNode.replaceChild(a, tmp._button); - tmp._button = a; - } - - if (oButton.type == 'select') { - if (tmp._button.tagName.toLowerCase() == 'select') { - icon.parentNode.removeChild(icon); - var iel = tmp._button, - parEl = tmp.get('element'); - parEl.parentNode.replaceChild(iel, parEl); - //The 'element' value is currently the orphaned element - //In order for "destroy" to execute we need to get('element') to reference the correct node. - //I'm not sure if there is a direct approach to setting this value. - tmp._configs.element.value = iel; - } else { - //Don't put a class on it if it's a real select element - tmp.addClass(this.CLASS_PREFIX + '-select'); - } - } - if (oButton.type == 'spin') { - if (!Lang.isArray(oButton.range)) { - oButton.range = [ 10, 100 ]; - } - this._makeSpinButton(tmp, oButton); - } - tmp.get('element').setAttribute('title', tmp.get('label')); - if (oButton.type != 'spin') { - if ((YAHOO.widget.Overlay) && (_oButton.menu instanceof YAHOO.widget.Overlay)) { - var showPicker = function(ev) { - var exec = true; - if (ev.keyCode && (ev.keyCode == 9)) { - exec = false; - } - if (exec) { - if (this._colorPicker) { - this._colorPicker._button = oButton.value; - } - var menuEL = tmp.getMenu().element; - if (Dom.getStyle(menuEL, 'visibility') == 'hidden') { - tmp.getMenu().show(); - } else { - tmp.getMenu().hide(); - } - } - YAHOO.util.Event.stopEvent(ev); - }; - tmp.on('mousedown', showPicker, oButton, this); - tmp.on('keydown', showPicker, oButton, this); - - } else if ((oButton.type != 'menu') && (oButton.type != 'select')) { - tmp.on('keypress', this._buttonClick, oButton, this); - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - this._buttonClick(ev, oButton); - }, oButton, this); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - } else { - //Stop the mousedown event so we can trap the selection in the editor! - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('change', function(ev) { - if (!ev.target) { - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ev.value; - this._buttonClick(ev, oButton); - } - }, this, true); - - var self = this; - //Hijack the mousedown event in the menu and make it fire a button click.. - tmp.on('appendTo', function() { - var tmp = this; - if (tmp.getMenu() && tmp.getMenu().mouseDownEvent) { - tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) { - var oMenu = args[1]; - YAHOO.util.Event.stopEvent(args[0]); - tmp._onMenuClick(args[0], tmp); - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue); - self._buttonClick.call(self, args[1], oButton); - tmp._hideMenu(); - return false; - }); - tmp.getMenu().clickEvent.subscribe(function(ev, args) { - YAHOO.util.Event.stopEvent(args[0]); - }); - tmp.getMenu().mouseUpEvent.subscribe(function(ev, args) { - YAHOO.util.Event.stopEvent(args[0]); - }); - } - }); - - } - } else { - //Stop the mousedown event so we can trap the selection in the editor! - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - } - if (this.browser.ie) { - /* - //Add a couple of new events for IE - tmp.DOM_EVENTS.focusin = true; - tmp.DOM_EVENTS.focusout = true; - - //Stop them so we don't loose focus in the Editor - tmp.on('focusin', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - - tmp.on('focusout', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - */ - } - if (this.browser.webkit) { - //This will keep the document from gaining focus and the editor from loosing it.. - //Forcefully remove the focus calls in button! - tmp.hasFocus = function() { - return true; - }; - } - this._buttonList[this._buttonList.length] = tmp; - if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) { - if (Lang.isArray(oButton.menu)) { - var menu = tmp.getMenu(); - if (menu && menu.renderEvent) { - menu.renderEvent.subscribe(this._addMenuClasses, tmp); - if (oButton.renderer) { - menu.renderEvent.subscribe(oButton.renderer, tmp); - } - } - } - } - } - return oButton; - }, - /** - * @method addSeparator - * @description Add a new button separator to the toolbar. - * @param {HTMLElement} cont Optional HTML element to insert this button into. - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addSeparator: function(cont, after) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addSeparator', arguments]; - return false; - } - var sepCont = ((cont) ? cont : this.get('cont')); - if (!this.get('element')) { - this._queue[this._queue.length] = ['addSeparator', arguments]; - return false; - } - if (this._sepCount === null) { - this._sepCount = 0; - } - if (!this._sep) { - this._sep = document.createElement('SPAN'); - Dom.addClass(this._sep, this.CLASS_SEPARATOR); - this._sep.innerHTML = '|'; - } - var _sep = this._sep.cloneNode(true); - this._sepCount++; - Dom.addClass(_sep, this.CLASS_SEPARATOR + '-' + this._sepCount); - if (after) { - var nextSib = null; - if (after.get) { - nextSib = after.get('element').nextSibling; - } else if (after.nextSibling) { - nextSib = after.nextSibling; - } else { - nextSib = after; - } - if (nextSib) { - if (nextSib == after) { - nextSib.parentNode.appendChild(_sep); - } else { - nextSib.parentNode.insertBefore(_sep, nextSib); - } - } - } else { - sepCont.appendChild(_sep); - } - return _sep; - }, - /** - * @method _createColorPicker - * @private - * @description Creates the core DOM reference to the color picker menu item. - * @param {String} id the id of the toolbar to prefix this DOM container with. - */ - _createColorPicker: function(id) { - if (Dom.get(id + '_colors')) { - Dom.get(id + '_colors').parentNode.removeChild(Dom.get(id + '_colors')); - } - var picker = document.createElement('div'); - picker.className = 'yui-toolbar-colors'; - picker.id = id + '_colors'; - picker.style.display = 'none'; - Event.on(window, 'load', function() { - document.body.appendChild(picker); - }, this, true); - - this._colorPicker = picker; - - var html = ''; - for (var i in this._colorData) { - if (Lang.hasOwnProperty(this._colorData, i)) { - html += '' + i.replace('#', '') + ''; - } - } - html += 'X'; - window.setTimeout(function() { - picker.innerHTML = html; - }, 0); - - Event.on(picker, 'mouseover', function(ev) { - var picker = this._colorPicker; - var em = picker.getElementsByTagName('em')[0]; - var strong = picker.getElementsByTagName('strong')[0]; - var tar = Event.getTarget(ev); - if (tar.tagName.toLowerCase() == 'a') { - em.style.backgroundColor = tar.style.backgroundColor; - strong.innerHTML = this._colorData['#' + tar.innerHTML] + '
            ' + tar.innerHTML; - } - }, this, true); - Event.on(picker, 'focus', function(ev) { - Event.stopEvent(ev); - }); - Event.on(picker, 'click', function(ev) { - Event.stopEvent(ev); - }); - Event.on(picker, 'mousedown', function(ev) { - Event.stopEvent(ev); - var tar = Event.getTarget(ev); - if (tar.tagName.toLowerCase() == 'a') { - var retVal = this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } ); - if (retVal !== false) { - var info = { - color: tar.innerHTML, - colorName: this._colorData['#' + tar.innerHTML], - value: this._colorPicker._button - }; - - this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info }); - } - this.getButtonByValue(this._colorPicker._button).getMenu().hide(); - } - }, this, true); - }, - /** - * @method _resetColorPicker - * @private - * @description Clears the currently selected color or mouseover color in the color picker. - */ - _resetColorPicker: function() { - var em = this._colorPicker.getElementsByTagName('em')[0]; - var strong = this._colorPicker.getElementsByTagName('strong')[0]; - em.style.backgroundColor = 'transparent'; - strong.innerHTML = ''; - }, - /** - * @method _makeColorButton - * @private - * @description Called to turn a "color" button into a menu button with an Overlay for the menu. - * @param {Object} _oButton YAHOO.widget.ToolbarButton reference - */ - _makeColorButton: function(_oButton) { - if (!this._colorPicker) { - this._createColorPicker(this.get('id')); - } - _oButton.type = 'color'; - _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visible: false, position: 'absolute', iframe: true }); - _oButton.menu.setBody(''); - _oButton.menu.render(this.get('cont')); - Dom.addClass(_oButton.menu.element, 'yui-button-menu'); - Dom.addClass(_oButton.menu.element, 'yui-color-button-menu'); - _oButton.menu.beforeShowEvent.subscribe(function() { - _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why. - _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why. - //Move the DOM reference of the color picker to the Overlay that we are about to show. - this._resetColorPicker(); - var _p = this._colorPicker; - if (_p.parentNode) { - _p.parentNode.removeChild(_p); - } - _oButton.menu.setBody(''); - _oButton.menu.appendToBody(_p); - this._colorPicker.style.display = 'block'; - }, this, true); - return _oButton; - }, - /** - * @private - * @method _makeSpinButton - * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values. - * @param {Object} _button YAHOO.widget.ToolbarButton reference - * @param {Object} oButton Object literal containing the buttons initial config - */ - _makeSpinButton: function(_button, oButton) { - _button.addClass(this.CLASS_PREFIX + '-spinbutton'); - var self = this, - _par = _button._button.parentNode.parentNode, //parentNode of Button Element for appending child - range = oButton.range, - _b1 = document.createElement('a'), - _b2 = document.createElement('a'); - _b1.href = '#'; - _b2.href = '#'; - _b1.tabIndex = '-1'; - _b2.tabIndex = '-1'; - - //Setup the up and down arrows - _b1.className = 'up'; - _b1.title = this.STR_SPIN_UP; - _b1.innerHTML = this.STR_SPIN_UP; - _b2.className = 'down'; - _b2.title = this.STR_SPIN_DOWN; - _b2.innerHTML = this.STR_SPIN_DOWN; - - //Append them to the container - _par.appendChild(_b1); - _par.appendChild(_b2); - - var label = YAHOO.lang.substitute(this.STR_SPIN_LABEL, { VALUE: _button.get('label') }); - _button.set('title', label); - - var cleanVal = function(value) { - value = ((value < range[0]) ? range[0] : value); - value = ((value > range[1]) ? range[1] : value); - return value; - }; - - var br = this.browser; - var tbar = false; - var strLabel = this.STR_SPIN_LABEL; - if (this._titlebar && this._titlebar.firstChild) { - tbar = this._titlebar.firstChild; - } - - var _intUp = function(ev) { - YAHOO.util.Event.stopEvent(ev); - if (!_button.get('disabled') && (ev.keyCode != 9)) { - var value = parseInt(_button.get('label'), 10); - value++; - value = cleanVal(value); - _button.set('label', ''+value); - var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') }); - _button.set('title', label); - if (!br.webkit && tbar) { - //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed - //_button.focus(); - } - self._buttonClick(ev, oButton); - } - }; - - var _intDown = function(ev) { - YAHOO.util.Event.stopEvent(ev); - if (!_button.get('disabled') && (ev.keyCode != 9)) { - var value = parseInt(_button.get('label'), 10); - value--; - value = cleanVal(value); - - _button.set('label', ''+value); - var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') }); - _button.set('title', label); - if (!br.webkit && tbar) { - //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed - //_button.focus(); - } - self._buttonClick(ev, oButton); - } - }; - - var _intKeyUp = function(ev) { - if (ev.keyCode == 38) { - _intUp(ev); - } else if (ev.keyCode == 40) { - _intDown(ev); - } else if (ev.keyCode == 107 && ev.shiftKey) { //Plus Key - _intUp(ev); - } else if (ev.keyCode == 109 && ev.shiftKey) { //Minus Key - _intDown(ev); - } - }; - - //Handle arrow keys.. - _button.on('keydown', _intKeyUp, this, true); - - //Listen for the click on the up button and act on it - //Listen for the click on the down button and act on it - Event.on(_b1, 'mousedown',function(ev) { - Event.stopEvent(ev); - }, this, true); - Event.on(_b2, 'mousedown', function(ev) { - Event.stopEvent(ev); - }, this, true); - Event.on(_b1, 'click', _intUp, this, true); - Event.on(_b2, 'click', _intDown, this, true); - }, - /** - * @protected - * @method _buttonClick - * @description Click handler for all buttons in the toolbar. - * @param {String} ev The event that was passed in. - * @param {Object} info Object literal of information about the button that was clicked. - */ - _buttonClick: function(ev, info) { - var doEvent = true; - - if (ev && ev.type == 'keypress') { - if (ev.keyCode == 9) { - doEvent = false; - } else if ((ev.keyCode === 13) || (ev.keyCode === 0) || (ev.keyCode === 32)) { - } else { - doEvent = false; - } - } - - if (doEvent) { - var fireNextEvent = true, - retValue = false; - - info.isSelected = this.isSelected(info.id); - - if (info.value) { - retValue = this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info }); - if (retValue === false) { - fireNextEvent = false; - } - } - - if (info.menucmd && fireNextEvent) { - retValue = this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info }); - if (retValue === false) { - fireNextEvent = false; - } - } - if (fireNextEvent) { - this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info }); - } - - if (info.type == 'select') { - var button = this.getButtonById(info.id); - if (button.buttonType == 'rich') { - var txt = info.value; - for (var i = 0; i < info.menu.length; i++) { - if (info.menu[i].value == info.value) { - txt = info.menu[i].text; - break; - } - } - button.set('label', '' + txt + ''); - var _items = button.getMenu().getItems(); - for (var m = 0; m < _items.length; m++) { - if (_items[m].value.toLowerCase() == info.value.toLowerCase()) { - _items[m].cfg.setProperty('checked', true); - } else { - _items[m].cfg.setProperty('checked', false); - } - } - } - } - if (ev) { - Event.stopEvent(ev); - } - } - }, - /** - * @private - * @property _keyNav - * @description Flag to determine if the arrow nav listeners have been attached - * @type Boolean - */ - _keyNav: null, - /** - * @private - * @property _navCounter - * @description Internal counter for walking the buttons in the toolbar with the arrow keys - * @type Number - */ - _navCounter: null, - /** - * @private - * @method _navigateButtons - * @description Handles the navigation/focus of toolbar buttons with the Arrow Keys - * @param {Event} ev The Key Event - */ - _navigateButtons: function(ev) { - switch (ev.keyCode) { - case 37: - case 39: - if (ev.keyCode == 37) { - this._navCounter--; - } else { - this._navCounter++; - } - if (this._navCounter > (this._buttonList.length - 1)) { - this._navCounter = 0; - } - if (this._navCounter < 0) { - this._navCounter = (this._buttonList.length - 1); - } - if (this._buttonList[this._navCounter]) { - var el = this._buttonList[this._navCounter].get('element'); - if (this.browser.ie) { - el = this._buttonList[this._navCounter].get('element').getElementsByTagName('a')[0]; - } - if (this._buttonList[this._navCounter].get('disabled')) { - this._navigateButtons(ev); - } else { - el.focus(); - } - } - break; - } - }, - /** - * @private - * @method _handleFocus - * @description Sets up the listeners for the arrow key navigation - */ - _handleFocus: function() { - if (!this._keyNav) { - var ev = 'keypress'; - if (this.browser.ie) { - ev = 'keydown'; - } - Event.on(this.get('element'), ev, this._navigateButtons, this, true); - this._keyNav = true; - this._navCounter = -1; - } - }, - /** - * @method getButtonById - * @description Gets a button instance from the toolbar by is Dom id. - * @param {String} id The Dom id to query for. - * @return {YAHOO.widget.ToolbarButton} - */ - getButtonById: function(id) { - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - if (this._buttonList[i] && this._buttonList[i].get('id') == id) { - return this._buttonList[i]; - } - } - return false; - }, - /** - * @method getButtonByValue - * @description Gets a button instance or a menuitem instance from the toolbar by it's value. - * @param {String} value The button value to query for. - * @return {YAHOO.widget.ToolbarButton or YAHOO.widget.MenuItem} - */ - getButtonByValue: function(value) { - var _buttons = this.get('buttons'); - if (!_buttons) { - return false; - } - var len = _buttons.length; - for (var i = 0; i < len; i++) { - if (_buttons[i].group !== undefined) { - for (var m = 0; m < _buttons[i].buttons.length; m++) { - if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) { - return this.getButtonById(_buttons[i].buttons[m].id); - } - if (_buttons[i].buttons[m].menu) { //Menu Button, loop through the values - for (var s = 0; s < _buttons[i].buttons[m].menu.length; s++) { - if (_buttons[i].buttons[m].menu[s].value == value) { - return this.getButtonById(_buttons[i].buttons[m].id); - } - } - } - } - } else { - if ((_buttons[i].value == value) || (_buttons[i].menucmd == value)) { - return this.getButtonById(_buttons[i].id); - } - if (_buttons[i].menu) { //Menu Button, loop through the values - for (var j = 0; j < _buttons[i].menu.length; j++) { - if (_buttons[i].menu[j].value == value) { - return this.getButtonById(_buttons[i].id); - } - } - } - } - } - return false; - }, - /** - * @method getButtonByIndex - * @description Gets a button instance from the toolbar by is index in _buttonList. - * @param {Number} index The index of the button in _buttonList. - * @return {YAHOO.widget.ToolbarButton} - */ - getButtonByIndex: function(index) { - if (this._buttonList[index]) { - return this._buttonList[index]; - } else { - return false; - } - }, - /** - * @method getButtons - * @description Returns an array of buttons in the current toolbar - * @return {Array} - */ - getButtons: function() { - return this._buttonList; - }, - /** - * @method disableButton - * @description Disables a button in the toolbar. - * @param {String/Number} id Disable a button by it's id, index or value. - * @return {Boolean} - */ - disableButton: function(id) { - var button = getButton.call(this, id); - if (button) { - button.set('disabled', true); - } else { - return false; - } - }, - /** - * @method enableButton - * @description Enables a button in the toolbar. - * @param {String/Number} id Enable a button by it's id, index or value. - * @return {Boolean} - */ - enableButton: function(id) { - if (this.get('disabled')) { - return false; - } - var button = getButton.call(this, id); - if (button) { - if (button.get('disabled')) { - button.set('disabled', false); - } - } else { - return false; - } - }, - /** - * @method isSelected - * @description Tells if a button is selected or not. - * @param {String/Number} id A button by it's id, index or value. - * @return {Boolean} - */ - isSelected: function(id) { - var button = getButton.call(this, id); - if (button) { - return button._selected; - } - return false; - }, - /** - * @method selectButton - * @description Selects a button in the toolbar. - * @param {String/Number} id Select a button by it's id, index or value. - * @param {String} value If this is a Menu Button, check this item in the menu - * @return {Boolean} - */ - selectButton: function(id, value) { - var button = getButton.call(this, id); - if (button) { - button.addClass('yui-button-selected'); - button.addClass('yui-button-' + button.get('value') + '-selected'); - button._selected = true; - if (value) { - if (button.buttonType == 'rich') { - var _items = button.getMenu().getItems(); - for (var m = 0; m < _items.length; m++) { - if (_items[m].value == value) { - _items[m].cfg.setProperty('checked', true); - button.set('label', '' + _items[m]._oText.nodeValue + ''); - } else { - _items[m].cfg.setProperty('checked', false); - } - } - } - } - } else { - return false; - } - }, - /** - * @method deselectButton - * @description Deselects a button in the toolbar. - * @param {String/Number} id Deselect a button by it's id, index or value. - * @return {Boolean} - */ - deselectButton: function(id) { - var button = getButton.call(this, id); - if (button) { - button.removeClass('yui-button-selected'); - button.removeClass('yui-button-' + button.get('value') + '-selected'); - button.removeClass('yui-button-hover'); - button._selected = false; - } else { - return false; - } - }, - /** - * @method deselectAllButtons - * @description Deselects all buttons in the toolbar. - * @return {Boolean} - */ - deselectAllButtons: function() { - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.deselectButton(this._buttonList[i]); - } - }, - /** - * @method disableAllButtons - * @description Disables all buttons in the toolbar. - * @return {Boolean} - */ - disableAllButtons: function() { - if (this.get('disabled')) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.disableButton(this._buttonList[i]); - } - }, - /** - * @method enableAllButtons - * @description Enables all buttons in the toolbar. - * @return {Boolean} - */ - enableAllButtons: function() { - if (this.get('disabled')) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.enableButton(this._buttonList[i]); - } - }, - /** - * @method resetAllButtons - * @description Resets all buttons to their initial state. - * @param {Object} _ex Except these buttons - * @return {Boolean} - */ - resetAllButtons: function(_ex) { - if (!Lang.isObject(_ex)) { - _ex = {}; - } - if (this.get('disabled') || !this._buttonList) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - var _button = this._buttonList[i]; - if (_button) { - var disabled = _button._configs.disabled._initialConfig.value; - if (_ex[_button.get('id')]) { - this.enableButton(_button); - this.selectButton(_button); - } else { - if (disabled) { - this.disableButton(_button); - } else { - this.enableButton(_button); - } - this.deselectButton(_button); - } - } - } - }, - /** - * @method destroyButton - * @description Destroy a button in the toolbar. - * @param {String/Number} id Destroy a button by it's id or index. - * @return {Boolean} - */ - destroyButton: function(id) { - var button = getButton.call(this, id); - if (button) { - var thisID = button.get('id'), - new_list = [], i = 0, - len = this._buttonList.length; - - button.destroy(); - - for (i = 0; i < len; i++) { - if (this._buttonList[i].get('id') != thisID) { - new_list[new_list.length]= this._buttonList[i]; - } - } - - this._buttonList = new_list; - } else { - return false; - } - }, - /** - * @method destroy - * @description Destroys the toolbar, all of it's elements and objects. - * @return {Boolean} - */ - destroy: function() { - var len = this._configuredButtons.length, j, i; - for(b = 0; b < len; b++) { - this.destroyButton(this._configuredButtons[b]); - } - - this._configuredButtons = null; - - this.get('element').innerHTML = ''; - this.get('element').className = ''; - //Brutal Object Destroy - for (i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - return true; - }, - /** - * @method collapse - * @description Programatically collapse the toolbar. - * @param {Boolean} collapse True to collapse, false to expand. - */ - collapse: function(collapse) { - var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapse === false) { - Dom.removeClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed'); - if (el[0]) { - Dom.removeClass(el[0], 'collapsed'); - el[0].title = this.STR_COLLAPSE; - } - this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this }); - } else { - if (el[0]) { - Dom.addClass(el[0], 'collapsed'); - el[0].title = this.STR_EXPAND; - } - Dom.addClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed'); - this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this }); - } - }, - /** - * @method toString - * @description Returns a string representing the toolbar. - * @return {String} - */ - toString: function() { - return 'Toolbar (#' + this.get('element').id + ') with ' + this._buttonList.length + ' buttons.'; - } - }); -/** -* @event buttonClick -* @param {Object} o The object passed to this handler is the button config used to create the button. -* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event valueClick -* @param {Object} o The object passed to this handler is the button config used to create the button. -* @description This is a special dynamic event that is created and dispatched based on the value property -* of the button config. See Element.addListener for more information on listening for this event. -* Example: -*
            -* buttons : [
            -*   { type: 'button', value: 'test', value: 'testButton' }
            -* ]
            -*
            -* With the valueClick event you could subscribe to this buttons click event with this: -* tbar.in('testButtonClick', function() { alert('test button clicked'); }) -* @type YAHOO.util.CustomEvent -*/ -/** -* @event toolbarExpanded -* @description Fires when the toolbar is expanded via the collapse button. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event toolbarCollapsed -* @description Fires when the toolbar is collapsed via the collapse button. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -})(); -/** - * @module editor - * @description

            The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.

            - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, toolbar - * @optional animation, container_core, resize, dragdrop - */ - -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang, - Toolbar = YAHOO.widget.Toolbar; - - /** - * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization. - * @constructor - * @class SimpleEditor - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The textarea element to turn into an editor. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.SimpleEditor = function(el, attrs) { - - var o = {}; - if (Lang.isObject(el) && (!el.tagName) && !attrs) { - Lang.augmentObject(o, el); //Break the config reference - el = document.createElement('textarea'); - this.DOMReady = true; - if (o.container) { - var c = Dom.get(o.container); - c.appendChild(el); - } else { - document.body.appendChild(el); - } - } else { - if (attrs) { - Lang.augmentObject(o, attrs); //Break the config reference - } - } - - var oConfig = { - element: null, - attributes: o - }, id = null; - - if (Lang.isString(el)) { - id = el; - } else { - if (oConfig.attributes.id) { - id = oConfig.attributes.id; - } else { - this.DOMReady = true; - id = Dom.generateId(el); - } - } - oConfig.element = el; - - var element_cont = document.createElement('DIV'); - oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, { - id: id + '_container' - }); - var div = document.createElement('div'); - Dom.addClass(div, 'first-child'); - oConfig.attributes.element_cont.appendChild(div); - - if (!oConfig.attributes.toolbar_cont) { - oConfig.attributes.toolbar_cont = document.createElement('DIV'); - oConfig.attributes.toolbar_cont.id = id + '_toolbar'; - div.appendChild(oConfig.attributes.toolbar_cont); - } - var editorWrapper = document.createElement('DIV'); - div.appendChild(editorWrapper); - oConfig.attributes.editor_wrapper = editorWrapper; - - YAHOO.widget.SimpleEditor.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - - YAHOO.extend(YAHOO.widget.SimpleEditor, YAHOO.util.Element, { - /** - * @private - * @property _resizeConfig - * @description The default config for the Resize Utility - */ - _resizeConfig: { - handles: ['br'], - autoRatio: true, - status: true, - proxy: true, - useShim: true, - setSize: false - }, - /** - * @private - * @method _setupResize - * @description Creates the Resize instance and binds its events. - */ - _setupResize: function() { - if (!YAHOO.util.DD || !YAHOO.util.Resize) { return false; } - if (this.get('resize')) { - var config = {}; - Lang.augmentObject(config, this._resizeConfig); //Break the config reference - this.resize = new YAHOO.util.Resize(this.get('element_cont').get('element'), config); - this.resize.on('resize', function(args) { - var anim = this.get('animate'); - this.set('animate', false); - this.set('width', args.width + 'px'); - var h = args.height, - th = (this.toolbar.get('element').clientHeight + 2), - dh = 0; - if (this.dompath) { - dh = (this.dompath.clientHeight + 1); //It has a 1px top border.. - } - var newH = (h - th - dh); - this.set('height', newH + 'px'); - this.get('element_cont').setStyle('height', ''); - this.set('animate', anim); - }, this, true); - } - }, - /** - * @property resize - * @description A reference to the Resize object - * @type YAHOO.util.Resize - */ - resize: null, - /** - * @private - * @method _setupDD - * @description Sets up the DD instance used from the 'drag' config option. - */ - _setupDD: function() { - if (!YAHOO.util.DD) { return false; } - if (this.get('drag')) { - var d = this.get('drag'), - dd = YAHOO.util.DD; - if (d === 'proxy') { - dd = YAHOO.util.DDProxy; - } - - this.dd = new dd(this.get('element_cont').get('element')); - this.toolbar.addClass('draggable'); - this.dd.setHandleElId(this.toolbar._titlebar); - } - }, - /** - * @property dd - * @description A reference to the DragDrop object. - * @type YAHOO.util.DD/YAHOO.util.DDProxy - */ - dd: null, - /** - * @private - * @property _lastCommand - * @description A cache of the last execCommand (used for Undo/Redo so they don't mark an undo level) - * @type String - */ - _lastCommand: null, - _undoNodeChange: function() {}, - _storeUndo: function() {}, - /** - * @private - * @method _checkKey - * @description Checks a keyMap entry against a key event - * @param {Object} k The _keyMap object - * @param {Event} e The Mouse Event - * @return {Boolean} - */ - _checkKey: function(k, e) { - var ret = false; - if ((e.keyCode === k.key)) { - if (k.mods && (k.mods.length > 0)) { - var val = 0; - for (var i = 0; i < k.mods.length; i++) { - if (this.browser.mac) { - if (k.mods[i] == 'ctrl') { - k.mods[i] = 'meta'; - } - } - if (e[k.mods[i] + 'Key'] === true) { - val++; - } - } - if (val === k.mods.length) { - ret = true; - } - } else { - ret = true; - } - } - return ret; - }, - /** - * @private - * @property _keyMap - * @description Named key maps for various actions in the Editor. Example: CLOSE_WINDOW: { key: 87, mods: ['shift', 'ctrl'] }. - * This entry shows that when key 87 (W) is found with the modifiers of shift and control, the window will close. You can customize this object to tweak keyboard shortcuts. - * @type {Object/Mixed} - */ - _keyMap: { - SELECT_ALL: { - key: 65, //A key - mods: ['ctrl'] - }, - CLOSE_WINDOW: { - key: 87, //W key - mods: ['shift', 'ctrl'] - }, - FOCUS_TOOLBAR: { - key: 27, - mods: ['shift'] - }, - FOCUS_AFTER: { - key: 27 - }, - FONT_SIZE_UP: { - key: 38, - mods: ['shift', 'ctrl'] - }, - FONT_SIZE_DOWN: { - key: 40, - mods: ['shift', 'ctrl'] - }, - CREATE_LINK: { - key: 76, - mods: ['shift', 'ctrl'] - }, - BOLD: { - key: 66, - mods: ['shift', 'ctrl'] - }, - ITALIC: { - key: 73, - mods: ['shift', 'ctrl'] - }, - UNDERLINE: { - key: 85, - mods: ['shift', 'ctrl'] - }, - UNDO: { - key: 90, - mods: ['ctrl'] - }, - REDO: { - key: 90, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_LEFT: { - key: 219, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_CENTER: { - key: 220, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_RIGHT: { - key: 221, - mods: ['shift', 'ctrl'] - } - }, - /** - * @private - * @method _cleanClassName - * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s. - * @param {String} str The classname to clean up - * @return {String} - */ - _cleanClassName: function(str) { - return str.replace(/ /g, '-').toLowerCase(); - }, - /** - * @property _textarea - * @description Flag to determine if we are using a textarea or an HTML Node. - * @type Boolean - */ - _textarea: null, - /** - * @property _docType - * @description The DOCTYPE to use in the editable container. - * @type String - */ - _docType: '', - /** - * @property editorDirty - * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed. - * @type Boolean - */ - editorDirty: null, - /** - * @property _defaultCSS - * @description The default CSS used in the config for 'css'. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + 'ADD MYY CSS HERE' } - * @type String - */ - _defaultCSS: 'html { height: 95%; } body { padding: 7px; background-color: #fff; font: 13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div.yui-wk-p { margin: 11px 0; } body.ptags.webkit div.yui-wk-div { margin: 0; }', - /** - * @property _defaultToolbar - * @private - * @description Default toolbar config. - * @type Object - */ - _defaultToolbar: null, - /** - * @property _lastButton - * @private - * @description The last button pressed, so we don't disable it. - * @type Object - */ - _lastButton: null, - /** - * @property _baseHREF - * @private - * @description The base location of the editable page (this page) so that relative paths for image work. - * @type String - */ - _baseHREF: function() { - var href = document.location.href; - if (href.indexOf('?') !== -1) { //Remove the query string - href = href.substring(0, href.indexOf('?')); - } - href = href.substring(0, href.lastIndexOf('/')) + '/'; - return href; - }(), - /** - * @property _lastImage - * @private - * @description Safari reference for the last image selected (for styling as selected). - * @type HTMLElement - */ - _lastImage: null, - /** - * @property _blankImageLoaded - * @private - * @description Don't load the blank image more than once.. - * @type Boolean - */ - _blankImageLoaded: null, - /** - * @property _fixNodesTimer - * @private - * @description Holder for the fixNodes timer - * @type Date - */ - _fixNodesTimer: null, - /** - * @property _nodeChangeTimer - * @private - * @description Holds a reference to the nodeChange setTimeout call - * @type Number - */ - _nodeChangeTimer: null, - /** - * @property _nodeChangeDelayTimer - * @private - * @description Holds a reference to the nodeChangeDelay setTimeout call - * @type Number - */ - _nodeChangeDelayTimer: null, - /** - * @property _lastNodeChangeEvent - * @private - * @description Flag to determine the last event that fired a node change - * @type Event - */ - _lastNodeChangeEvent: null, - /** - * @property _lastNodeChange - * @private - * @description Flag to determine when the last node change was fired - * @type Date - */ - _lastNodeChange: 0, - /** - * @property _rendered - * @private - * @description Flag to determine if editor has been rendered or not - * @type Boolean - */ - _rendered: null, - /** - * @property DOMReady - * @private - * @description Flag to determine if DOM is ready or not - * @type Boolean - */ - DOMReady: null, - /** - * @property _selection - * @private - * @description Holder for caching iframe selections - * @type Object - */ - _selection: null, - /** - * @property _mask - * @private - * @description DOM Element holder for the editor Mask when disabled - * @type Object - */ - _mask: null, - /** - * @property _showingHiddenElements - * @private - * @description Status of the hidden elements button - * @type Boolean - */ - _showingHiddenElements: null, - /** - * @property currentWindow - * @description A reference to the currently open EditorWindow - * @type Object - */ - currentWindow: null, - /** - * @property currentEvent - * @description A reference to the current editor event - * @type Event - */ - currentEvent: null, - /** - * @property operaEvent - * @private - * @description setTimeout holder for Opera and Image DoubleClick event.. - * @type Object - */ - operaEvent: null, - /** - * @property currentFont - * @description A reference to the last font selected from the Toolbar - * @type HTMLElement - */ - currentFont: null, - /** - * @property currentElement - * @description A reference to the current working element in the editor - * @type Array - */ - currentElement: null, - /** - * @property dompath - * @description A reference to the dompath container for writing the current working dom path to. - * @type HTMLElement - */ - dompath: null, - /** - * @property beforeElement - * @description A reference to the H2 placed before the editor for Accessibilty. - * @type HTMLElement - */ - beforeElement: null, - /** - * @property afterElement - * @description A reference to the H2 placed after the editor for Accessibilty. - * @type HTMLElement - */ - afterElement: null, - /** - * @property invalidHTML - * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine. - * @type Object - */ - invalidHTML: { - form: true, - input: true, - button: true, - select: true, - link: true, - html: true, - body: true, - iframe: true, - script: true, - style: true, - textarea: true - }, - /** - * @property toolbar - * @description Local property containing the YAHOO.widget.Toolbar instance - * @type YAHOO.widget.Toolbar - */ - toolbar: null, - /** - * @private - * @property _contentTimer - * @description setTimeout holder for documentReady check - */ - _contentTimer: null, - /** - * @private - * @property _contentTimerMax - * @description The number of times the loaded content should be checked before giving up. Default: 500 - */ - _contentTimerMax: 500, - /** - * @private - * @property _contentTimerCounter - * @description Counter to check the number of times the body is polled for before giving up - * @type Number - */ - _contentTimerCounter: 0, - /** - * @private - * @property _disabled - * @description The Toolbar items that should be disabled if there is no selection present in the editor. - * @type Array - */ - _disabled: [ 'createlink', 'fontname', 'fontsize', 'forecolor', 'backcolor' ], - /** - * @private - * @property _alwaysDisabled - * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor. - * @type Object - */ - _alwaysDisabled: { undo: true, redo: true }, - /** - * @private - * @property _alwaysEnabled - * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor. - * @type Object - */ - _alwaysEnabled: { }, - /** - * @private - * @property _semantic - * @description The Toolbar commands that we should attempt to make tags out of instead of using styles. - * @type Object - */ - _semantic: { 'bold': true, 'italic' : true, 'underline' : true }, - /** - * @private - * @property _tag2cmd - * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button. - * @type Object - */ - _tag2cmd: { - 'b': 'bold', - 'strong': 'bold', - 'i': 'italic', - 'em': 'italic', - 'u': 'underline', - 'sup': 'superscript', - 'sub': 'subscript', - 'img': 'insertimage', - 'a' : 'createlink', - 'ul' : 'insertunorderedlist', - 'ol' : 'insertorderedlist' - }, - - /** - * @private _createIframe - * @description Creates the DOM and YUI Element for the iFrame editor area. - * @param {String} id The string ID to prefix the iframe with - * @return {Object} iFrame object - */ - _createIframe: function() { - var ifrmDom = document.createElement('iframe'); - ifrmDom.id = this.get('id') + '_editor'; - var config = { - border: '0', - frameBorder: '0', - marginWidth: '0', - marginHeight: '0', - leftMargin: '0', - topMargin: '0', - allowTransparency: 'true', - width: '100%' - }; - if (this.get('autoHeight')) { - config.scrolling = 'no'; - } - for (var i in config) { - if (Lang.hasOwnProperty(config, i)) { - ifrmDom.setAttribute(i, config[i]); - } - } - var isrc = 'javascript:;'; - if (this.browser.ie) { - //isrc = 'about:blank'; - //TODO - Check this, I have changed it before.. - isrc = 'javascript:false;'; - } - ifrmDom.setAttribute('src', isrc); - var ifrm = new YAHOO.util.Element(ifrmDom); - ifrm.setStyle('visibility', 'hidden'); - return ifrm; - }, - /** - * @private _isElement - * @description Checks to see if an Element reference is a valid one and has a certain tag type - * @param {HTMLElement} el The element to check - * @param {String} tag The tag that the element needs to be - * @return {Boolean} - */ - _isElement: function(el, tag) { - if (el && el.tagName && (el.tagName.toLowerCase() == tag)) { - return true; - } - if (el && el.getAttribute && (el.getAttribute('tag') == tag)) { - return true; - } - return false; - }, - /** - * @private _hasParent - * @description Checks to see if an Element reference or one of it's parents is a valid one and has a certain tag type - * @param {HTMLElement} el The element to check - * @param {String} tag The tag that the element needs to be - * @return HTMLElement - */ - _hasParent: function(el, tag) { - if (!el || !el.parentNode) { - return false; - } - - while (el.parentNode) { - if (this._isElement(el, tag)) { - return el; - } - if (el.parentNode) { - el = el.parentNode; - } else { - return false; - } - } - return false; - }, - /** - * @private - * @method _getDoc - * @description Get the Document of the IFRAME - * @return {Object} - */ - _getDoc: function() { - var value = false; - try { - if (this.get('iframe').get('element').contentWindow.document) { - value = this.get('iframe').get('element').contentWindow.document; - return value; - } - } catch (e) { - return false; - } - }, - /** - * @private - * @method _getWindow - * @description Get the Window of the IFRAME - * @return {Object} - */ - _getWindow: function() { - return this.get('iframe').get('element').contentWindow; - }, - /** - * @method focus - * @description Attempt to set the focus of the iframes window. - */ - focus: function() { - this._getWindow().focus(); - }, - /** - * @private - * @depreciated - This should not be used, moved to this.focus(); - * @method _focusWindow - * @description Attempt to set the focus of the iframes window. - */ - _focusWindow: function() { - this.focus(); - }, - /** - * @private - * @method _hasSelection - * @description Determines if there is a selection in the editor document. - * @return {Boolean} - */ - _hasSelection: function() { - var sel = this._getSelection(); - var range = this._getRange(); - var hasSel = false; - - if (!sel || !range) { - return hasSel; - } - - //Internet Explorer - if (this.browser.ie || this.browser.opera) { - if (range.text) { - hasSel = true; - } - if (range.html) { - hasSel = true; - } - } else { - if (this.browser.webkit) { - if (sel+'' !== '') { - hasSel = true; - } - } else { - if (sel && (sel.toString() !== '') && (sel !== undefined)) { - hasSel = true; - } - } - } - return hasSel; - }, - /** - * @private - * @method _getSelection - * @description Handles the different selection objects across the A-Grade list. - * @return {Object} Selection Object - */ - _getSelection: function() { - var _sel = null; - if (this._getDoc() && this._getWindow()) { - if (this._getDoc().selection) { - _sel = this._getDoc().selection; - } else { - _sel = this._getWindow().getSelection(); - } - //Handle Safari's lack of Selection Object - if (this.browser.webkit) { - if (_sel.baseNode) { - this._selection = {}; - this._selection.baseNode = _sel.baseNode; - this._selection.baseOffset = _sel.baseOffset; - this._selection.extentNode = _sel.extentNode; - this._selection.extentOffset = _sel.extentOffset; - } else if (this._selection !== null) { - _sel = this._getWindow().getSelection(); - _sel.setBaseAndExtent( - this._selection.baseNode, - this._selection.baseOffset, - this._selection.extentNode, - this._selection.extentOffset); - this._selection = null; - } - } - } - return _sel; - }, - /** - * @private - * @method _selectNode - * @description Places the highlight around a given node - * @param {HTMLElement} node The node to select - */ - _selectNode: function(node, collapse) { - if (!node) { - return false; - } - var sel = this._getSelection(), - range = null; - - if (this.browser.ie) { - try { //IE freaks out here sometimes.. - range = this._getDoc().body.createTextRange(); - range.moveToElementText(node); - range.select(); - } catch (e) { - } - } else if (this.browser.webkit) { - if (collapse) { - sel.setBaseAndExtent(node, 1, node, node.innerText.length); - } else { - sel.setBaseAndExtent(node, 0, node, node.innerText.length); - } - } else if (this.browser.opera) { - sel = this._getWindow().getSelection(); - range = this._getDoc().createRange(); - range.selectNode(node); - sel.removeAllRanges(); - sel.addRange(range); - } else { - range = this._getDoc().createRange(); - range.selectNodeContents(node); - sel.removeAllRanges(); - sel.addRange(range); - } - //TODO - Check Performance - this.nodeChange(); - }, - /** - * @private - * @method _getRange - * @description Handles the different range objects across the A-Grade list. - * @return {Object} Range Object - */ - _getRange: function() { - var sel = this._getSelection(); - - if (sel === null) { - return null; - } - - if (this.browser.webkit && !sel.getRangeAt) { - var _range = this._getDoc().createRange(); - try { - _range.setStart(sel.anchorNode, sel.anchorOffset); - _range.setEnd(sel.focusNode, sel.focusOffset); - } catch (e) { - _range = this._getWindow().getSelection()+''; - } - return _range; - } - - if (this.browser.ie || this.browser.opera) { - try { - return sel.createRange(); - } catch (e2) { - return null; - } - } - - if (sel.rangeCount > 0) { - return sel.getRangeAt(0); - } - return null; - }, - /** - * @private - * @method _setDesignMode - * @description Sets the designMode property of the iFrame document's body. - * @param {String} state This should be either on or off - */ - _setDesignMode: function(state) { - if (this.get('setDesignMode')) { - try { - this._getDoc().designMode = ((state.toLowerCase() == 'off') ? 'off' : 'on'); - } catch(e) { } - } - }, - /** - * @private - * @method _toggleDesignMode - * @description Toggles the designMode property of the iFrame document on and off. - * @return {String} The state that it was set to. - */ - _toggleDesignMode: function() { - var _dMode = this._getDoc().designMode, - _state = ((_dMode.toLowerCase() == 'on') ? 'off' : 'on'); - this._setDesignMode(_state); - return _state; - }, - /** - * @private - * @property _focused - * @description Holder for trapping focus/blur state and prevent double events - * @type Boolean - */ - _focused: null, - /** - * @private - * @method _handleFocus - * @description Handles the focus of the iframe. Note, this is window focus event, not an Editor focus event. - * @param {Event} e The DOM Event - */ - _handleFocus: function(e) { - if (!this._focused) { - this._focused = true; - this.fireEvent('editorWindowFocus', { type: 'editorWindowFocus', target: this }); - } - }, - /** - * @private - * @method _handleBlur - * @description Handles the blur of the iframe. Note, this is window blur event, not an Editor blur event. - * @param {Event} e The DOM Event - */ - _handleBlur: function(e) { - if (this._focused) { - this._focused = false; - this.fireEvent('editorWindowBlur', { type: 'editorWindowBlur', target: this }); - } - }, - /** - * @private - * @method _initEditorEvents - * @description This method sets up the listeners on the Editors document. - */ - _initEditorEvents: function() { - //Setup Listeners on iFrame - var doc = this._getDoc(), - win = this._getWindow(); - - Event.on(doc, 'mouseup', this._handleMouseUp, this, true); - Event.on(doc, 'mousedown', this._handleMouseDown, this, true); - Event.on(doc, 'click', this._handleClick, this, true); - Event.on(doc, 'dblclick', this._handleDoubleClick, this, true); - Event.on(doc, 'keypress', this._handleKeyPress, this, true); - Event.on(doc, 'keyup', this._handleKeyUp, this, true); - Event.on(doc, 'keydown', this._handleKeyDown, this, true); - /* TODO -- Everyone but Opera works here.. - Event.on(doc, 'paste', function() { - }, this, true); - */ - - //Focus and blur.. - Event.on(win, 'focus', this._handleFocus, this, true); - Event.on(win, 'blur', this._handleBlur, this, true); - }, - /** - * @private - * @method _removeEditorEvents - * @description This method removes the listeners on the Editors document (for disabling). - */ - _removeEditorEvents: function() { - //Remove Listeners on iFrame - var doc = this._getDoc(), - win = this._getWindow(); - - Event.removeListener(doc, 'mouseup', this._handleMouseUp, this, true); - Event.removeListener(doc, 'mousedown', this._handleMouseDown, this, true); - Event.removeListener(doc, 'click', this._handleClick, this, true); - Event.removeListener(doc, 'dblclick', this._handleDoubleClick, this, true); - Event.removeListener(doc, 'keypress', this._handleKeyPress, this, true); - Event.removeListener(doc, 'keyup', this._handleKeyUp, this, true); - Event.removeListener(doc, 'keydown', this._handleKeyDown, this, true); - - //Focus and blur.. - Event.removeListener(win, 'focus', this._handleFocus, this, true); - Event.removeListener(win, 'blur', this._handleBlur, this, true); - }, - _fixWebkitDivs: function() { - if (this.browser.webkit) { - var divs = this._getDoc().body.getElementsByTagName('div'); - Dom.addClass(divs, 'yui-wk-div'); - } - }, - /** - * @private - * @method _initEditor - * @param {Boolean} raw Don't add events. - * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners. - */ - _initEditor: function(raw) { - if (this._editorInit) { - return; - } - this._editorInit = true; - if (this.browser.ie) { - this._getDoc().body.style.margin = '0'; - } - if (!this.get('disabled')) { - this._setDesignMode('on'); - this._contentTimerCounter = 0; - } - if (!this._getDoc().body) { - this._contentTimerCounter = 0; - this._editorInit = false; - this._checkLoaded(); - return false; - } - - if (!raw) { - this.toolbar.on('buttonClick', this._handleToolbarClick, this, true); - } - if (!this.get('disabled')) { - this._initEditorEvents(); - this.toolbar.set('disabled', false); - } - - if (raw) { - this.fireEvent('editorContentReloaded', { type: 'editorreloaded', target: this }); - } else { - this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this }); - } - this._fixWebkitDivs(); - if (this.get('dompath')) { - var self = this; - setTimeout(function() { - self._writeDomPath.call(self); - self._setupResize.call(self); - }, 150); - } - var br = []; - for (var i in this.browser) { - if (this.browser[i]) { - br.push(i); - } - } - if (this.get('ptags')) { - br.push('ptags'); - } - Dom.addClass(this._getDoc().body, br.join(' ')); - this.nodeChange(true); - }, - /** - * @private - * @method _checkLoaded - * @param {Boolean} raw Don't add events. - * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor. - */ - _checkLoaded: function(raw) { - this._editorInit = false; - this._contentTimerCounter++; - if (this._contentTimer) { - clearTimeout(this._contentTimer); - } - if (this._contentTimerCounter > this._contentTimerMax) { - return false; - } - var init = false; - try { - if (this._getDoc() && this._getDoc().body) { - if (this.browser.ie) { - if (this._getDoc().body.readyState == 'complete') { - init = true; - } - } else { - if (this._getDoc().body._rteLoaded === true) { - init = true; - } - } - } - } catch (e) { - init = false; - } - - if (init === true) { - //The onload event has fired, clean up after ourselves and fire the _initEditor method - this._initEditor(raw); - } else { - var self = this; - this._contentTimer = setTimeout(function() { - self._checkLoaded.call(self, raw); - }, 20); - } - }, - /** - * @private - * @method _setInitialContent - * @param {Boolean} raw Don't add events. - * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking. - */ - _setInitialContent: function(raw) { - - var value = ((this._textarea) ? this.get('element').value : this.get('element').innerHTML), - doc = null; - - if (value === '') { - value = '
            '; - } - - var html = Lang.substitute(this.get('html'), { - TITLE: this.STR_TITLE, - CONTENT: this._cleanIncomingHTML(value), - CSS: this.get('css'), - HIDDEN_CSS: ((this.get('hiddencss')) ? this.get('hiddencss') : '/* No Hidden CSS */'), - EXTRA_CSS: ((this.get('extracss')) ? this.get('extracss') : '/* No Extra CSS */') - }), - check = true; - - html = html.replace(/RIGHT_BRACKET/gi, '{'); - html = html.replace(/LEFT_BRACKET/gi, '}'); - - if (document.compatMode != 'BackCompat') { - html = this._docType + "\n" + html; - } else { - } - - if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) { - //Firefox 1.5 doesn't like setting designMode on an document created with a data url - try { - //Adobe AIR Code - if (this.browser.air) { - doc = this._getDoc().implementation.createHTMLDocument(); - var origDoc = this._getDoc(); - origDoc.open(); - origDoc.close(); - doc.open(); - doc.write(html); - doc.close(); - var node = origDoc.importNode(doc.getElementsByTagName("html")[0], true); - origDoc.replaceChild(node, origDoc.getElementsByTagName("html")[0]); - origDoc.body._rteLoaded = true; - } else { - doc = this._getDoc(); - doc.open(); - doc.write(html); - doc.close(); - } - } catch (e) { - //Safari will only be here if we are hidden - check = false; - } - } else { - //This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality - this.get('iframe').get('element').src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html); - } - this.get('iframe').setStyle('visibility', ''); - if (check) { - this._checkLoaded(raw); - } - }, - /** - * @private - * @method _setMarkupType - * @param {String} action The action to take. Possible values are: css, default or semantic - * @description This method will turn on/off the useCSS execCommand. - */ - _setMarkupType: function(action) { - switch (this.get('markup')) { - case 'css': - this._setEditorStyle(true); - break; - case 'default': - this._setEditorStyle(false); - break; - case 'semantic': - case 'xhtml': - if (this._semantic[action]) { - this._setEditorStyle(false); - } else { - this._setEditorStyle(true); - } - break; - } - }, - /** - * Set the editor to use CSS instead of HTML - * @param {Booleen} stat True/False - */ - _setEditorStyle: function(stat) { - try { - this._getDoc().execCommand('useCSS', false, !stat); - } catch (ex) { - } - }, - /** - * @private - * @method _getSelectedElement - * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event. - * @return {HTMLElement} The currently selected element. - */ - _getSelectedElement: function() { - var doc = this._getDoc(), - range = null, - sel = null, - elm = null, - check = true; - - if (this.browser.ie) { - this.currentEvent = this._getWindow().event; //Event utility assumes window.event, so we need to reset it to this._getWindow().event; - range = this._getRange(); - if (range) { - elm = range.item ? range.item(0) : range.parentElement(); - if (this._hasSelection()) { - //TODO - //WTF.. Why can't I get an element reference here?!??! - } - if (elm === doc.body) { - elm = null; - } - } - if ((this.currentEvent !== null) && (this.currentEvent.keyCode === 0)) { - elm = Event.getTarget(this.currentEvent); - } - } else { - sel = this._getSelection(); - range = this._getRange(); - - if (!sel || !range) { - return null; - } - //TODO - if (!this._hasSelection() && this.browser.webkit3) { - //check = false; - } - if (this.browser.gecko) { - //Added in 2.6.0 - if (range.startContainer) { - if (range.startContainer.nodeType === 3) { - elm = range.startContainer.parentNode; - } else if (range.startContainer.nodeType === 1) { - elm = range.startContainer; - } - //Added in 2.7.0 - if (this.currentEvent) { - var tar = Event.getTarget(this.currentEvent); - if (!this._isElement(tar, 'html')) { - if (elm !== tar) { - elm = tar; - } - } - } - } - } - - if (check) { - if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) { - if (sel.anchorNode.parentNode) { //next check parentNode - elm = sel.anchorNode.parentNode; - } - if (sel.anchorNode.nextSibling != sel.focusNode.nextSibling) { - elm = sel.anchorNode.nextSibling; - } - } - if (this._isElement(elm, 'br')) { - elm = null; - } - if (!elm) { - elm = range.commonAncestorContainer; - if (!range.collapsed) { - if (range.startContainer == range.endContainer) { - if (range.startOffset - range.endOffset < 2) { - if (range.startContainer.hasChildNodes()) { - elm = range.startContainer.childNodes[range.startOffset]; - } - } - } - } - } - } - } - - if (this.currentEvent !== null) { - try { - switch (this.currentEvent.type) { - case 'click': - case 'mousedown': - case 'mouseup': - if (this.browser.webkit) { - elm = Event.getTarget(this.currentEvent); - } - break; - default: - //Do nothing - break; - } - } catch (e) { - } - } else if ((this.currentElement && this.currentElement[0]) && (!this.browser.ie)) { - //TODO is this still needed? - //elm = this.currentElement[0]; - } - - - if (this.browser.opera || this.browser.webkit) { - if (this.currentEvent && !elm) { - elm = YAHOO.util.Event.getTarget(this.currentEvent); - } - } - if (!elm || !elm.tagName) { - elm = doc.body; - } - if (this._isElement(elm, 'html')) { - //Safari sometimes gives us the HTML node back.. - elm = doc.body; - } - if (this._isElement(elm, 'body')) { - //make sure that body means this body not the parent.. - elm = doc.body; - } - if (elm && !elm.parentNode) { //Not in document - elm = doc.body; - } - if (elm === undefined) { - elm = null; - } - return elm; - }, - /** - * @private - * @method _getDomPath - * @description This method will attempt to build the DOM path from the currently selected element. - * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used - * @return {Array} An array of node references that will create the DOM Path. - */ - _getDomPath: function(el) { - if (!el) { - el = this._getSelectedElement(); - } - var domPath = []; - while (el !== null) { - if (el.ownerDocument != this._getDoc()) { - el = null; - break; - } - //Check to see if we get el.nodeName and nodeType - if (el.nodeName && el.nodeType && (el.nodeType == 1)) { - domPath[domPath.length] = el; - } - - if (this._isElement(el, 'body')) { - break; - } - - el = el.parentNode; - } - if (domPath.length === 0) { - if (this._getDoc() && this._getDoc().body) { - domPath[0] = this._getDoc().body; - } - } - return domPath.reverse(); - }, - /** - * @private - * @method _writeDomPath - * @description Write the current DOM path out to the dompath container below the editor. - */ - _writeDomPath: function() { - var path = this._getDomPath(), - pathArr = [], - classPath = '', - pathStr = ''; - - for (var i = 0; i < path.length; i++) { - var tag = path[i].tagName.toLowerCase(); - if ((tag == 'ol') && (path[i].type)) { - tag += ':' + path[i].type; - } - if (Dom.hasClass(path[i], 'yui-tag')) { - tag = path[i].getAttribute('tag'); - } - if ((this.get('markup') == 'semantic') || (this.get('markup') == 'xhtml')) { - switch (tag) { - case 'b': tag = 'strong'; break; - case 'i': tag = 'em'; break; - } - } - if (!Dom.hasClass(path[i], 'yui-non')) { - if (Dom.hasClass(path[i], 'yui-tag')) { - pathStr = tag; - } else { - classPath = ((path[i].className !== '') ? '.' + path[i].className.replace(/ /g, '.') : ''); - if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) { - classPath = ''; - } - pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath; - } - switch (tag) { - case 'body': - pathStr = 'body'; - break; - case 'a': - if (path[i].getAttribute('href', 2)) { - pathStr += ':' + path[i].getAttribute('href', 2).replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp - } - break; - case 'img': - var h = path[i].height; - var w = path[i].width; - if (path[i].style.height) { - h = parseInt(path[i].style.height, 10); - } - if (path[i].style.width) { - w = parseInt(path[i].style.width, 10); - } - pathStr += '(' + w + 'x' + h + ')'; - break; - } - - if (pathStr.length > 10) { - pathStr = '' + pathStr.substring(0, 10) + '...' + ''; - } else { - pathStr = '' + pathStr + ''; - } - pathArr[pathArr.length] = pathStr; - } - } - var str = pathArr.join(' ' + this.SEP_DOMPATH + ' '); - //Prevent flickering - if (this.dompath.innerHTML != str) { - this.dompath.innerHTML = str; - } - }, - /** - * @private - * @method _fixNodes - * @description Fix href and imgs as well as remove invalid HTML. - */ - _fixNodes: function() { - try { - var doc = this._getDoc(), - els = []; - - for (var v in this.invalidHTML) { - if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) { - if (v.toLowerCase() != 'span') { - var tags = doc.body.getElementsByTagName(v); - if (tags.length) { - for (var i = 0; i < tags.length; i++) { - els.push(tags[i]); - } - } - } - } - } - for (var h = 0; h < els.length; h++) { - if (els[h].parentNode) { - if (Lang.isObject(this.invalidHTML[els[h].tagName.toLowerCase()]) && this.invalidHTML[els[h].tagName.toLowerCase()].keepContents) { - this._swapEl(els[h], 'span', function(el) { - el.className = 'yui-non'; - }); - } else { - els[h].parentNode.removeChild(els[h]); - } - } - } - var imgs = this._getDoc().getElementsByTagName('img'); - Dom.addClass(imgs, 'yui-img'); - } catch(e) {} - }, - /** - * @private - * @method _isNonEditable - * @param Event ev The Dom event being checked - * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied. - * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also - * disable and enable the Editor's toolbar based on the noedit state. - * @return Boolean - */ - _isNonEditable: function(ev) { - if (this.get('allowNoEdit')) { - var el = Event.getTarget(ev); - if (this._isElement(el, 'html')) { - el = null; - } - var path = this._getDomPath(el); - for (var i = (path.length - 1); i > -1; i--) { - if (Dom.hasClass(path[i], this.CLASS_NOEDIT)) { - //if (this.toolbar.get('disabled') === false) { - // this.toolbar.set('disabled', true); - //} - try { - this._getDoc().execCommand('enableObjectResizing', false, 'false'); - } catch (e) {} - this.nodeChange(); - Event.stopEvent(ev); - return true; - } - } - //if (this.toolbar.get('disabled') === true) { - //Should only happen once.. - //this.toolbar.set('disabled', false); - try { - this._getDoc().execCommand('enableObjectResizing', false, 'true'); - } catch (e2) {} - //} - } - return false; - }, - /** - * @private - * @method _setCurrentEvent - * @param {Event} ev The event to cache - * @description Sets the current event property - */ - _setCurrentEvent: function(ev) { - this.currentEvent = ev; - }, - /** - * @private - * @method _handleClick - * @param {Event} ev The event we are working on. - * @description Handles all click events inside the iFrame document. - */ - _handleClick: function(ev) { - var ret = this.fireEvent('beforeEditorClick', { type: 'beforeEditorClick', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - if (this.currentWindow) { - this.closeWindow(); - } - if (this.currentWindow) { - this.closeWindow(); - } - if (this.browser.webkit) { - var tar =Event.getTarget(ev); - if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) { - Event.stopEvent(ev); - this.nodeChange(); - } - } else { - this.nodeChange(); - } - this.fireEvent('editorClick', { type: 'editorClick', target: this, ev: ev }); - }, - /** - * @private - * @method _handleMouseUp - * @param {Event} ev The event we are working on. - * @description Handles all mouseup events inside the iFrame document. - */ - _handleMouseUp: function(ev) { - var ret = this.fireEvent('beforeEditorMouseUp', { type: 'beforeEditorMouseUp', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - //Don't set current event for mouseup. - //It get's fired after a menu is closed and gives up a bogus event to work with - //this._setCurrentEvent(ev); - var self = this; - if (this.browser.opera) { - /* - * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on.. - * @browser Opera - * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event. - */ - var sel = Event.getTarget(ev); - if (this._isElement(sel, 'img')) { - this.nodeChange(); - if (this.operaEvent) { - clearTimeout(this.operaEvent); - this.operaEvent = null; - this._handleDoubleClick(ev); - } else { - this.operaEvent = window.setTimeout(function() { - self.operaEvent = false; - }, 700); - } - } - } - //This will stop Safari from selecting the entire document if you select all the text in the editor - if (this.browser.webkit || this.browser.opera) { - if (this.browser.webkit) { - Event.stopEvent(ev); - } - } - this.nodeChange(); - this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev }); - }, - /** - * @private - * @method _handleMouseDown - * @param {Event} ev The event we are working on. - * @description Handles all mousedown events inside the iFrame document. - */ - _handleMouseDown: function(ev) { - var ret = this.fireEvent('beforeEditorMouseDown', { type: 'beforeEditorMouseDown', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - var sel = Event.getTarget(ev); - if (this.browser.webkit && this._hasSelection()) { - var _sel = this._getSelection(); - if (!this.browser.webkit3) { - _sel.collapse(true); - } else { - _sel.collapseToStart(); - } - } - if (this.browser.webkit && this._lastImage) { - Dom.removeClass(this._lastImage, 'selected'); - this._lastImage = null; - } - if (this._isElement(sel, 'img') || this._isElement(sel, 'a')) { - if (this.browser.webkit) { - Event.stopEvent(ev); - if (this._isElement(sel, 'img')) { - Dom.addClass(sel, 'selected'); - this._lastImage = sel; - } - } - if (this.currentWindow) { - this.closeWindow(); - } - this.nodeChange(); - } - this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev }); - }, - /** - * @private - * @method _handleDoubleClick - * @param {Event} ev The event we are working on. - * @description Handles all doubleclick events inside the iFrame document. - */ - _handleDoubleClick: function(ev) { - var ret = this.fireEvent('beforeEditorDoubleClick', { type: 'beforeEditorDoubleClick', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - var sel = Event.getTarget(ev); - if (this._isElement(sel, 'img')) { - this.currentElement[0] = sel; - this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - } else if (this._hasParent(sel, 'a')) { //Handle elements inside an a - this.currentElement[0] = this._hasParent(sel, 'a'); - this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - } - this.nodeChange(); - this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyUp - * @param {Event} ev The event we are working on. - * @description Handles all keyup events inside the iFrame document. - */ - _handleKeyUp: function(ev) { - var ret = this.fireEvent('beforeEditorKeyUp', { type: 'beforeEditorKeyUp', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._storeUndo(); - this._setCurrentEvent(ev); - switch (ev.keyCode) { - case this._keyMap.SELECT_ALL.key: - if (this._checkKey(this._keyMap.SELECT_ALL, ev)) { - this.nodeChange(); - } - break; - case 32: //Space Bar - case 35: //End - case 36: //Home - case 37: //Left Arrow - case 38: //Up Arrow - case 39: //Right Arrow - case 40: //Down Arrow - case 46: //Forward Delete - case 8: //Delete - case this._keyMap.CLOSE_WINDOW.key: //W key if window is open - if ((ev.keyCode == this._keyMap.CLOSE_WINDOW.key) && this.currentWindow) { - if (this._checkKey(this._keyMap.CLOSE_WINDOW, ev)) { - this.closeWindow(); - } - } else { - if (!this.browser.ie) { - if (this._nodeChangeTimer) { - clearTimeout(this._nodeChangeTimer); - } - var self = this; - this._nodeChangeTimer = setTimeout(function() { - self._nodeChangeTimer = null; - self.nodeChange.call(self); - }, 100); - } else { - this.nodeChange(); - } - this.editorDirty = true; - } - break; - } - this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyPress - * @param {Event} ev The event we are working on. - * @description Handles all keypress events inside the iFrame document. - */ - _handleKeyPress: function(ev) { - var ret = this.fireEvent('beforeEditorKeyPress', { type: 'beforeEditorKeyPress', target: this, ev: ev }); - if (ret === false) { - return false; - } - - if (this.get('allowNoEdit')) { - //if (ev && ev.keyCode && ((ev.keyCode == 46) || ev.keyCode == 63272)) { - if (ev && ev.keyCode && (ev.keyCode == 63272)) { - //Forward delete key - Event.stopEvent(ev); - } - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - this._storeUndo(); - if (this.browser.opera) { - if (ev.keyCode === 13) { - var tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - this.execCommand('inserthtml', '
            '); - Event.stopEvent(ev); - } - } - } - if (this.browser.webkit) { - if (!this.browser.webkit3) { - if (ev.keyCode && (ev.keyCode == 122) && (ev.metaKey)) { - //This is CMD + z (for undo) - if (this._hasParent(this._getSelectedElement(), 'li')) { - Event.stopEvent(ev); - } - } - } - this._listFix(ev); - } - this._fixListDupIds(); - this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyDown - * @param {Event} ev The event we are working on. - * @description Handles all keydown events inside the iFrame document. - */ - _handleKeyDown: function(ev) { - var ret = this.fireEvent('beforeEditorKeyDown', { type: 'beforeEditorKeyDown', target: this, ev: ev }); - if (ret === false) { - return false; - } - var tar = null, _range = null; - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - if (this.currentWindow) { - this.closeWindow(); - } - if (this.currentWindow) { - this.closeWindow(); - } - var doExec = false, - action = null, - value = null, - exec = false; - - - switch (ev.keyCode) { - case this._keyMap.FOCUS_TOOLBAR.key: - if (this._checkKey(this._keyMap.FOCUS_TOOLBAR, ev)) { - var h = this.toolbar.getElementsByTagName('h2')[0]; - if (h && h.firstChild) { - h.firstChild.focus(); - } - } else if (this._checkKey(this._keyMap.FOCUS_AFTER, ev)) { - //Focus After Element - Esc - this.afterElement.focus(); - } - Event.stopEvent(ev); - doExec = false; - break; - //case 76: //L - case this._keyMap.CREATE_LINK.key: //L - if (this._hasSelection()) { - if (this._checkKey(this._keyMap.CREATE_LINK, ev)) { - var makeLink = true; - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - makeLink = false; - } - } - if (makeLink) { - this.execCommand('createlink', ''); - this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - doExec = false; - } - } - } - break; - //case 90: //Z - case this._keyMap.UNDO.key: - case this._keyMap.REDO.key: - if (this._checkKey(this._keyMap.REDO, ev)) { - action = 'redo'; - doExec = true; - } else if (this._checkKey(this._keyMap.UNDO, ev)) { - action = 'undo'; - doExec = true; - } - break; - //case 66: //B - case this._keyMap.BOLD.key: - if (this._checkKey(this._keyMap.BOLD, ev)) { - action = 'bold'; - doExec = true; - } - break; - case this._keyMap.FONT_SIZE_UP.key: - case this._keyMap.FONT_SIZE_DOWN.key: - var uk = false, dk = false; - if (this._checkKey(this._keyMap.FONT_SIZE_UP, ev)) { - uk = true; - } - if (this._checkKey(this._keyMap.FONT_SIZE_DOWN, ev)) { - dk = true; - } - if (uk || dk) { - var fs_button = this.toolbar.getButtonByValue('fontsize'), - label = parseInt(fs_button.get('label'), 10), - newValue = (label + 1); - - if (dk) { - newValue = (label - 1); - } - - action = 'fontsize'; - value = newValue + 'px'; - doExec = true; - } - break; - //case 73: //I - case this._keyMap.ITALIC.key: - if (this._checkKey(this._keyMap.ITALIC, ev)) { - action = 'italic'; - doExec = true; - } - break; - //case 85: //U - case this._keyMap.UNDERLINE.key: - if (this._checkKey(this._keyMap.UNDERLINE, ev)) { - action = 'underline'; - doExec = true; - } - break; - case 9: - if (this.browser.ie) { - //Insert a tab in Internet Explorer - _range = this._getRange(); - tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - if (_range) { - _range.pasteHTML('    '); - _range.collapse(false); - _range.select(); - } - Event.stopEvent(ev); - } - } - //Firefox 3 code - if (this.browser.gecko > 1.8) { - tar = this._getSelectedElement(); - if (this._isElement(tar, 'li')) { - if (ev.shiftKey) { - this._getDoc().execCommand('outdent', null, ''); - } else { - this._getDoc().execCommand('indent', null, ''); - } - - } else if (!this._hasSelection()) { - this.execCommand('inserthtml', '    '); - } - Event.stopEvent(ev); - } - break; - case 13: - var p = null, i = 0; - if (this.get('ptags') && !ev.shiftKey) { - if (this.browser.gecko) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - if (this._hasParent(tar, 'p')) { - p = this._getDoc().createElement('p'); - p.innerHTML = ' '; - Dom.insertAfter(p, tar); - this._selectNode(p.firstChild); - } else if (this._isElement(tar, 'body')) { - this.execCommand('insertparagraph', null); - var ps = this._getDoc().body.getElementsByTagName('p'); - for (i = 0; i < ps.length; i++) { - if (ps[i].getAttribute('_moz_dirty') !== null) { - p = this._getDoc().createElement('p'); - p.innerHTML = ' '; - Dom.insertAfter(p, ps[i]); - this._selectNode(p.firstChild); - ps[i].removeAttribute('_moz_dirty'); - } - } - } else { - doExec = true; - action = 'insertparagraph'; - } - Event.stopEvent(ev); - } - } - if (this.browser.webkit) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - this.execCommand('insertparagraph', null); - var divs = this._getDoc().body.getElementsByTagName('div'); - for (i = 0; i < divs.length; i++) { - if (!Dom.hasClass(divs[i], 'yui-wk-div')) { - Dom.addClass(divs[i], 'yui-wk-p'); - } - } - Event.stopEvent(ev); - } - } - } else { - if (this.browser.webkit) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - if (this.browser.webkit4) { - this.execCommand('insertlinebreak'); - } else { - this.execCommand('inserthtml', ''); - var holder = this._getDoc().getElementById('yui-br'), - br = this._getDoc().createElement('br'), - caret = this._getDoc().createElement('span'); - - holder.parentNode.replaceChild(br, holder); - caret.className = 'yui-non'; - caret.innerHTML = ' '; - Dom.insertAfter(caret, br); - this._selectNode(caret); - } - Event.stopEvent(ev); - } - } - if (this.browser.ie) { - //Insert a
            instead of a

            in Internet Explorer - _range = this._getRange(); - tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - if (_range) { - _range.pasteHTML('
            '); - _range.collapse(false); - _range.select(); - } - Event.stopEvent(ev); - } - } - } - break; - } - if (this.browser.ie) { - this._listFix(ev); - } - if (doExec && action) { - this.execCommand(action, value); - Event.stopEvent(ev); - this.nodeChange(); - } - this._storeUndo(); - this.fireEvent('editorKeyDown', { type: 'editorKeyDown', target: this, ev: ev }); - }, - /** - * @private - * @property _fixListRunning - * @type Boolean - * @description Keeps more than one _fixListDupIds from running at the same time. - */ - _fixListRunning: null, - /** - * @private - * @method _fixListDupIds - * @description Some browsers will duplicate the id of an LI when created in designMode. - * This method will fix the duplicate id issue. However it will only preserve the first element - * in the document list with the unique id. - */ - _fixListDupIds: function() { - if (this._fixListRunning) { - return false; - } - if (this._getDoc()) { - this._fixListRunning = true; - var lis = this._getDoc().body.getElementsByTagName('li'), - i = 0, ids = {}; - for (i = 0; i < lis.length; i++) { - if (lis[i].id) { - if (ids[lis[i].id]) { - lis[i].id = ''; - } - ids[lis[i].id] = true; - } - } - this._fixListRunning = false; - } - }, - /** - * @private - * @method _listFix - * @param {Event} ev The event we are working on. - * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items. - */ - _listFix: function(ev) { - var testLi = null, par = null, preContent = false, range = null; - //Enter Key - if (this.browser.webkit) { - if (ev.keyCode && (ev.keyCode == 13)) { - if (this._hasParent(this._getSelectedElement(), 'li')) { - var tar = this._hasParent(this._getSelectedElement(), 'li'); - if (tar.previousSibling) { - if (tar.firstChild && (tar.firstChild.length == 1)) { - this._selectNode(tar); - } - } - } - } - } - //Shift + Tab Key - if (ev.keyCode && ((!this.browser.webkit3 && (ev.keyCode == 25)) || ((this.browser.webkit3 || !this.browser.webkit) && ((ev.keyCode == 9) && ev.shiftKey)))) { - testLi = this._getSelectedElement(); - if (this._hasParent(testLi, 'li')) { - testLi = this._hasParent(testLi, 'li'); - if (this._hasParent(testLi, 'ul') || this._hasParent(testLi, 'ol')) { - par = this._hasParent(testLi, 'ul'); - if (!par) { - par = this._hasParent(testLi, 'ol'); - } - if (this._isElement(par.previousSibling, 'li')) { - par.removeChild(testLi); - par.parentNode.insertBefore(testLi, par.nextSibling); - if (this.browser.ie) { - range = this._getDoc().body.createTextRange(); - range.moveToElementText(testLi); - range.collapse(false); - range.select(); - } - if (this.browser.webkit) { - this._selectNode(testLi.firstChild); - } - Event.stopEvent(ev); - } - } - } - } - //Tab Key - if (ev.keyCode && ((ev.keyCode == 9) && (!ev.shiftKey))) { - var preLi = this._getSelectedElement(); - if (this._hasParent(preLi, 'li')) { - preContent = this._hasParent(preLi, 'li').innerHTML; - } - if (this.browser.webkit) { - this._getDoc().execCommand('inserttext', false, '\t'); - } - testLi = this._getSelectedElement(); - if (this._hasParent(testLi, 'li')) { - par = this._hasParent(testLi, 'li'); - var newUl = this._getDoc().createElement(par.parentNode.tagName.toLowerCase()); - if (this.browser.webkit) { - var span = Dom.getElementsByClassName('Apple-tab-span', 'span', par); - //Remove the span element that Safari puts in - if (span[0]) { - par.removeChild(span[0]); - par.innerHTML = Lang.trim(par.innerHTML); - //Put the HTML from the LI into this new LI - if (preContent) { - par.innerHTML = '' + preContent + ' '; - } else { - par.innerHTML = '  '; - } - } - } else { - if (preContent) { - par.innerHTML = preContent + ' '; - } else { - par.innerHTML = ' '; - } - } - - par.parentNode.replaceChild(newUl, par); - newUl.appendChild(par); - if (this.browser.webkit) { - this._getSelection().setBaseAndExtent(par.firstChild, 1, par.firstChild, par.firstChild.innerText.length); - if (!this.browser.webkit3) { - par.parentNode.parentNode.style.display = 'list-item'; - setTimeout(function() { - par.parentNode.parentNode.style.display = 'block'; - }, 1); - } - } else if (this.browser.ie) { - range = this._getDoc().body.createTextRange(); - range.moveToElementText(par); - range.collapse(false); - range.select(); - } else { - this._selectNode(par); - } - Event.stopEvent(ev); - } - if (this.browser.webkit) { - Event.stopEvent(ev); - } - this.nodeChange(); - } - }, - /** - * @method nodeChange - * @param {Boolean} force Optional paramenter to skip the threshold counter - * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes. - */ - nodeChange: function(force) { - var NCself = this; - this._storeUndo(); - if (this.get('nodeChangeDelay')) { - this._nodeChangeDelayTimer = window.setTimeout(function() { - NCself._nodeChangeDelayTimer = null; - NCself._nodeChange.apply(NCself, arguments); - }, 0); - } else { - this._nodeChange(); - } - }, - /** - * @private - * @method _nodeChange - * @param {Boolean} force Optional paramenter to skip the threshold counter - * @description Fired from nodeChange in a setTimeout. - */ - _nodeChange: function(force) { - var threshold = parseInt(this.get('nodeChangeThreshold'), 10), - thisNodeChange = Math.round(new Date().getTime() / 1000), - self = this; - - if (force === true) { - this._lastNodeChange = 0; - } - - if ((this._lastNodeChange + threshold) < thisNodeChange) { - if (this._fixNodesTimer === null) { - this._fixNodesTimer = window.setTimeout(function() { - self._fixNodes.call(self); - self._fixNodesTimer = null; - }, 0); - } - } - this._lastNodeChange = thisNodeChange; - if (this.currentEvent) { - try { - this._lastNodeChangeEvent = this.currentEvent.type; - } catch (e) {} - } - - var beforeNodeChange = this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this }); - if (beforeNodeChange === false) { - return false; - } - if (this.get('dompath')) { - window.setTimeout(function() { - self._writeDomPath.call(self); - }, 0); - } - //Check to see if we are disabled before continuing - if (!this.get('disabled')) { - if (this.STOP_NODE_CHANGE) { - //Reset this var for next action - this.STOP_NODE_CHANGE = false; - return false; - } else { - var sel = this._getSelection(), - range = this._getRange(), - el = this._getSelectedElement(), - fn_button = this.toolbar.getButtonByValue('fontname'), - fs_button = this.toolbar.getButtonByValue('fontsize'), - undo_button = this.toolbar.getButtonByValue('undo'), - redo_button = this.toolbar.getButtonByValue('redo'); - - //Handle updating the toolbar with active buttons - var _ex = {}; - if (this._lastButton) { - _ex[this._lastButton.id] = true; - //this._lastButton = null; - } - if (!this._isElement(el, 'body')) { - if (fn_button) { - _ex[fn_button.get('id')] = true; - } - if (fs_button) { - _ex[fs_button.get('id')] = true; - } - } - if (redo_button) { - delete _ex[redo_button.get('id')]; - } - this.toolbar.resetAllButtons(_ex); - - //Handle disabled buttons - for (var d = 0; d < this._disabled.length; d++) { - var _button = this.toolbar.getButtonByValue(this._disabled[d]); - if (_button && _button.get) { - if (this._lastButton && (_button.get('id') === this._lastButton.id)) { - //Skip - } else { - if (!this._hasSelection() && !this.get('insert')) { - switch (this._disabled[d]) { - case 'fontname': - case 'fontsize': - break; - default: - //No Selection - disable - this.toolbar.disableButton(_button); - } - } else { - if (!this._alwaysDisabled[this._disabled[d]]) { - this.toolbar.enableButton(_button); - } - } - if (!this._alwaysEnabled[this._disabled[d]]) { - this.toolbar.deselectButton(_button); - } - } - } - } - var path = this._getDomPath(); - var tag = null, cmd = null; - for (var i = 0; i < path.length; i++) { - tag = path[i].tagName.toLowerCase(); - if (path[i].getAttribute('tag')) { - tag = path[i].getAttribute('tag').toLowerCase(); - } - cmd = this._tag2cmd[tag]; - if (cmd === undefined) { - cmd = []; - } - if (!Lang.isArray(cmd)) { - cmd = [cmd]; - } - - //Bold and Italic styles - if (path[i].style.fontWeight.toLowerCase() == 'bold') { - cmd[cmd.length] = 'bold'; - } - if (path[i].style.fontStyle.toLowerCase() == 'italic') { - cmd[cmd.length] = 'italic'; - } - if (path[i].style.textDecoration.toLowerCase() == 'underline') { - cmd[cmd.length] = 'underline'; - } - if (path[i].style.textDecoration.toLowerCase() == 'line-through') { - cmd[cmd.length] = 'strikethrough'; - } - if (cmd.length > 0) { - for (var j = 0; j < cmd.length; j++) { - this.toolbar.selectButton(cmd[j]); - this.toolbar.enableButton(cmd[j]); - } - } - //Handle Alignment - switch (path[i].style.textAlign.toLowerCase()) { - case 'left': - case 'right': - case 'center': - case 'justify': - var alignType = path[i].style.textAlign.toLowerCase(); - if (path[i].style.textAlign.toLowerCase() == 'justify') { - alignType = 'full'; - } - this.toolbar.selectButton('justify' + alignType); - this.toolbar.enableButton('justify' + alignType); - break; - } - } - //After for loop - - //Reset Font Family and Size to the inital configs - if (fn_button) { - var family = fn_button._configs.label._initialConfig.value; - fn_button.set('label', '' + family + ''); - this._updateMenuChecked('fontname', family); - } - - if (fs_button) { - fs_button.set('label', fs_button._configs.label._initialConfig.value); - } - - var hd_button = this.toolbar.getButtonByValue('heading'); - if (hd_button) { - hd_button.set('label', hd_button._configs.label._initialConfig.value); - this._updateMenuChecked('heading', 'none'); - } - var img_button = this.toolbar.getButtonByValue('insertimage'); - if (img_button && this.currentWindow && (this.currentWindow.name == 'insertimage')) { - this.toolbar.disableButton(img_button); - } - if (this._lastButton && this._lastButton.isSelected) { - this.toolbar.deselectButton(this._lastButton.id); - } - this._undoNodeChange(); - } - } - - this.fireEvent('afterNodeChange', { type: 'afterNodeChange', target: this }); - }, - /** - * @private - * @method _updateMenuChecked - * @param {Object} button The command identifier of the button you want to check - * @param {String} value The value of the menu item you want to check - * @param {YAHOO.widget.Toolbar} The Toolbar instance the button belongs to (defaults to this.toolbar) - * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on. - */ - _updateMenuChecked: function(button, value, tbar) { - if (!tbar) { - tbar = this.toolbar; - } - var _button = tbar.getButtonByValue(button); - _button.checkValue(value); - }, - /** - * @private - * @method _handleToolbarClick - * @param {Event} ev The event that triggered the button click - * @description This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button. - */ - _handleToolbarClick: function(ev) { - var value = ''; - var str = ''; - var cmd = ev.button.value; - if (ev.button.menucmd) { - value = cmd; - cmd = ev.button.menucmd; - } - this._lastButton = ev.button; - if (this.STOP_EXEC_COMMAND) { - this.STOP_EXEC_COMMAND = false; - return false; - } else { - this.execCommand(cmd, value); - if (!this.browser.webkit) { - var Fself = this; - setTimeout(function() { - Fself.focus.call(Fself); - }, 5); - } - } - Event.stopEvent(ev); - }, - /** - * @private - * @method _setupAfterElement - * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation. - */ - _setupAfterElement: function() { - if (!this.beforeElement) { - this.beforeElement = document.createElement('h2'); - this.beforeElement.className = 'yui-editor-skipheader'; - this.beforeElement.tabIndex = '-1'; - this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR; - this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling')); - } - if (!this.afterElement) { - this.afterElement = document.createElement('h2'); - this.afterElement.className = 'yui-editor-skipheader'; - this.afterElement.tabIndex = '-1'; - this.afterElement.innerHTML = this.STR_LEAVE_EDITOR; - this.get('element_cont').get('firstChild').appendChild(this.afterElement); - } - }, - /** - * @private - * @method _disableEditor - * @param {Boolean} disabled Pass true to disable, false to enable - * @description Creates a mask to place over the Editor. - */ - _disableEditor: function(disabled) { - var iframe, par, html, height; - if (!this.get('disabled_iframe')) { - iframe = this._createIframe(); - iframe.set('id', 'disabled_' + this.get('iframe').get('id')); - iframe.setStyle('height', '100%'); - iframe.setStyle('display', 'none'); - iframe.setStyle('visibility', 'visible'); - this.set('disabled_iframe', iframe); - par = this.get('iframe').get('parentNode'); - par.appendChild(iframe.get('element')); - } - if (!iframe) { - iframe = this.get('disabled_iframe'); - } - if (disabled) { - this._orgIframe = this.get('iframe'); - - if (this.toolbar) { - this.toolbar.set('disabled', true); - } - - html = this.getEditorHTML(); - height = this.get('iframe').get('offsetHeight'); - iframe.setStyle('visibility', ''); - iframe.setStyle('position', ''); - iframe.setStyle('top', ''); - iframe.setStyle('left', ''); - this._orgIframe.setStyle('visibility', 'hidden'); - this._orgIframe.setStyle('position', 'absolute'); - this._orgIframe.setStyle('top', '-99999px'); - this._orgIframe.setStyle('left', '-99999px'); - this.set('iframe', iframe); - this._setInitialContent(true); - - if (!this._mask) { - this._mask = document.createElement('DIV'); - Dom.addClass(this._mask, 'yui-editor-masked'); - if (this.browser.ie) { - this._mask.style.height = height + 'px'; - } - this.get('iframe').get('parentNode').appendChild(this._mask); - } - this.on('editorContentReloaded', function() { - this._getDoc().body._rteLoaded = false; - this.setEditorHTML(html); - iframe.setStyle('display', 'block'); - this.unsubscribeAll('editorContentReloaded'); - }); - } else { - if (this._mask) { - this._mask.parentNode.removeChild(this._mask); - this._mask = null; - if (this.toolbar) { - this.toolbar.set('disabled', false); - } - iframe.setStyle('visibility', 'hidden'); - iframe.setStyle('position', 'absolute'); - iframe.setStyle('top', '-99999px'); - iframe.setStyle('left', '-99999px'); - this._orgIframe.setStyle('visibility', ''); - this._orgIframe.setStyle('position', ''); - this._orgIframe.setStyle('top', ''); - this._orgIframe.setStyle('left', ''); - this.set('iframe', this._orgIframe); - - this.focus(); - var self = this; - window.setTimeout(function() { - self.nodeChange.call(self); - }, 100); - } - } - }, - /** - * @property SEP_DOMPATH - * @description The value to place in between the Dom path items - * @type String - */ - SEP_DOMPATH: '<', - /** - * @property STR_LEAVE_EDITOR - * @description The accessibility string for the element after the iFrame - * @type String - */ - STR_LEAVE_EDITOR: 'You have left the Rich Text Editor.', - /** - * @property STR_BEFORE_EDITOR - * @description The accessibility string for the element before the iFrame - * @type String - */ - STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Shift + Escape to place focus on the toolbar and navigate between options with your arrow keys. To exit this text editor use the Escape key and continue tabbing.

            Common formatting keyboard shortcuts:

            • Control Shift B sets text to bold
            • Control Shift I sets text to italic
            • Control Shift U underlines text
            • Control Shift L adds an HTML link
            ', - /** - * @property STR_TITLE - * @description The Title of the HTML document that is created in the iFrame - * @type String - */ - STR_TITLE: 'Rich Text Area.', - /** - * @property STR_IMAGE_HERE - * @description The text to place in the URL textbox when using the blankimage. - * @type String - */ - STR_IMAGE_HERE: 'Image URL Here', - /** - * @property STR_IMAGE_URL - * @description The label string for Image URL - * @type String - */ - STR_IMAGE_URL: 'Image URL', - /** - * @property STR_LINK_URL - * @description The label string for the Link URL. - * @type String - */ - STR_LINK_URL: 'Link URL', - /** - * @protected - * @property STOP_EXEC_COMMAND - * @description Set to true when you want the default execCommand function to not process anything - * @type Boolean - */ - STOP_EXEC_COMMAND: false, - /** - * @protected - * @property STOP_NODE_CHANGE - * @description Set to true when you want the default nodeChange function to not process anything - * @type Boolean - */ - STOP_NODE_CHANGE: false, - /** - * @protected - * @property CLASS_NOEDIT - * @description CSS class applied to elements that are not editable. - * @type String - */ - CLASS_NOEDIT: 'yui-noedit', - /** - * @protected - * @property CLASS_CONTAINER - * @description Default CSS class to apply to the editors container element - * @type String - */ - CLASS_CONTAINER: 'yui-editor-container', - /** - * @protected - * @property CLASS_EDITABLE - * @description Default CSS class to apply to the editors iframe element - * @type String - */ - CLASS_EDITABLE: 'yui-editor-editable', - /** - * @protected - * @property CLASS_EDITABLE_CONT - * @description Default CSS class to apply to the editors iframe's parent element - * @type String - */ - CLASS_EDITABLE_CONT: 'yui-editor-editable-container', - /** - * @protected - * @property CLASS_PREFIX - * @description Default prefix for dynamically created class names - * @type String - */ - CLASS_PREFIX: 'yui-editor', - /** - * @property browser - * @description Standard browser detection - * @type Object - */ - browser: function() { - var br = YAHOO.env.ua; - //Check for webkit3 - if (br.webkit >= 420) { - br.webkit3 = br.webkit; - } else { - br.webkit3 = 0; - } - if (br.webkit >= 530) { - br.webkit4 = br.webkit; - } else { - br.webkit4 = 0; - } - br.mac = false; - //Check for Mac - if (navigator.userAgent.indexOf('Macintosh') !== -1) { - br.mac = true; - } - - return br; - }(), - /** - * @method init - * @description The Editor class' initialization method - */ - init: function(p_oElement, p_oAttributes) { - - if (!this._defaultToolbar) { - this._defaultToolbar = { - collapse: true, - titlebar: 'Text Editing Tools', - draggable: false, - buttons: [ - { group: 'fontstyle', label: 'Font Name and Size', - buttons: [ - { type: 'select', label: 'Arial', value: 'fontname', disabled: true, - menu: [ - { text: 'Arial', checked: true }, - { text: 'Arial Black' }, - { text: 'Comic Sans MS' }, - { text: 'Courier New' }, - { text: 'Lucida Console' }, - { text: 'Tahoma' }, - { text: 'Times New Roman' }, - { text: 'Trebuchet MS' }, - { text: 'Verdana' } - ] - }, - { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true } - ] - }, - { type: 'separator' }, - { group: 'textstyle', label: 'Font Style', - buttons: [ - { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' }, - { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' }, - { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' }, - { type: 'push', label: 'Strike Through', value: 'strikethrough' }, - { type: 'separator' }, - { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true }, - { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true } - - ] - }, - { type: 'separator' }, - { group: 'indentlist', label: 'Lists', - buttons: [ - { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' }, - { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' } - ] - }, - { type: 'separator' }, - { group: 'insertitem', label: 'Insert Item', - buttons: [ - { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true }, - { type: 'push', label: 'Insert Image', value: 'insertimage' } - ] - } - ] - }; - } - - YAHOO.widget.SimpleEditor.superclass.init.call(this, p_oElement, p_oAttributes); - YAHOO.widget.EditorInfo._instances[this.get('id')] = this; - - - this.currentElement = []; - this.on('contentReady', function() { - this.DOMReady = true; - this.fireQueue(); - }, this, true); - - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the editor. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the editor. - */ - initAttributes: function(attr) { - YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this, attr); - var self = this; - - /** - * @config setDesignMode - * @description Should the Editor set designMode on the document. Default: true. - * @default true - * @type Boolean - */ - this.setAttributeConfig('setDesignMode', { - value: ((attr.setDesignMode === false) ? false : true) - }); - /** - * @config nodeChangeDelay - * @description Do we wrap the nodeChange method in a timeout for performance. Default: true. - * @default true - * @type Boolean - */ - this.setAttributeConfig('nodeChangeDelay', { - value: ((attr.nodeChangeDelay === false) ? false : true) - }); - /** - * @config maxUndo - * @description The max number of undo levels to store. - * @default 30 - * @type Number - */ - this.setAttributeConfig('maxUndo', { - writeOnce: true, - value: attr.maxUndo || 30 - }); - - /** - * @config ptags - * @description If true, the editor uses <P> tags instead of <br> tags. (Use Shift + Enter to get a <br>) - * @default false - * @type Boolean - */ - this.setAttributeConfig('ptags', { - writeOnce: true, - value: attr.ptags || false - }); - /** - * @config insert - * @description If true, selection is not required for: fontname, fontsize, forecolor, backcolor. - * @default false - * @type Boolean - */ - this.setAttributeConfig('insert', { - writeOnce: true, - value: attr.insert || false, - method: function(insert) { - if (insert) { - var buttons = { - fontname: true, - fontsize: true, - forecolor: true, - backcolor: true - }; - var tmp = this._defaultToolbar.buttons; - for (var i = 0; i < tmp.length; i++) { - if (tmp[i].buttons) { - for (var a = 0; a < tmp[i].buttons.length; a++) { - if (tmp[i].buttons[a].value) { - if (buttons[tmp[i].buttons[a].value]) { - delete tmp[i].buttons[a].disabled; - } - } - } - } - } - } - } - }); - /** - * @config container - * @description Used when dynamically creating the Editor from Javascript with no default textarea. - * We will create one and place it in this container. If no container is passed we will append to document.body. - * @default false - * @type HTMLElement - */ - this.setAttributeConfig('container', { - writeOnce: true, - value: attr.container || false - }); - /** - * @config plainText - * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds. - * @default false - * @type Boolean - */ - this.setAttributeConfig('plainText', { - writeOnce: true, - value: attr.plainText || false - }); - /** - * @private - * @config iframe - * @description Internal config for holding the iframe element. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('iframe', { - value: null - }); - /** - * @private - * @config disabled_iframe - * @description Internal config for holding the iframe element used when disabling the Editor. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('disabled_iframe', { - value: null - }); - /** - * @private - * @depreciated - No longer used, should use this.get('element') - * @config textarea - * @description Internal config for holding the textarea element (replaced with element). - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('textarea', { - value: null, - writeOnce: true - }); - /** - * @config nodeChangeThreshold - * @description The number of seconds that need to be in between nodeChange processing - * @default 3 - * @type Number - */ - this.setAttributeConfig('nodeChangeThreshold', { - value: attr.nodeChangeThreshold || 3, - validator: YAHOO.lang.isNumber - }); - /** - * @config allowNoEdit - * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes. - * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key. - * @default false - * @type Boolean - */ - this.setAttributeConfig('allowNoEdit', { - value: attr.allowNoEdit || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @config limitCommands - * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar. - * @default false - * @type Boolean - */ - this.setAttributeConfig('limitCommands', { - value: attr.limitCommands || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @config element_cont - * @description Internal config for the editors container - * @default false - * @type HTMLElement - */ - this.setAttributeConfig('element_cont', { - value: attr.element_cont - }); - /** - * @private - * @config editor_wrapper - * @description The outter wrapper for the entire editor. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('editor_wrapper', { - value: attr.editor_wrapper || null, - writeOnce: true - }); - /** - * @attribute height - * @description The height of the editor iframe container, not including the toolbar.. - * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument - * @type String - */ - this.setAttributeConfig('height', { - value: attr.height || Dom.getStyle(self.get('element'), 'height'), - method: function(height) { - if (this._rendered) { - //We have been rendered, change the height - if (this.get('animate')) { - var anim = new YAHOO.util.Anim(this.get('iframe').get('parentNode'), { - height: { - to: parseInt(height, 10) - } - }, 0.5); - anim.animate(); - } else { - Dom.setStyle(this.get('iframe').get('parentNode'), 'height', height); - } - } - } - }); - /** - * @config autoHeight - * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height. - * @default false - * @type Boolean || Number - */ - this.setAttributeConfig('autoHeight', { - value: attr.autoHeight || false, - method: function(a) { - if (a) { - if (this.get('iframe')) { - this.get('iframe').get('element').setAttribute('scrolling', 'no'); - } - this.on('afterNodeChange', this._handleAutoHeight, this, true); - this.on('editorKeyDown', this._handleAutoHeight, this, true); - this.on('editorKeyPress', this._handleAutoHeight, this, true); - } else { - if (this.get('iframe')) { - this.get('iframe').get('element').setAttribute('scrolling', 'auto'); - } - this.unsubscribe('afterNodeChange', this._handleAutoHeight); - this.unsubscribe('editorKeyDown', this._handleAutoHeight); - this.unsubscribe('editorKeyPress', this._handleAutoHeight); - } - } - }); - /** - * @attribute width - * @description The width of the editor container. - * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument - * @type String - */ - this.setAttributeConfig('width', { - value: attr.width || Dom.getStyle(this.get('element'), 'width'), - method: function(width) { - if (this._rendered) { - //We have been rendered, change the width - if (this.get('animate')) { - var anim = new YAHOO.util.Anim(this.get('element_cont').get('element'), { - width: { - to: parseInt(width, 10) - } - }, 0.5); - anim.animate(); - } else { - this.get('element_cont').setStyle('width', width); - } - } - } - }); - - /** - * @attribute blankimage - * @description The URL for the image placeholder to put in when inserting an image. - * @default The yahooapis.com address for the current release + 'assets/blankimage.png' - * @type String - */ - this.setAttributeConfig('blankimage', { - value: attr.blankimage || this._getBlankImage() - }); - /** - * @attribute css - * @description The Base CSS used to format the content of the editor - * @default
            html {
            -                height: 95%;
            -            }
            -            body {
            -                height: 100%;
            -                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
            -            }
            -            a {
            -                color: blue;
            -                text-decoration: underline;
            -                cursor: pointer;
            -            }
            -            .warning-localfile {
            -                border-bottom: 1px dashed red !important;
            -            }
            -            .yui-busy {
            -                cursor: wait !important;
            -            }
            -            img.selected { //Safari image selection
            -                border: 2px dotted #808080;
            -            }
            -            img {
            -                cursor: pointer !important;
            -                border: none;
            -            }
            -            
            - * @type String - */ - this.setAttributeConfig('css', { - value: attr.css || this._defaultCSS, - writeOnce: true - }); - /** - * @attribute html - * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item) - * @default This HTML requires a few things if you are to override: -

            {TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS} and {CONTENT} need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.

            -

            onload="document.body._rteLoaded = true;" : the onload statement must be there or the editor will not finish loading.

            - -
            -                <html>
            -                    <head>
            -                        <title>{TITLE}</title>
            -                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            -                        <style>
            -                        {CSS}
            -                        </style>
            -                        <style>
            -                        {HIDDEN_CSS}
            -                        </style>
            -                        <style>
            -                        {EXTRA_CSS}
            -                        </style>
            -                    </head>
            -                <body onload="document.body._rteLoaded = true;">
            -                {CONTENT}
            -                </body>
            -                </html>
            -                
            -
            - * @type String - */ - this.setAttributeConfig('html', { - value: attr.html || '{TITLE}{CONTENT}', - writeOnce: true - }); - - /** - * @attribute extracss - * @description Extra user defined css to load after the default SimpleEditor CSS - * @default '' - * @type String - */ - this.setAttributeConfig('extracss', { - value: attr.extracss || '', - writeOnce: true - }); - - /** - * @attribute handleSubmit - * @description Config handles if the editor will attach itself to the textareas parent form's submit handler. - If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form. - Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted. - * @default false - * @type Boolean - */ - this.setAttributeConfig('handleSubmit', { - value: attr.handleSubmit || false, - method: function(exec) { - if (this.get('element').form) { - if (!this._formButtons) { - this._formButtons = []; - } - if (exec) { - Event.on(this.get('element').form, 'submit', this._handleFormSubmit, this, true); - var i = this.get('element').form.getElementsByTagName('input'); - for (var s = 0; s < i.length; s++) { - var type = i[s].getAttribute('type'); - if (type && (type.toLowerCase() == 'submit')) { - Event.on(i[s], 'click', this._handleFormButtonClick, this, true); - this._formButtons[this._formButtons.length] = i[s]; - } - } - } else { - Event.removeListener(this.get('element').form, 'submit', this._handleFormSubmit); - if (this._formButtons) { - Event.removeListener(this._formButtons, 'click', this._handleFormButtonClick); - } - } - } - } - }); - /** - * @attribute disabled - * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place. - All Toolbar buttons are also disabled so they cannot be used. - * @default false - * @type Boolean - */ - - this.setAttributeConfig('disabled', { - value: false, - method: function(disabled) { - if (this._rendered) { - this._disableEditor(disabled); - } - } - }); - /** - * @config saveEl - * @description When save HTML is called, this element will be updated as well as the source of data. - * @default element - * @type HTMLElement - */ - this.setAttributeConfig('saveEl', { - value: this.get('element') - }); - /** - * @config toolbar_cont - * @description Internal config for the toolbars container - * @default false - * @type Boolean - */ - this.setAttributeConfig('toolbar_cont', { - value: null, - writeOnce: true - }); - /** - * @attribute toolbar - * @description The default toolbar config. - * @type Object - */ - this.setAttributeConfig('toolbar', { - value: attr.toolbar || this._defaultToolbar, - writeOnce: true, - method: function(toolbar) { - if (!toolbar.buttonType) { - toolbar.buttonType = this._defaultToolbar.buttonType; - } - this._defaultToolbar = toolbar; - } - }); - /** - * @attribute animate - * @description Should the editor animate window movements - * @default false unless Animation is found, then true - * @type Boolean - */ - this.setAttributeConfig('animate', { - value: ((attr.animate) ? ((YAHOO.util.Anim) ? true : false) : false), - validator: function(value) { - var ret = true; - if (!YAHOO.util.Anim) { - ret = false; - } - return ret; - } - }); - /** - * @config panel - * @description A reference to the panel we are using for windows. - * @default false - * @type Boolean - */ - this.setAttributeConfig('panel', { - value: null, - writeOnce: true, - validator: function(value) { - var ret = true; - if (!YAHOO.widget.Overlay) { - ret = false; - } - return ret; - } - }); - /** - * @attribute focusAtStart - * @description Should we focus the window when the content is ready? - * @default false - * @type Boolean - */ - this.setAttributeConfig('focusAtStart', { - value: attr.focusAtStart || false, - writeOnce: true, - method: function(fs) { - if (fs) { - this.on('editorContentLoaded', function() { - var self = this; - setTimeout(function() { - self.focus.call(self); - self.editorDirty = false; - }, 400); - }, this, true); - } - } - }); - /** - * @attribute dompath - * @description Toggle the display of the current Dom path below the editor - * @default false - * @type Boolean - */ - this.setAttributeConfig('dompath', { - value: attr.dompath || false, - method: function(dompath) { - if (dompath && !this.dompath) { - this.dompath = document.createElement('DIV'); - this.dompath.id = this.get('id') + '_dompath'; - Dom.addClass(this.dompath, 'dompath'); - this.get('element_cont').get('firstChild').appendChild(this.dompath); - if (this.get('iframe')) { - this._writeDomPath(); - } - } else if (!dompath && this.dompath) { - this.dompath.parentNode.removeChild(this.dompath); - this.dompath = null; - } - } - }); - /** - * @attribute markup - * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml - * @default "semantic" - * @type String - */ - this.setAttributeConfig('markup', { - value: attr.markup || 'semantic', - validator: function(markup) { - switch (markup.toLowerCase()) { - case 'semantic': - case 'css': - case 'default': - case 'xhtml': - return true; - } - return false; - } - }); - /** - * @attribute removeLineBreaks - * @description Should we remove linebreaks and extra spaces on cleanup - * @default false - * @type Boolean - */ - this.setAttributeConfig('removeLineBreaks', { - value: attr.removeLineBreaks || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @config drag - * @description Set this config to make the Editor draggable, pass 'proxy' to make use YAHOO.util.DDProxy. - * @type {Boolean/String} - */ - this.setAttributeConfig('drag', { - writeOnce: true, - value: attr.drag || false - }); - - /** - * @config resize - * @description Set this to true to make the Editor Resizable with YAHOO.util.Resize. The default config is available: myEditor._resizeConfig - * Animation will be ignored while performing this resize to allow for the dynamic change in size of the toolbar. - * @type Boolean - */ - this.setAttributeConfig('resize', { - writeOnce: true, - value: attr.resize || false - }); - - /** - * @config filterWord - * @description Attempt to filter out MS Word HTML from the Editor's output. - * @type Boolean - */ - this.setAttributeConfig('filterWord', { - value: attr.filterWord || false, - validator: YAHOO.lang.isBoolean - }); - - }, - /** - * @private - * @method _getBlankImage - * @description Retrieves the full url of the image to use as the blank image. - * @return {String} The URL to the blank image - */ - _getBlankImage: function() { - if (!this.DOMReady) { - this._queue[this._queue.length] = ['_getBlankImage', arguments]; - return ''; - } - var img = ''; - if (!this._blankImageLoaded) { - if (YAHOO.widget.EditorInfo.blankImage) { - this.set('blankimage', YAHOO.widget.EditorInfo.blankImage); - this._blankImageLoaded = true; - } else { - var div = document.createElement('div'); - div.style.position = 'absolute'; - div.style.top = '-9999px'; - div.style.left = '-9999px'; - div.className = this.CLASS_PREFIX + '-blankimage'; - document.body.appendChild(div); - img = YAHOO.util.Dom.getStyle(div, 'background-image'); - img = img.replace('url(', '').replace(')', '').replace(/"/g, ''); - //Adobe AIR Code - img = img.replace('app:/', ''); - this.set('blankimage', img); - this._blankImageLoaded = true; - div.parentNode.removeChild(div); - YAHOO.widget.EditorInfo.blankImage = img; - } - } else { - img = this.get('blankimage'); - } - return img; - }, - /** - * @private - * @method _handleAutoHeight - * @description Handles resizing the editor's height based on the content - */ - _handleAutoHeight: function() { - var doc = this._getDoc(), - body = doc.body, - docEl = doc.documentElement; - - var height = parseInt(Dom.getStyle(this.get('editor_wrapper'), 'height'), 10); - var newHeight = body.scrollHeight; - if (this.browser.webkit) { - newHeight = docEl.scrollHeight; - } - if (newHeight < parseInt(this.get('height'), 10)) { - newHeight = parseInt(this.get('height'), 10); - } - if ((height != newHeight) && (newHeight >= parseInt(this.get('height'), 10))) { - var anim = this.get('animate'); - this.set('animate', false); - this.set('height', newHeight + 'px'); - this.set('animate', anim); - if (this.browser.ie) { - //Internet Explorer needs this - this.get('iframe').setStyle('height', '99%'); - this.get('iframe').setStyle('zoom', '1'); - var self = this; - window.setTimeout(function() { - self.get('iframe').setStyle('height', '100%'); - }, 1); - } - } - }, - /** - * @private - * @property _formButtons - * @description Array of buttons that are in the Editor's parent form (for handleSubmit) - * @type Array - */ - _formButtons: null, - /** - * @private - * @property _formButtonClicked - * @description The form button that was clicked to submit the form. - * @type HTMLElement - */ - _formButtonClicked: null, - /** - * @private - * @method _handleFormButtonClick - * @description The click listener assigned to each submit button in the Editor's parent form. - * @param {Event} ev The click event - */ - _handleFormButtonClick: function(ev) { - var tar = Event.getTarget(ev); - this._formButtonClicked = tar; - }, - /** - * @private - * @method _handleFormSubmit - * @description Handles the form submission. - * @param {Object} ev The Form Submit Event - */ - _handleFormSubmit: function(ev) { - this.saveHTML(); - - var form = this.get('element').form, - tar = this._formButtonClicked || false; - - Event.removeListener(form, 'submit', this._handleFormSubmit); - if (YAHOO.env.ua.ie) { - //form.fireEvent("onsubmit"); - if (tar && !tar.disabled) { - tar.click(); - } - } else { // Gecko, Opera, and Safari - if (tar && !tar.disabled) { - tar.click(); - } - var oEvent = document.createEvent("HTMLEvents"); - oEvent.initEvent("submit", true, true); - form.dispatchEvent(oEvent); - if (YAHOO.env.ua.webkit) { - if (YAHOO.lang.isFunction(form.submit)) { - form.submit(); - } - } - } - //2.6.0 - //Removed this, not need since removing Safari 2.x - //Event.stopEvent(ev); - }, - /** - * @private - * @method _handleFontSize - * @description Handles the font size button in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleFontSize: function(o) { - var button = this.toolbar.getButtonById(o.button.id); - var value = button.get('label') + 'px'; - this.execCommand('fontsize', value); - return false; - }, - /** - * @private - * @description Handles the colorpicker buttons in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleColorPicker: function(o) { - var cmd = o.button; - var value = '#' + o.color; - if ((cmd == 'forecolor') || (cmd == 'backcolor')) { - this.execCommand(cmd, value); - } - }, - /** - * @private - * @method _handleAlign - * @description Handles the alignment buttons in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleAlign: function(o) { - var cmd = null; - for (var i = 0; i < o.button.menu.length; i++) { - if (o.button.menu[i].value == o.button.value) { - cmd = o.button.menu[i].value; - } - } - var value = this._getSelection(); - - this.execCommand(cmd, value); - return false; - }, - /** - * @private - * @method _handleAfterNodeChange - * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state). - */ - _handleAfterNodeChange: function() { - var path = this._getDomPath(), - elm = null, - family = null, - fontsize = null, - validFont = false, - fn_button = this.toolbar.getButtonByValue('fontname'), - fs_button = this.toolbar.getButtonByValue('fontsize'), - hd_button = this.toolbar.getButtonByValue('heading'); - - for (var i = 0; i < path.length; i++) { - elm = path[i]; - - var tag = elm.tagName.toLowerCase(); - - - if (elm.getAttribute('tag')) { - tag = elm.getAttribute('tag'); - } - - family = elm.getAttribute('face'); - if (Dom.getStyle(elm, 'font-family')) { - family = Dom.getStyle(elm, 'font-family'); - //Adobe AIR Code - family = family.replace(/'/g, ''); - } - - if (tag.substring(0, 1) == 'h') { - if (hd_button) { - for (var h = 0; h < hd_button._configs.menu.value.length; h++) { - if (hd_button._configs.menu.value[h].value.toLowerCase() == tag) { - hd_button.set('label', hd_button._configs.menu.value[h].text); - } - } - this._updateMenuChecked('heading', tag); - } - } - } - - if (fn_button) { - for (var b = 0; b < fn_button._configs.menu.value.length; b++) { - if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) { - validFont = true; - family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button - } - } - if (!validFont) { - family = fn_button._configs.label._initialConfig.value; - } - var familyLabel = '' + family + ''; - if (fn_button.get('label') != familyLabel) { - fn_button.set('label', familyLabel); - this._updateMenuChecked('fontname', family); - } - } - - if (fs_button) { - fontsize = parseInt(Dom.getStyle(elm, 'fontSize'), 10); - if ((fontsize === null) || isNaN(fontsize)) { - fontsize = fs_button._configs.label._initialConfig.value; - } - fs_button.set('label', ''+fontsize); - } - - if (!this._isElement(elm, 'body') && !this._isElement(elm, 'img')) { - this.toolbar.enableButton(fn_button); - this.toolbar.enableButton(fs_button); - this.toolbar.enableButton('forecolor'); - this.toolbar.enableButton('backcolor'); - } - if (this._isElement(elm, 'img')) { - if (YAHOO.widget.Overlay) { - this.toolbar.enableButton('createlink'); - } - } - if (this._hasParent(elm, 'blockquote')) { - this.toolbar.selectButton('indent'); - this.toolbar.disableButton('indent'); - this.toolbar.enableButton('outdent'); - } - if (this._hasParent(elm, 'ol') || this._hasParent(elm, 'ul')) { - this.toolbar.disableButton('indent'); - } - this._lastButton = null; - - }, - /** - * @private - * @method _handleInsertImageClick - * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked. - */ - _handleInsertImageClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('insertimage')) { - return false; - } - } - - this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing - var _handleAEC = function() { - var el = this.currentElement[0], - src = 'http://'; - if (!el) { - el = this._getSelectedElement(); - } - if (el) { - if (el.getAttribute('src')) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - src = this.STR_IMAGE_HERE; - } - } - } - var str = prompt(this.STR_IMAGE_URL + ': ', src); - if ((str !== '') && (str !== null)) { - el.setAttribute('src', str); - } else if (str === '') { - el.parentNode.removeChild(el); - this.currentElement = []; - this.nodeChange(); - } else if ((str === null)) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - el.parentNode.removeChild(el); - this.currentElement = []; - this.nodeChange(); - } - } - this.closeWindow(); - this.toolbar.set('disabled', false); - this.unsubscribe('afterExecCommand', _handleAEC, this, true); - }; - this.on('afterExecCommand', _handleAEC, this, true); - }, - /** - * @private - * @method _handleInsertImageWindowClose - * @description Handles the closing of the Image Properties Window. - */ - _handleInsertImageWindowClose: function() { - this.nodeChange(); - }, - /** - * @private - * @method _isLocalFile - * @param {String} url THe url/string to check - * @description Checks to see if a string (href or img src) is possibly a local file reference.. - */ - _isLocalFile: function(url) { - if ((url) && (url !== '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) { - return true; - } - return false; - }, - /** - * @private - * @method _handleCreateLinkClick - * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked. - */ - _handleCreateLinkClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - return false; - } - } - - this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing - - var _handleAEC = function() { - var el = this.currentElement[0], - url = ''; - - if (el) { - if (el.getAttribute('href', 2) !== null) { - url = el.getAttribute('href', 2); - } - } - var str = prompt(this.STR_LINK_URL + ': ', url); - if ((str !== '') && (str !== null)) { - var urlValue = str; - if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - //Found an @ sign, prefix with mailto: - urlValue = 'mailto:' + urlValue; - } else { - /* :// not found adding */ - if (urlValue.substring(0, 1) != '#') { - //urlValue = 'http:/'+'/' + urlValue; - } - } - } - el.setAttribute('href', urlValue); - } else if (str !== null) { - var _span = this._getDoc().createElement('span'); - _span.innerHTML = el.innerHTML; - Dom.addClass(_span, 'yui-non'); - el.parentNode.replaceChild(_span, el); - } - this.closeWindow(); - this.toolbar.set('disabled', false); - this.unsubscribe('afterExecCommand', _handleAEC, this, true); - }; - this.on('afterExecCommand', _handleAEC, this); - - }, - /** - * @private - * @method _handleCreateLinkWindowClose - * @description Handles the closing of the Link Properties Window. - */ - _handleCreateLinkWindowClose: function() { - this.nodeChange(); - this.currentElement = []; - }, - /** - * @method render - * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load. - */ - render: function() { - if (this._rendered) { - return false; - } - if (!this.DOMReady) { - this._queue[this._queue.length] = ['render', arguments]; - return false; - } - if (this.get('element')) { - if (this.get('element').tagName) { - this._textarea = true; - if (this.get('element').tagName.toLowerCase() !== 'textarea') { - this._textarea = false; - } - } else { - return false; - } - } else { - return false; - } - this._rendered = true; - var self = this; - window.setTimeout(function() { - self._render.call(self); - }, 4); - }, - /** - * @private - * @method _render - * @description Causes the toolbar and the editor to render and replace the textarea. - */ - _render: function() { - var self = this; - this.set('textarea', this.get('element')); - - this.get('element_cont').setStyle('display', 'none'); - this.get('element_cont').addClass(this.CLASS_CONTAINER); - - this.set('iframe', this._createIframe()); - - window.setTimeout(function() { - self._setInitialContent.call(self); - }, 10); - - this.get('editor_wrapper').appendChild(this.get('iframe').get('element')); - - if (this.get('disabled')) { - this._disableEditor(true); - } - - var tbarConf = this.get('toolbar'); - //Create Toolbar instance - if (tbarConf instanceof Toolbar) { - this.toolbar = tbarConf; - //Set the toolbar to disabled until content is loaded - this.toolbar.set('disabled', true); - } else { - //Set the toolbar to disabled until content is loaded - tbarConf.disabled = true; - this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf); - } - - this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar }); - - - this.toolbar.on('toolbarCollapsed', function() { - if (this.currentWindow) { - this.moveWindow(); - } - }, this, true); - this.toolbar.on('toolbarExpanded', function() { - if (this.currentWindow) { - this.moveWindow(); - } - }, this, true); - this.toolbar.on('fontsizeClick', this._handleFontSize, this, true); - - this.toolbar.on('colorPickerClicked', function(o) { - this._handleColorPicker(o); - return false; //Stop the buttonClick event - }, this, true); - - this.toolbar.on('alignClick', this._handleAlign, this, true); - this.on('afterNodeChange', this._handleAfterNodeChange, this, true); - this.toolbar.on('insertimageClick', this._handleInsertImageClick, this, true); - this.on('windowinsertimageClose', this._handleInsertImageWindowClose, this, true); - this.toolbar.on('createlinkClick', this._handleCreateLinkClick, this, true); - this.on('windowcreatelinkClose', this._handleCreateLinkWindowClose, this, true); - - - //Replace Textarea with editable area - this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element')); - - - this.setStyle('visibility', 'hidden'); - this.setStyle('position', 'absolute'); - this.setStyle('top', '-9999px'); - this.setStyle('left', '-9999px'); - this.get('element_cont').appendChild(this.get('element')); - this.get('element_cont').setStyle('display', 'block'); - - - Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT); - this.get('iframe').addClass(this.CLASS_EDITABLE); - - //Set height and width of editor container - this.get('element_cont').setStyle('width', this.get('width')); - Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height')); - - this.get('iframe').setStyle('width', '100%'); //WIDTH - this.get('iframe').setStyle('height', '100%'); - - this._setupDD(); - - window.setTimeout(function() { - self._setupAfterElement.call(self); - }, 0); - this.fireEvent('afterRender', { type: 'afterRender', target: this }); - }, - /** - * @method execCommand - * @param {String} action The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml) - * @param {String} value (optional) The value for a given action such as action: fontname value: 'Verdana' - * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions - */ - execCommand: function(action, value) { - var beforeExec = this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments }); - if ((beforeExec === false) || (this.STOP_EXEC_COMMAND)) { - this.STOP_EXEC_COMMAND = false; - return false; - } - this._lastCommand = action; - this._setMarkupType(action); - if (this.browser.ie) { - this._getWindow().focus(); - } - var exec = true; - - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue(action)) { - exec = false; - } - } - - this.editorDirty = true; - - if ((typeof this['cmd_' + action.toLowerCase()] == 'function') && exec) { - var retValue = this['cmd_' + action.toLowerCase()](value); - exec = retValue[0]; - if (retValue[1]) { - action = retValue[1]; - } - if (retValue[2]) { - value = retValue[2]; - } - } - if (exec) { - try { - this._getDoc().execCommand(action, false, value); - } catch(e) { - } - } else { - } - this.on('afterExecCommand', function() { - this.unsubscribeAll('afterExecCommand'); - this.nodeChange(); - }, this, true); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - - }, - /* {{{ Command Overrides */ - - /** - * @method cmd_bold - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('bold') is used. - */ - cmd_bold: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span') && this._hasSelection()) { - if (el.style.fontWeight == 'bold') { - el.style.fontWeight = ''; - var b = this._getDoc().createElement('b'), - par = el.parentNode; - par.replaceChild(b, el); - b.appendChild(el); - } - } - } - return [true]; - }, - /** - * @method cmd_italic - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('italic') is used. - */ - - cmd_italic: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span') && this._hasSelection()) { - if (el.style.fontStyle == 'italic') { - el.style.fontStyle = ''; - var i = this._getDoc().createElement('i'), - par = el.parentNode; - par.replaceChild(i, el); - i.appendChild(el); - } - } - } - return [true]; - }, - - - /** - * @method cmd_underline - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('underline') is used. - */ - cmd_underline: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span')) { - if (el.style.textDecoration == 'underline') { - el.style.textDecoration = 'none'; - } else { - el.style.textDecoration = 'underline'; - } - return [false]; - } - } - return [true]; - }, - /** - * @method cmd_backcolor - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('backcolor') is used. - */ - cmd_backcolor: function(value) { - var exec = true, - el = this._getSelectedElement(), - action = 'backcolor'; - - if (this.browser.gecko || this.browser.opera) { - this._setEditorStyle(true); - action = 'hilitecolor'; - } - - if (!this._isElement(el, 'body') && !this._hasSelection()) { - el.style.backgroundColor = value; - this._selectNode(el); - exec = false; - } else { - if (this.get('insert')) { - el = this._createInsertElement({ backgroundColor: value }); - } else { - this._createCurrentElement('span', { backgroundColor: value, color: el.style.color, fontSize: el.style.fontSize, fontFamily: el.style.fontFamily }); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - - return [exec, action]; - }, - /** - * @method cmd_forecolor - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('forecolor') is used. - */ - cmd_forecolor: function(value) { - var exec = true, - el = this._getSelectedElement(); - - if (!this._isElement(el, 'body') && !this._hasSelection()) { - Dom.setStyle(el, 'color', value); - this._selectNode(el); - exec = false; - } else { - if (this.get('insert')) { - el = this._createInsertElement({ color: value }); - } else { - this._createCurrentElement('span', { color: value, fontSize: el.style.fontSize, fontFamily: el.style.fontFamily, backgroundColor: el.style.backgroundColor }); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - return [exec]; - }, - /** - * @method cmd_unlink - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('unlink') is used. - */ - cmd_unlink: function(value) { - this._swapEl(this.currentElement[0], 'span', function(el) { - el.className = 'yui-non'; - }); - return [false]; - }, - /** - * @method cmd_createlink - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('createlink') is used. - */ - cmd_createlink: function(value) { - var el = this._getSelectedElement(), _a = null; - if (this._hasParent(el, 'a')) { - this.currentElement[0] = this._hasParent(el, 'a'); - } else if (this._isElement(el, 'li')) { - _a = this._getDoc().createElement('a'); - _a.innerHTML = el.innerHTML; - el.innerHTML = ''; - el.appendChild(_a); - this.currentElement[0] = _a; - } else if (!this._isElement(el, 'a')) { - this._createCurrentElement('a'); - _a = this._swapEl(this.currentElement[0], 'a'); - this.currentElement[0] = _a; - } else { - this.currentElement[0] = el; - } - return [false]; - }, - /** - * @method cmd_insertimage - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertimage') is used. - */ - cmd_insertimage: function(value) { - var exec = true, _img = null, action = 'insertimage', - el = this._getSelectedElement(); - - if (value === '') { - value = this.get('blankimage'); - } - - /* - * @knownissue Safari Cursor Position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - - if (this._isElement(el, 'img')) { - this.currentElement[0] = el; - exec = false; - } else { - if (this._getDoc().queryCommandEnabled(action)) { - this._getDoc().execCommand(action, false, value); - var imgs = this._getDoc().getElementsByTagName('img'); - for (var i = 0; i < imgs.length; i++) { - if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) { - YAHOO.util.Dom.addClass(imgs[i], 'yui-img'); - this.currentElement[0] = imgs[i]; - } - } - exec = false; - } else { - if (el == this._getDoc().body) { - _img = this._getDoc().createElement('img'); - _img.setAttribute('src', value); - YAHOO.util.Dom.addClass(_img, 'yui-img'); - this._getDoc().body.appendChild(_img); - } else { - this._createCurrentElement('img'); - _img = this._getDoc().createElement('img'); - _img.setAttribute('src', value); - YAHOO.util.Dom.addClass(_img, 'yui-img'); - this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]); - } - this.currentElement[0] = _img; - exec = false; - } - } - return [exec]; - }, - /** - * @method cmd_inserthtml - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('inserthtml') is used. - */ - cmd_inserthtml: function(value) { - var exec = true, action = 'inserthtml', _span = null, _range = null; - /* - * @knownissue Safari cursor position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) { - this._createCurrentElement('img'); - _span = this._getDoc().createElement('span'); - _span.innerHTML = value; - this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]); - exec = false; - } else if (this.browser.ie) { - _range = this._getRange(); - if (_range.item) { - _range.item(0).outerHTML = value; - } else { - _range.pasteHTML(value); - } - exec = false; - } - return [exec]; - }, - /** - * @method cmd_list - * @param tag The tag of the list you want to create (eg, ul or ol) - * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods. - */ - cmd_list: function(tag) { - var exec = true, list = null, li = 0, el = null, str = '', - selEl = this._getSelectedElement(), action = 'insertorderedlist'; - if (tag == 'ul') { - action = 'insertunorderedlist'; - } - /* - * @knownissue Safari 2.+ doesn't support ordered and unordered lists - * @browser Safari 2.x - * The issue with this workaround is that when applied to a set of text - * that has BR's in it, Safari may or may not pick up the individual items as - * list items. This is fixed in WebKit (Safari 3) - * 2.6.0: Seems there are still some issues with List Creation and Safari 3, reverting to previously working Safari 2.x code - */ - //if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) { - if ((this.browser.webkit && !this.browser.webkit4) || (this.browser.opera)) { - if (this._isElement(selEl, 'li') && this._isElement(selEl.parentNode, tag)) { - el = selEl.parentNode; - list = this._getDoc().createElement('span'); - YAHOO.util.Dom.addClass(list, 'yui-non'); - str = ''; - var lis = el.getElementsByTagName('li'), p_tag = ((this.browser.opera && this.get('ptags')) ? 'p' : 'div'); - for (li = 0; li < lis.length; li++) { - str += '<' + p_tag + '>' + lis[li].innerHTML + ''; - } - list.innerHTML = str; - this.currentElement[0] = el; - this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]); - } else { - this._createCurrentElement(tag.toLowerCase()); - list = this._getDoc().createElement(tag); - for (li = 0; li < this.currentElement.length; li++) { - var newli = this._getDoc().createElement('li'); - newli.innerHTML = this.currentElement[li].innerHTML + '  '; - list.appendChild(newli); - if (li > 0) { - this.currentElement[li].parentNode.removeChild(this.currentElement[li]); - } - } - var b_tag = ((this.browser.opera) ? '
            ' : '
            '), - items = list.firstChild.innerHTML.split(b_tag), i, item; - if (items.length > 0) { - list.innerHTML = ''; - for (i = 0; i < items.length; i++) { - item = this._getDoc().createElement('li'); - item.innerHTML = items[i]; - list.appendChild(item); - } - } - - this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]); - this.currentElement[0] = list; - var _h = this.currentElement[0].firstChild; - _h = Dom.getElementsByClassName('yui-non', 'span', _h)[0]; - if (this.browser.webkit) { - this._getSelection().setBaseAndExtent(_h, 1, _h, _h.innerText.length); - } - } - exec = false; - } else { - el = this._getSelectedElement(); - if (this._isElement(el, 'li') && this._isElement(el.parentNode, tag) || (this.browser.ie && this._isElement(this._getRange().parentElement, 'li')) || (this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { //we are in a list.. - if (this.browser.ie) { - if ((this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { - el = el.getElementsByTagName('li')[0]; - } - str = ''; - var lis2 = el.parentNode.getElementsByTagName('li'); - for (var j = 0; j < lis2.length; j++) { - str += lis2[j].innerHTML + '
            '; - } - var newEl = this._getDoc().createElement('span'); - newEl.innerHTML = str; - el.parentNode.parentNode.replaceChild(newEl, el.parentNode); - } else { - this.nodeChange(); - this._getDoc().execCommand(action, '', el.parentNode); - this.nodeChange(); - } - exec = false; - } - if (this.browser.opera) { - var self = this; - window.setTimeout(function() { - var liso = self._getDoc().getElementsByTagName('li'); - for (var i = 0; i < liso.length; i++) { - if (liso[i].innerHTML.toLowerCase() == '
            ') { - liso[i].parentNode.parentNode.removeChild(liso[i].parentNode); - } - } - },30); - } - if (this.browser.ie && exec) { - var html = ''; - if (this._getRange().html) { - html = '
          • ' + this._getRange().html+ '
          • '; - } else { - var t = this._getRange().text.split('\n'); - if (t.length > 1) { - html = ''; - for (var ie = 0; ie < t.length; ie++) { - html += '
          • ' + t[ie] + '
          • '; - } - } else { - var txt = this._getRange().text; - if (txt === '') { - html = '
          • ' + txt + '
          • '; - } else { - html = '
          • ' + txt + '
          • '; - } - } - } - this._getRange().pasteHTML('<' + tag + '>' + html + ''); - var new_item = this._getDoc().getElementById('new_list_item'); - if (new_item) { - var range = this._getDoc().body.createTextRange(); - range.moveToElementText(new_item); - range.collapse(false); - range.select(); - new_item.id = ''; - } - exec = false; - } - } - return exec; - }, - /** - * @method cmd_insertorderedlist - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertorderedlist ') is used. - */ - cmd_insertorderedlist: function(value) { - return [this.cmd_list('ol')]; - }, - /** - * @method cmd_insertunorderedlist - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertunorderedlist') is used. - */ - cmd_insertunorderedlist: function(value) { - return [this.cmd_list('ul')]; - }, - /** - * @method cmd_fontname - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontname') is used. - */ - cmd_fontname: function(value) { - var exec = true, - selEl = this._getSelectedElement(); - - this.currentFont = value; - if (selEl && selEl.tagName && !this._hasSelection() && !this._isElement(selEl, 'body') && !this.get('insert')) { - YAHOO.util.Dom.setStyle(selEl, 'font-family', value); - exec = false; - } else if (this.get('insert') && !this._hasSelection()) { - var el = this._createInsertElement({ fontFamily: value }); - exec = false; - } - return [exec]; - }, - /** - * @method cmd_fontsize - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontsize') is used. - */ - cmd_fontsize: function(value) { - var el = null, go = true; - el = this._getSelectedElement(); - if (this.browser.webkit) { - if (this.currentElement[0]) { - if (el == this.currentElement[0]) { - go = false; - YAHOO.util.Dom.setStyle(el, 'fontSize', value); - this._selectNode(el); - this.currentElement[0] = el; - } - } - } - if (go) { - if (!this._isElement(this._getSelectedElement(), 'body') && (!this._hasSelection())) { - el = this._getSelectedElement(); - YAHOO.util.Dom.setStyle(el, 'fontSize', value); - if (this.get('insert') && this.browser.ie) { - var r = this._getRange(); - r.collapse(false); - r.select(); - } else { - this._selectNode(el); - } - } else if (this.currentElement && (this.currentElement.length > 0) && (!this._hasSelection()) && (!this.get('insert'))) { - YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value); - } else { - if (this.get('insert') && !this._hasSelection()) { - el = this._createInsertElement({ fontSize: value }); - this.currentElement[0] = el; - this._selectNode(this.currentElement[0]); - } else { - this._createCurrentElement('span', {'fontSize': value, fontFamily: el.style.fontFamily, color: el.style.color, backgroundColor: el.style.backgroundColor }); - this._selectNode(this.currentElement[0]); - } - } - } - return [false]; - }, - /* }}} */ - /** - * @private - * @method _swapEl - * @param {HTMLElement} el The element to swap with - * @param {String} tagName The tagname of the element that you wish to create - * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function. - * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place. - */ - _swapEl: function(el, tagName, callback) { - var _el = this._getDoc().createElement(tagName); - if (el) { - _el.innerHTML = el.innerHTML; - } - if (typeof callback == 'function') { - callback.call(this, _el); - } - if (el) { - el.parentNode.replaceChild(_el, el); - } - return _el; - }, - /** - * @private - * @method _createInsertElement - * @description Creates a new "currentElement" then adds some text (and other things) to make it selectable and stylable. Then the user can continue typing. - * @param {Object} css (optional) Object literal containing styles to apply to the new element. - * @return {HTMLElement} - */ - _createInsertElement: function(css) { - this._createCurrentElement('span', css); - var el = this.currentElement[0]; - if (this.browser.webkit) { - //Little Safari Hackery here.. - el.innerHTML = ' '; - el = el.firstChild; - this._getSelection().setBaseAndExtent(el, 1, el, el.innerText.length); - } else if (this.browser.ie || this.browser.opera) { - el.innerHTML = ' '; - } - this.focus(); - this._selectNode(el, true); - return el; - }, - /** - * @private - * @method _createCurrentElement - * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create - * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element. - * @description This is a work around for the various browser issues with execCommand. This method will run execCommand('fontname', false, 'yui-tmp') on the given selection. - * It will then search the document for an element with the font-family set to yui-tmp and replace that with another span that has other information in it, then assign the new span to the - * this.currentElement array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit. - */ - _createCurrentElement: function(tagName, tagStyle) { - tagName = ((tagName) ? tagName : 'a'); - var tar = null, - el = [], - _doc = this._getDoc(); - - if (this.currentFont) { - if (!tagStyle) { - tagStyle = {}; - } - tagStyle.fontFamily = this.currentFont; - this.currentFont = null; - } - this.currentElement = []; - - var _elCreate = function(tagName, tagStyle) { - var el = null; - tagName = ((tagName) ? tagName : 'span'); - tagName = tagName.toLowerCase(); - switch (tagName) { - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - el = _doc.createElement(tagName); - break; - default: - el = _doc.createElement(tagName); - if (tagName === 'span') { - YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName); - YAHOO.util.Dom.addClass(el, 'yui-tag'); - el.setAttribute('tag', tagName); - } - - for (var k in tagStyle) { - if (YAHOO.lang.hasOwnProperty(tagStyle, k)) { - el.style[k] = tagStyle[k]; - } - } - break; - } - return el; - }; - - if (!this._hasSelection()) { - if (this._getDoc().queryCommandEnabled('insertimage')) { - this._getDoc().execCommand('insertimage', false, 'yui-tmp-img'); - var imgs = this._getDoc().getElementsByTagName('img'); - for (var j = 0; j < imgs.length; j++) { - if (imgs[j].getAttribute('src', 2) == 'yui-tmp-img') { - el = _elCreate(tagName, tagStyle); - imgs[j].parentNode.replaceChild(el, imgs[j]); - this.currentElement[this.currentElement.length] = el; - } - } - } else { - if (this.currentEvent) { - tar = YAHOO.util.Event.getTarget(this.currentEvent); - } else { - //For Safari.. - tar = this._getDoc().body; - } - } - if (tar) { - /* - * @knownissue Safari Cursor Position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - el = _elCreate(tagName, tagStyle); - if (this._isElement(tar, 'body') || this._isElement(tar, 'html')) { - if (this._isElement(tar, 'html')) { - tar = this._getDoc().body; - } - tar.appendChild(el); - } else if (tar.nextSibling) { - tar.parentNode.insertBefore(el, tar.nextSibling); - } else { - tar.parentNode.appendChild(el); - } - //this.currentElement = el; - this.currentElement[this.currentElement.length] = el; - this.currentEvent = null; - if (this.browser.webkit) { - //Force Safari to focus the new element - this._getSelection().setBaseAndExtent(el, 0, el, 0); - if (this.browser.webkit3) { - this._getSelection().collapseToStart(); - } else { - this._getSelection().collapse(true); - } - } - } - } else { - //Force CSS Styling for this action... - this._setEditorStyle(true); - this._getDoc().execCommand('fontname', false, 'yui-tmp'); - var _tmp = [], __tmp, __els = ['font', 'span', 'i', 'b', 'u']; - - if (!this._isElement(this._getSelectedElement(), 'body')) { - __els[__els.length] = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName); - __els[__els.length] = this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName); - } - for (var _els = 0; _els < __els.length; _els++) { - var _tmp1 = this._getDoc().getElementsByTagName(__els[_els]); - for (var e = 0; e < _tmp1.length; e++) { - _tmp[_tmp.length] = _tmp1[e]; - } - } - - - for (var i = 0; i < _tmp.length; i++) { - if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) { - if (tagName !== 'span') { - el = _elCreate(tagName, tagStyle); - } else { - el = _elCreate(_tmp[i].tagName, tagStyle); - } - el.innerHTML = _tmp[i].innerHTML; - if (this._isElement(_tmp[i], 'ol') || (this._isElement(_tmp[i], 'ul'))) { - var fc = _tmp[i].getElementsByTagName('li')[0]; - _tmp[i].style.fontFamily = 'inherit'; - fc.style.fontFamily = 'inherit'; - el.innerHTML = fc.innerHTML; - fc.innerHTML = ''; - fc.appendChild(el); - this.currentElement[this.currentElement.length] = el; - } else if (this._isElement(_tmp[i], 'li')) { - _tmp[i].innerHTML = ''; - _tmp[i].appendChild(el); - _tmp[i].style.fontFamily = 'inherit'; - this.currentElement[this.currentElement.length] = el; - } else { - if (_tmp[i].parentNode) { - _tmp[i].parentNode.replaceChild(el, _tmp[i]); - this.currentElement[this.currentElement.length] = el; - this.currentEvent = null; - if (this.browser.webkit) { - //Force Safari to focus the new element - this._getSelection().setBaseAndExtent(el, 0, el, 0); - if (this.browser.webkit3) { - this._getSelection().collapseToStart(); - } else { - this._getSelection().collapse(true); - } - } - if (this.browser.ie && tagStyle && tagStyle.fontSize) { - this._getSelection().empty(); - } - if (this.browser.gecko) { - this._getSelection().collapseToStart(); - } - } - } - } - } - var len = this.currentElement.length; - for (var o = 0; o < len; o++) { - if ((o + 1) != len) { //Skip the last one in the list - if (this.currentElement[o] && this.currentElement[o].nextSibling) { - if (this._isElement(this.currentElement[o], 'br')) { - this.currentElement[this.currentElement.length] = this.currentElement[o].nextSibling; - } - } - } - } - } - }, - /** - * @method saveHTML - * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea. - * @return String - */ - saveHTML: function() { - var html = this.cleanHTML(); - if (this._textarea) { - this.get('element').value = html; - } else { - this.get('element').innerHTML = html; - } - if (this.get('saveEl') !== this.get('element')) { - var out = this.get('saveEl'); - if (Lang.isString(out)) { - out = Dom.get(out); - } - if (out) { - if (out.tagName.toLowerCase() === 'textarea') { - out.value = html; - } else { - out.innerHTML = html; - } - } - } - return html; - }, - /** - * @method setEditorHTML - * @param {String} incomingHTML The html content to load into the editor - * @description Loads HTML into the editors body - */ - setEditorHTML: function(incomingHTML) { - var html = this._cleanIncomingHTML(incomingHTML); - html = html.replace(/RIGHT_BRACKET/gi, '{'); - html = html.replace(/LEFT_BRACKET/gi, '}'); - this._getDoc().body.innerHTML = html; - this.nodeChange(); - }, - /** - * @method getEditorHTML - * @description Gets the unprocessed/unfiltered HTML from the editor - */ - getEditorHTML: function() { - try { - var b = this._getDoc().body; - if (b === null) { - return null; - } - return this._getDoc().body.innerHTML; - } catch (e) { - return ''; - } - }, - /** - * @method show - * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none. - */ - show: function() { - if (this.browser.gecko) { - this._setDesignMode('on'); - this.focus(); - } - if (this.browser.webkit) { - var self = this; - window.setTimeout(function() { - self._setInitialContent.call(self); - }, 10); - } - //Adding this will close all other Editor window's when showing this one. - if (this.currentWindow) { - this.closeWindow(); - } - //Put the iframe back in place - this.get('iframe').setStyle('position', 'static'); - this.get('iframe').setStyle('left', ''); - }, - /** - * @method hide - * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows. - */ - hide: function() { - //Adding this will close all other Editor window's. - if (this.currentWindow) { - this.closeWindow(); - } - if (this._fixNodesTimer) { - clearTimeout(this._fixNodesTimer); - this._fixNodesTimer = null; - } - if (this._nodeChangeTimer) { - clearTimeout(this._nodeChangeTimer); - this._nodeChangeTimer = null; - } - this._lastNodeChange = 0; - //Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements. - this.get('iframe').setStyle('position', 'absolute'); - this.get('iframe').setStyle('left', '-9999px'); - }, - /** - * @method _cleanIncomingHTML - * @param {String} html The unfiltered HTML - * @description Process the HTML with a few regexes to clean it up and stabilize the input - * @return {String} The filtered HTML - */ - _cleanIncomingHTML: function(html) { - html = html.replace(/{/gi, 'RIGHT_BRACKET'); - html = html.replace(/}/gi, 'LEFT_BRACKET'); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/strong>/gi, '
            '); - - //replace embed before em check - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/embed>/gi, ''); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/em>/gi, '
            '); - html = html.replace(/_moz_dirty=""/gi, ''); - - //Put embed tags back in.. - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/YUI_EMBED>/gi, ''); - if (this.get('plainText')) { - html = html.replace(/\n/g, '
            ').replace(/\r/g, '
            '); - html = html.replace(/ /gi, '  '); //Replace all double spaces - html = html.replace(/\t/gi, '    '); //Replace all tabs - } - //Removing Script Tags from the Editor - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/script([^>]*)>/gi, ''); - html = html.replace(/<script([^>]*)>/gi, ''); - html = html.replace(/<\/script([^>]*)>/gi, ''); - //Replace the line feeds - html = html.replace(/\r\n/g, '').replace(/\n/g, '').replace(/\r/g, ''); - - //Remove Bad HTML elements (used to be script nodes) - html = html.replace(new RegExp(']*)>(.*?)<\/bad>', 'gi'), ''); - //Replace the lines feeds - html = html.replace(//g, '\n'); - return html; - }, - /** - * @method cleanHTML - * @param {String} html The unfiltered HTML - * @description Process the HTML with a few regexes to clean it up and stabilize the output - * @return {String} The filtered HTML - */ - cleanHTML: function(html) { - //Start Filtering Output - //Begin RegExs.. - if (!html) { - html = this.getEditorHTML(); - } - var markup = this.get('markup'); - //Make some backups... - html = this.pre_filter_linebreaks(html, markup); - - //Filter MS Word - html = this.filter_msword(html); - - html = html.replace(/]*)\/>/gi, ''); - html = html.replace(/]*)>/gi, ''); - - html = html.replace(/]*)\/>/gi, ''); - html = html.replace(/]*)>/gi, ''); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/ul>/gi, '<\/YUI_UL>'); - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/blockquote>/gi, '<\/YUI_BQ>'); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/embed>/gi, '<\/YUI_EMBED>'); - - //Convert b and i tags to strong and em tags - if ((markup == 'semantic') || (markup == 'xhtml')) { - html = html.replace(/]*)?>/gi, ''); - html = html.replace(/<\/i>/gi, ''); - html = html.replace(/]*)?>/gi, ''); - html = html.replace(/<\/b>/gi, ''); - } - - html = html.replace(/_moz_dirty=""/gi, ''); - - //normalize strikethrough - html = html.replace(//gi, '/span>'); - - - //Case Changing - if (this.browser.ie) { - html = html.replace(/text-decoration/gi, 'text-decoration'); - html = html.replace(/font-weight/gi, 'font-weight'); - html = html.replace(/_width="([^>]*)"/gi, ''); - html = html.replace(/_height="([^>]*)"/gi, ''); - //Cleanup Image URL's - var url = this._baseHREF.replace(/\//gi, '\\/'), - re = new RegExp('src="' + url, 'gi'); - html = html.replace(re, 'src="'); - } - html = html.replace(//gi, ''); - html = html.replace(//gi, ''); - if ((markup == 'semantic') || (markup == 'xhtml') || (markup == 'css')) { - html = html.replace(new RegExp(']*)face="([^>]*)">(.*?)<\/font>', 'gi'), '$3'); - html = html.replace(/([^>]*)<\/span>', 'gi'), '$1'); - html = html.replace(new RegExp('([^>]*)<\/span>', 'gi'), '$1'); - } - html = html.replace(/\/u>/gi, '/span>'); - if (markup == 'css') { - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/em>/gi, '
            '); - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/strong>/gi, ''); - html = html.replace(//gi, '/span>'); - html = html.replace(//gi, '/span>'); - } - html = html.replace(/ /gi, ' '); //Replace all double spaces and replace with a single - } else { - html = html.replace(//gi, '/u>'); - } - html = html.replace(/]*)>/gi, ''); - html = html.replace(/\/ol>/gi, '/ol>'); - html = html.replace(/
          • /gi, '/li>'); - html = this.filter_safari(html); - - html = this.filter_internals(html); - - html = this.filter_all_rgb(html); - - //Replace our backups with the real thing - html = this.post_filter_linebreaks(html, markup); - - if (markup == 'xhtml') { - html = html.replace(/]*)>/g, ''); - html = html.replace(/]*)>/g, ''); - } else { - html = html.replace(/]*)>/g, ''); - html = html.replace(/]*)>/g, ''); - } - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_UL>/g, '<\/ul>'); - - html = this.filter_invalid_lists(html); - - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_BQ>/g, '<\/blockquote>'); - - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_EMBED>/g, '<\/embed>'); - - //This should fix &'s in URL's - html = html.replace(/ & /gi, ' YUI_AMP '); - html = html.replace(/ &/gi, ' YUI_AMP_F '); - html = html.replace(/& /gi, ' YUI_AMP_R '); - html = html.replace(/&/gi, '&'); - html = html.replace(/ YUI_AMP /gi, ' & '); - html = html.replace(/ YUI_AMP_F /gi, ' &'); - html = html.replace(/ YUI_AMP_R /gi, '& '); - - //Trim the output, removing whitespace from the beginning and end - html = YAHOO.lang.trim(html); - - if (this.get('removeLineBreaks')) { - html = html.replace(/\n/g, '').replace(/\r/g, ''); - html = html.replace(/ /gi, ' '); //Replace all double spaces and replace with a single - } - - for (var v in this.invalidHTML) { - if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) { - if (Lang.isObject(v) && v.keepContents) { - html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '$1'); - } else { - html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), ''); - } - } - } - - /* LATER -- Add DOM manipulation - console.log(html); - var frag = document.createDocumentFragment(); - frag.innerHTML = html; - - var ps = frag.getElementsByTagName('p'), - len = ps.length; - for (var i = 0; i < len; i++) { - var ps2 = ps[i].getElementsByTagName('p'); - if (ps2.length) { - - } - - } - html = frag.innerHTML; - console.log(html); - */ - - this.fireEvent('cleanHTML', { type: 'cleanHTML', target: this, html: html }); - - return html; - }, - /** - * @method filter_msword - * @param String html The HTML string to filter - * @description Filters out msword html attributes and other junk. Activate with filterWord: true in config - */ - filter_msword: function(html) { - if (!this.get('filterWord')) { - return html; - } - //Remove the ms o: tags - html = html.replace(/\s*<\/o:p>/g, ''); - html = html.replace(/[\s\S]*?<\/o:p>/g, ' '); - - //Remove the ms w: tags - html = html.replace( /]*>[\s\S]*?<\/w:[^>]*>/gi, ''); - - //Remove mso-? styles. - html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, ''); - - //Remove more bogus MS styles. - html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, ''); - html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\""); - html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, ''); - html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\""); - html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\""); - html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ); - html = html.replace( /\s*tab-stops:[^;"]*;?/gi, ''); - html = html.replace( /\s*tab-stops:[^"]*/gi, ''); - - //Remove XML declarations - html = html.replace(/<\\?\?xml[^>]*>/gi, ''); - - //Remove lang - html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); - - //Remove language tags - html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3"); - - //Remove onmouseover and onmouseout events (from MS Word comments effect) - html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3"); - html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3"); - - return html; - }, - /** - * @method filter_invalid_lists - * @param String html The HTML string to filter - * @description Filters invalid ol and ul list markup, converts this:
            1. ..
            to this:
            1. ..
          • - */ - filter_invalid_lists: function(html) { - html = html.replace(/<\/li>\n/gi, ''); - - html = html.replace(/<\/li>
              /gi, '
              1. '); - html = html.replace(/<\/ol>/gi, '
            1. '); - html = html.replace(/<\/ol><\/li>\n/gi, "
            "); - - html = html.replace(/<\/li>
              /gi, '
              • '); - html = html.replace(/<\/ul>/gi, '
            • '); - html = html.replace(/<\/ul><\/li>\n?/gi, "
            "); - - html = html.replace(/<\/li>/gi, ""); - html = html.replace(/<\/ol>/gi, "
      "); - html = html.replace(/
        /gi, "
          "); - html = html.replace(/
            /gi, "
              "); - return html; - }, - /** - * @method filter_safari - * @param String html The HTML string to filter - * @description Filters strings specific to Safari - * @return String - */ - filter_safari: function(html) { - if (this.browser.webkit) { - // - html = html.replace(/([^>])<\/span>/gi, '    '); - html = html.replace(/Apple-style-span/gi, ''); - html = html.replace(/style="line-height: normal;"/gi, ''); - html = html.replace(/yui-wk-div/gi, ''); - html = html.replace(/yui-wk-p/gi, ''); - - - //Remove bogus LI's - html = html.replace(/
            • <\/li>/gi, ''); - html = html.replace(/
            • <\/li>/gi, ''); - html = html.replace(/
            • <\/li>/gi, ''); - //Remove bogus DIV's - updated from just removing the div's to replacing /div with a break - if (this.get('ptags')) { - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/div>/gi, '

              '); - } else { - //html = html.replace(/
              /gi, '
              '); - html = html.replace(/]*)>([ tnr]*)<\/div>/gi, '
              '); - html = html.replace(/<\/div>/gi, ''); - } - } - return html; - }, - /** - * @method filter_internals - * @param String html The HTML string to filter - * @description Filters internal RTE strings and bogus attrs we don't want - * @return String - */ - filter_internals: function(html) { - html = html.replace(/\r/g, ''); - //Fix stuff we don't want - html = html.replace(/<\/?(body|head|html)[^>]*>/gi, ''); - //Fix last BR in LI - html = html.replace(/<\/li>/gi, '
            • '); - - html = html.replace(/yui-tag-span/gi, ''); - html = html.replace(/yui-tag/gi, ''); - html = html.replace(/yui-non/gi, ''); - html = html.replace(/yui-img/gi, ''); - html = html.replace(/ tag="span"/gi, ''); - html = html.replace(/ class=""/gi, ''); - html = html.replace(/ style=""/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ target=""/gi, ''); - html = html.replace(/ title=""/gi, ''); - - if (this.browser.ie) { - html = html.replace(/ class= /gi, ''); - html = html.replace(/ class= >/gi, ''); - } - - return html; - }, - /** - * @method filter_all_rgb - * @param String str The HTML string to filter - * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00" - * @return String - */ - filter_all_rgb: function(str) { - var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi"); - var arr = str.match(exp); - if (Lang.isArray(arr)) { - for (var i = 0; i < arr.length; i++) { - var color = this.filter_rgb(arr[i]); - str = str.replace(arr[i].toString(), color); - } - } - - return str; - }, - /** - * @method filter_rgb - * @param String css The CSS string containing rgb(#,#,#); - * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00 - * @return String - */ - filter_rgb: function(css) { - if (css.toLowerCase().indexOf('rgb') != -1) { - var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"); - var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(','); - - if (rgb.length == 5) { - var r = parseInt(rgb[1], 10).toString(16); - var g = parseInt(rgb[2], 10).toString(16); - var b = parseInt(rgb[3], 10).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - css = "#" + r + g + b; - } - } - return css; - }, - /** - * @method pre_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - pre_filter_linebreaks: function(html, markup) { - if (this.browser.webkit) { - html = html.replace(/
              /gi, ''); - html = html.replace(/
              /gi, ''); - } - html = html.replace(/
              /gi, ''); - html = html.replace(/
              /gi, ''); - html = html.replace(//gi, ''); - html = html.replace(/
              /gi, ''); - html = html.replace(/
              <\/div>/gi, ''); - html = html.replace(/

              ( | )<\/p>/g, ''); - html = html.replace(/


               <\/p>/gi, ''); - html = html.replace(/

               <\/p>/gi, ''); - //Fix last BR - html = html.replace(/$/, ''); - //Fix last BR in P - html = html.replace(/<\/p>/g, '

              '); - if (this.browser.ie) { - html = html.replace(/    /g, '\t'); - } - return html; - }, - /** - * @method post_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - post_filter_linebreaks: function(html, markup) { - if (markup == 'xhtml') { - html = html.replace(//g, '
              '); - } else { - html = html.replace(//g, '
              '); - } - return html; - }, - /** - * @method clearEditorDoc - * @description Clear the doc of the Editor - */ - clearEditorDoc: function() { - this._getDoc().body.innerHTML = ' '; - }, - /** - * @method openWindow - * @description Override Method for Advanced Editor - */ - openWindow: function(win) { - }, - /** - * @method moveWindow - * @description Override Method for Advanced Editor - */ - moveWindow: function() { - }, - /** - * @private - * @method _closeWindow - * @description Override Method for Advanced Editor - */ - _closeWindow: function() { - }, - /** - * @method closeWindow - * @description Override Method for Advanced Editor - */ - closeWindow: function() { - //this.unsubscribeAll('afterExecCommand'); - this.toolbar.resetAllButtons(); - this.focus(); - }, - /** - * @method destroy - * @description Destroys the editor, all of it's elements and objects. - * @return {Boolean} - */ - destroy: function() { - if (this._nodeChangeDelayTimer) { - clearTimeout(this._nodeChangeDelayTimer); - } - this.hide(); - - if (this.resize) { - this.resize.destroy(); - } - if (this.dd) { - this.dd.unreg(); - } - if (this.get('panel')) { - this.get('panel').destroy(); - } - this.saveHTML(); - this.toolbar.destroy(); - this.setStyle('visibility', 'visible'); - this.setStyle('position', 'static'); - this.setStyle('top', ''); - this.setStyle('left', ''); - var textArea = this.get('element'); - this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element')); - this.get('element_cont').get('element').innerHTML = ''; - this.set('handleSubmit', false); //Remove the submit handler - return true; - }, - /** - * @method toString - * @description Returns a string representing the editor. - * @return {String} - */ - toString: function() { - var str = 'SimpleEditor'; - if (this.get && this.get('element_cont')) { - str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : '')); - } - return str; - } - }); - -/** -* @event toolbarLoaded -* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event cleanHTML -* @description Event is fired after the cleanHTML method is called. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterRender -* @description Event is fired after the render process finishes. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorContentLoaded -* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeNodeChange -* @description Event fires at the beginning of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterNodeChange -* @description Event fires at the end of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeExecCommand -* @description Event fires at the beginning of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterExecCommand -* @description Event fires at the end of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ - -/** -* @event editorWindowFocus -* @description Fires when the iframe is focused. Note, this is window focus event, not an Editor focus event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorWindowBlur -* @description Fires when the iframe is blurred. Note, this is window blur event, not an Editor blur event. -* @type YAHOO.util.CustomEvent -*/ - - -/** - * @description Singleton object used to track the open window objects and panels across the various open editors - * @class EditorInfo - * @static -*/ -YAHOO.widget.EditorInfo = { - /** - * @private - * @property _instances - * @description A reference to all editors on the page. - * @type Object - */ - _instances: {}, - /** - * @private - * @property blankImage - * @description A reference to the blankImage url - * @type String - */ - blankImage: '', - /** - * @private - * @property window - * @description A reference to the currently open window object in any editor on the page. - * @type Object YAHOO.widget.EditorWindow - */ - window: {}, - /** - * @private - * @property panel - * @description A reference to the currently open panel in any editor on the page. - * @type Object YAHOO.widget.Overlay - */ - panel: null, - /** - * @method getEditorById - * @description Returns a reference to the Editor object associated with the given textarea - * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of - * @return Object YAHOO.widget.Editor - */ - getEditorById: function(id) { - if (!YAHOO.lang.isString(id)) { - //Not a string, assume a node Reference - id = id.id; - } - if (this._instances[id]) { - return this._instances[id]; - } - return false; - }, - /** - * @method saveAll - * @description Saves all Editor instances on the page. If a form reference is passed, only Editor's bound to this form will be saved. - * @param {HTMLElement} form The form to check if this Editor instance belongs to - */ - saveAll: function(form) { - var i, e, items = YAHOO.widget.EditorInfo._instances; - if (form) { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - e = items[i]; - if (e.get('element').form && (e.get('element').form == form)) { - e.saveHTML(); - } - } - } - } else { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - items[i].saveHTML(); - } - } - } - }, - /** - * @method toString - * @description Returns a string representing the EditorInfo. - * @return {String} - */ - toString: function() { - var len = 0; - for (var i in this._instances) { - if (Lang.hasOwnProperty(this._instances, i)) { - len++; - } - } - return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')'; - } -}; - - - - -})(); -/** - * @module editor - * @description

              The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.

              - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, container_core, simpleeditor - * @optional dragdrop, animation, menu, button, resize - */ - -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang, - Toolbar = YAHOO.widget.Toolbar; - - /** - * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization. - * @constructor - * @class Editor - * @extends YAHOO.widget.SimpleEditor - * @param {String/HTMLElement} el The textarea element to turn into an editor. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.Editor = function(el, attrs) { - YAHOO.widget.Editor.superclass.constructor.call(this, el, attrs); - }; - - YAHOO.extend(YAHOO.widget.Editor, YAHOO.widget.SimpleEditor, { - /** - * @private - * @property _undoCache - * @description An Array hash of the Undo Levels. - * @type Array - */ - _undoCache: null, - /** - * @private - * @property _undoLevel - * @description The index of the current undo state. - * @type Number - */ - _undoLevel: null, - /** - * @private - * @method _hasUndoLevel - * @description Checks to see if we have an undo level available - * @return Boolean - */ - _hasUndoLevel: function() { - return ((this._undoCache.length > 1) && this._undoLevel); - }, - /** - * @private - * @method _undoNodeChange - * @description nodeChange listener for undo processing - */ - _undoNodeChange: function() { - var undo_button = this.toolbar.getButtonByValue('undo'), - redo_button = this.toolbar.getButtonByValue('redo'); - if (undo_button && redo_button) { - if (this._hasUndoLevel()) { - this.toolbar.enableButton(undo_button); - } - if (this._undoLevel < this._undoCache.length) { - this.toolbar.enableButton(redo_button); - } - } - this._lastCommand = null; - }, - /** - * @private - * @method _checkUndo - * @description Prunes the undo cache when it reaches the maxUndo config - */ - _checkUndo: function() { - var len = this._undoCache.length, - tmp = []; - if (len >= this.get('maxUndo')) { - for (var i = (len - this.get('maxUndo')); i < len; i++) { - tmp.push(this._undoCache[i]); - } - this._undoCache = tmp; - } - }, - /** - * @private - * @method _putUndo - * @description Puts the content of the Editor into the _undoCache. - * //TODO Convert the hash to a series of TEXTAREAS to store state in. - * @param {String} str The content of the Editor - */ - _putUndo: function(str) { - if (this._undoLevel === this._undoCache.length) { - this._undoCache.push(str); - this._undoLevel = this._undoCache.length; - } else { - var str = this.getEditorHTML(); - var last = this._undoCache[this._undoLevel]; - if (last) { - if (str !== last) { - this._undoCache = []; - this._undoLevel = 0; - } - } - } - }, - /** - * @private - * @method _getUndo - * @description Get's a level from the undo cache. - * @param {Number} index The index of the undo level we want to get. - * @return {String} - */ - _getUndo: function(index) { - this._undoLevel = index; - return this._undoCache[index]; - }, - /** - * @private - * @method _storeUndo - * @description Method to call when you want to store an undo state. Currently called from nodeChange and _handleKeyUp - */ - _storeUndo: function() { - if (this._lastCommand === 'undo' || this._lastCommand === 'redo') { - return false; - } - if (!this._undoCache) { - this._undoCache = []; - this._undoLevel = 0; - } - this._checkUndo(); - var str = this.getEditorHTML(); - //var last = this._undoCache[this._undoCache.length - 1]; - var last = this._undoCache[this._undoLevel - 1]; - if (last) { - if (str !== last) { - this._putUndo(str); - } - } else { - this._putUndo(str); - } - this._undoNodeChange(); - }, - /** - * @property STR_BEFORE_EDITOR - * @description The accessibility string for the element before the iFrame - * @type String - */ - STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Control + Shift + T to place focus on the toolbar and navigate between option heading names.

              Common formatting keyboard shortcuts:

              • Control Shift B sets text to bold
              • Control Shift I sets text to italic
              • Control Shift U underlines text
              • Control Shift [ aligns text left
              • Control Shift | centers text
              • Control Shift ] aligns text right
              • Control Shift L adds an HTML link
              • To exit this text editor use the keyboard shortcut Control + Shift + ESC.
              ', - /** - * @property STR_CLOSE_WINDOW - * @description The Title of the close button in the Editor Window - * @type String - */ - STR_CLOSE_WINDOW: 'Close Window', - /** - * @property STR_CLOSE_WINDOW_NOTE - * @description A note appearing in the Editor Window to tell the user that the Escape key will close the window - * @type String - */ - STR_CLOSE_WINDOW_NOTE: 'To close this window use the Control + Shift + W key', - /** - * @property STR_IMAGE_PROP_TITLE - * @description The title for the Image Property Editor Window - * @type String - */ - STR_IMAGE_PROP_TITLE: 'Image Options', - /** - * @property STR_IMAGE_TITLE - * @description The label string for Image Description - * @type String - */ - STR_IMAGE_TITLE: 'Description', - /** - * @property STR_IMAGE_SIZE - * @description The label string for Image Size - * @type String - */ - STR_IMAGE_SIZE: 'Size', - /** - * @property STR_IMAGE_ORIG_SIZE - * @description The label string for Original Image Size - * @type String - */ - STR_IMAGE_ORIG_SIZE: 'Original Size', - /** - * @property STR_IMAGE_COPY - * @description The label string for the image copy and paste message for Opera and Safari - * @type String - */ - STR_IMAGE_COPY: 'Note:To move this image just highlight it, cut, and paste where ever you\'d like.', - /** - * @property STR_IMAGE_PADDING - * @description The label string for the image padding. - * @type String - */ - STR_IMAGE_PADDING: 'Padding', - /** - * @property STR_IMAGE_BORDER - * @description The label string for the image border. - * @type String - */ - STR_IMAGE_BORDER: 'Border', - /** - * @property STR_IMAGE_BORDER_SIZE - * @description The label string for the image border size. - * @type String - */ - STR_IMAGE_BORDER_SIZE: 'Border Size', - /** - * @property STR_IMAGE_BORDER_TYPE - * @description The label string for the image border type. - * @type String - */ - STR_IMAGE_BORDER_TYPE: 'Border Type', - /** - * @property STR_IMAGE_TEXTFLOW - * @description The label string for the image text flow. - * @type String - */ - STR_IMAGE_TEXTFLOW: 'Text Flow', - /** - * @property STR_LOCAL_FILE_WARNING - * @description The label string for the local file warning. - * @type String - */ - STR_LOCAL_FILE_WARNING: 'Note:This image/link points to a file on your computer and will not be accessible to others on the internet.', - /** - * @property STR_LINK_PROP_TITLE - * @description The label string for the Link Property Editor Window. - * @type String - */ - STR_LINK_PROP_TITLE: 'Link Options', - /** - * @property STR_LINK_PROP_REMOVE - * @description The label string for the Remove link from text link inside the property editor. - * @type String - */ - STR_LINK_PROP_REMOVE: 'Remove link from text', - /** - * @property STR_LINK_NEW_WINDOW - * @description The string for the open in a new window label. - * @type String - */ - STR_LINK_NEW_WINDOW: 'Open in a new window.', - /** - * @property STR_LINK_TITLE - * @description The string for the link description. - * @type String - */ - STR_LINK_TITLE: 'Description', - /** - * @property STR_NONE - * @description The string for the word none. - * @type String - */ - STR_NONE: 'none', - /** - * @protected - * @property CLASS_LOCAL_FILE - * @description CSS class applied to an element when it's found to have a local url. - * @type String - */ - CLASS_LOCAL_FILE: 'warning-localfile', - /** - * @protected - * @property CLASS_HIDDEN - * @description CSS class applied to the body when the hiddenelements button is pressed. - * @type String - */ - CLASS_HIDDEN: 'yui-hidden', - /** - * @method init - * @description The Editor class' initialization method - */ - init: function(p_oElement, p_oAttributes) { - - this._windows = {}; - if (!this._defaultToolbar) { - this._defaultToolbar = { - collapse: true, - titlebar: 'Text Editing Tools', - draggable: false, - buttonType: 'advanced', - buttons: [ - { group: 'fontstyle', label: 'Font Name and Size', - buttons: [ - { type: 'select', label: 'Arial', value: 'fontname', disabled: true, - menu: [ - { text: 'Arial', checked: true }, - { text: 'Arial Black' }, - { text: 'Comic Sans MS' }, - { text: 'Courier New' }, - { text: 'Lucida Console' }, - { text: 'Tahoma' }, - { text: 'Times New Roman' }, - { text: 'Trebuchet MS' }, - { text: 'Verdana' } - ] - }, - { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true } - ] - }, - { type: 'separator' }, - { group: 'textstyle', label: 'Font Style', - buttons: [ - { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' }, - { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' }, - { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' }, - { type: 'separator' }, - { type: 'push', label: 'Subscript', value: 'subscript', disabled: true }, - { type: 'push', label: 'Superscript', value: 'superscript', disabled: true } - ] - }, - { type: 'separator' }, - { group: 'textstyle2', label: ' ', - buttons: [ - { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true }, - { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true }, - { type: 'separator' }, - { type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true }, - { type: 'push', label: 'Show/Hide Hidden Elements', value: 'hiddenelements' } - ] - }, - { type: 'separator' }, - { group: 'undoredo', label: 'Undo/Redo', - buttons: [ - { type: 'push', label: 'Undo', value: 'undo', disabled: true }, - { type: 'push', label: 'Redo', value: 'redo', disabled: true } - - ] - }, - { type: 'separator' }, - { group: 'alignment', label: 'Alignment', - buttons: [ - { type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' }, - { type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' }, - { type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' }, - { type: 'push', label: 'Justify', value: 'justifyfull' } - ] - }, - { type: 'separator' }, - { group: 'parastyle', label: 'Paragraph Style', - buttons: [ - { type: 'select', label: 'Normal', value: 'heading', disabled: true, - menu: [ - { text: 'Normal', value: 'none', checked: true }, - { text: 'Header 1', value: 'h1' }, - { text: 'Header 2', value: 'h2' }, - { text: 'Header 3', value: 'h3' }, - { text: 'Header 4', value: 'h4' }, - { text: 'Header 5', value: 'h5' }, - { text: 'Header 6', value: 'h6' } - ] - } - ] - }, - { type: 'separator' }, - - { group: 'indentlist2', label: 'Indenting and Lists', - buttons: [ - { type: 'push', label: 'Indent', value: 'indent', disabled: true }, - { type: 'push', label: 'Outdent', value: 'outdent', disabled: true }, - { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' }, - { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' } - ] - }, - { type: 'separator' }, - { group: 'insertitem', label: 'Insert Item', - buttons: [ - { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true }, - { type: 'push', label: 'Insert Image', value: 'insertimage' } - ] - } - ] - }; - } - - if (!this._defaultImageToolbarConfig) { - this._defaultImageToolbarConfig = { - buttonType: this._defaultToolbar.buttonType, - buttons: [ - { group: 'textflow', label: this.STR_IMAGE_TEXTFLOW + ':', - buttons: [ - { type: 'push', label: 'Left', value: 'left' }, - { type: 'push', label: 'Inline', value: 'inline' }, - { type: 'push', label: 'Block', value: 'block' }, - { type: 'push', label: 'Right', value: 'right' } - ] - }, - { type: 'separator' }, - { group: 'padding', label: this.STR_IMAGE_PADDING + ':', - buttons: [ - { type: 'spin', label: '0', value: 'padding', range: [0, 50] } - ] - }, - { type: 'separator' }, - { group: 'border', label: this.STR_IMAGE_BORDER + ':', - buttons: [ - { type: 'select', label: this.STR_IMAGE_BORDER_SIZE, value: 'bordersize', - menu: [ - { text: 'none', value: '0', checked: true }, - { text: '1px', value: '1' }, - { text: '2px', value: '2' }, - { text: '3px', value: '3' }, - { text: '4px', value: '4' }, - { text: '5px', value: '5' } - ] - }, - { type: 'select', label: this.STR_IMAGE_BORDER_TYPE, value: 'bordertype', disabled: true, - menu: [ - { text: 'Solid', value: 'solid', checked: true }, - { text: 'Dashed', value: 'dashed' }, - { text: 'Dotted', value: 'dotted' } - ] - }, - { type: 'color', label: 'Border Color', value: 'bordercolor', disabled: true } - ] - } - ] - }; - } - - YAHOO.widget.Editor.superclass.init.call(this, p_oElement, p_oAttributes); - }, - _render: function() { - YAHOO.widget.Editor.superclass._render.apply(this, arguments); - var self = this; - //Render the panel in another thread and delay it a little.. - window.setTimeout(function() { - self._renderPanel.call(self); - }, 800); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the editor. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the editor. - */ - initAttributes: function(attr) { - YAHOO.widget.Editor.superclass.initAttributes.call(this, attr); - - /** - * @attribute localFileWarning - * @description Should we throw the warning if we detect a file that is local to their machine? - * @default true - * @type Boolean - */ - this.setAttributeConfig('localFileWarning', { - value: attr.locaFileWarning || true - }); - - /** - * @attribute hiddencss - * @description The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in this.CLASS_HIDDEN - * @default
              -            .yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u,
              -            .yui-hidden div, .yui-hidden p, .yui-hidden span, .yui-hidden img, .yui-hidden ul, .yui-hidden ol,
              -            .yui-hidden li, .yui-hidden table {
              -                border: 1px dotted #ccc;
              -            }
              -            .yui-hidden .yui-non {
              -                border: none;
              -            }
              -            .yui-hidden img {
              -                padding: 2px;
              -            }
              - * @type String - */ - this.setAttributeConfig('hiddencss', { - value: attr.hiddencss || '.yui-hidden font, .yui-hidden strong, .yui-hidden b, .yui-hidden em, .yui-hidden i, .yui-hidden u, .yui-hidden div,.yui-hidden p,.yui-hidden span,.yui-hidden img, .yui-hidden ul, .yui-hidden ol, .yui-hidden li, .yui-hidden table { border: 1px dotted #ccc; } .yui-hidden .yui-non { border: none; } .yui-hidden img { padding: 2px; }', - writeOnce: true - }); - - }, - /** - * @private - * @method _windows - * @description A reference to the HTML elements used for the body of Editor Windows. - */ - _windows: null, - /** - * @private - * @method _defaultImageToolbar - * @description A reference to the Toolbar Object inside Image Editor Window. - */ - _defaultImageToolbar: null, - /** - * @private - * @method _defaultImageToolbarConfig - * @description Config to be used for the default Image Editor Window. - */ - _defaultImageToolbarConfig: null, - /** - * @private - * @method _fixNodes - * @description Fix href and imgs as well as remove invalid HTML. - */ - _fixNodes: function() { - YAHOO.widget.Editor.superclass._fixNodes.call(this); - try { - var url = ''; - - var imgs = this._getDoc().getElementsByTagName('img'); - for (var im = 0; im < imgs.length; im++) { - if (imgs[im].getAttribute('href', 2)) { - url = imgs[im].getAttribute('src', 2); - if (this._isLocalFile(url)) { - Dom.addClass(imgs[im], this.CLASS_LOCAL_FILE); - } else { - Dom.removeClass(imgs[im], this.CLASS_LOCAL_FILE); - } - } - } - var fakeAs = this._getDoc().body.getElementsByTagName('a'); - for (var a = 0; a < fakeAs.length; a++) { - if (fakeAs[a].getAttribute('href', 2)) { - url = fakeAs[a].getAttribute('href', 2); - if (this._isLocalFile(url)) { - Dom.addClass(fakeAs[a], this.CLASS_LOCAL_FILE); - } else { - Dom.removeClass(fakeAs[a], this.CLASS_LOCAL_FILE); - } - } - } - } catch(e) {} - }, - /** - * @private - * @property _disabled - * @description The Toolbar items that should be disabled if there is no selection present in the editor. - * @type Array - */ - _disabled: [ 'createlink', 'forecolor', 'backcolor', 'fontname', 'fontsize', 'superscript', 'subscript', 'removeformat', 'heading', 'indent' ], - /** - * @private - * @property _alwaysDisabled - * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor. - * @type Object - */ - _alwaysDisabled: { 'outdent': true }, - /** - * @private - * @property _alwaysEnabled - * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor. - * @type Object - */ - _alwaysEnabled: { hiddenelements: true }, - /** - * @private - * @method _handleKeyDown - * @param {Event} ev The event we are working on. - * @description Override method that handles some new keydown events inside the iFrame document. - */ - _handleKeyDown: function(ev) { - YAHOO.widget.Editor.superclass._handleKeyDown.call(this, ev); - var doExec = false, - action = null, - exec = false; - - switch (ev.keyCode) { - //case 219: //Left - case this._keyMap.JUSTIFY_LEFT.key: //Left - if (this._checkKey(this._keyMap.JUSTIFY_LEFT, ev)) { - action = 'justifyleft'; - doExec = true; - } - break; - //case 220: //Center - case this._keyMap.JUSTIFY_CENTER.key: - if (this._checkKey(this._keyMap.JUSTIFY_CENTER, ev)) { - action = 'justifycenter'; - doExec = true; - } - break; - case 221: //Right - case this._keyMap.JUSTIFY_RIGHT.key: - if (this._checkKey(this._keyMap.JUSTIFY_RIGHT, ev)) { - action = 'justifyright'; - doExec = true; - } - break; - } - if (doExec && action) { - this.execCommand(action, null); - Event.stopEvent(ev); - this.nodeChange(); - } - }, - /** - * @private - * @method _renderCreateLinkWindow - * @description Pre renders the CreateLink window so we get faster window opening. - */ - _renderCreateLinkWindow: function() { - var str = ''; - str += ''; - str += ''; - - var body = document.createElement('div'); - body.innerHTML = str; - - var unlinkCont = document.createElement('div'); - unlinkCont.className = 'removeLink'; - var unlink = document.createElement('a'); - unlink.href = '#'; - unlink.innerHTML = this.STR_LINK_PROP_REMOVE; - unlink.title = this.STR_LINK_PROP_REMOVE; - Event.on(unlink, 'click', function(ev) { - Event.stopEvent(ev); - this.unsubscribeAll('afterExecCommand'); - this.execCommand('unlink'); - this.closeWindow(); - }, this, true); - unlinkCont.appendChild(unlink); - body.appendChild(unlinkCont); - - this._windows.createlink = {}; - this._windows.createlink.body = body; - //body.style.display = 'none'; - Event.on(body, 'keyup', function(e) { - Event.stopPropagation(e); - }); - this.get('panel').editor_form.appendChild(body); - this.fireEvent('windowCreateLinkRender', { type: 'windowCreateLinkRender', panel: this.get('panel'), body: body }); - return body; - }, - _handleCreateLinkClick: function() { - var el = this._getSelectedElement(); - if (this._isElement(el, 'img')) { - this.STOP_EXEC_COMMAND = true; - this.currentElement[0] = el; - this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - return false; - } - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - return false; - } - } - - this.on('afterExecCommand', function() { - var win = new YAHOO.widget.EditorWindow('createlink', { - width: '350px' - }); - - var el = this.currentElement[0], - url = '', - title = '', - target = '', - localFile = false; - if (el) { - win.el = el; - if (el.getAttribute('href', 2) !== null) { - url = el.getAttribute('href', 2); - if (this._isLocalFile(url)) { - //Local File throw Warning - win.setFooter(this.STR_LOCAL_FILE_WARNING); - localFile = true; - } else { - win.setFooter(' '); - } - } - if (el.getAttribute('title') !== null) { - title = el.getAttribute('title'); - } - if (el.getAttribute('target') !== null) { - target = el.getAttribute('target'); - } - } - var body = null; - if (this._windows.createlink && this._windows.createlink.body) { - body = this._windows.createlink.body; - } else { - body = this._renderCreateLinkWindow(); - } - - win.setHeader(this.STR_LINK_PROP_TITLE); - win.setBody(body); - - Event.purgeElement(this.get('id') + '_createlink_url'); - - Dom.get(this.get('id') + '_createlink_url').value = url; - Dom.get(this.get('id') + '_createlink_title').value = title; - Dom.get(this.get('id') + '_createlink_target').checked = ((target) ? true : false); - - - Event.onAvailable(this.get('id') + '_createlink_url', function() { - var id = this.get('id'); - window.setTimeout(function() { - try { - YAHOO.util.Dom.get(id + '_createlink_url').focus(); - } catch (e) {} - }, 50); - - if (this._isLocalFile(url)) { - //Local File throw Warning - Dom.addClass(this.get('id') + '_createlink_url', 'warning'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else { - Dom.removeClass(this.get('id') + '_createlink_url', 'warning'); - this.get('panel').setFooter(' '); - } - Event.on(this.get('id') + '_createlink_url', 'blur', function() { - var url = Dom.get(this.get('id') + '_createlink_url'); - if (this._isLocalFile(url.value)) { - //Local File throw Warning - Dom.addClass(url, 'warning'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else { - Dom.removeClass(url, 'warning'); - this.get('panel').setFooter(' '); - } - }, this, true); - }, this, true); - - this.openWindow(win); - - }); - }, - /** - * @private - * @method _handleCreateLinkWindowClose - * @description Handles the closing of the Link Properties Window. - */ - _handleCreateLinkWindowClose: function() { - - var url = Dom.get(this.get('id') + '_createlink_url'), - target = Dom.get(this.get('id') + '_createlink_target'), - title = Dom.get(this.get('id') + '_createlink_title'), - el = arguments[0].win.el, - a = el; - - if (url && url.value) { - var urlValue = url.value; - if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - //Found an @ sign, prefix with mailto: - urlValue = 'mailto:' + urlValue; - } else { - // :// not found adding - if (urlValue.substring(0, 1) != '#') { - urlValue = 'http:/'+'/' + urlValue; - } - - } - } - el.setAttribute('href', urlValue); - if (target.checked) { - el.setAttribute('target', target.value); - } else { - el.setAttribute('target', ''); - } - el.setAttribute('title', ((title.value) ? title.value : '')); - - } else { - var _span = this._getDoc().createElement('span'); - _span.innerHTML = el.innerHTML; - Dom.addClass(_span, 'yui-non'); - el.parentNode.replaceChild(_span, el); - } - Dom.removeClass(url, 'warning'); - Dom.get(this.get('id') + '_createlink_url').value = ''; - Dom.get(this.get('id') + '_createlink_title').value = ''; - Dom.get(this.get('id') + '_createlink_target').checked = false; - this.nodeChange(); - this.currentElement = []; - - }, - /** - * @private - * @method _renderInsertImageWindow - * @description Pre renders the InsertImage window so we get faster window opening. - */ - _renderInsertImageWindow: function() { - var el = this.currentElement[0]; - var str = ''; - var body = document.createElement('div'); - body.innerHTML = str; - - var tbarCont = document.createElement('div'); - tbarCont.id = this.get('id') + '_img_toolbar'; - body.appendChild(tbarCont); - - var str2 = ''; - str2 += ''; - str2 += ''; - var div = document.createElement('div'); - div.innerHTML = str2; - body.appendChild(div); - - var o = {}; - Lang.augmentObject(o, this._defaultImageToolbarConfig); //Break the config reference - - var tbar = new YAHOO.widget.Toolbar(tbarCont, o); - tbar.editor_el = el; - this._defaultImageToolbar = tbar; - - var cont = tbar.get('cont'); - var hw = document.createElement('div'); - hw.className = 'yui-toolbar-group yui-toolbar-group-height-width height-width'; - hw.innerHTML = '

              ' + this.STR_IMAGE_SIZE + ':

              '; - hw.innerHTML += ' x '; - cont.insertBefore(hw, cont.firstChild); - - Event.onAvailable(this.get('id') + '_insertimage_width', function() { - Event.on(this.get('id') + '_insertimage_width', 'blur', function() { - var value = parseInt(Dom.get(this.get('id') + '_insertimage_width').value, 10); - if (value > 5) { - this._defaultImageToolbar.editor_el.style.width = value + 'px'; - //Removed moveWindow call so the window doesn't jump - //this.moveWindow(); - } - }, this, true); - }, this, true); - Event.onAvailable(this.get('id') + '_insertimage_height', function() { - Event.on(this.get('id') + '_insertimage_height', 'blur', function() { - var value = parseInt(Dom.get(this.get('id') + '_insertimage_height').value, 10); - if (value > 5) { - this._defaultImageToolbar.editor_el.style.height = value + 'px'; - //Removed moveWindow call so the window doesn't jump - //this.moveWindow(); - } - }, this, true); - }, this, true); - - - tbar.on('colorPickerClicked', function(o) { - var size = '1', type = 'solid', color = 'black', el = this._defaultImageToolbar.editor_el; - - if (el.style.borderLeftWidth) { - size = parseInt(el.style.borderLeftWidth, 10); - } - if (el.style.borderLeftStyle) { - type = el.style.borderLeftStyle; - } - if (el.style.borderLeftColor) { - color = el.style.borderLeftColor; - } - var borderString = size + 'px ' + type + ' #' + o.color; - el.style.border = borderString; - }, this, true); - - tbar.on('buttonClick', function(o) { - var value = o.button.value, - el = this._defaultImageToolbar.editor_el, - borderString = ''; - if (o.button.menucmd) { - value = o.button.menucmd; - } - var size = '1', type = 'solid', color = 'black'; - - /* All border calcs are done on the left border - since our default interface only supports - one border size/type and color */ - if (el.style.borderLeftWidth) { - size = parseInt(el.style.borderLeftWidth, 10); - } - if (el.style.borderLeftStyle) { - type = el.style.borderLeftStyle; - } - if (el.style.borderLeftColor) { - color = el.style.borderLeftColor; - } - switch(value) { - case 'bordersize': - if (this.browser.webkit && this._lastImage) { - Dom.removeClass(this._lastImage, 'selected'); - this._lastImage = null; - } - - borderString = parseInt(o.button.value, 10) + 'px ' + type + ' ' + color; - el.style.border = borderString; - if (parseInt(o.button.value, 10) > 0) { - tbar.enableButton('bordertype'); - tbar.enableButton('bordercolor'); - } else { - tbar.disableButton('bordertype'); - tbar.disableButton('bordercolor'); - } - break; - case 'bordertype': - if (this.browser.webkit && this._lastImage) { - Dom.removeClass(this._lastImage, 'selected'); - this._lastImage = null; - } - borderString = size + 'px ' + o.button.value + ' ' + color; - el.style.border = borderString; - break; - case 'right': - case 'left': - tbar.deselectAllButtons(); - el.style.display = ''; - el.align = o.button.value; - break; - case 'inline': - tbar.deselectAllButtons(); - el.style.display = ''; - el.align = ''; - break; - case 'block': - tbar.deselectAllButtons(); - el.style.display = 'block'; - el.align = 'center'; - break; - case 'padding': - var _button = tbar.getButtonById(o.button.id); - el.style.margin = _button.get('label') + 'px'; - break; - } - tbar.selectButton(o.button.value); - if (value !== 'padding') { - this.moveWindow(); - } - }, this, true); - - - - if (this.get('localFileWarning')) { - Event.on(this.get('id') + '_insertimage_link', 'blur', function() { - var url = Dom.get(this.get('id') + '_insertimage_link'); - if (this._isLocalFile(url.value)) { - //Local File throw Warning - Dom.addClass(url, 'warning'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else { - Dom.removeClass(url, 'warning'); - this.get('panel').setFooter(' '); - //Adobe AIR Code - if ((this.browser.webkit && !this.browser.webkit3 || this.browser.air) || this.browser.opera) { - this.get('panel').setFooter(this.STR_IMAGE_COPY); - } - } - }, this, true); - } - - Event.on(this.get('id') + '_insertimage_url', 'blur', function() { - var url = Dom.get(this.get('id') + '_insertimage_url'), - el = this.currentElement[0]; - - if (url.value && el) { - if (url.value == el.getAttribute('src', 2)) { - return false; - } - } - if (this._isLocalFile(url.value)) { - //Local File throw Warning - Dom.addClass(url, 'warning'); - this.get('panel').setFooter(this.STR_LOCAL_FILE_WARNING); - } else if (this.currentElement[0]) { - Dom.removeClass(url, 'warning'); - this.get('panel').setFooter(' '); - //Adobe AIR Code - if ((this.browser.webkit && !this.browser.webkit3 || this.browser.air) || this.browser.opera) { - this.get('panel').setFooter(this.STR_IMAGE_COPY); - } - - if (url && url.value && (url.value != this.STR_IMAGE_HERE)) { - this.currentElement[0].setAttribute('src', url.value); - var self = this, - img = new Image(); - - img.onerror = function() { - url.value = self.STR_IMAGE_HERE; - img.setAttribute('src', self.get('blankimage')); - self.currentElement[0].setAttribute('src', self.get('blankimage')); - YAHOO.util.Dom.get(self.get('id') + '_insertimage_height').value = img.height; - YAHOO.util.Dom.get(self.get('id') + '_insertimage_width').value = img.width; - }; - var id = this.get('id'); - window.setTimeout(function() { - YAHOO.util.Dom.get(id + '_insertimage_height').value = img.height; - YAHOO.util.Dom.get(id + '_insertimage_width').value = img.width; - if (self.currentElement && self.currentElement[0]) { - if (!self.currentElement[0]._height) { - self.currentElement[0]._height = img.height; - } - if (!self.currentElement[0]._width) { - self.currentElement[0]._width = img.width; - } - } - //Removed moveWindow call so the window doesn't jump - //self.moveWindow(); - }, 800); //Bumped the timeout up to account for larger images.. - - if (url.value != this.STR_IMAGE_HERE) { - img.src = url.value; - } - } - } - }, this, true); - - - - this._windows.insertimage = {}; - this._windows.insertimage.body = body; - //body.style.display = 'none'; - this.get('panel').editor_form.appendChild(body); - this.fireEvent('windowInsertImageRender', { type: 'windowInsertImageRender', panel: this.get('panel'), body: body, toolbar: tbar }); - return body; - }, - /** - * @private - * @method _handleInsertImageClick - * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked. - */ - _handleInsertImageClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('insertimage')) { - return false; - } - } - this.on('afterExecCommand', function() { - var el = this.currentElement[0], - body = null, - link = '', - target = '', - tbar = null, - title = '', - src = '', - align = '', - height = 75, - width = 75, - padding = 0, - oheight = 0, - owidth = 0, - blankimage = false, - win = new YAHOO.widget.EditorWindow('insertimage', { - width: '415px' - }); - - if (!el) { - el = this._getSelectedElement(); - } - if (el) { - win.el = el; - if (el.getAttribute('src')) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - src = this.STR_IMAGE_HERE; - blankimage = true; - } - } - if (el.getAttribute('alt', 2)) { - title = el.getAttribute('alt', 2); - } - if (el.getAttribute('title', 2)) { - title = el.getAttribute('title', 2); - } - - if (el.parentNode && this._isElement(el.parentNode, 'a')) { - link = el.parentNode.getAttribute('href', 2); - if (el.parentNode.getAttribute('target') !== null) { - target = el.parentNode.getAttribute('target'); - } - } - height = parseInt(el.height, 10); - width = parseInt(el.width, 10); - if (el.style.height) { - height = parseInt(el.style.height, 10); - } - if (el.style.width) { - width = parseInt(el.style.width, 10); - } - if (el.style.margin) { - padding = parseInt(el.style.margin, 10); - } - if (!blankimage) { - if (!el._height) { - el._height = height; - } - if (!el._width) { - el._width = width; - } - oheight = el._height; - owidth = el._width; - } - } - if (this._windows.insertimage && this._windows.insertimage.body) { - body = this._windows.insertimage.body; - this._defaultImageToolbar.resetAllButtons(); - } else { - body = this._renderInsertImageWindow(); - } - - tbar = this._defaultImageToolbar; - tbar.editor_el = el; - - - var bsize = '0', - btype = 'solid'; - - if (el.style.borderLeftWidth) { - bsize = parseInt(el.style.borderLeftWidth, 10); - } - if (el.style.borderLeftStyle) { - btype = el.style.borderLeftStyle; - } - var bs_button = tbar.getButtonByValue('bordersize'), - bSizeStr = ((parseInt(bsize, 10) > 0) ? '' : this.STR_NONE); - bs_button.set('label', '' + bSizeStr + ''); - this._updateMenuChecked('bordersize', bsize, tbar); - - var bt_button = tbar.getButtonByValue('bordertype'); - bt_button.set('label', 'asdfa'); - this._updateMenuChecked('bordertype', btype, tbar); - if (parseInt(bsize, 10) > 0) { - tbar.enableButton(bt_button); - tbar.enableButton(bs_button); - tbar.enableButton('bordercolor'); - } - - if ((el.align == 'right') || (el.align == 'left')) { - tbar.selectButton(el.align); - } else if (el.style.display == 'block') { - tbar.selectButton('block'); - } else { - tbar.selectButton('inline'); - } - if (parseInt(el.style.marginLeft, 10) > 0) { - tbar.getButtonByValue('padding').set('label', ''+parseInt(el.style.marginLeft, 10)); - } - if (el.style.borderSize) { - tbar.selectButton('bordersize'); - tbar.selectButton(parseInt(el.style.borderSize, 10)); - } - tbar.getButtonByValue('padding').set('label', ''+padding); - - - - win.setHeader(this.STR_IMAGE_PROP_TITLE); - win.setBody(body); - //Adobe AIR Code - if ((this.browser.webkit && !this.browser.webkit3 || this.browser.air) || this.browser.opera) { - win.setFooter(this.STR_IMAGE_COPY); - } - this.openWindow(win); - Dom.get(this.get('id') + '_insertimage_url').value = src; - Dom.get(this.get('id') + '_insertimage_title').value = title; - Dom.get(this.get('id') + '_insertimage_link').value = link; - Dom.get(this.get('id') + '_insertimage_target').checked = ((target) ? true : false); - Dom.get(this.get('id') + '_insertimage_width').value = width; - Dom.get(this.get('id') + '_insertimage_height').value = height; - - - if (((height != oheight) || (width != owidth)) && (!blankimage)) { - var s = document.createElement('span'); - s.className = 'info'; - s.innerHTML = this.STR_IMAGE_ORIG_SIZE + ': ('+ owidth +' x ' + oheight + ')'; - if (Dom.get(this.get('id') + '_insertimage_height').nextSibling) { - var old = Dom.get(this.get('id') + '_insertimage_height').nextSibling; - old.parentNode.removeChild(old); - } - Dom.get(this.get('id') + '_insertimage_height').parentNode.appendChild(s); - } - - this.toolbar.selectButton('insertimage'); - var id = this.get('id'); - window.setTimeout(function() { - try { - YAHOO.util.Dom.get(id + '_insertimage_url').focus(); - if (blankimage) { - YAHOO.util.Dom.get(id + '_insertimage_url').select(); - } - } catch (e) {} - }, 50); - - }); - }, - /** - * @private - * @method _handleInsertImageWindowClose - * @description Handles the closing of the Image Properties Window. - */ - _handleInsertImageWindowClose: function() { - var url = Dom.get(this.get('id') + '_insertimage_url'), - title = Dom.get(this.get('id') + '_insertimage_title'), - link = Dom.get(this.get('id') + '_insertimage_link'), - target = Dom.get(this.get('id') + '_insertimage_target'), - el = arguments[0].win.el; - - if (url && url.value && (url.value != this.STR_IMAGE_HERE)) { - el.setAttribute('src', url.value); - el.setAttribute('title', title.value); - el.setAttribute('alt', title.value); - var par = el.parentNode; - if (link.value) { - var urlValue = link.value; - if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - //Found an @ sign, prefix with mailto: - urlValue = 'mailto:' + urlValue; - } else { - // :// not found adding - urlValue = 'http:/'+'/' + urlValue; - } - } - if (par && this._isElement(par, 'a')) { - par.setAttribute('href', urlValue); - if (target.checked) { - par.setAttribute('target', target.value); - } else { - par.setAttribute('target', ''); - } - } else { - var _a = this._getDoc().createElement('a'); - _a.setAttribute('href', urlValue); - if (target.checked) { - _a.setAttribute('target', target.value); - } else { - _a.setAttribute('target', ''); - } - el.parentNode.replaceChild(_a, el); - _a.appendChild(el); - } - } else { - if (par && this._isElement(par, 'a')) { - par.parentNode.replaceChild(el, par); - } - } - } else { - //No url/src given, remove the node from the document - el.parentNode.removeChild(el); - } - Dom.get(this.get('id') + '_insertimage_url').value = ''; - Dom.get(this.get('id') + '_insertimage_title').value = ''; - Dom.get(this.get('id') + '_insertimage_link').value = ''; - Dom.get(this.get('id') + '_insertimage_target').checked = false; - Dom.get(this.get('id') + '_insertimage_width').value = 0; - Dom.get(this.get('id') + '_insertimage_height').value = 0; - this._defaultImageToolbar.resetAllButtons(); - this.currentElement = []; - this.nodeChange(); - }, - /** - * @property EDITOR_PANEL_ID - * @description HTML id to give the properties window in the DOM. - * @type String - */ - EDITOR_PANEL_ID: '-panel', - /** - * @private - * @method _renderPanel - * @description Renders the panel used for Editor Windows to the document so we can start using it.. - * @return {YAHOO.widget.Overlay} - */ - _renderPanel: function() { - var panelEl = document.createElement('div'); - Dom.addClass(panelEl, 'yui-editor-panel'); - panelEl.id = this.get('id') + this.EDITOR_PANEL_ID; - panelEl.style.position = 'absolute'; - panelEl.style.top = '-9999px'; - panelEl.style.left = '-9999px'; - document.body.appendChild(panelEl); - this.get('element_cont').insertBefore(panelEl, this.get('element_cont').get('firstChild')); - - - - var panel = new YAHOO.widget.Overlay(this.get('id') + this.EDITOR_PANEL_ID, { - width: '300px', - iframe: true, - visible: false, - underlay: 'none', - draggable: false, - close: false - }); - this.set('panel', panel); - - panel.setBody('---'); - panel.setHeader(' '); - panel.setFooter(' '); - - - var body = document.createElement('div'); - body.className = this.CLASS_PREFIX + '-body-cont'; - for (var b in this.browser) { - if (this.browser[b]) { - Dom.addClass(body, b); - break; - } - } - Dom.addClass(body, ((YAHOO.widget.Button && (this._defaultToolbar.buttonType == 'advanced')) ? 'good-button' : 'no-button')); - - var _note = document.createElement('h3'); - _note.className = 'yui-editor-skipheader'; - _note.innerHTML = this.STR_CLOSE_WINDOW_NOTE; - body.appendChild(_note); - var form = document.createElement('fieldset'); - panel.editor_form = form; - - body.appendChild(form); - var _close = document.createElement('span'); - _close.innerHTML = 'X'; - _close.title = this.STR_CLOSE_WINDOW; - _close.className = 'close'; - - Event.on(_close, 'click', this.closeWindow, this, true); - - var _knob = document.createElement('span'); - _knob.innerHTML = '^'; - _knob.className = 'knob'; - panel.editor_knob = _knob; - - var _header = document.createElement('h3'); - panel.editor_header = _header; - _header.innerHTML = ''; - - panel.setHeader(' '); //Clear the current header - panel.appendToHeader(_header); - _header.appendChild(_close); - _header.appendChild(_knob); - panel.setBody(' '); //Clear the current body - panel.setFooter(' '); //Clear the current footer - panel.appendToBody(body); //Append the new DOM node to it - - Event.on(panel.element, 'click', function(ev) { - Event.stopPropagation(ev); - }); - - var fireShowEvent = function() { - panel.bringToTop(); - YAHOO.util.Dom.setStyle(this.element, 'display', 'block'); - this._handleWindowInputs(false); - }; - panel.showEvent.subscribe(fireShowEvent, this, true); - panel.hideEvent.subscribe(function() { - this._handleWindowInputs(true); - }, this, true); - panel.renderEvent.subscribe(function() { - this._renderInsertImageWindow(); - this._renderCreateLinkWindow(); - this.fireEvent('windowRender', { type: 'windowRender', panel: panel }); - this._handleWindowInputs(true); - }, this, true); - - if (this.DOMReady) { - this.get('panel').render(); - } else { - Event.onDOMReady(function() { - this.get('panel').render(); - }, this, true); - } - return this.get('panel'); - }, - /** - * @method _handleWindowInputs - * @param {Boolean} disable The state to set all inputs in all Editor windows to. Defaults to: false. - * @description Disables/Enables all fields inside Editor windows. Used in show/hide events to keep window fields from submitting when the parent form is submitted. - */ - _handleWindowInputs: function(disable) { - if (!Lang.isBoolean(disable)) { - disable = false; - } - var inputs = this.get('panel').element.getElementsByTagName('input'); - for (var i = 0; i < inputs.length; i++) { - try { - inputs[i].disabled = disable; - } catch (e) {} - } - }, - /** - * @method openWindow - * @param {YAHOO.widget.EditorWindow} win A YAHOO.widget.EditorWindow instance - * @description Opens a new "window/panel" - */ - openWindow: function(win) { - - var self = this; - window.setTimeout(function() { - self.toolbar.set('disabled', true); //Disable the toolbar when an editor window is open.. - }, 10); - Event.on(document, 'keydown', this._closeWindow, this, true); - - if (this.currentWindow) { - this.closeWindow(); - } - - var xy = Dom.getXY(this.currentElement[0]), - elXY = Dom.getXY(this.get('iframe').get('element')), - panel = this.get('panel'), - newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)], - wWidth = (parseInt(win.attrs.width, 10) / 2), - align = 'center', - body = null; - - this.fireEvent('beforeOpenWindow', { type: 'beforeOpenWindow', win: win, panel: panel }); - - var form = panel.editor_form; - - var wins = this._windows; - for (var b in wins) { - if (Lang.hasOwnProperty(wins, b)) { - if (wins[b] && wins[b].body) { - if (b == win.name) { - Dom.setStyle(wins[b].body, 'display', 'block'); - } else { - Dom.setStyle(wins[b].body, 'display', 'none'); - } - } - } - } - - if (this._windows[win.name].body) { - Dom.setStyle(this._windows[win.name].body, 'display', 'block'); - form.appendChild(this._windows[win.name].body); - } else { - if (Lang.isObject(win.body)) { //Assume it's a reference - form.appendChild(win.body); - } else { //Assume it's a string - var _tmp = document.createElement('div'); - _tmp.innerHTML = win.body; - form.appendChild(_tmp); - } - } - panel.editor_header.firstChild.innerHTML = win.header; - if (win.footer !== null) { - panel.setFooter(win.footer); - } - panel.cfg.setProperty('width', win.attrs.width); - - this.currentWindow = win; - this.moveWindow(true); - panel.show(); - this.fireEvent('afterOpenWindow', { type: 'afterOpenWindow', win: win, panel: panel }); - }, - /** - * @method moveWindow - * @param {Boolean} force Boolean to tell it to move but not use any animation (Usually done the first time the window is loaded.) - * @description Realign the window with the currentElement and reposition the knob above the panel. - */ - moveWindow: function(force) { - if (!this.currentWindow) { - return false; - } - var win = this.currentWindow, - xy = Dom.getXY(this.currentElement[0]), - elXY = Dom.getXY(this.get('iframe').get('element')), - panel = this.get('panel'), - //newXY = [(xy[0] + elXY[0] - 20), (xy[1] + elXY[1] + 10)], - newXY = [(xy[0] + elXY[0]), (xy[1] + elXY[1])], - wWidth = (parseInt(win.attrs.width, 10) / 2), - align = 'center', - orgXY = panel.cfg.getProperty('xy') || [0,0], - _knob = panel.editor_knob, - xDiff = 0, - yDiff = 0, - anim = false; - - - newXY[0] = ((newXY[0] - wWidth) + 20); - //Account for the Scroll bars in a scrolled editor window. - newXY[0] = newXY[0] - Dom.getDocumentScrollLeft(this._getDoc()); - newXY[1] = newXY[1] - Dom.getDocumentScrollTop(this._getDoc()); - - if (this._isElement(this.currentElement[0], 'img')) { - if (this.currentElement[0].src.indexOf(this.get('blankimage')) != -1) { - newXY[0] = (newXY[0] + (75 / 2)); //Placeholder size - newXY[1] = (newXY[1] + 75); //Placeholder sizea - } else { - var w = parseInt(this.currentElement[0].width, 10); - var h = parseInt(this.currentElement[0].height, 10); - newXY[0] = (newXY[0] + (w / 2)); - newXY[1] = (newXY[1] + h); - } - newXY[1] = newXY[1] + 15; - } else { - var fs = Dom.getStyle(this.currentElement[0], 'fontSize'); - if (fs && fs.indexOf && fs.indexOf('px') != -1) { - newXY[1] = newXY[1] + parseInt(Dom.getStyle(this.currentElement[0], 'fontSize'), 10) + 5; - } else { - newXY[1] = newXY[1] + 20; - } - } - if (newXY[0] < elXY[0]) { - newXY[0] = elXY[0] + 5; - align = 'left'; - } - - if ((newXY[0] + (wWidth * 2)) > (elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10))) { - newXY[0] = ((elXY[0] + parseInt(this.get('iframe').get('element').clientWidth, 10)) - (wWidth * 2) - 5); - align = 'right'; - } - - try { - xDiff = (newXY[0] - orgXY[0]); - yDiff = (newXY[1] - orgXY[1]); - } catch (e) {} - - - var iTop = elXY[1] + parseInt(this.get('height'), 10); - var iLeft = elXY[0] + parseInt(this.get('width'), 10); - if (newXY[1] > iTop) { - newXY[1] = iTop; - } - if (newXY[0] > iLeft) { - newXY[0] = (iLeft / 2); - } - - //Convert negative numbers to positive so we can get the difference in distance - xDiff = ((xDiff < 0) ? (xDiff * -1) : xDiff); - yDiff = ((yDiff < 0) ? (yDiff * -1) : yDiff); - - if (((xDiff > 10) || (yDiff > 10)) || force) { //Only move the window if it's supposed to move more than 10px or force was passed (new window) - var _knobLeft = 0, - elW = 0; - - if (this.currentElement[0].width) { - elW = (parseInt(this.currentElement[0].width, 10) / 2); - } - - var leftOffset = xy[0] + elXY[0] + elW; - _knobLeft = leftOffset - newXY[0]; - //Check to see if the knob will go off either side & reposition it - if (_knobLeft > (parseInt(win.attrs.width, 10) - 1)) { - _knobLeft = ((parseInt(win.attrs.width, 10) - 30) - 1); - } else if (_knobLeft < 40) { - _knobLeft = 1; - } - if (isNaN(_knobLeft)) { - _knobLeft = 1; - } - if (force) { - if (_knob) { - _knob.style.left = _knobLeft + 'px'; - } - //Removed Animation from a forced move.. - panel.cfg.setProperty('xy', newXY); - } else { - if (this.get('animate')) { - anim = new YAHOO.util.Anim(panel.element, {}, 0.5, YAHOO.util.Easing.easeOut); - anim.attributes = { - top: { - to: newXY[1] - }, - left: { - to: newXY[0] - } - }; - anim.onComplete.subscribe(function() { - panel.cfg.setProperty('xy', newXY); - }); - //We have to animate the iframe shim at the same time as the panel or we get scrollbar bleed .. - var iframeAnim = new YAHOO.util.Anim(panel.iframe, anim.attributes, 0.5, YAHOO.util.Easing.easeOut); - - var _knobAnim = new YAHOO.util.Anim(_knob, { - left: { - to: _knobLeft - } - }, 0.6, YAHOO.util.Easing.easeOut); - anim.animate(); - iframeAnim.animate(); - _knobAnim.animate(); - } else { - _knob.style.left = _knobLeft + 'px'; - panel.cfg.setProperty('xy', newXY); - } - } - } - }, - /** - * @private - * @method _closeWindow - * @description Close the currently open EditorWindow with the Escape key. - * @param {Event} ev The keypress Event that we are trapping - */ - _closeWindow: function(ev) { - //if ((ev.charCode == 87) && ev.shiftKey && ev.ctrlKey) { - if (this._checkKey(this._keyMap.CLOSE_WINDOW, ev)) { - if (this.currentWindow) { - this.closeWindow(); - } - } - }, - /** - * @method closeWindow - * @description Close the currently open EditorWindow. - */ - closeWindow: function(keepOpen) { - this.fireEvent('window' + this.currentWindow.name + 'Close', { type: 'window' + this.currentWindow.name + 'Close', win: this.currentWindow, el: this.currentElement[0] }); - this.fireEvent('closeWindow', { type: 'closeWindow', win: this.currentWindow }); - this.currentWindow = null; - this.get('panel').hide(); - this.get('panel').cfg.setProperty('xy', [-900,-900]); - this.get('panel').syncIframe(); //Needed to move the iframe with the hidden panel - this.unsubscribeAll('afterExecCommand'); - this.toolbar.set('disabled', false); //enable the toolbar now that the window is closed - this.toolbar.resetAllButtons(); - this.focus(); - Event.removeListener(document, 'keydown', this._closeWindow); - }, - - /* {{{ Command Overrides - These commands are only over written when we are using the advanced version */ - - /** - * @method cmd_undo - * @description Pulls an item from the Undo stack and updates the Editor - * @param value Value passed from the execCommand method - */ - cmd_undo: function(value) { - if (this._hasUndoLevel()) { - var c_html = this.getEditorHTML(), html; - if (!this._undoLevel) { - this._undoLevel = this._undoCache.length; - } - this._undoLevel = (this._undoLevel - 1); - if (this._undoCache[this._undoLevel]) { - html = this._getUndo(this._undoLevel); - if (html != c_html) { - this.setEditorHTML(html); - } else { - this._undoLevel = (this._undoLevel - 1); - html = this._getUndo(this._undoLevel); - if (html != c_html) { - this.setEditorHTML(html); - } - } - } else { - this._undoLevel = 0; - this.toolbar.disableButton('undo'); - } - } - return [false]; - }, - - /** - * @method cmd_redo - * @description Pulls an item from the Undo stack and updates the Editor - * @param value Value passed from the execCommand method - */ - cmd_redo: function(value) { - this._undoLevel = this._undoLevel + 1; - if (this._undoLevel >= this._undoCache.length) { - this._undoLevel = this._undoCache.length; - } - if (this._undoCache[this._undoLevel]) { - var html = this._getUndo(this._undoLevel); - this.setEditorHTML(html); - } else { - this.toolbar.disableButton('redo'); - } - return [false]; - }, - - /** - * @method cmd_heading - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('heading') is used. - */ - cmd_heading: function(value) { - var exec = true, - el = null, - action = 'heading', - _sel = this._getSelection(), - _selEl = this._getSelectedElement(); - - if (_selEl) { - _sel = _selEl; - } - - if (this.browser.ie) { - action = 'formatblock'; - } - if (value == this.STR_NONE) { - if ((_sel && _sel.tagName && (_sel.tagName.toLowerCase().substring(0,1) == 'h')) || (_sel && _sel.parentNode && _sel.parentNode.tagName && (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h'))) { - if (_sel.parentNode.tagName.toLowerCase().substring(0,1) == 'h') { - _sel = _sel.parentNode; - } - if (this._isElement(_sel, 'html')) { - return [false]; - } - el = this._swapEl(_selEl, 'span', function(el) { - el.className = 'yui-non'; - }); - this._selectNode(el); - this.currentElement[0] = el; - } - exec = false; - } else { - if (this._isElement(_selEl, 'h1') || this._isElement(_selEl, 'h2') || this._isElement(_selEl, 'h3') || this._isElement(_selEl, 'h4') || this._isElement(_selEl, 'h5') || this._isElement(_selEl, 'h6')) { - el = this._swapEl(_selEl, value); - this._selectNode(el); - this.currentElement[0] = el; - } else { - this._createCurrentElement(value); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - return [exec, action]; - }, - /** - * @method cmd_hiddenelements - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('hiddenelements') is used. - */ - cmd_hiddenelements: function(value) { - if (this._showingHiddenElements) { - //Don't auto highlight the hidden button - this._lastButton = null; - this._showingHiddenElements = false; - this.toolbar.deselectButton('hiddenelements'); - Dom.removeClass(this._getDoc().body, this.CLASS_HIDDEN); - } else { - this._showingHiddenElements = true; - Dom.addClass(this._getDoc().body, this.CLASS_HIDDEN); - this.toolbar.selectButton('hiddenelements'); - } - return [false]; - }, - /** - * @method cmd_removeformat - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('removeformat') is used. - */ - cmd_removeformat: function(value) { - var exec = true; - /* - * @knownissue Remove Format issue - * @browser Safari 2.x - * @description There is an issue here with Safari, that it may not always remove the format of the item that is selected. - * Due to the way that Safari 2.x handles ranges, it is very difficult to determine what the selection holds. - * So here we are making the best possible guess and acting on it. - */ - if (this.browser.webkit && !this._getDoc().queryCommandEnabled('removeformat')) { - var _txt = this._getSelection()+''; - this._createCurrentElement('span'); - this.currentElement[0].className = 'yui-non'; - this.currentElement[0].innerHTML = _txt; - for (var i = 1; i < this.currentElement.length; i++) { - this.currentElement[i].parentNode.removeChild(this.currentElement[i]); - } - - exec = false; - } - return [exec]; - }, - /** - * @method cmd_script - * @param action action passed from the execCommand method - * @param value Value passed from the execCommand method - * @description This is a combined execCommand override method. It is called from the cmd_superscript and cmd_subscript methods. - */ - cmd_script: function(action, value) { - var exec = true, tag = action.toLowerCase().substring(0, 3), - _span = null, _selEl = this._getSelectedElement(); - - if (this.browser.webkit) { - if (this._isElement(_selEl, tag)) { - _span = this._swapEl(this.currentElement[0], 'span', function(el) { - el.className = 'yui-non'; - }); - this._selectNode(_span); - } else { - this._createCurrentElement(tag); - var _sub = this._swapEl(this.currentElement[0], tag); - this._selectNode(_sub); - this.currentElement[0] = _sub; - } - exec = false; - } - return exec; - }, - /** - * @method cmd_superscript - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('superscript') is used. - */ - cmd_superscript: function(value) { - return [this.cmd_script('superscript', value)]; - }, - /** - * @method cmd_subscript - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('subscript') is used. - */ - cmd_subscript: function(value) { - return [this.cmd_script('subscript', value)]; - }, - /** - * @method cmd_indent - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('indent') is used. - */ - cmd_indent: function(value) { - var exec = true, selEl = this._getSelectedElement(), _bq = null; - - //if (this.browser.webkit || this.browser.ie || this.browser.gecko) { - //if (this.browser.webkit || this.browser.ie) { - if (this.browser.ie) { - if (this._isElement(selEl, 'blockquote')) { - _bq = this._getDoc().createElement('blockquote'); - _bq.innerHTML = selEl.innerHTML; - selEl.innerHTML = ''; - selEl.appendChild(_bq); - this._selectNode(_bq); - } else { - _bq = this._getDoc().createElement('blockquote'); - var html = this._getRange().htmlText; - _bq.innerHTML = html; - this._createCurrentElement('blockquote'); - /* - for (var i = 0; i < this.currentElement.length; i++) { - _bq = this._getDoc().createElement('blockquote'); - _bq.innerHTML = this.currentElement[i].innerHTML; - this.currentElement[i].parentNode.replaceChild(_bq, this.currentElement[i]); - this.currentElement[i] = _bq; - } - */ - this.currentElement[0].parentNode.replaceChild(_bq, this.currentElement[0]); - this.currentElement[0] = _bq; - this._selectNode(this.currentElement[0]); - } - exec = false; - } else { - value = 'blockquote'; - } - return [exec, 'formatblock', value]; - }, - /** - * @method cmd_outdent - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('outdent') is used. - */ - cmd_outdent: function(value) { - var exec = true, selEl = this._getSelectedElement(), _bq = null, _span = null; - //if (this.browser.webkit || this.browser.ie || this.browser.gecko) { - if (this.browser.webkit || this.browser.ie) { - //if (this.browser.ie) { - selEl = this._getSelectedElement(); - if (this._isElement(selEl, 'blockquote')) { - var par = selEl.parentNode; - if (this._isElement(selEl.parentNode, 'blockquote')) { - par.innerHTML = selEl.innerHTML; - this._selectNode(par); - } else { - _span = this._getDoc().createElement('span'); - _span.innerHTML = selEl.innerHTML; - YAHOO.util.Dom.addClass(_span, 'yui-non'); - par.replaceChild(_span, selEl); - this._selectNode(_span); - } - } else { - } - exec = false; - } else { - value = false; - } - return [exec, 'outdent', value]; - }, - /** - * @method cmd_justify - * @param dir The direction to justify - * @description This is a factory method for the justify family of commands. - */ - cmd_justify: function(dir) { - if (this.browser.ie) { - if (this._hasSelection()) { - this._createCurrentElement('span'); - this._swapEl(this.currentElement[0], 'div', function(el) { - el.style.textAlign = dir; - }); - - return [false]; - } - } - return [true, 'justify' + dir, '']; - }, - /** - * @method cmd_justifycenter - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('justifycenter') is used. - */ - cmd_justifycenter: function() { - return [this.cmd_justify('center')]; - }, - /** - * @method cmd_justifyleft - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('justifyleft') is used. - */ - cmd_justifyleft: function() { - return [this.cmd_justify('left')]; - }, - /** - * @method cmd_justifyright - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('justifyright') is used. - */ - cmd_justifyright: function() { - return [this.cmd_justify('right')]; - }, - /* }}}*/ - /** - * @method toString - * @description Returns a string representing the editor. - * @return {String} - */ - toString: function() { - var str = 'Editor'; - if (this.get && this.get('element_cont')) { - str = 'Editor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : '')); - } - return str; - } - }); -/** -* @event beforeOpenWindow -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Event fires before an Editor Window is opened. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterOpenWindow -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Event fires after an Editor Window is opened. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event closeWindow -* @param {EditorWindow} win The EditorWindow object -* @description Event fires after an Editor Window is closed. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowCMDOpen -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Dynamic event fired when an EditorWindow is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowCMDClose -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Dynamic event fired when an EditorWindow is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowRender -* @param {EditorWindow} win The EditorWindow object -* @param {Overlay} panel The Overlay object that is used to create the window. -* @description Event fired when the initial Overlay is rendered. Can be used to manipulate the content of the panel. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowInsertImageRender -* @param {Overlay} panel The Overlay object that is used to create the window. -* @param {HTMLElement} body The HTML element used as the body of the window.. -* @param {Toolbar} toolbar A reference to the toolbar object used inside this window. -* @description Event fired when the pre render of the Insert Image window has finished. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event windowCreateLinkRender -* @param {Overlay} panel The Overlay object that is used to create the window. -* @param {HTMLElement} body The HTML element used as the body of the window.. -* @description Event fired when the pre render of the Create Link window has finished. -* @type YAHOO.util.CustomEvent -*/ - - - - /** - * @description Class to hold Window information between uses. We use the same panel to show the windows, so using this will allow you to configure a window before it is shown. - * This is what you pass to Editor.openWindow();. These parameters will not take effect until the openWindow() is called in the editor. - * @class EditorWindow - * @param {String} name The name of the window. - * @param {Object} attrs Attributes for the window. Current attributes used are : height and width - */ - YAHOO.widget.EditorWindow = function(name, attrs) { - /** - * @private - * @property name - * @description A unique name for the window - */ - this.name = name.replace(' ', '_'); - /** - * @private - * @property attrs - * @description The window attributes - */ - this.attrs = attrs; - }; - - YAHOO.widget.EditorWindow.prototype = { - /** - * @private - * @property header - * @description Holder for the header of the window, used in Editor.openWindow - */ - header: null, - /** - * @private - * @property body - * @description Holder for the body of the window, used in Editor.openWindow - */ - body: null, - /** - * @private - * @property footer - * @description Holder for the footer of the window, used in Editor.openWindow - */ - footer: null, - /** - * @method setHeader - * @description Sets the header for the window. - * @param {String/HTMLElement} str The string or DOM reference to be used as the windows header. - */ - setHeader: function(str) { - this.header = str; - }, - /** - * @method setBody - * @description Sets the body for the window. - * @param {String/HTMLElement} str The string or DOM reference to be used as the windows body. - */ - setBody: function(str) { - this.body = str; - }, - /** - * @method setFooter - * @description Sets the footer for the window. - * @param {String/HTMLElement} str The string or DOM reference to be used as the windows footer. - */ - setFooter: function(str) { - this.footer = str; - }, - /** - * @method toString - * @description Returns a string representing the EditorWindow. - * @return {String} - */ - toString: function() { - return 'Editor Window (' + this.name + ')'; - } - }; -})(); -YAHOO.register("editor", YAHOO.widget.Editor, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-debug.js deleted file mode 100644 index f24d180953..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-debug.js +++ /dev/null @@ -1,7493 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - /** - * @module editor - * @description

              Creates a rich custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar

              - * @class ToolbarButtonAdvanced - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, container_core, menu, button - * - * Provides a toolbar button based on the button and menu widgets. - * @constructor - * @class ToolbarButtonAdvanced - * @param {String/HTMLElement} el The element to turn into a button. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - if (YAHOO.widget.Button) { - YAHOO.widget.ToolbarButtonAdvanced = YAHOO.widget.Button; - /** - * @property buttonType - * @private - * @description Tells if the Button is a Rich Button or a Simple Button - */ - YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType = 'rich'; - /** - * @method checkValue - * @param {String} value The value of the option that we want to mark as selected - * @description Select an option by value - */ - YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue = function(value) { - var _menuItems = this.getMenu().getItems(); - if (_menuItems.length === 0) { - this.getMenu()._onBeforeShow(); - _menuItems = this.getMenu().getItems(); - } - for (var i = 0; i < _menuItems.length; i++) { - _menuItems[i].cfg.setProperty('checked', false); - if (_menuItems[i].value == value) { - _menuItems[i].cfg.setProperty('checked', true); - } - } - }; - } else { - YAHOO.widget.ToolbarButtonAdvanced = function() {}; - } - - - /** - * @description

              Creates a basic custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar

              Provides a toolbar button based on the button and menu widgets, <select> elements are used in place of menu's.

              - * @class ToolbarButton - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event - * @extends YAHOO.util.Element - * - * - * @constructor - * @param {String/HTMLElement} el The element to turn into a button. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.ToolbarButton = function(el, attrs) { - YAHOO.log('ToolbarButton Initalizing', 'info', 'ToolbarButton'); - YAHOO.log(arguments.length + ' arguments passed to constructor', 'info', 'Toolbar'); - - if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) { - attrs = el; - } - var local_attrs = (attrs || {}); - - var oConfig = { - element: null, - attributes: local_attrs - }; - - if (!oConfig.attributes.type) { - oConfig.attributes.type = 'push'; - } - - oConfig.element = document.createElement('span'); - oConfig.element.setAttribute('unselectable', 'on'); - oConfig.element.className = 'yui-button yui-' + oConfig.attributes.type + '-button'; - oConfig.element.innerHTML = 'LABEL'; - oConfig.element.firstChild.firstChild.tabIndex = '-1'; - oConfig.attributes.id = (oConfig.attributes.id || Dom.generateId()); - oConfig.element.id = oConfig.attributes.id; - - YAHOO.widget.ToolbarButton.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - YAHOO.extend(YAHOO.widget.ToolbarButton, YAHOO.util.Element, { - /** - * @property buttonType - * @private - * @description Tells if the Button is a Rich Button or a Simple Button - */ - buttonType: 'normal', - /** - * @method _handleMouseOver - * @private - * @description Adds classes to the button elements on mouseover (hover) - */ - _handleMouseOver: function() { - if (!this.get('disabled')) { - this.addClass('yui-button-hover'); - this.addClass('yui-' + this.get('type') + '-button-hover'); - } - }, - /** - * @method _handleMouseOut - * @private - * @description Removes classes from the button elements on mouseout (hover) - */ - _handleMouseOut: function() { - this.removeClass('yui-button-hover'); - this.removeClass('yui-' + this.get('type') + '-button-hover'); - }, - /** - * @method checkValue - * @param {String} value The value of the option that we want to mark as selected - * @description Select an option by value - */ - checkValue: function(value) { - if (this.get('type') == 'menu') { - var opts = this._button.options; - for (var i = 0; i < opts.length; i++) { - if (opts[i].value == value) { - opts.selectedIndex = i; - } - } - } - }, - /** - * @method init - * @description The ToolbarButton class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.widget.ToolbarButton.superclass.init.call(this, p_oElement, p_oAttributes); - - this.on('mouseover', this._handleMouseOver, this, true); - this.on('mouseout', this._handleMouseOut, this, true); - this.on('click', function(ev) { - Event.stopEvent(ev); - return false; - }, this, true); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the toolbar. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the toolbar. - */ - initAttributes: function(attr) { - YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this, attr); - /** - * @attribute value - * @description The value of the button - * @type String - */ - this.setAttributeConfig('value', { - value: attr.value - }); - /** - * @attribute menu - * @description The menu attribute, see YAHOO.widget.Button - * @type Object - */ - this.setAttributeConfig('menu', { - value: attr.menu || false - }); - /** - * @attribute type - * @description The type of button to create: push, menu, color, select, spin - * @type String - */ - this.setAttributeConfig('type', { - value: attr.type, - writeOnce: true, - method: function(type) { - var el, opt; - if (!this._button) { - this._button = this.get('element').getElementsByTagName('a')[0]; - } - switch (type) { - case 'select': - case 'menu': - el = document.createElement('select'); - el.id = this.get('id'); - var menu = this.get('menu'); - for (var i = 0; i < menu.length; i++) { - opt = document.createElement('option'); - opt.innerHTML = menu[i].text; - opt.value = menu[i].value; - if (menu[i].checked) { - opt.selected = true; - } - el.appendChild(opt); - } - this._button.parentNode.replaceChild(el, this._button); - Event.on(el, 'change', this._handleSelect, this, true); - this._button = el; - break; - } - } - }); - - /** - * @attribute disabled - * @description Set the button into a disabled state - * @type String - */ - this.setAttributeConfig('disabled', { - value: attr.disabled || false, - method: function(disabled) { - if (disabled) { - this.addClass('yui-button-disabled'); - this.addClass('yui-' + this.get('type') + '-button-disabled'); - } else { - this.removeClass('yui-button-disabled'); - this.removeClass('yui-' + this.get('type') + '-button-disabled'); - } - if ((this.get('type') == 'menu') || (this.get('type') == 'select')) { - this._button.disabled = disabled; - } - } - }); - - /** - * @attribute label - * @description The text label for the button - * @type String - */ - this.setAttributeConfig('label', { - value: attr.label, - method: function(label) { - if (!this._button) { - this._button = this.get('element').getElementsByTagName('a')[0]; - } - if (this.get('type') == 'push') { - this._button.innerHTML = label; - } - } - }); - - /** - * @attribute title - * @description The title of the button - * @type String - */ - this.setAttributeConfig('title', { - value: attr.title - }); - - /** - * @config container - * @description The container that the button is rendered to, handled by Toolbar - * @type String - */ - this.setAttributeConfig('container', { - value: null, - writeOnce: true, - method: function(cont) { - this.appendTo(cont); - } - }); - - }, - /** - * @private - * @method _handleSelect - * @description The event fired when a change event gets fired on a select element - * @param {Event} ev The change event. - */ - _handleSelect: function(ev) { - var tar = Event.getTarget(ev); - var value = tar.options[tar.selectedIndex].value; - this.fireEvent('change', {type: 'change', value: value }); - }, - /** - * @method getMenu - * @description A stub function to mimic YAHOO.widget.Button's getMenu method - */ - getMenu: function() { - return this.get('menu'); - }, - /** - * @method destroy - * @description Destroy the button - */ - destroy: function() { - Event.purgeElement(this.get('element'), true); - this.get('element').parentNode.removeChild(this.get('element')); - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - }, - /** - * @method fireEvent - * @description Overridden fireEvent method to prevent DOM events from firing if the button is disabled. - */ - fireEvent: function(p_sType, p_aArgs) { - // Disabled buttons should not respond to DOM events - if (this.DOM_EVENTS[p_sType] && this.get('disabled')) { - Event.stopEvent(p_aArgs); - return; - } - - YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this, p_sType, p_aArgs); - }, - /** - * @method toString - * @description Returns a string representing the toolbar. - * @return {String} - */ - toString: function() { - return 'ToolbarButton (' + this.get('id') + ')'; - } - - }); -})(); -/** - * @module editor - * @description

              Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor

              - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, toolbarbutton - * @optional container_core, dragdrop - */ -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - var getButton = function(id) { - var button = id; - if (Lang.isString(id)) { - button = this.getButtonById(id); - } - if (Lang.isNumber(id)) { - button = this.getButtonByIndex(id); - } - if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) { - button = this.getButtonByValue(id); - } - if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) { - return button; - } - return false; - }; - - /** - * Provides a rich toolbar widget based on the button and menu widgets - * @constructor - * @class Toolbar - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The element to turn into a toolbar. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - YAHOO.widget.Toolbar = function(el, attrs) { - YAHOO.log('Toolbar Initalizing', 'info', 'Toolbar'); - YAHOO.log(arguments.length + ' arguments passed to constructor', 'info', 'Toolbar'); - - if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) { - attrs = el; - } - var local_attrs = {}; - if (attrs) { - Lang.augmentObject(local_attrs, attrs); //Break the config reference - } - - - var oConfig = { - element: null, - attributes: local_attrs - }; - - - if (Lang.isString(el) && Dom.get(el)) { - oConfig.element = Dom.get(el); - } else if (Lang.isObject(el) && Dom.get(el) && Dom.get(el).nodeType) { - oConfig.element = Dom.get(el); - } - - - if (!oConfig.element) { - YAHOO.log('No element defined, creating toolbar container', 'warn', 'Toolbar'); - oConfig.element = document.createElement('DIV'); - oConfig.element.id = Dom.generateId(); - - if (local_attrs.container && Dom.get(local_attrs.container)) { - YAHOO.log('Container found in config appending to it (' + Dom.get(local_attrs.container).id + ')', 'info', 'Toolbar'); - Dom.get(local_attrs.container).appendChild(oConfig.element); - } - } - - - if (!oConfig.element.id) { - oConfig.element.id = ((Lang.isString(el)) ? el : Dom.generateId()); - YAHOO.log('No element ID defined for toolbar container, creating..', 'warn', 'Toolbar'); - } - YAHOO.log('Initing toolbar with id: ' + oConfig.element.id, 'info', 'Toolbar'); - - var fs = document.createElement('fieldset'); - var lg = document.createElement('legend'); - lg.innerHTML = 'Toolbar'; - fs.appendChild(lg); - - var cont = document.createElement('DIV'); - oConfig.attributes.cont = cont; - Dom.addClass(cont, 'yui-toolbar-subcont'); - fs.appendChild(cont); - oConfig.element.appendChild(fs); - - oConfig.element.tabIndex = -1; - - - oConfig.attributes.element = oConfig.element; - oConfig.attributes.id = oConfig.element.id; - - this._configuredButtons = []; - - YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - - }; - - YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, { - /** - * @protected - * @property _configuredButtons - * @type Array - */ - _configuredButtons: null, - /** - * @method _addMenuClasses - * @private - * @description This method is called from Menu's renderEvent to add a few more classes to the menu items - * @param {String} ev The event that fired. - * @param {Array} na Array of event information. - * @param {Object} o Button config object. - */ - _addMenuClasses: function(ev, na, o) { - Dom.addClass(this.element, 'yui-toolbar-' + o.get('value') + '-menu'); - if (Dom.hasClass(o._button.parentNode.parentNode, 'yui-toolbar-select')) { - Dom.addClass(this.element, 'yui-toolbar-select-menu'); - } - var items = this.getItems(); - for (var i = 0; i < items.length; i++) { - Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase())); - Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-'))); - } - }, - /** - * @property buttonType - * @description The default button to use - * @type Object - */ - buttonType: YAHOO.widget.ToolbarButton, - /** - * @property dd - * @description The DragDrop instance associated with the Toolbar - * @type Object - */ - dd: null, - /** - * @property _colorData - * @description Object reference containing colors hex and text values. - * @type Object - */ - _colorData: { -/* {{{ _colorData */ - '#111111': 'Obsidian', - '#2D2D2D': 'Dark Gray', - '#434343': 'Shale', - '#5B5B5B': 'Flint', - '#737373': 'Gray', - '#8B8B8B': 'Concrete', - '#A2A2A2': 'Gray', - '#B9B9B9': 'Titanium', - '#000000': 'Black', - '#D0D0D0': 'Light Gray', - '#E6E6E6': 'Silver', - '#FFFFFF': 'White', - '#BFBF00': 'Pumpkin', - '#FFFF00': 'Yellow', - '#FFFF40': 'Banana', - '#FFFF80': 'Pale Yellow', - '#FFFFBF': 'Butter', - '#525330': 'Raw Siena', - '#898A49': 'Mildew', - '#AEA945': 'Olive', - '#7F7F00': 'Paprika', - '#C3BE71': 'Earth', - '#E0DCAA': 'Khaki', - '#FCFAE1': 'Cream', - '#60BF00': 'Cactus', - '#80FF00': 'Chartreuse', - '#A0FF40': 'Green', - '#C0FF80': 'Pale Lime', - '#DFFFBF': 'Light Mint', - '#3B5738': 'Green', - '#668F5A': 'Lime Gray', - '#7F9757': 'Yellow', - '#407F00': 'Clover', - '#8A9B55': 'Pistachio', - '#B7C296': 'Light Jade', - '#E6EBD5': 'Breakwater', - '#00BF00': 'Spring Frost', - '#00FF80': 'Pastel Green', - '#40FFA0': 'Light Emerald', - '#80FFC0': 'Sea Foam', - '#BFFFDF': 'Sea Mist', - '#033D21': 'Dark Forrest', - '#438059': 'Moss', - '#7FA37C': 'Medium Green', - '#007F40': 'Pine', - '#8DAE94': 'Yellow Gray Green', - '#ACC6B5': 'Aqua Lung', - '#DDEBE2': 'Sea Vapor', - '#00BFBF': 'Fog', - '#00FFFF': 'Cyan', - '#40FFFF': 'Turquoise Blue', - '#80FFFF': 'Light Aqua', - '#BFFFFF': 'Pale Cyan', - '#033D3D': 'Dark Teal', - '#347D7E': 'Gray Turquoise', - '#609A9F': 'Green Blue', - '#007F7F': 'Seaweed', - '#96BDC4': 'Green Gray', - '#B5D1D7': 'Soapstone', - '#E2F1F4': 'Light Turquoise', - '#0060BF': 'Summer Sky', - '#0080FF': 'Sky Blue', - '#40A0FF': 'Electric Blue', - '#80C0FF': 'Light Azure', - '#BFDFFF': 'Ice Blue', - '#1B2C48': 'Navy', - '#385376': 'Biscay', - '#57708F': 'Dusty Blue', - '#00407F': 'Sea Blue', - '#7792AC': 'Sky Blue Gray', - '#A8BED1': 'Morning Sky', - '#DEEBF6': 'Vapor', - '#0000BF': 'Deep Blue', - '#0000FF': 'Blue', - '#4040FF': 'Cerulean Blue', - '#8080FF': 'Evening Blue', - '#BFBFFF': 'Light Blue', - '#212143': 'Deep Indigo', - '#373E68': 'Sea Blue', - '#444F75': 'Night Blue', - '#00007F': 'Indigo Blue', - '#585E82': 'Dockside', - '#8687A4': 'Blue Gray', - '#D2D1E1': 'Light Blue Gray', - '#6000BF': 'Neon Violet', - '#8000FF': 'Blue Violet', - '#A040FF': 'Violet Purple', - '#C080FF': 'Violet Dusk', - '#DFBFFF': 'Pale Lavender', - '#302449': 'Cool Shale', - '#54466F': 'Dark Indigo', - '#655A7F': 'Dark Violet', - '#40007F': 'Violet', - '#726284': 'Smoky Violet', - '#9E8FA9': 'Slate Gray', - '#DCD1DF': 'Violet White', - '#BF00BF': 'Royal Violet', - '#FF00FF': 'Fuchsia', - '#FF40FF': 'Magenta', - '#FF80FF': 'Orchid', - '#FFBFFF': 'Pale Magenta', - '#4A234A': 'Dark Purple', - '#794A72': 'Medium Purple', - '#936386': 'Cool Granite', - '#7F007F': 'Purple', - '#9D7292': 'Purple Moon', - '#C0A0B6': 'Pale Purple', - '#ECDAE5': 'Pink Cloud', - '#BF005F': 'Hot Pink', - '#FF007F': 'Deep Pink', - '#FF409F': 'Grape', - '#FF80BF': 'Electric Pink', - '#FFBFDF': 'Pink', - '#451528': 'Purple Red', - '#823857': 'Purple Dino', - '#A94A76': 'Purple Gray', - '#7F003F': 'Rose', - '#BC6F95': 'Antique Mauve', - '#D8A5BB': 'Cool Marble', - '#F7DDE9': 'Pink Granite', - '#C00000': 'Apple', - '#FF0000': 'Fire Truck', - '#FF4040': 'Pale Red', - '#FF8080': 'Salmon', - '#FFC0C0': 'Warm Pink', - '#441415': 'Sepia', - '#82393C': 'Rust', - '#AA4D4E': 'Brick', - '#800000': 'Brick Red', - '#BC6E6E': 'Mauve', - '#D8A3A4': 'Shrimp Pink', - '#F8DDDD': 'Shell Pink', - '#BF5F00': 'Dark Orange', - '#FF7F00': 'Orange', - '#FF9F40': 'Grapefruit', - '#FFBF80': 'Canteloupe', - '#FFDFBF': 'Wax', - '#482C1B': 'Dark Brick', - '#855A40': 'Dirt', - '#B27C51': 'Tan', - '#7F3F00': 'Nutmeg', - '#C49B71': 'Mustard', - '#E1C4A8': 'Pale Tan', - '#FDEEE0': 'Marble' -/* }}} */ - }, - /** - * @property _colorPicker - * @description The HTML Element containing the colorPicker - * @type HTMLElement - */ - _colorPicker: null, - /** - * @property STR_COLLAPSE - * @description String for Toolbar Collapse Button - * @type String - */ - STR_COLLAPSE: 'Collapse Toolbar', - /** - * @property STR_EXPAND - * @description String for Toolbar Collapse Button - Expand - * @type String - */ - STR_EXPAND: 'Expand Toolbar', - /** - * @property STR_SPIN_LABEL - * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute - * @type String - */ - STR_SPIN_LABEL: 'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.', - /** - * @property STR_SPIN_UP - * @description String for spinbutton up - * @type String - */ - STR_SPIN_UP: 'Click to increase the value of this input', - /** - * @property STR_SPIN_DOWN - * @description String for spinbutton down - * @type String - */ - STR_SPIN_DOWN: 'Click to decrease the value of this input', - /** - * @property _titlebar - * @description Object reference to the titlebar - * @type HTMLElement - */ - _titlebar: null, - /** - * @property browser - * @description Standard browser detection - * @type Object - */ - browser: YAHOO.env.ua, - /** - * @protected - * @property _buttonList - * @description Internal property list of current buttons in the toolbar - * @type Array - */ - _buttonList: null, - /** - * @protected - * @property _buttonGroupList - * @description Internal property list of current button groups in the toolbar - * @type Array - */ - _buttonGroupList: null, - /** - * @protected - * @property _sep - * @description Internal reference to the separator HTML Element for cloning - * @type HTMLElement - */ - _sep: null, - /** - * @protected - * @property _sepCount - * @description Internal refernce for counting separators, so we can give them a useful class name for styling - * @type Number - */ - _sepCount: null, - /** - * @protected - * @property draghandle - * @type HTMLElement - */ - _dragHandle: null, - /** - * @protected - * @property _toolbarConfigs - * @type Object - */ - _toolbarConfigs: { - renderer: true - }, - /** - * @protected - * @property CLASS_CONTAINER - * @description Default CSS class to apply to the toolbar container element - * @type String - */ - CLASS_CONTAINER: 'yui-toolbar-container', - /** - * @protected - * @property CLASS_DRAGHANDLE - * @description Default CSS class to apply to the toolbar's drag handle element - * @type String - */ - CLASS_DRAGHANDLE: 'yui-toolbar-draghandle', - /** - * @protected - * @property CLASS_SEPARATOR - * @description Default CSS class to apply to all separators in the toolbar - * @type String - */ - CLASS_SEPARATOR: 'yui-toolbar-separator', - /** - * @protected - * @property CLASS_DISABLED - * @description Default CSS class to apply when the toolbar is disabled - * @type String - */ - CLASS_DISABLED: 'yui-toolbar-disabled', - /** - * @protected - * @property CLASS_PREFIX - * @description Default prefix for dynamically created class names - * @type String - */ - CLASS_PREFIX: 'yui-toolbar', - /** - * @method init - * @description The Toolbar class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.widget.Toolbar.superclass.init.call(this, p_oElement, p_oAttributes); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the toolbar. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the toolbar. - */ - initAttributes: function(attr) { - YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr); - this.addClass(this.CLASS_CONTAINER); - - /** - * @attribute buttonType - * @description The buttonType to use (advanced or basic) - * @type String - */ - this.setAttributeConfig('buttonType', { - value: attr.buttonType || 'basic', - writeOnce: true, - validator: function(type) { - switch (type) { - case 'advanced': - case 'basic': - return true; - } - return false; - }, - method: function(type) { - if (type == 'advanced') { - if (YAHOO.widget.Button) { - this.buttonType = YAHOO.widget.ToolbarButtonAdvanced; - } else { - YAHOO.log('Can not find YAHOO.widget.Button', 'error', 'Toolbar'); - this.buttonType = YAHOO.widget.ToolbarButton; - } - } else { - this.buttonType = YAHOO.widget.ToolbarButton; - } - } - }); - - - /** - * @attribute buttons - * @description Object specifying the buttons to include in the toolbar - * Example: - *
              -            * {
              -            *   { id: 'b3', type: 'button', label: 'Underline', value: 'underline' },
              -            *   { type: 'separator' },
              -            *   { id: 'b4', type: 'menu', label: 'Align', value: 'align',
              -            *       menu: [
              -            *           { text: "Left", value: 'alignleft' },
              -            *           { text: "Center", value: 'aligncenter' },
              -            *           { text: "Right", value: 'alignright' }
              -            *       ]
              -            *   }
              -            * }
              -            * 
              - * @type Array - */ - - this.setAttributeConfig('buttons', { - value: [], - writeOnce: true, - method: function(data) { - var i, button, buttons, len, b; - for (i in data) { - if (Lang.hasOwnProperty(data, i)) { - if (data[i].type == 'separator') { - this.addSeparator(); - } else if (data[i].group !== undefined) { - buttons = this.addButtonGroup(data[i]); - if (buttons) { - len = buttons.length; - for(b = 0; b < len; b++) { - if (buttons[b]) { - this._configuredButtons[this._configuredButtons.length] = buttons[b].id; - } - } - } - - } else { - button = this.addButton(data[i]); - if (button) { - this._configuredButtons[this._configuredButtons.length] = button.id; - } - } - } - } - } - }); - - /** - * @attribute disabled - * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on. - * @default false - * @type Boolean - */ - this.setAttributeConfig('disabled', { - value: false, - method: function(disabled) { - if (this.get('disabled') === disabled) { - return false; - } - if (disabled) { - this.addClass(this.CLASS_DISABLED); - this.set('draggable', false); - this.disableAllButtons(); - } else { - this.removeClass(this.CLASS_DISABLED); - if (this._configs.draggable._initialConfig.value) { - //Draggable by default, set it back - this.set('draggable', true); - } - this.resetAllButtons(); - } - } - }); - - /** - * @config cont - * @description The container for the toolbar. - * @type HTMLElement - */ - this.setAttributeConfig('cont', { - value: attr.cont, - readOnly: true - }); - - - /** - * @attribute grouplabels - * @description Boolean indicating if the toolbar should show the group label's text string. - * @default true - * @type Boolean - */ - this.setAttributeConfig('grouplabels', { - value: ((attr.grouplabels === false) ? false : true), - method: function(grouplabels) { - if (grouplabels) { - Dom.removeClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels')); - } else { - Dom.addClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels')); - } - } - }); - /** - * @attribute titlebar - * @description Boolean indicating if the toolbar should have a titlebar. If - * passed a string, it will use that as the titlebar text - * @default false - * @type Boolean or String - */ - this.setAttributeConfig('titlebar', { - value: false, - method: function(titlebar) { - if (titlebar) { - if (this._titlebar && this._titlebar.parentNode) { - this._titlebar.parentNode.removeChild(this._titlebar); - } - this._titlebar = document.createElement('DIV'); - this._titlebar.tabIndex = '-1'; - Event.on(this._titlebar, 'focus', function() { - this._handleFocus(); - }, this, true); - Dom.addClass(this._titlebar, this.CLASS_PREFIX + '-titlebar'); - if (Lang.isString(titlebar)) { - var h2 = document.createElement('h2'); - h2.tabIndex = '-1'; - h2.innerHTML = '' + titlebar + ''; - this._titlebar.appendChild(h2); - Event.on(h2.firstChild, 'click', function(ev) { - Event.stopEvent(ev); - }); - Event.on([h2, h2.firstChild], 'focus', function() { - this._handleFocus(); - }, this, true); - } - if (this.get('firstChild')) { - this.insertBefore(this._titlebar, this.get('firstChild')); - } else { - this.appendChild(this._titlebar); - } - if (this.get('collapse')) { - this.set('collapse', true); - } - } else if (this._titlebar) { - if (this._titlebar && this._titlebar.parentNode) { - this._titlebar.parentNode.removeChild(this._titlebar); - } - } - } - }); - - - /** - * @attribute collapse - * @description Boolean indicating if the titlebar should have a collapse button. - * The collapse button will not remove the toolbar, it will minimize it to the titlebar - * @default false - * @type Boolean - */ - this.setAttributeConfig('collapse', { - value: false, - method: function(collapse) { - if (this._titlebar) { - var collapseEl = null; - var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapse) { - if (el.length > 0) { - //There is already a collapse button - return true; - } - collapseEl = document.createElement('SPAN'); - collapseEl.innerHTML = 'X'; - collapseEl.title = this.STR_COLLAPSE; - - Dom.addClass(collapseEl, 'collapse'); - this._titlebar.appendChild(collapseEl); - Event.addListener(collapseEl, 'click', function() { - if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) { - this.collapse(false); //Expand Toolbar - } else { - this.collapse(); //Collapse Toolbar - } - }, this, true); - } else { - collapseEl = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapseEl[0]) { - if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) { - //We are closed, reopen the titlebar.. - this.collapse(false); //Expand Toolbar - } - collapseEl[0].parentNode.removeChild(collapseEl[0]); - } - } - } - } - }); - - /** - * @attribute draggable - * @description Boolean indicating if the toolbar should be draggable. - * @default false - * @type Boolean - */ - - this.setAttributeConfig('draggable', { - value: (attr.draggable || false), - method: function(draggable) { - if (draggable && !this.get('titlebar')) { - YAHOO.log('Dragging enabled', 'info', 'Toolbar'); - if (!this._dragHandle) { - this._dragHandle = document.createElement('SPAN'); - this._dragHandle.innerHTML = '|'; - this._dragHandle.setAttribute('title', 'Click to drag the toolbar'); - this._dragHandle.id = this.get('id') + '_draghandle'; - Dom.addClass(this._dragHandle, this.CLASS_DRAGHANDLE); - if (this.get('cont').hasChildNodes()) { - this.get('cont').insertBefore(this._dragHandle, this.get('cont').firstChild); - } else { - this.get('cont').appendChild(this._dragHandle); - } - this.dd = new YAHOO.util.DD(this.get('id')); - this.dd.setHandleElId(this._dragHandle.id); - - } - } else { - YAHOO.log('Dragging disabled', 'info', 'Toolbar'); - if (this._dragHandle) { - this._dragHandle.parentNode.removeChild(this._dragHandle); - this._dragHandle = null; - this.dd = null; - } - } - if (this._titlebar) { - if (draggable) { - this.dd = new YAHOO.util.DD(this.get('id')); - this.dd.setHandleElId(this._titlebar); - Dom.addClass(this._titlebar, 'draggable'); - } else { - Dom.removeClass(this._titlebar, 'draggable'); - if (this.dd) { - this.dd.unreg(); - this.dd = null; - } - } - } - }, - validator: function(value) { - var ret = true; - if (!YAHOO.util.DD) { - ret = false; - } - return ret; - } - }); - - }, - /** - * @method addButtonGroup - * @description Add a new button group to the toolbar. (uses addButton) - * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs as well as the group label) - */ - addButtonGroup: function(oGroup) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addButtonGroup', arguments]; - return false; - } - - if (!this.hasClass(this.CLASS_PREFIX + '-grouped')) { - this.addClass(this.CLASS_PREFIX + '-grouped'); - } - var div = document.createElement('DIV'); - Dom.addClass(div, this.CLASS_PREFIX + '-group'); - Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group); - if (oGroup.label) { - var label = document.createElement('h3'); - label.innerHTML = oGroup.label; - div.appendChild(label); - } - if (!this.get('grouplabels')) { - Dom.addClass(this.get('cont'), this.CLASS_PREFIX, '-nogrouplabels'); - } - - this.get('cont').appendChild(div); - - //For accessibility, let's put all of the group buttons in an Unordered List - var ul = document.createElement('ul'); - div.appendChild(ul); - - if (!this._buttonGroupList) { - this._buttonGroupList = {}; - } - - this._buttonGroupList[oGroup.group] = ul; - - //An array of the button ids added to this group - //This is used for destruction later... - var addedButtons = [], - button; - - - for (var i = 0; i < oGroup.buttons.length; i++) { - var li = document.createElement('li'); - li.className = this.CLASS_PREFIX + '-groupitem'; - ul.appendChild(li); - if ((oGroup.buttons[i].type !== undefined) && oGroup.buttons[i].type == 'separator') { - this.addSeparator(li); - } else { - oGroup.buttons[i].container = li; - button = this.addButton(oGroup.buttons[i]); - if (button) { - addedButtons[addedButtons.length] = button.id; - } - } - } - return addedButtons; - }, - /** - * @method addButtonToGroup - * @description Add a new button to a toolbar group. Buttons supported: - * push, split, menu, select, color, spin - * @param {Object} oButton Object literal reference to the Button's Config - * @param {String} group The Group identifier passed into the initial config - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addButtonToGroup: function(oButton, group, after) { - var groupCont = this._buttonGroupList[group], - li = document.createElement('li'); - - li.className = this.CLASS_PREFIX + '-groupitem'; - oButton.container = li; - this.addButton(oButton, after); - groupCont.appendChild(li); - }, - /** - * @method addButton - * @description Add a new button to the toolbar. Buttons supported: - * push, split, menu, select, color, spin - * @param {Object} oButton Object literal reference to the Button's Config - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addButton: function(oButton, after) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addButton', arguments]; - return false; - } - if (!this._buttonList) { - this._buttonList = []; - } - YAHOO.log('Adding button of type: ' + oButton.type, 'info', 'Toolbar'); - if (!oButton.container) { - oButton.container = this.get('cont'); - } - - if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) { - if (Lang.isArray(oButton.menu)) { - for (var i in oButton.menu) { - if (Lang.hasOwnProperty(oButton.menu, i)) { - var funcObject = { - fn: function(ev, x, oMenu) { - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue); - }, - scope: this - }; - oButton.menu[i].onclick = funcObject; - } - } - } - } - var _oButton = {}, skip = false; - for (var o in oButton) { - if (Lang.hasOwnProperty(oButton, o)) { - if (!this._toolbarConfigs[o]) { - _oButton[o] = oButton[o]; - } - } - } - if (oButton.type == 'select') { - _oButton.type = 'menu'; - } - if (oButton.type == 'spin') { - _oButton.type = 'push'; - } - if (_oButton.type == 'color') { - if (YAHOO.widget.Overlay) { - _oButton = this._makeColorButton(_oButton); - } else { - skip = true; - } - } - if (_oButton.menu) { - if ((YAHOO.widget.Overlay) && (oButton.menu instanceof YAHOO.widget.Overlay)) { - oButton.menu.showEvent.subscribe(function() { - this._button = _oButton; - }); - } else { - for (var m = 0; m < _oButton.menu.length; m++) { - if (!_oButton.menu[m].value) { - _oButton.menu[m].value = _oButton.menu[m].text; - } - } - if (this.browser.webkit) { - _oButton.focusmenu = false; - } - } - } - if (skip) { - oButton = false; - } else { - //Add to .get('buttons') manually - this._configs.buttons.value[this._configs.buttons.value.length] = oButton; - - var tmp = new this.buttonType(_oButton); - tmp.get('element').tabIndex = '-1'; - tmp.get('element').setAttribute('role', 'button'); - tmp._selected = true; - - if (this.get('disabled')) { - //Toolbar is disabled, disable the new button too! - tmp.set('disabled', true); - } - if (!oButton.id) { - oButton.id = tmp.get('id'); - } - YAHOO.log('Button created (' + oButton.type + ')', 'info', 'Toolbar'); - - if (after) { - var el = tmp.get('element'); - var nextSib = null; - if (after.get) { - nextSib = after.get('element').nextSibling; - } else if (after.nextSibling) { - nextSib = after.nextSibling; - } - if (nextSib) { - nextSib.parentNode.insertBefore(el, nextSib); - } - } - tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value')); - - var icon = document.createElement('span'); - icon.className = this.CLASS_PREFIX + '-icon'; - tmp.get('element').insertBefore(icon, tmp.get('firstChild')); - if (tmp._button.tagName.toLowerCase() == 'button') { - tmp.get('element').setAttribute('unselectable', 'on'); - //Replace the Button HTML Element with an a href if it exists - var a = document.createElement('a'); - a.innerHTML = tmp._button.innerHTML; - a.href = '#'; - a.tabIndex = '-1'; - Event.on(a, 'click', function(ev) { - Event.stopEvent(ev); - }); - tmp._button.parentNode.replaceChild(a, tmp._button); - tmp._button = a; - } - - if (oButton.type == 'select') { - if (tmp._button.tagName.toLowerCase() == 'select') { - icon.parentNode.removeChild(icon); - var iel = tmp._button, - parEl = tmp.get('element'); - parEl.parentNode.replaceChild(iel, parEl); - //The 'element' value is currently the orphaned element - //In order for "destroy" to execute we need to get('element') to reference the correct node. - //I'm not sure if there is a direct approach to setting this value. - tmp._configs.element.value = iel; - } else { - //Don't put a class on it if it's a real select element - tmp.addClass(this.CLASS_PREFIX + '-select'); - } - } - if (oButton.type == 'spin') { - if (!Lang.isArray(oButton.range)) { - oButton.range = [ 10, 100 ]; - } - this._makeSpinButton(tmp, oButton); - } - tmp.get('element').setAttribute('title', tmp.get('label')); - if (oButton.type != 'spin') { - if ((YAHOO.widget.Overlay) && (_oButton.menu instanceof YAHOO.widget.Overlay)) { - var showPicker = function(ev) { - var exec = true; - if (ev.keyCode && (ev.keyCode == 9)) { - exec = false; - } - if (exec) { - if (this._colorPicker) { - this._colorPicker._button = oButton.value; - } - var menuEL = tmp.getMenu().element; - if (Dom.getStyle(menuEL, 'visibility') == 'hidden') { - tmp.getMenu().show(); - } else { - tmp.getMenu().hide(); - } - } - YAHOO.util.Event.stopEvent(ev); - }; - tmp.on('mousedown', showPicker, oButton, this); - tmp.on('keydown', showPicker, oButton, this); - - } else if ((oButton.type != 'menu') && (oButton.type != 'select')) { - tmp.on('keypress', this._buttonClick, oButton, this); - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - this._buttonClick(ev, oButton); - }, oButton, this); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - } else { - //Stop the mousedown event so we can trap the selection in the editor! - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('change', function(ev) { - if (!ev.target) { - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ev.value; - this._buttonClick(ev, oButton); - } - }, this, true); - - var self = this; - //Hijack the mousedown event in the menu and make it fire a button click.. - tmp.on('appendTo', function() { - var tmp = this; - if (tmp.getMenu() && tmp.getMenu().mouseDownEvent) { - tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) { - YAHOO.log('mouseDownEvent', 'warn', 'Toolbar'); - var oMenu = args[1]; - YAHOO.util.Event.stopEvent(args[0]); - tmp._onMenuClick(args[0], tmp); - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue); - self._buttonClick.call(self, args[1], oButton); - tmp._hideMenu(); - return false; - }); - tmp.getMenu().clickEvent.subscribe(function(ev, args) { - YAHOO.log('clickEvent', 'warn', 'Toolbar'); - YAHOO.util.Event.stopEvent(args[0]); - }); - tmp.getMenu().mouseUpEvent.subscribe(function(ev, args) { - YAHOO.log('mouseUpEvent', 'warn', 'Toolbar'); - YAHOO.util.Event.stopEvent(args[0]); - }); - } - }); - - } - } else { - //Stop the mousedown event so we can trap the selection in the editor! - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - } - if (this.browser.ie) { - /* - //Add a couple of new events for IE - tmp.DOM_EVENTS.focusin = true; - tmp.DOM_EVENTS.focusout = true; - - //Stop them so we don't loose focus in the Editor - tmp.on('focusin', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - - tmp.on('focusout', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - */ - } - if (this.browser.webkit) { - //This will keep the document from gaining focus and the editor from loosing it.. - //Forcefully remove the focus calls in button! - tmp.hasFocus = function() { - return true; - }; - } - this._buttonList[this._buttonList.length] = tmp; - if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) { - if (Lang.isArray(oButton.menu)) { - YAHOO.log('Button type is (' + oButton.type + '), doing extra renderer work.', 'info', 'Toolbar'); - var menu = tmp.getMenu(); - if (menu && menu.renderEvent) { - menu.renderEvent.subscribe(this._addMenuClasses, tmp); - if (oButton.renderer) { - menu.renderEvent.subscribe(oButton.renderer, tmp); - } - } - } - } - } - return oButton; - }, - /** - * @method addSeparator - * @description Add a new button separator to the toolbar. - * @param {HTMLElement} cont Optional HTML element to insert this button into. - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addSeparator: function(cont, after) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addSeparator', arguments]; - return false; - } - var sepCont = ((cont) ? cont : this.get('cont')); - if (!this.get('element')) { - this._queue[this._queue.length] = ['addSeparator', arguments]; - return false; - } - if (this._sepCount === null) { - this._sepCount = 0; - } - if (!this._sep) { - YAHOO.log('Separator does not yet exist, creating', 'info', 'Toolbar'); - this._sep = document.createElement('SPAN'); - Dom.addClass(this._sep, this.CLASS_SEPARATOR); - this._sep.innerHTML = '|'; - } - YAHOO.log('Separator does exist, cloning', 'info', 'Toolbar'); - var _sep = this._sep.cloneNode(true); - this._sepCount++; - Dom.addClass(_sep, this.CLASS_SEPARATOR + '-' + this._sepCount); - if (after) { - var nextSib = null; - if (after.get) { - nextSib = after.get('element').nextSibling; - } else if (after.nextSibling) { - nextSib = after.nextSibling; - } else { - nextSib = after; - } - if (nextSib) { - if (nextSib == after) { - nextSib.parentNode.appendChild(_sep); - } else { - nextSib.parentNode.insertBefore(_sep, nextSib); - } - } - } else { - sepCont.appendChild(_sep); - } - return _sep; - }, - /** - * @method _createColorPicker - * @private - * @description Creates the core DOM reference to the color picker menu item. - * @param {String} id the id of the toolbar to prefix this DOM container with. - */ - _createColorPicker: function(id) { - if (Dom.get(id + '_colors')) { - Dom.get(id + '_colors').parentNode.removeChild(Dom.get(id + '_colors')); - } - var picker = document.createElement('div'); - picker.className = 'yui-toolbar-colors'; - picker.id = id + '_colors'; - picker.style.display = 'none'; - Event.on(window, 'load', function() { - document.body.appendChild(picker); - }, this, true); - - this._colorPicker = picker; - - var html = ''; - for (var i in this._colorData) { - if (Lang.hasOwnProperty(this._colorData, i)) { - html += '' + i.replace('#', '') + ''; - } - } - html += 'X'; - window.setTimeout(function() { - picker.innerHTML = html; - }, 0); - - Event.on(picker, 'mouseover', function(ev) { - var picker = this._colorPicker; - var em = picker.getElementsByTagName('em')[0]; - var strong = picker.getElementsByTagName('strong')[0]; - var tar = Event.getTarget(ev); - if (tar.tagName.toLowerCase() == 'a') { - em.style.backgroundColor = tar.style.backgroundColor; - strong.innerHTML = this._colorData['#' + tar.innerHTML] + '
              ' + tar.innerHTML; - } - }, this, true); - Event.on(picker, 'focus', function(ev) { - Event.stopEvent(ev); - }); - Event.on(picker, 'click', function(ev) { - Event.stopEvent(ev); - }); - Event.on(picker, 'mousedown', function(ev) { - Event.stopEvent(ev); - var tar = Event.getTarget(ev); - if (tar.tagName.toLowerCase() == 'a') { - var retVal = this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } ); - if (retVal !== false) { - var info = { - color: tar.innerHTML, - colorName: this._colorData['#' + tar.innerHTML], - value: this._colorPicker._button - }; - - this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info }); - } - this.getButtonByValue(this._colorPicker._button).getMenu().hide(); - } - }, this, true); - }, - /** - * @method _resetColorPicker - * @private - * @description Clears the currently selected color or mouseover color in the color picker. - */ - _resetColorPicker: function() { - var em = this._colorPicker.getElementsByTagName('em')[0]; - var strong = this._colorPicker.getElementsByTagName('strong')[0]; - em.style.backgroundColor = 'transparent'; - strong.innerHTML = ''; - }, - /** - * @method _makeColorButton - * @private - * @description Called to turn a "color" button into a menu button with an Overlay for the menu. - * @param {Object} _oButton YAHOO.widget.ToolbarButton reference - */ - _makeColorButton: function(_oButton) { - if (!this._colorPicker) { - this._createColorPicker(this.get('id')); - } - _oButton.type = 'color'; - _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visible: false, position: 'absolute', iframe: true }); - _oButton.menu.setBody(''); - _oButton.menu.render(this.get('cont')); - Dom.addClass(_oButton.menu.element, 'yui-button-menu'); - Dom.addClass(_oButton.menu.element, 'yui-color-button-menu'); - _oButton.menu.beforeShowEvent.subscribe(function() { - _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why. - _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why. - //Move the DOM reference of the color picker to the Overlay that we are about to show. - this._resetColorPicker(); - var _p = this._colorPicker; - if (_p.parentNode) { - _p.parentNode.removeChild(_p); - } - _oButton.menu.setBody(''); - _oButton.menu.appendToBody(_p); - this._colorPicker.style.display = 'block'; - }, this, true); - return _oButton; - }, - /** - * @private - * @method _makeSpinButton - * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values. - * @param {Object} _button YAHOO.widget.ToolbarButton reference - * @param {Object} oButton Object literal containing the buttons initial config - */ - _makeSpinButton: function(_button, oButton) { - _button.addClass(this.CLASS_PREFIX + '-spinbutton'); - var self = this, - _par = _button._button.parentNode.parentNode, //parentNode of Button Element for appending child - range = oButton.range, - _b1 = document.createElement('a'), - _b2 = document.createElement('a'); - _b1.href = '#'; - _b2.href = '#'; - _b1.tabIndex = '-1'; - _b2.tabIndex = '-1'; - - //Setup the up and down arrows - _b1.className = 'up'; - _b1.title = this.STR_SPIN_UP; - _b1.innerHTML = this.STR_SPIN_UP; - _b2.className = 'down'; - _b2.title = this.STR_SPIN_DOWN; - _b2.innerHTML = this.STR_SPIN_DOWN; - - //Append them to the container - _par.appendChild(_b1); - _par.appendChild(_b2); - - var label = YAHOO.lang.substitute(this.STR_SPIN_LABEL, { VALUE: _button.get('label') }); - _button.set('title', label); - - var cleanVal = function(value) { - value = ((value < range[0]) ? range[0] : value); - value = ((value > range[1]) ? range[1] : value); - return value; - }; - - var br = this.browser; - var tbar = false; - var strLabel = this.STR_SPIN_LABEL; - if (this._titlebar && this._titlebar.firstChild) { - tbar = this._titlebar.firstChild; - } - - var _intUp = function(ev) { - YAHOO.util.Event.stopEvent(ev); - if (!_button.get('disabled') && (ev.keyCode != 9)) { - var value = parseInt(_button.get('label'), 10); - value++; - value = cleanVal(value); - _button.set('label', ''+value); - var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') }); - _button.set('title', label); - if (!br.webkit && tbar) { - //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed - //_button.focus(); - } - self._buttonClick(ev, oButton); - } - }; - - var _intDown = function(ev) { - YAHOO.util.Event.stopEvent(ev); - if (!_button.get('disabled') && (ev.keyCode != 9)) { - var value = parseInt(_button.get('label'), 10); - value--; - value = cleanVal(value); - - _button.set('label', ''+value); - var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') }); - _button.set('title', label); - if (!br.webkit && tbar) { - //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed - //_button.focus(); - } - self._buttonClick(ev, oButton); - } - }; - - var _intKeyUp = function(ev) { - if (ev.keyCode == 38) { - _intUp(ev); - } else if (ev.keyCode == 40) { - _intDown(ev); - } else if (ev.keyCode == 107 && ev.shiftKey) { //Plus Key - _intUp(ev); - } else if (ev.keyCode == 109 && ev.shiftKey) { //Minus Key - _intDown(ev); - } - }; - - //Handle arrow keys.. - _button.on('keydown', _intKeyUp, this, true); - - //Listen for the click on the up button and act on it - //Listen for the click on the down button and act on it - Event.on(_b1, 'mousedown',function(ev) { - Event.stopEvent(ev); - }, this, true); - Event.on(_b2, 'mousedown', function(ev) { - Event.stopEvent(ev); - }, this, true); - Event.on(_b1, 'click', _intUp, this, true); - Event.on(_b2, 'click', _intDown, this, true); - }, - /** - * @protected - * @method _buttonClick - * @description Click handler for all buttons in the toolbar. - * @param {String} ev The event that was passed in. - * @param {Object} info Object literal of information about the button that was clicked. - */ - _buttonClick: function(ev, info) { - var doEvent = true; - - if (ev && ev.type == 'keypress') { - if (ev.keyCode == 9) { - doEvent = false; - } else if ((ev.keyCode === 13) || (ev.keyCode === 0) || (ev.keyCode === 32)) { - } else { - doEvent = false; - } - } - - if (doEvent) { - var fireNextEvent = true, - retValue = false; - - info.isSelected = this.isSelected(info.id); - - if (info.value) { - YAHOO.log('fireEvent::' + info.value + 'Click', 'info', 'Toolbar'); - retValue = this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info }); - if (retValue === false) { - fireNextEvent = false; - } - } - - if (info.menucmd && fireNextEvent) { - YAHOO.log('fireEvent::' + info.menucmd + 'Click', 'info', 'Toolbar'); - retValue = this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info }); - if (retValue === false) { - fireNextEvent = false; - } - } - if (fireNextEvent) { - YAHOO.log('fireEvent::buttonClick', 'info', 'Toolbar'); - this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info }); - } - - if (info.type == 'select') { - var button = this.getButtonById(info.id); - if (button.buttonType == 'rich') { - var txt = info.value; - for (var i = 0; i < info.menu.length; i++) { - if (info.menu[i].value == info.value) { - txt = info.menu[i].text; - break; - } - } - button.set('label', '' + txt + ''); - var _items = button.getMenu().getItems(); - for (var m = 0; m < _items.length; m++) { - if (_items[m].value.toLowerCase() == info.value.toLowerCase()) { - _items[m].cfg.setProperty('checked', true); - } else { - _items[m].cfg.setProperty('checked', false); - } - } - } - } - if (ev) { - Event.stopEvent(ev); - } - } - }, - /** - * @private - * @property _keyNav - * @description Flag to determine if the arrow nav listeners have been attached - * @type Boolean - */ - _keyNav: null, - /** - * @private - * @property _navCounter - * @description Internal counter for walking the buttons in the toolbar with the arrow keys - * @type Number - */ - _navCounter: null, - /** - * @private - * @method _navigateButtons - * @description Handles the navigation/focus of toolbar buttons with the Arrow Keys - * @param {Event} ev The Key Event - */ - _navigateButtons: function(ev) { - switch (ev.keyCode) { - case 37: - case 39: - if (ev.keyCode == 37) { - this._navCounter--; - } else { - this._navCounter++; - } - if (this._navCounter > (this._buttonList.length - 1)) { - this._navCounter = 0; - } - if (this._navCounter < 0) { - this._navCounter = (this._buttonList.length - 1); - } - if (this._buttonList[this._navCounter]) { - var el = this._buttonList[this._navCounter].get('element'); - if (this.browser.ie) { - el = this._buttonList[this._navCounter].get('element').getElementsByTagName('a')[0]; - } - if (this._buttonList[this._navCounter].get('disabled')) { - this._navigateButtons(ev); - } else { - el.focus(); - } - } - break; - } - }, - /** - * @private - * @method _handleFocus - * @description Sets up the listeners for the arrow key navigation - */ - _handleFocus: function() { - if (!this._keyNav) { - var ev = 'keypress'; - if (this.browser.ie) { - ev = 'keydown'; - } - Event.on(this.get('element'), ev, this._navigateButtons, this, true); - this._keyNav = true; - this._navCounter = -1; - } - }, - /** - * @method getButtonById - * @description Gets a button instance from the toolbar by is Dom id. - * @param {String} id The Dom id to query for. - * @return {YAHOO.widget.ToolbarButton} - */ - getButtonById: function(id) { - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - if (this._buttonList[i] && this._buttonList[i].get('id') == id) { - return this._buttonList[i]; - } - } - return false; - }, - /** - * @method getButtonByValue - * @description Gets a button instance or a menuitem instance from the toolbar by it's value. - * @param {String} value The button value to query for. - * @return {YAHOO.widget.ToolbarButton or YAHOO.widget.MenuItem} - */ - getButtonByValue: function(value) { - var _buttons = this.get('buttons'); - if (!_buttons) { - return false; - } - var len = _buttons.length; - for (var i = 0; i < len; i++) { - if (_buttons[i].group !== undefined) { - for (var m = 0; m < _buttons[i].buttons.length; m++) { - if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) { - return this.getButtonById(_buttons[i].buttons[m].id); - } - if (_buttons[i].buttons[m].menu) { //Menu Button, loop through the values - for (var s = 0; s < _buttons[i].buttons[m].menu.length; s++) { - if (_buttons[i].buttons[m].menu[s].value == value) { - return this.getButtonById(_buttons[i].buttons[m].id); - } - } - } - } - } else { - if ((_buttons[i].value == value) || (_buttons[i].menucmd == value)) { - return this.getButtonById(_buttons[i].id); - } - if (_buttons[i].menu) { //Menu Button, loop through the values - for (var j = 0; j < _buttons[i].menu.length; j++) { - if (_buttons[i].menu[j].value == value) { - return this.getButtonById(_buttons[i].id); - } - } - } - } - } - return false; - }, - /** - * @method getButtonByIndex - * @description Gets a button instance from the toolbar by is index in _buttonList. - * @param {Number} index The index of the button in _buttonList. - * @return {YAHOO.widget.ToolbarButton} - */ - getButtonByIndex: function(index) { - if (this._buttonList[index]) { - return this._buttonList[index]; - } else { - return false; - } - }, - /** - * @method getButtons - * @description Returns an array of buttons in the current toolbar - * @return {Array} - */ - getButtons: function() { - return this._buttonList; - }, - /** - * @method disableButton - * @description Disables a button in the toolbar. - * @param {String/Number} id Disable a button by it's id, index or value. - * @return {Boolean} - */ - disableButton: function(id) { - var button = getButton.call(this, id); - if (button) { - button.set('disabled', true); - } else { - return false; - } - }, - /** - * @method enableButton - * @description Enables a button in the toolbar. - * @param {String/Number} id Enable a button by it's id, index or value. - * @return {Boolean} - */ - enableButton: function(id) { - if (this.get('disabled')) { - return false; - } - var button = getButton.call(this, id); - if (button) { - if (button.get('disabled')) { - button.set('disabled', false); - } - } else { - return false; - } - }, - /** - * @method isSelected - * @description Tells if a button is selected or not. - * @param {String/Number} id A button by it's id, index or value. - * @return {Boolean} - */ - isSelected: function(id) { - var button = getButton.call(this, id); - if (button) { - return button._selected; - } - return false; - }, - /** - * @method selectButton - * @description Selects a button in the toolbar. - * @param {String/Number} id Select a button by it's id, index or value. - * @param {String} value If this is a Menu Button, check this item in the menu - * @return {Boolean} - */ - selectButton: function(id, value) { - var button = getButton.call(this, id); - if (button) { - button.addClass('yui-button-selected'); - button.addClass('yui-button-' + button.get('value') + '-selected'); - button._selected = true; - if (value) { - if (button.buttonType == 'rich') { - var _items = button.getMenu().getItems(); - for (var m = 0; m < _items.length; m++) { - if (_items[m].value == value) { - _items[m].cfg.setProperty('checked', true); - button.set('label', '' + _items[m]._oText.nodeValue + ''); - } else { - _items[m].cfg.setProperty('checked', false); - } - } - } - } - } else { - return false; - } - }, - /** - * @method deselectButton - * @description Deselects a button in the toolbar. - * @param {String/Number} id Deselect a button by it's id, index or value. - * @return {Boolean} - */ - deselectButton: function(id) { - var button = getButton.call(this, id); - if (button) { - button.removeClass('yui-button-selected'); - button.removeClass('yui-button-' + button.get('value') + '-selected'); - button.removeClass('yui-button-hover'); - button._selected = false; - } else { - return false; - } - }, - /** - * @method deselectAllButtons - * @description Deselects all buttons in the toolbar. - * @return {Boolean} - */ - deselectAllButtons: function() { - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.deselectButton(this._buttonList[i]); - } - }, - /** - * @method disableAllButtons - * @description Disables all buttons in the toolbar. - * @return {Boolean} - */ - disableAllButtons: function() { - if (this.get('disabled')) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.disableButton(this._buttonList[i]); - } - }, - /** - * @method enableAllButtons - * @description Enables all buttons in the toolbar. - * @return {Boolean} - */ - enableAllButtons: function() { - if (this.get('disabled')) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.enableButton(this._buttonList[i]); - } - }, - /** - * @method resetAllButtons - * @description Resets all buttons to their initial state. - * @param {Object} _ex Except these buttons - * @return {Boolean} - */ - resetAllButtons: function(_ex) { - if (!Lang.isObject(_ex)) { - _ex = {}; - } - if (this.get('disabled') || !this._buttonList) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - var _button = this._buttonList[i]; - if (_button) { - var disabled = _button._configs.disabled._initialConfig.value; - if (_ex[_button.get('id')]) { - this.enableButton(_button); - this.selectButton(_button); - } else { - if (disabled) { - this.disableButton(_button); - } else { - this.enableButton(_button); - } - this.deselectButton(_button); - } - } - } - }, - /** - * @method destroyButton - * @description Destroy a button in the toolbar. - * @param {String/Number} id Destroy a button by it's id or index. - * @return {Boolean} - */ - destroyButton: function(id) { - var button = getButton.call(this, id); - if (button) { - var thisID = button.get('id'), - new_list = [], i = 0, - len = this._buttonList.length; - - button.destroy(); - - for (i = 0; i < len; i++) { - if (this._buttonList[i].get('id') != thisID) { - new_list[new_list.length]= this._buttonList[i]; - } - } - - this._buttonList = new_list; - } else { - return false; - } - }, - /** - * @method destroy - * @description Destroys the toolbar, all of it's elements and objects. - * @return {Boolean} - */ - destroy: function() { - var len = this._configuredButtons.length, j, i; - for(b = 0; b < len; b++) { - this.destroyButton(this._configuredButtons[b]); - } - - this._configuredButtons = null; - - this.get('element').innerHTML = ''; - this.get('element').className = ''; - //Brutal Object Destroy - for (i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - return true; - }, - /** - * @method collapse - * @description Programatically collapse the toolbar. - * @param {Boolean} collapse True to collapse, false to expand. - */ - collapse: function(collapse) { - var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapse === false) { - Dom.removeClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed'); - if (el[0]) { - Dom.removeClass(el[0], 'collapsed'); - el[0].title = this.STR_COLLAPSE; - } - this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this }); - } else { - if (el[0]) { - Dom.addClass(el[0], 'collapsed'); - el[0].title = this.STR_EXPAND; - } - Dom.addClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed'); - this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this }); - } - }, - /** - * @method toString - * @description Returns a string representing the toolbar. - * @return {String} - */ - toString: function() { - return 'Toolbar (#' + this.get('element').id + ') with ' + this._buttonList.length + ' buttons.'; - } - }); -/** -* @event buttonClick -* @param {Object} o The object passed to this handler is the button config used to create the button. -* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event valueClick -* @param {Object} o The object passed to this handler is the button config used to create the button. -* @description This is a special dynamic event that is created and dispatched based on the value property -* of the button config. See Element.addListener for more information on listening for this event. -* Example: -*
              -* buttons : [
              -*   { type: 'button', value: 'test', value: 'testButton' }
              -* ]
              -*
              -* With the valueClick event you could subscribe to this buttons click event with this: -* tbar.in('testButtonClick', function() { alert('test button clicked'); }) -* @type YAHOO.util.CustomEvent -*/ -/** -* @event toolbarExpanded -* @description Fires when the toolbar is expanded via the collapse button. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event toolbarCollapsed -* @description Fires when the toolbar is collapsed via the collapse button. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -})(); -/** - * @module editor - * @description

              The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.

              - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, toolbar - * @optional animation, container_core, resize, dragdrop - */ - -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang, - Toolbar = YAHOO.widget.Toolbar; - - /** - * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization. - * @constructor - * @class SimpleEditor - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The textarea element to turn into an editor. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.SimpleEditor = function(el, attrs) { - YAHOO.log('SimpleEditor Initalizing', 'info', 'SimpleEditor'); - - var o = {}; - if (Lang.isObject(el) && (!el.tagName) && !attrs) { - Lang.augmentObject(o, el); //Break the config reference - el = document.createElement('textarea'); - this.DOMReady = true; - if (o.container) { - var c = Dom.get(o.container); - c.appendChild(el); - } else { - document.body.appendChild(el); - } - } else { - if (attrs) { - Lang.augmentObject(o, attrs); //Break the config reference - } - } - - var oConfig = { - element: null, - attributes: o - }, id = null; - - if (Lang.isString(el)) { - id = el; - } else { - if (oConfig.attributes.id) { - id = oConfig.attributes.id; - } else { - this.DOMReady = true; - id = Dom.generateId(el); - } - } - oConfig.element = el; - - var element_cont = document.createElement('DIV'); - oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, { - id: id + '_container' - }); - var div = document.createElement('div'); - Dom.addClass(div, 'first-child'); - oConfig.attributes.element_cont.appendChild(div); - - if (!oConfig.attributes.toolbar_cont) { - oConfig.attributes.toolbar_cont = document.createElement('DIV'); - oConfig.attributes.toolbar_cont.id = id + '_toolbar'; - div.appendChild(oConfig.attributes.toolbar_cont); - } - var editorWrapper = document.createElement('DIV'); - div.appendChild(editorWrapper); - oConfig.attributes.editor_wrapper = editorWrapper; - - YAHOO.widget.SimpleEditor.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - - YAHOO.extend(YAHOO.widget.SimpleEditor, YAHOO.util.Element, { - /** - * @private - * @property _resizeConfig - * @description The default config for the Resize Utility - */ - _resizeConfig: { - handles: ['br'], - autoRatio: true, - status: true, - proxy: true, - useShim: true, - setSize: false - }, - /** - * @private - * @method _setupResize - * @description Creates the Resize instance and binds its events. - */ - _setupResize: function() { - if (!YAHOO.util.DD || !YAHOO.util.Resize) { return false; } - if (this.get('resize')) { - var config = {}; - Lang.augmentObject(config, this._resizeConfig); //Break the config reference - this.resize = new YAHOO.util.Resize(this.get('element_cont').get('element'), config); - this.resize.on('resize', function(args) { - var anim = this.get('animate'); - this.set('animate', false); - this.set('width', args.width + 'px'); - var h = args.height, - th = (this.toolbar.get('element').clientHeight + 2), - dh = 0; - if (this.dompath) { - dh = (this.dompath.clientHeight + 1); //It has a 1px top border.. - } - var newH = (h - th - dh); - this.set('height', newH + 'px'); - this.get('element_cont').setStyle('height', ''); - this.set('animate', anim); - }, this, true); - } - }, - /** - * @property resize - * @description A reference to the Resize object - * @type YAHOO.util.Resize - */ - resize: null, - /** - * @private - * @method _setupDD - * @description Sets up the DD instance used from the 'drag' config option. - */ - _setupDD: function() { - if (!YAHOO.util.DD) { return false; } - if (this.get('drag')) { - YAHOO.log('Attaching DD instance to Editor', 'info', 'SimpleEditor'); - var d = this.get('drag'), - dd = YAHOO.util.DD; - if (d === 'proxy') { - dd = YAHOO.util.DDProxy; - } - - this.dd = new dd(this.get('element_cont').get('element')); - this.toolbar.addClass('draggable'); - this.dd.setHandleElId(this.toolbar._titlebar); - } - }, - /** - * @property dd - * @description A reference to the DragDrop object. - * @type YAHOO.util.DD/YAHOO.util.DDProxy - */ - dd: null, - /** - * @private - * @property _lastCommand - * @description A cache of the last execCommand (used for Undo/Redo so they don't mark an undo level) - * @type String - */ - _lastCommand: null, - _undoNodeChange: function() {}, - _storeUndo: function() {}, - /** - * @private - * @method _checkKey - * @description Checks a keyMap entry against a key event - * @param {Object} k The _keyMap object - * @param {Event} e The Mouse Event - * @return {Boolean} - */ - _checkKey: function(k, e) { - var ret = false; - if ((e.keyCode === k.key)) { - if (k.mods && (k.mods.length > 0)) { - var val = 0; - for (var i = 0; i < k.mods.length; i++) { - if (this.browser.mac) { - if (k.mods[i] == 'ctrl') { - k.mods[i] = 'meta'; - } - } - if (e[k.mods[i] + 'Key'] === true) { - val++; - } - } - if (val === k.mods.length) { - ret = true; - } - } else { - ret = true; - } - } - //YAHOO.log('Shortcut Key Check: (' + k.key + ') return: ' + ret, 'info', 'SimpleEditor'); - return ret; - }, - /** - * @private - * @property _keyMap - * @description Named key maps for various actions in the Editor. Example: CLOSE_WINDOW: { key: 87, mods: ['shift', 'ctrl'] }. - * This entry shows that when key 87 (W) is found with the modifiers of shift and control, the window will close. You can customize this object to tweak keyboard shortcuts. - * @type {Object/Mixed} - */ - _keyMap: { - SELECT_ALL: { - key: 65, //A key - mods: ['ctrl'] - }, - CLOSE_WINDOW: { - key: 87, //W key - mods: ['shift', 'ctrl'] - }, - FOCUS_TOOLBAR: { - key: 27, - mods: ['shift'] - }, - FOCUS_AFTER: { - key: 27 - }, - FONT_SIZE_UP: { - key: 38, - mods: ['shift', 'ctrl'] - }, - FONT_SIZE_DOWN: { - key: 40, - mods: ['shift', 'ctrl'] - }, - CREATE_LINK: { - key: 76, - mods: ['shift', 'ctrl'] - }, - BOLD: { - key: 66, - mods: ['shift', 'ctrl'] - }, - ITALIC: { - key: 73, - mods: ['shift', 'ctrl'] - }, - UNDERLINE: { - key: 85, - mods: ['shift', 'ctrl'] - }, - UNDO: { - key: 90, - mods: ['ctrl'] - }, - REDO: { - key: 90, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_LEFT: { - key: 219, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_CENTER: { - key: 220, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_RIGHT: { - key: 221, - mods: ['shift', 'ctrl'] - } - }, - /** - * @private - * @method _cleanClassName - * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s. - * @param {String} str The classname to clean up - * @return {String} - */ - _cleanClassName: function(str) { - return str.replace(/ /g, '-').toLowerCase(); - }, - /** - * @property _textarea - * @description Flag to determine if we are using a textarea or an HTML Node. - * @type Boolean - */ - _textarea: null, - /** - * @property _docType - * @description The DOCTYPE to use in the editable container. - * @type String - */ - _docType: '', - /** - * @property editorDirty - * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed. - * @type Boolean - */ - editorDirty: null, - /** - * @property _defaultCSS - * @description The default CSS used in the config for 'css'. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + 'ADD MYY CSS HERE' } - * @type String - */ - _defaultCSS: 'html { height: 95%; } body { padding: 7px; background-color: #fff; font: 13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div.yui-wk-p { margin: 11px 0; } body.ptags.webkit div.yui-wk-div { margin: 0; }', - /** - * @property _defaultToolbar - * @private - * @description Default toolbar config. - * @type Object - */ - _defaultToolbar: null, - /** - * @property _lastButton - * @private - * @description The last button pressed, so we don't disable it. - * @type Object - */ - _lastButton: null, - /** - * @property _baseHREF - * @private - * @description The base location of the editable page (this page) so that relative paths for image work. - * @type String - */ - _baseHREF: function() { - var href = document.location.href; - if (href.indexOf('?') !== -1) { //Remove the query string - href = href.substring(0, href.indexOf('?')); - } - href = href.substring(0, href.lastIndexOf('/')) + '/'; - return href; - }(), - /** - * @property _lastImage - * @private - * @description Safari reference for the last image selected (for styling as selected). - * @type HTMLElement - */ - _lastImage: null, - /** - * @property _blankImageLoaded - * @private - * @description Don't load the blank image more than once.. - * @type Boolean - */ - _blankImageLoaded: null, - /** - * @property _fixNodesTimer - * @private - * @description Holder for the fixNodes timer - * @type Date - */ - _fixNodesTimer: null, - /** - * @property _nodeChangeTimer - * @private - * @description Holds a reference to the nodeChange setTimeout call - * @type Number - */ - _nodeChangeTimer: null, - /** - * @property _nodeChangeDelayTimer - * @private - * @description Holds a reference to the nodeChangeDelay setTimeout call - * @type Number - */ - _nodeChangeDelayTimer: null, - /** - * @property _lastNodeChangeEvent - * @private - * @description Flag to determine the last event that fired a node change - * @type Event - */ - _lastNodeChangeEvent: null, - /** - * @property _lastNodeChange - * @private - * @description Flag to determine when the last node change was fired - * @type Date - */ - _lastNodeChange: 0, - /** - * @property _rendered - * @private - * @description Flag to determine if editor has been rendered or not - * @type Boolean - */ - _rendered: null, - /** - * @property DOMReady - * @private - * @description Flag to determine if DOM is ready or not - * @type Boolean - */ - DOMReady: null, - /** - * @property _selection - * @private - * @description Holder for caching iframe selections - * @type Object - */ - _selection: null, - /** - * @property _mask - * @private - * @description DOM Element holder for the editor Mask when disabled - * @type Object - */ - _mask: null, - /** - * @property _showingHiddenElements - * @private - * @description Status of the hidden elements button - * @type Boolean - */ - _showingHiddenElements: null, - /** - * @property currentWindow - * @description A reference to the currently open EditorWindow - * @type Object - */ - currentWindow: null, - /** - * @property currentEvent - * @description A reference to the current editor event - * @type Event - */ - currentEvent: null, - /** - * @property operaEvent - * @private - * @description setTimeout holder for Opera and Image DoubleClick event.. - * @type Object - */ - operaEvent: null, - /** - * @property currentFont - * @description A reference to the last font selected from the Toolbar - * @type HTMLElement - */ - currentFont: null, - /** - * @property currentElement - * @description A reference to the current working element in the editor - * @type Array - */ - currentElement: null, - /** - * @property dompath - * @description A reference to the dompath container for writing the current working dom path to. - * @type HTMLElement - */ - dompath: null, - /** - * @property beforeElement - * @description A reference to the H2 placed before the editor for Accessibilty. - * @type HTMLElement - */ - beforeElement: null, - /** - * @property afterElement - * @description A reference to the H2 placed after the editor for Accessibilty. - * @type HTMLElement - */ - afterElement: null, - /** - * @property invalidHTML - * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine. - * @type Object - */ - invalidHTML: { - form: true, - input: true, - button: true, - select: true, - link: true, - html: true, - body: true, - iframe: true, - script: true, - style: true, - textarea: true - }, - /** - * @property toolbar - * @description Local property containing the YAHOO.widget.Toolbar instance - * @type YAHOO.widget.Toolbar - */ - toolbar: null, - /** - * @private - * @property _contentTimer - * @description setTimeout holder for documentReady check - */ - _contentTimer: null, - /** - * @private - * @property _contentTimerMax - * @description The number of times the loaded content should be checked before giving up. Default: 500 - */ - _contentTimerMax: 500, - /** - * @private - * @property _contentTimerCounter - * @description Counter to check the number of times the body is polled for before giving up - * @type Number - */ - _contentTimerCounter: 0, - /** - * @private - * @property _disabled - * @description The Toolbar items that should be disabled if there is no selection present in the editor. - * @type Array - */ - _disabled: [ 'createlink', 'fontname', 'fontsize', 'forecolor', 'backcolor' ], - /** - * @private - * @property _alwaysDisabled - * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor. - * @type Object - */ - _alwaysDisabled: { undo: true, redo: true }, - /** - * @private - * @property _alwaysEnabled - * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor. - * @type Object - */ - _alwaysEnabled: { }, - /** - * @private - * @property _semantic - * @description The Toolbar commands that we should attempt to make tags out of instead of using styles. - * @type Object - */ - _semantic: { 'bold': true, 'italic' : true, 'underline' : true }, - /** - * @private - * @property _tag2cmd - * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button. - * @type Object - */ - _tag2cmd: { - 'b': 'bold', - 'strong': 'bold', - 'i': 'italic', - 'em': 'italic', - 'u': 'underline', - 'sup': 'superscript', - 'sub': 'subscript', - 'img': 'insertimage', - 'a' : 'createlink', - 'ul' : 'insertunorderedlist', - 'ol' : 'insertorderedlist' - }, - - /** - * @private _createIframe - * @description Creates the DOM and YUI Element for the iFrame editor area. - * @param {String} id The string ID to prefix the iframe with - * @return {Object} iFrame object - */ - _createIframe: function() { - var ifrmDom = document.createElement('iframe'); - ifrmDom.id = this.get('id') + '_editor'; - var config = { - border: '0', - frameBorder: '0', - marginWidth: '0', - marginHeight: '0', - leftMargin: '0', - topMargin: '0', - allowTransparency: 'true', - width: '100%' - }; - if (this.get('autoHeight')) { - config.scrolling = 'no'; - } - for (var i in config) { - if (Lang.hasOwnProperty(config, i)) { - ifrmDom.setAttribute(i, config[i]); - } - } - var isrc = 'javascript:;'; - if (this.browser.ie) { - //isrc = 'about:blank'; - //TODO - Check this, I have changed it before.. - isrc = 'javascript:false;'; - } - ifrmDom.setAttribute('src', isrc); - var ifrm = new YAHOO.util.Element(ifrmDom); - ifrm.setStyle('visibility', 'hidden'); - return ifrm; - }, - /** - * @private _isElement - * @description Checks to see if an Element reference is a valid one and has a certain tag type - * @param {HTMLElement} el The element to check - * @param {String} tag The tag that the element needs to be - * @return {Boolean} - */ - _isElement: function(el, tag) { - if (el && el.tagName && (el.tagName.toLowerCase() == tag)) { - return true; - } - if (el && el.getAttribute && (el.getAttribute('tag') == tag)) { - return true; - } - return false; - }, - /** - * @private _hasParent - * @description Checks to see if an Element reference or one of it's parents is a valid one and has a certain tag type - * @param {HTMLElement} el The element to check - * @param {String} tag The tag that the element needs to be - * @return HTMLElement - */ - _hasParent: function(el, tag) { - if (!el || !el.parentNode) { - return false; - } - - while (el.parentNode) { - if (this._isElement(el, tag)) { - return el; - } - if (el.parentNode) { - el = el.parentNode; - } else { - return false; - } - } - return false; - }, - /** - * @private - * @method _getDoc - * @description Get the Document of the IFRAME - * @return {Object} - */ - _getDoc: function() { - var value = false; - try { - if (this.get('iframe').get('element').contentWindow.document) { - value = this.get('iframe').get('element').contentWindow.document; - return value; - } - } catch (e) { - return false; - } - }, - /** - * @private - * @method _getWindow - * @description Get the Window of the IFRAME - * @return {Object} - */ - _getWindow: function() { - return this.get('iframe').get('element').contentWindow; - }, - /** - * @method focus - * @description Attempt to set the focus of the iframes window. - */ - focus: function() { - this._getWindow().focus(); - }, - /** - * @private - * @depreciated - This should not be used, moved to this.focus(); - * @method _focusWindow - * @description Attempt to set the focus of the iframes window. - */ - _focusWindow: function() { - YAHOO.log('_focusWindow: depreciated in favor of this.focus()', 'warn', 'Editor'); - this.focus(); - }, - /** - * @private - * @method _hasSelection - * @description Determines if there is a selection in the editor document. - * @return {Boolean} - */ - _hasSelection: function() { - var sel = this._getSelection(); - var range = this._getRange(); - var hasSel = false; - - if (!sel || !range) { - return hasSel; - } - - //Internet Explorer - if (this.browser.ie || this.browser.opera) { - if (range.text) { - hasSel = true; - } - if (range.html) { - hasSel = true; - } - } else { - if (this.browser.webkit) { - if (sel+'' !== '') { - hasSel = true; - } - } else { - if (sel && (sel.toString() !== '') && (sel !== undefined)) { - hasSel = true; - } - } - } - return hasSel; - }, - /** - * @private - * @method _getSelection - * @description Handles the different selection objects across the A-Grade list. - * @return {Object} Selection Object - */ - _getSelection: function() { - var _sel = null; - if (this._getDoc() && this._getWindow()) { - if (this._getDoc().selection) { - _sel = this._getDoc().selection; - } else { - _sel = this._getWindow().getSelection(); - } - //Handle Safari's lack of Selection Object - if (this.browser.webkit) { - if (_sel.baseNode) { - this._selection = {}; - this._selection.baseNode = _sel.baseNode; - this._selection.baseOffset = _sel.baseOffset; - this._selection.extentNode = _sel.extentNode; - this._selection.extentOffset = _sel.extentOffset; - } else if (this._selection !== null) { - _sel = this._getWindow().getSelection(); - _sel.setBaseAndExtent( - this._selection.baseNode, - this._selection.baseOffset, - this._selection.extentNode, - this._selection.extentOffset); - this._selection = null; - } - } - } - return _sel; - }, - /** - * @private - * @method _selectNode - * @description Places the highlight around a given node - * @param {HTMLElement} node The node to select - */ - _selectNode: function(node, collapse) { - if (!node) { - return false; - } - var sel = this._getSelection(), - range = null; - - if (this.browser.ie) { - try { //IE freaks out here sometimes.. - range = this._getDoc().body.createTextRange(); - range.moveToElementText(node); - range.select(); - } catch (e) { - YAHOO.log('IE failed to select element: ' + node.tagName, 'warn', 'SimpleEditor'); - } - } else if (this.browser.webkit) { - if (collapse) { - sel.setBaseAndExtent(node, 1, node, node.innerText.length); - } else { - sel.setBaseAndExtent(node, 0, node, node.innerText.length); - } - } else if (this.browser.opera) { - sel = this._getWindow().getSelection(); - range = this._getDoc().createRange(); - range.selectNode(node); - sel.removeAllRanges(); - sel.addRange(range); - } else { - range = this._getDoc().createRange(); - range.selectNodeContents(node); - sel.removeAllRanges(); - sel.addRange(range); - } - //TODO - Check Performance - this.nodeChange(); - }, - /** - * @private - * @method _getRange - * @description Handles the different range objects across the A-Grade list. - * @return {Object} Range Object - */ - _getRange: function() { - var sel = this._getSelection(); - - if (sel === null) { - return null; - } - - if (this.browser.webkit && !sel.getRangeAt) { - var _range = this._getDoc().createRange(); - try { - _range.setStart(sel.anchorNode, sel.anchorOffset); - _range.setEnd(sel.focusNode, sel.focusOffset); - } catch (e) { - _range = this._getWindow().getSelection()+''; - } - return _range; - } - - if (this.browser.ie || this.browser.opera) { - try { - return sel.createRange(); - } catch (e2) { - return null; - } - } - - if (sel.rangeCount > 0) { - return sel.getRangeAt(0); - } - return null; - }, - /** - * @private - * @method _setDesignMode - * @description Sets the designMode property of the iFrame document's body. - * @param {String} state This should be either on or off - */ - _setDesignMode: function(state) { - if (this.get('setDesignMode')) { - try { - this._getDoc().designMode = ((state.toLowerCase() == 'off') ? 'off' : 'on'); - } catch(e) { } - } - }, - /** - * @private - * @method _toggleDesignMode - * @description Toggles the designMode property of the iFrame document on and off. - * @return {String} The state that it was set to. - */ - _toggleDesignMode: function() { - YAHOO.log('It is not recommended to use this method and it will be depreciated.', 'warn', 'SimpleEditor'); - var _dMode = this._getDoc().designMode, - _state = ((_dMode.toLowerCase() == 'on') ? 'off' : 'on'); - this._setDesignMode(_state); - return _state; - }, - /** - * @private - * @property _focused - * @description Holder for trapping focus/blur state and prevent double events - * @type Boolean - */ - _focused: null, - /** - * @private - * @method _handleFocus - * @description Handles the focus of the iframe. Note, this is window focus event, not an Editor focus event. - * @param {Event} e The DOM Event - */ - _handleFocus: function(e) { - if (!this._focused) { - //YAHOO.log('Editor Window Focused', 'info', 'SimpleEditor'); - this._focused = true; - this.fireEvent('editorWindowFocus', { type: 'editorWindowFocus', target: this }); - } - }, - /** - * @private - * @method _handleBlur - * @description Handles the blur of the iframe. Note, this is window blur event, not an Editor blur event. - * @param {Event} e The DOM Event - */ - _handleBlur: function(e) { - if (this._focused) { - //YAHOO.log('Editor Window Blurred', 'info', 'SimpleEditor'); - this._focused = false; - this.fireEvent('editorWindowBlur', { type: 'editorWindowBlur', target: this }); - } - }, - /** - * @private - * @method _initEditorEvents - * @description This method sets up the listeners on the Editors document. - */ - _initEditorEvents: function() { - //Setup Listeners on iFrame - var doc = this._getDoc(), - win = this._getWindow(); - - Event.on(doc, 'mouseup', this._handleMouseUp, this, true); - Event.on(doc, 'mousedown', this._handleMouseDown, this, true); - Event.on(doc, 'click', this._handleClick, this, true); - Event.on(doc, 'dblclick', this._handleDoubleClick, this, true); - Event.on(doc, 'keypress', this._handleKeyPress, this, true); - Event.on(doc, 'keyup', this._handleKeyUp, this, true); - Event.on(doc, 'keydown', this._handleKeyDown, this, true); - /* TODO -- Everyone but Opera works here.. - Event.on(doc, 'paste', function() { - YAHOO.log('PASTE', 'info', 'SimpleEditor'); - }, this, true); - */ - - //Focus and blur.. - Event.on(win, 'focus', this._handleFocus, this, true); - Event.on(win, 'blur', this._handleBlur, this, true); - }, - /** - * @private - * @method _removeEditorEvents - * @description This method removes the listeners on the Editors document (for disabling). - */ - _removeEditorEvents: function() { - //Remove Listeners on iFrame - var doc = this._getDoc(), - win = this._getWindow(); - - Event.removeListener(doc, 'mouseup', this._handleMouseUp, this, true); - Event.removeListener(doc, 'mousedown', this._handleMouseDown, this, true); - Event.removeListener(doc, 'click', this._handleClick, this, true); - Event.removeListener(doc, 'dblclick', this._handleDoubleClick, this, true); - Event.removeListener(doc, 'keypress', this._handleKeyPress, this, true); - Event.removeListener(doc, 'keyup', this._handleKeyUp, this, true); - Event.removeListener(doc, 'keydown', this._handleKeyDown, this, true); - - //Focus and blur.. - Event.removeListener(win, 'focus', this._handleFocus, this, true); - Event.removeListener(win, 'blur', this._handleBlur, this, true); - }, - _fixWebkitDivs: function() { - if (this.browser.webkit) { - var divs = this._getDoc().body.getElementsByTagName('div'); - Dom.addClass(divs, 'yui-wk-div'); - } - }, - /** - * @private - * @method _initEditor - * @param {Boolean} raw Don't add events. - * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners. - */ - _initEditor: function(raw) { - if (this._editorInit) { - return; - } - this._editorInit = true; - if (this.browser.ie) { - this._getDoc().body.style.margin = '0'; - } - if (!this.get('disabled')) { - this._setDesignMode('on'); - this._contentTimerCounter = 0; - } - if (!this._getDoc().body) { - YAHOO.log('Body is null, check again', 'error', 'SimpleEditor'); - this._contentTimerCounter = 0; - this._editorInit = false; - this._checkLoaded(); - return false; - } - - YAHOO.log('editorLoaded', 'info', 'SimpleEditor'); - if (!raw) { - this.toolbar.on('buttonClick', this._handleToolbarClick, this, true); - } - if (!this.get('disabled')) { - this._initEditorEvents(); - this.toolbar.set('disabled', false); - } - - if (raw) { - this.fireEvent('editorContentReloaded', { type: 'editorreloaded', target: this }); - } else { - this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this }); - } - this._fixWebkitDivs(); - if (this.get('dompath')) { - YAHOO.log('Delayed DomPath write', 'info', 'SimpleEditor'); - var self = this; - setTimeout(function() { - self._writeDomPath.call(self); - self._setupResize.call(self); - }, 150); - } - var br = []; - for (var i in this.browser) { - if (this.browser[i]) { - br.push(i); - } - } - if (this.get('ptags')) { - br.push('ptags'); - } - Dom.addClass(this._getDoc().body, br.join(' ')); - this.nodeChange(true); - }, - /** - * @private - * @method _checkLoaded - * @param {Boolean} raw Don't add events. - * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor. - */ - _checkLoaded: function(raw) { - this._editorInit = false; - this._contentTimerCounter++; - if (this._contentTimer) { - clearTimeout(this._contentTimer); - } - if (this._contentTimerCounter > this._contentTimerMax) { - YAHOO.log('ERROR: Body Did Not load', 'error', 'SimpleEditor'); - return false; - } - var init = false; - try { - if (this._getDoc() && this._getDoc().body) { - if (this.browser.ie) { - if (this._getDoc().body.readyState == 'complete') { - init = true; - } - } else { - if (this._getDoc().body._rteLoaded === true) { - init = true; - } - } - } - } catch (e) { - init = false; - YAHOO.log('checking body (e)' + e, 'error', 'SimpleEditor'); - } - - if (init === true) { - //The onload event has fired, clean up after ourselves and fire the _initEditor method - YAHOO.log('Firing _initEditor', 'info', 'SimpleEditor'); - this._initEditor(raw); - } else { - var self = this; - this._contentTimer = setTimeout(function() { - self._checkLoaded.call(self, raw); - }, 20); - } - }, - /** - * @private - * @method _setInitialContent - * @param {Boolean} raw Don't add events. - * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking. - */ - _setInitialContent: function(raw) { - YAHOO.log('Populating editor body with contents of the text area', 'info', 'SimpleEditor'); - - var value = ((this._textarea) ? this.get('element').value : this.get('element').innerHTML), - doc = null; - - if (value === '') { - value = '
              '; - } - - var html = Lang.substitute(this.get('html'), { - TITLE: this.STR_TITLE, - CONTENT: this._cleanIncomingHTML(value), - CSS: this.get('css'), - HIDDEN_CSS: ((this.get('hiddencss')) ? this.get('hiddencss') : '/* No Hidden CSS */'), - EXTRA_CSS: ((this.get('extracss')) ? this.get('extracss') : '/* No Extra CSS */') - }), - check = true; - - html = html.replace(/RIGHT_BRACKET/gi, '{'); - html = html.replace(/LEFT_BRACKET/gi, '}'); - - if (document.compatMode != 'BackCompat') { - YAHOO.log('Adding Doctype to editable area', 'info', 'SimpleEditor'); - html = this._docType + "\n" + html; - } else { - YAHOO.log('DocType skipped because we are in BackCompat Mode.', 'warn', 'SimpleEditor'); - } - - if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) { - //Firefox 1.5 doesn't like setting designMode on an document created with a data url - try { - //Adobe AIR Code - if (this.browser.air) { - doc = this._getDoc().implementation.createHTMLDocument(); - var origDoc = this._getDoc(); - origDoc.open(); - origDoc.close(); - doc.open(); - doc.write(html); - doc.close(); - var node = origDoc.importNode(doc.getElementsByTagName("html")[0], true); - origDoc.replaceChild(node, origDoc.getElementsByTagName("html")[0]); - origDoc.body._rteLoaded = true; - } else { - doc = this._getDoc(); - doc.open(); - doc.write(html); - doc.close(); - } - } catch (e) { - YAHOO.log('Setting doc failed.. (_setInitialContent)', 'error', 'SimpleEditor'); - //Safari will only be here if we are hidden - check = false; - } - } else { - //This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality - this.get('iframe').get('element').src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html); - } - this.get('iframe').setStyle('visibility', ''); - if (check) { - this._checkLoaded(raw); - } - }, - /** - * @private - * @method _setMarkupType - * @param {String} action The action to take. Possible values are: css, default or semantic - * @description This method will turn on/off the useCSS execCommand. - */ - _setMarkupType: function(action) { - switch (this.get('markup')) { - case 'css': - this._setEditorStyle(true); - break; - case 'default': - this._setEditorStyle(false); - break; - case 'semantic': - case 'xhtml': - if (this._semantic[action]) { - this._setEditorStyle(false); - } else { - this._setEditorStyle(true); - } - break; - } - }, - /** - * Set the editor to use CSS instead of HTML - * @param {Booleen} stat True/False - */ - _setEditorStyle: function(stat) { - try { - this._getDoc().execCommand('useCSS', false, !stat); - } catch (ex) { - } - }, - /** - * @private - * @method _getSelectedElement - * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event. - * @return {HTMLElement} The currently selected element. - */ - _getSelectedElement: function() { - var doc = this._getDoc(), - range = null, - sel = null, - elm = null, - check = true; - - if (this.browser.ie) { - this.currentEvent = this._getWindow().event; //Event utility assumes window.event, so we need to reset it to this._getWindow().event; - range = this._getRange(); - if (range) { - elm = range.item ? range.item(0) : range.parentElement(); - if (this._hasSelection()) { - //TODO - //WTF.. Why can't I get an element reference here?!??! - } - if (elm === doc.body) { - elm = null; - } - } - if ((this.currentEvent !== null) && (this.currentEvent.keyCode === 0)) { - elm = Event.getTarget(this.currentEvent); - } - } else { - sel = this._getSelection(); - range = this._getRange(); - - if (!sel || !range) { - return null; - } - //TODO - if (!this._hasSelection() && this.browser.webkit3) { - //check = false; - } - if (this.browser.gecko) { - //Added in 2.6.0 - if (range.startContainer) { - if (range.startContainer.nodeType === 3) { - elm = range.startContainer.parentNode; - } else if (range.startContainer.nodeType === 1) { - elm = range.startContainer; - } - //Added in 2.7.0 - if (this.currentEvent) { - var tar = Event.getTarget(this.currentEvent); - if (!this._isElement(tar, 'html')) { - if (elm !== tar) { - elm = tar; - } - } - } - } - } - - if (check) { - if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) { - if (sel.anchorNode.parentNode) { //next check parentNode - elm = sel.anchorNode.parentNode; - } - if (sel.anchorNode.nextSibling != sel.focusNode.nextSibling) { - elm = sel.anchorNode.nextSibling; - } - } - if (this._isElement(elm, 'br')) { - elm = null; - } - if (!elm) { - elm = range.commonAncestorContainer; - if (!range.collapsed) { - if (range.startContainer == range.endContainer) { - if (range.startOffset - range.endOffset < 2) { - if (range.startContainer.hasChildNodes()) { - elm = range.startContainer.childNodes[range.startOffset]; - } - } - } - } - } - } - } - - if (this.currentEvent !== null) { - try { - switch (this.currentEvent.type) { - case 'click': - case 'mousedown': - case 'mouseup': - if (this.browser.webkit) { - elm = Event.getTarget(this.currentEvent); - } - break; - default: - //Do nothing - break; - } - } catch (e) { - YAHOO.log('Firefox 1.5 errors here: ' + e, 'error', 'SimpleEditor'); - } - } else if ((this.currentElement && this.currentElement[0]) && (!this.browser.ie)) { - //TODO is this still needed? - //elm = this.currentElement[0]; - } - - - if (this.browser.opera || this.browser.webkit) { - if (this.currentEvent && !elm) { - elm = YAHOO.util.Event.getTarget(this.currentEvent); - } - } - if (!elm || !elm.tagName) { - elm = doc.body; - } - if (this._isElement(elm, 'html')) { - //Safari sometimes gives us the HTML node back.. - elm = doc.body; - } - if (this._isElement(elm, 'body')) { - //make sure that body means this body not the parent.. - elm = doc.body; - } - if (elm && !elm.parentNode) { //Not in document - elm = doc.body; - } - if (elm === undefined) { - elm = null; - } - return elm; - }, - /** - * @private - * @method _getDomPath - * @description This method will attempt to build the DOM path from the currently selected element. - * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used - * @return {Array} An array of node references that will create the DOM Path. - */ - _getDomPath: function(el) { - if (!el) { - el = this._getSelectedElement(); - } - var domPath = []; - while (el !== null) { - if (el.ownerDocument != this._getDoc()) { - el = null; - break; - } - //Check to see if we get el.nodeName and nodeType - if (el.nodeName && el.nodeType && (el.nodeType == 1)) { - domPath[domPath.length] = el; - } - - if (this._isElement(el, 'body')) { - break; - } - - el = el.parentNode; - } - if (domPath.length === 0) { - if (this._getDoc() && this._getDoc().body) { - domPath[0] = this._getDoc().body; - } - } - return domPath.reverse(); - }, - /** - * @private - * @method _writeDomPath - * @description Write the current DOM path out to the dompath container below the editor. - */ - _writeDomPath: function() { - var path = this._getDomPath(), - pathArr = [], - classPath = '', - pathStr = ''; - - for (var i = 0; i < path.length; i++) { - var tag = path[i].tagName.toLowerCase(); - if ((tag == 'ol') && (path[i].type)) { - tag += ':' + path[i].type; - } - if (Dom.hasClass(path[i], 'yui-tag')) { - tag = path[i].getAttribute('tag'); - } - if ((this.get('markup') == 'semantic') || (this.get('markup') == 'xhtml')) { - switch (tag) { - case 'b': tag = 'strong'; break; - case 'i': tag = 'em'; break; - } - } - if (!Dom.hasClass(path[i], 'yui-non')) { - if (Dom.hasClass(path[i], 'yui-tag')) { - pathStr = tag; - } else { - classPath = ((path[i].className !== '') ? '.' + path[i].className.replace(/ /g, '.') : ''); - if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) { - classPath = ''; - } - pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath; - } - switch (tag) { - case 'body': - pathStr = 'body'; - break; - case 'a': - if (path[i].getAttribute('href', 2)) { - pathStr += ':' + path[i].getAttribute('href', 2).replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp - } - break; - case 'img': - var h = path[i].height; - var w = path[i].width; - if (path[i].style.height) { - h = parseInt(path[i].style.height, 10); - } - if (path[i].style.width) { - w = parseInt(path[i].style.width, 10); - } - pathStr += '(' + w + 'x' + h + ')'; - break; - } - - if (pathStr.length > 10) { - pathStr = '' + pathStr.substring(0, 10) + '...' + ''; - } else { - pathStr = '' + pathStr + ''; - } - pathArr[pathArr.length] = pathStr; - } - } - var str = pathArr.join(' ' + this.SEP_DOMPATH + ' '); - //Prevent flickering - if (this.dompath.innerHTML != str) { - this.dompath.innerHTML = str; - } - }, - /** - * @private - * @method _fixNodes - * @description Fix href and imgs as well as remove invalid HTML. - */ - _fixNodes: function() { - try { - var doc = this._getDoc(), - els = []; - - for (var v in this.invalidHTML) { - if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) { - if (v.toLowerCase() != 'span') { - var tags = doc.body.getElementsByTagName(v); - if (tags.length) { - for (var i = 0; i < tags.length; i++) { - els.push(tags[i]); - } - } - } - } - } - for (var h = 0; h < els.length; h++) { - if (els[h].parentNode) { - if (Lang.isObject(this.invalidHTML[els[h].tagName.toLowerCase()]) && this.invalidHTML[els[h].tagName.toLowerCase()].keepContents) { - this._swapEl(els[h], 'span', function(el) { - el.className = 'yui-non'; - }); - } else { - els[h].parentNode.removeChild(els[h]); - } - } - } - var imgs = this._getDoc().getElementsByTagName('img'); - Dom.addClass(imgs, 'yui-img'); - } catch(e) {} - }, - /** - * @private - * @method _isNonEditable - * @param Event ev The Dom event being checked - * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied. - * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also - * disable and enable the Editor's toolbar based on the noedit state. - * @return Boolean - */ - _isNonEditable: function(ev) { - if (this.get('allowNoEdit')) { - var el = Event.getTarget(ev); - if (this._isElement(el, 'html')) { - el = null; - } - var path = this._getDomPath(el); - for (var i = (path.length - 1); i > -1; i--) { - if (Dom.hasClass(path[i], this.CLASS_NOEDIT)) { - //if (this.toolbar.get('disabled') === false) { - // this.toolbar.set('disabled', true); - //} - try { - this._getDoc().execCommand('enableObjectResizing', false, 'false'); - } catch (e) {} - this.nodeChange(); - Event.stopEvent(ev); - YAHOO.log('CLASS_NOEDIT found in DOM Path, stopping event', 'info', 'SimpleEditor'); - return true; - } - } - //if (this.toolbar.get('disabled') === true) { - //Should only happen once.. - //this.toolbar.set('disabled', false); - try { - this._getDoc().execCommand('enableObjectResizing', false, 'true'); - } catch (e2) {} - //} - } - return false; - }, - /** - * @private - * @method _setCurrentEvent - * @param {Event} ev The event to cache - * @description Sets the current event property - */ - _setCurrentEvent: function(ev) { - this.currentEvent = ev; - }, - /** - * @private - * @method _handleClick - * @param {Event} ev The event we are working on. - * @description Handles all click events inside the iFrame document. - */ - _handleClick: function(ev) { - var ret = this.fireEvent('beforeEditorClick', { type: 'beforeEditorClick', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - if (this.currentWindow) { - this.closeWindow(); - } - if (this.currentWindow) { - this.closeWindow(); - } - if (this.browser.webkit) { - var tar =Event.getTarget(ev); - if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) { - Event.stopEvent(ev); - this.nodeChange(); - } - } else { - this.nodeChange(); - } - this.fireEvent('editorClick', { type: 'editorClick', target: this, ev: ev }); - }, - /** - * @private - * @method _handleMouseUp - * @param {Event} ev The event we are working on. - * @description Handles all mouseup events inside the iFrame document. - */ - _handleMouseUp: function(ev) { - var ret = this.fireEvent('beforeEditorMouseUp', { type: 'beforeEditorMouseUp', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - //Don't set current event for mouseup. - //It get's fired after a menu is closed and gives up a bogus event to work with - //this._setCurrentEvent(ev); - var self = this; - if (this.browser.opera) { - /* - * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on.. - * @browser Opera - * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event. - */ - var sel = Event.getTarget(ev); - if (this._isElement(sel, 'img')) { - this.nodeChange(); - if (this.operaEvent) { - clearTimeout(this.operaEvent); - this.operaEvent = null; - this._handleDoubleClick(ev); - } else { - this.operaEvent = window.setTimeout(function() { - self.operaEvent = false; - }, 700); - } - } - } - //This will stop Safari from selecting the entire document if you select all the text in the editor - if (this.browser.webkit || this.browser.opera) { - if (this.browser.webkit) { - Event.stopEvent(ev); - } - } - this.nodeChange(); - this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev }); - }, - /** - * @private - * @method _handleMouseDown - * @param {Event} ev The event we are working on. - * @description Handles all mousedown events inside the iFrame document. - */ - _handleMouseDown: function(ev) { - var ret = this.fireEvent('beforeEditorMouseDown', { type: 'beforeEditorMouseDown', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - var sel = Event.getTarget(ev); - if (this.browser.webkit && this._hasSelection()) { - var _sel = this._getSelection(); - if (!this.browser.webkit3) { - _sel.collapse(true); - } else { - _sel.collapseToStart(); - } - } - if (this.browser.webkit && this._lastImage) { - Dom.removeClass(this._lastImage, 'selected'); - this._lastImage = null; - } - if (this._isElement(sel, 'img') || this._isElement(sel, 'a')) { - if (this.browser.webkit) { - Event.stopEvent(ev); - if (this._isElement(sel, 'img')) { - Dom.addClass(sel, 'selected'); - this._lastImage = sel; - } - } - if (this.currentWindow) { - this.closeWindow(); - } - this.nodeChange(); - } - this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev }); - }, - /** - * @private - * @method _handleDoubleClick - * @param {Event} ev The event we are working on. - * @description Handles all doubleclick events inside the iFrame document. - */ - _handleDoubleClick: function(ev) { - var ret = this.fireEvent('beforeEditorDoubleClick', { type: 'beforeEditorDoubleClick', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - var sel = Event.getTarget(ev); - if (this._isElement(sel, 'img')) { - this.currentElement[0] = sel; - this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - } else if (this._hasParent(sel, 'a')) { //Handle elements inside an a - this.currentElement[0] = this._hasParent(sel, 'a'); - this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - } - this.nodeChange(); - this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyUp - * @param {Event} ev The event we are working on. - * @description Handles all keyup events inside the iFrame document. - */ - _handleKeyUp: function(ev) { - var ret = this.fireEvent('beforeEditorKeyUp', { type: 'beforeEditorKeyUp', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._storeUndo(); - this._setCurrentEvent(ev); - switch (ev.keyCode) { - case this._keyMap.SELECT_ALL.key: - if (this._checkKey(this._keyMap.SELECT_ALL, ev)) { - this.nodeChange(); - } - break; - case 32: //Space Bar - case 35: //End - case 36: //Home - case 37: //Left Arrow - case 38: //Up Arrow - case 39: //Right Arrow - case 40: //Down Arrow - case 46: //Forward Delete - case 8: //Delete - case this._keyMap.CLOSE_WINDOW.key: //W key if window is open - if ((ev.keyCode == this._keyMap.CLOSE_WINDOW.key) && this.currentWindow) { - if (this._checkKey(this._keyMap.CLOSE_WINDOW, ev)) { - this.closeWindow(); - } - } else { - if (!this.browser.ie) { - if (this._nodeChangeTimer) { - clearTimeout(this._nodeChangeTimer); - } - var self = this; - this._nodeChangeTimer = setTimeout(function() { - self._nodeChangeTimer = null; - self.nodeChange.call(self); - }, 100); - } else { - this.nodeChange(); - } - this.editorDirty = true; - } - break; - } - this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyPress - * @param {Event} ev The event we are working on. - * @description Handles all keypress events inside the iFrame document. - */ - _handleKeyPress: function(ev) { - var ret = this.fireEvent('beforeEditorKeyPress', { type: 'beforeEditorKeyPress', target: this, ev: ev }); - if (ret === false) { - return false; - } - - if (this.get('allowNoEdit')) { - //if (ev && ev.keyCode && ((ev.keyCode == 46) || ev.keyCode == 63272)) { - if (ev && ev.keyCode && (ev.keyCode == 63272)) { - //Forward delete key - YAHOO.log('allowNoEdit is set, forward delete key has been disabled', 'warn', 'SimpleEditor'); - Event.stopEvent(ev); - } - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - this._storeUndo(); - if (this.browser.opera) { - if (ev.keyCode === 13) { - var tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - this.execCommand('inserthtml', '
              '); - Event.stopEvent(ev); - } - } - } - if (this.browser.webkit) { - if (!this.browser.webkit3) { - if (ev.keyCode && (ev.keyCode == 122) && (ev.metaKey)) { - //This is CMD + z (for undo) - if (this._hasParent(this._getSelectedElement(), 'li')) { - YAHOO.log('We are in an LI and we found CMD + z, stopping the event', 'warn', 'SimpleEditor'); - Event.stopEvent(ev); - } - } - } - this._listFix(ev); - } - this._fixListDupIds(); - this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyDown - * @param {Event} ev The event we are working on. - * @description Handles all keydown events inside the iFrame document. - */ - _handleKeyDown: function(ev) { - var ret = this.fireEvent('beforeEditorKeyDown', { type: 'beforeEditorKeyDown', target: this, ev: ev }); - if (ret === false) { - return false; - } - var tar = null, _range = null; - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - if (this.currentWindow) { - this.closeWindow(); - } - if (this.currentWindow) { - this.closeWindow(); - } - var doExec = false, - action = null, - value = null, - exec = false; - - //YAHOO.log('keyCode: ' + ev.keyCode, 'info', 'SimpleEditor'); - - switch (ev.keyCode) { - case this._keyMap.FOCUS_TOOLBAR.key: - if (this._checkKey(this._keyMap.FOCUS_TOOLBAR, ev)) { - var h = this.toolbar.getElementsByTagName('h2')[0]; - if (h && h.firstChild) { - h.firstChild.focus(); - } - } else if (this._checkKey(this._keyMap.FOCUS_AFTER, ev)) { - //Focus After Element - Esc - this.afterElement.focus(); - } - Event.stopEvent(ev); - doExec = false; - break; - //case 76: //L - case this._keyMap.CREATE_LINK.key: //L - if (this._hasSelection()) { - if (this._checkKey(this._keyMap.CREATE_LINK, ev)) { - var makeLink = true; - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'SimpleEditor'); - makeLink = false; - } - } - if (makeLink) { - this.execCommand('createlink', ''); - this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - doExec = false; - } - } - } - break; - //case 90: //Z - case this._keyMap.UNDO.key: - case this._keyMap.REDO.key: - if (this._checkKey(this._keyMap.REDO, ev)) { - action = 'redo'; - doExec = true; - } else if (this._checkKey(this._keyMap.UNDO, ev)) { - action = 'undo'; - doExec = true; - } - break; - //case 66: //B - case this._keyMap.BOLD.key: - if (this._checkKey(this._keyMap.BOLD, ev)) { - action = 'bold'; - doExec = true; - } - break; - case this._keyMap.FONT_SIZE_UP.key: - case this._keyMap.FONT_SIZE_DOWN.key: - var uk = false, dk = false; - if (this._checkKey(this._keyMap.FONT_SIZE_UP, ev)) { - uk = true; - } - if (this._checkKey(this._keyMap.FONT_SIZE_DOWN, ev)) { - dk = true; - } - if (uk || dk) { - var fs_button = this.toolbar.getButtonByValue('fontsize'), - label = parseInt(fs_button.get('label'), 10), - newValue = (label + 1); - - if (dk) { - newValue = (label - 1); - } - - action = 'fontsize'; - value = newValue + 'px'; - doExec = true; - } - break; - //case 73: //I - case this._keyMap.ITALIC.key: - if (this._checkKey(this._keyMap.ITALIC, ev)) { - action = 'italic'; - doExec = true; - } - break; - //case 85: //U - case this._keyMap.UNDERLINE.key: - if (this._checkKey(this._keyMap.UNDERLINE, ev)) { - action = 'underline'; - doExec = true; - } - break; - case 9: - if (this.browser.ie) { - //Insert a tab in Internet Explorer - _range = this._getRange(); - tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - if (_range) { - _range.pasteHTML('    '); - _range.collapse(false); - _range.select(); - } - Event.stopEvent(ev); - } - } - //Firefox 3 code - if (this.browser.gecko > 1.8) { - tar = this._getSelectedElement(); - if (this._isElement(tar, 'li')) { - if (ev.shiftKey) { - this._getDoc().execCommand('outdent', null, ''); - } else { - this._getDoc().execCommand('indent', null, ''); - } - - } else if (!this._hasSelection()) { - this.execCommand('inserthtml', '    '); - } - Event.stopEvent(ev); - } - break; - case 13: - var p = null, i = 0; - if (this.get('ptags') && !ev.shiftKey) { - if (this.browser.gecko) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - if (this._hasParent(tar, 'p')) { - p = this._getDoc().createElement('p'); - p.innerHTML = ' '; - Dom.insertAfter(p, tar); - this._selectNode(p.firstChild); - } else if (this._isElement(tar, 'body')) { - this.execCommand('insertparagraph', null); - var ps = this._getDoc().body.getElementsByTagName('p'); - for (i = 0; i < ps.length; i++) { - if (ps[i].getAttribute('_moz_dirty') !== null) { - p = this._getDoc().createElement('p'); - p.innerHTML = ' '; - Dom.insertAfter(p, ps[i]); - this._selectNode(p.firstChild); - ps[i].removeAttribute('_moz_dirty'); - } - } - } else { - YAHOO.log('Something went wrong with paragraphs, please file a bug!!', 'error', 'SimpleEditor'); - doExec = true; - action = 'insertparagraph'; - } - Event.stopEvent(ev); - } - } - if (this.browser.webkit) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - this.execCommand('insertparagraph', null); - var divs = this._getDoc().body.getElementsByTagName('div'); - for (i = 0; i < divs.length; i++) { - if (!Dom.hasClass(divs[i], 'yui-wk-div')) { - Dom.addClass(divs[i], 'yui-wk-p'); - } - } - Event.stopEvent(ev); - } - } - } else { - if (this.browser.webkit) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - if (this.browser.webkit4) { - this.execCommand('insertlinebreak'); - } else { - this.execCommand('inserthtml', ''); - var holder = this._getDoc().getElementById('yui-br'), - br = this._getDoc().createElement('br'), - caret = this._getDoc().createElement('span'); - - holder.parentNode.replaceChild(br, holder); - caret.className = 'yui-non'; - caret.innerHTML = ' '; - Dom.insertAfter(caret, br); - this._selectNode(caret); - } - Event.stopEvent(ev); - } - } - if (this.browser.ie) { - YAHOO.log('Stopping P tags', 'info', 'SimpleEditor'); - //Insert a
              instead of a

              in Internet Explorer - _range = this._getRange(); - tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - if (_range) { - _range.pasteHTML('
              '); - _range.collapse(false); - _range.select(); - } - Event.stopEvent(ev); - } - } - } - break; - } - if (this.browser.ie) { - this._listFix(ev); - } - if (doExec && action) { - this.execCommand(action, value); - Event.stopEvent(ev); - this.nodeChange(); - } - this._storeUndo(); - this.fireEvent('editorKeyDown', { type: 'editorKeyDown', target: this, ev: ev }); - }, - /** - * @private - * @property _fixListRunning - * @type Boolean - * @description Keeps more than one _fixListDupIds from running at the same time. - */ - _fixListRunning: null, - /** - * @private - * @method _fixListDupIds - * @description Some browsers will duplicate the id of an LI when created in designMode. - * This method will fix the duplicate id issue. However it will only preserve the first element - * in the document list with the unique id. - */ - _fixListDupIds: function() { - if (this._fixListRunning) { - return false; - } - if (this._getDoc()) { - this._fixListRunning = true; - var lis = this._getDoc().body.getElementsByTagName('li'), - i = 0, ids = {}; - for (i = 0; i < lis.length; i++) { - if (lis[i].id) { - if (ids[lis[i].id]) { - lis[i].id = ''; - } - ids[lis[i].id] = true; - } - } - this._fixListRunning = false; - } - }, - /** - * @private - * @method _listFix - * @param {Event} ev The event we are working on. - * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items. - */ - _listFix: function(ev) { - //YAHOO.log('Lists Fix (' + ev.keyCode + ')', 'info', 'SimpleEditor'); - var testLi = null, par = null, preContent = false, range = null; - //Enter Key - if (this.browser.webkit) { - if (ev.keyCode && (ev.keyCode == 13)) { - if (this._hasParent(this._getSelectedElement(), 'li')) { - var tar = this._hasParent(this._getSelectedElement(), 'li'); - if (tar.previousSibling) { - if (tar.firstChild && (tar.firstChild.length == 1)) { - this._selectNode(tar); - } - } - } - } - } - //Shift + Tab Key - if (ev.keyCode && ((!this.browser.webkit3 && (ev.keyCode == 25)) || ((this.browser.webkit3 || !this.browser.webkit) && ((ev.keyCode == 9) && ev.shiftKey)))) { - testLi = this._getSelectedElement(); - if (this._hasParent(testLi, 'li')) { - testLi = this._hasParent(testLi, 'li'); - YAHOO.log('We have a SHIFT tab in an LI, reverse it..', 'info', 'SimpleEditor'); - if (this._hasParent(testLi, 'ul') || this._hasParent(testLi, 'ol')) { - YAHOO.log('We have a double parent, move up a level', 'info', 'SimpleEditor'); - par = this._hasParent(testLi, 'ul'); - if (!par) { - par = this._hasParent(testLi, 'ol'); - } - //YAHOO.log(par.previousSibling + ' :: ' + par.previousSibling.innerHTML); - if (this._isElement(par.previousSibling, 'li')) { - par.removeChild(testLi); - par.parentNode.insertBefore(testLi, par.nextSibling); - if (this.browser.ie) { - range = this._getDoc().body.createTextRange(); - range.moveToElementText(testLi); - range.collapse(false); - range.select(); - } - if (this.browser.webkit) { - this._selectNode(testLi.firstChild); - } - Event.stopEvent(ev); - } - } - } - } - //Tab Key - if (ev.keyCode && ((ev.keyCode == 9) && (!ev.shiftKey))) { - YAHOO.log('List Fix - Tab', 'info', 'SimpleEditor'); - var preLi = this._getSelectedElement(); - if (this._hasParent(preLi, 'li')) { - preContent = this._hasParent(preLi, 'li').innerHTML; - } - //YAHOO.log('preLI: ' + preLi.tagName + ' :: ' + preLi.innerHTML); - if (this.browser.webkit) { - this._getDoc().execCommand('inserttext', false, '\t'); - } - testLi = this._getSelectedElement(); - if (this._hasParent(testLi, 'li')) { - YAHOO.log('We have a tab in an LI', 'info', 'SimpleEditor'); - par = this._hasParent(testLi, 'li'); - YAHOO.log('parLI: ' + par.tagName + ' :: ' + par.innerHTML); - var newUl = this._getDoc().createElement(par.parentNode.tagName.toLowerCase()); - if (this.browser.webkit) { - var span = Dom.getElementsByClassName('Apple-tab-span', 'span', par); - //Remove the span element that Safari puts in - if (span[0]) { - par.removeChild(span[0]); - par.innerHTML = Lang.trim(par.innerHTML); - //Put the HTML from the LI into this new LI - if (preContent) { - par.innerHTML = '' + preContent + ' '; - } else { - par.innerHTML = '  '; - } - } - } else { - if (preContent) { - par.innerHTML = preContent + ' '; - } else { - par.innerHTML = ' '; - } - } - - par.parentNode.replaceChild(newUl, par); - newUl.appendChild(par); - if (this.browser.webkit) { - this._getSelection().setBaseAndExtent(par.firstChild, 1, par.firstChild, par.firstChild.innerText.length); - if (!this.browser.webkit3) { - par.parentNode.parentNode.style.display = 'list-item'; - setTimeout(function() { - par.parentNode.parentNode.style.display = 'block'; - }, 1); - } - } else if (this.browser.ie) { - range = this._getDoc().body.createTextRange(); - range.moveToElementText(par); - range.collapse(false); - range.select(); - } else { - this._selectNode(par); - } - Event.stopEvent(ev); - } - if (this.browser.webkit) { - Event.stopEvent(ev); - } - this.nodeChange(); - } - }, - /** - * @method nodeChange - * @param {Boolean} force Optional paramenter to skip the threshold counter - * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes. - */ - nodeChange: function(force) { - var NCself = this; - this._storeUndo(); - if (this.get('nodeChangeDelay')) { - this._nodeChangeDelayTimer = window.setTimeout(function() { - NCself._nodeChangeDelayTimer = null; - NCself._nodeChange.apply(NCself, arguments); - }, 0); - } else { - this._nodeChange(); - } - }, - /** - * @private - * @method _nodeChange - * @param {Boolean} force Optional paramenter to skip the threshold counter - * @description Fired from nodeChange in a setTimeout. - */ - _nodeChange: function(force) { - var threshold = parseInt(this.get('nodeChangeThreshold'), 10), - thisNodeChange = Math.round(new Date().getTime() / 1000), - self = this; - - if (force === true) { - this._lastNodeChange = 0; - } - - if ((this._lastNodeChange + threshold) < thisNodeChange) { - if (this._fixNodesTimer === null) { - this._fixNodesTimer = window.setTimeout(function() { - self._fixNodes.call(self); - self._fixNodesTimer = null; - }, 0); - } - } - this._lastNodeChange = thisNodeChange; - if (this.currentEvent) { - try { - this._lastNodeChangeEvent = this.currentEvent.type; - } catch (e) {} - } - - var beforeNodeChange = this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this }); - if (beforeNodeChange === false) { - return false; - } - if (this.get('dompath')) { - window.setTimeout(function() { - self._writeDomPath.call(self); - }, 0); - } - //Check to see if we are disabled before continuing - if (!this.get('disabled')) { - if (this.STOP_NODE_CHANGE) { - //Reset this var for next action - this.STOP_NODE_CHANGE = false; - return false; - } else { - var sel = this._getSelection(), - range = this._getRange(), - el = this._getSelectedElement(), - fn_button = this.toolbar.getButtonByValue('fontname'), - fs_button = this.toolbar.getButtonByValue('fontsize'), - undo_button = this.toolbar.getButtonByValue('undo'), - redo_button = this.toolbar.getButtonByValue('redo'); - - //Handle updating the toolbar with active buttons - var _ex = {}; - if (this._lastButton) { - _ex[this._lastButton.id] = true; - //this._lastButton = null; - } - if (!this._isElement(el, 'body')) { - if (fn_button) { - _ex[fn_button.get('id')] = true; - } - if (fs_button) { - _ex[fs_button.get('id')] = true; - } - } - if (redo_button) { - delete _ex[redo_button.get('id')]; - } - this.toolbar.resetAllButtons(_ex); - - //Handle disabled buttons - for (var d = 0; d < this._disabled.length; d++) { - var _button = this.toolbar.getButtonByValue(this._disabled[d]); - if (_button && _button.get) { - if (this._lastButton && (_button.get('id') === this._lastButton.id)) { - //Skip - } else { - if (!this._hasSelection() && !this.get('insert')) { - switch (this._disabled[d]) { - case 'fontname': - case 'fontsize': - break; - default: - //No Selection - disable - this.toolbar.disableButton(_button); - } - } else { - if (!this._alwaysDisabled[this._disabled[d]]) { - this.toolbar.enableButton(_button); - } - } - if (!this._alwaysEnabled[this._disabled[d]]) { - this.toolbar.deselectButton(_button); - } - } - } - } - var path = this._getDomPath(); - var tag = null, cmd = null; - for (var i = 0; i < path.length; i++) { - tag = path[i].tagName.toLowerCase(); - if (path[i].getAttribute('tag')) { - tag = path[i].getAttribute('tag').toLowerCase(); - } - cmd = this._tag2cmd[tag]; - if (cmd === undefined) { - cmd = []; - } - if (!Lang.isArray(cmd)) { - cmd = [cmd]; - } - - //Bold and Italic styles - if (path[i].style.fontWeight.toLowerCase() == 'bold') { - cmd[cmd.length] = 'bold'; - } - if (path[i].style.fontStyle.toLowerCase() == 'italic') { - cmd[cmd.length] = 'italic'; - } - if (path[i].style.textDecoration.toLowerCase() == 'underline') { - cmd[cmd.length] = 'underline'; - } - if (path[i].style.textDecoration.toLowerCase() == 'line-through') { - cmd[cmd.length] = 'strikethrough'; - } - if (cmd.length > 0) { - for (var j = 0; j < cmd.length; j++) { - this.toolbar.selectButton(cmd[j]); - this.toolbar.enableButton(cmd[j]); - } - } - //Handle Alignment - switch (path[i].style.textAlign.toLowerCase()) { - case 'left': - case 'right': - case 'center': - case 'justify': - var alignType = path[i].style.textAlign.toLowerCase(); - if (path[i].style.textAlign.toLowerCase() == 'justify') { - alignType = 'full'; - } - this.toolbar.selectButton('justify' + alignType); - this.toolbar.enableButton('justify' + alignType); - break; - } - } - //After for loop - - //Reset Font Family and Size to the inital configs - if (fn_button) { - var family = fn_button._configs.label._initialConfig.value; - fn_button.set('label', '' + family + ''); - this._updateMenuChecked('fontname', family); - } - - if (fs_button) { - fs_button.set('label', fs_button._configs.label._initialConfig.value); - } - - var hd_button = this.toolbar.getButtonByValue('heading'); - if (hd_button) { - hd_button.set('label', hd_button._configs.label._initialConfig.value); - this._updateMenuChecked('heading', 'none'); - } - var img_button = this.toolbar.getButtonByValue('insertimage'); - if (img_button && this.currentWindow && (this.currentWindow.name == 'insertimage')) { - this.toolbar.disableButton(img_button); - } - if (this._lastButton && this._lastButton.isSelected) { - this.toolbar.deselectButton(this._lastButton.id); - } - this._undoNodeChange(); - } - } - - this.fireEvent('afterNodeChange', { type: 'afterNodeChange', target: this }); - }, - /** - * @private - * @method _updateMenuChecked - * @param {Object} button The command identifier of the button you want to check - * @param {String} value The value of the menu item you want to check - * @param {YAHOO.widget.Toolbar} The Toolbar instance the button belongs to (defaults to this.toolbar) - * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on. - */ - _updateMenuChecked: function(button, value, tbar) { - if (!tbar) { - tbar = this.toolbar; - } - var _button = tbar.getButtonByValue(button); - _button.checkValue(value); - }, - /** - * @private - * @method _handleToolbarClick - * @param {Event} ev The event that triggered the button click - * @description This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button. - */ - _handleToolbarClick: function(ev) { - var value = ''; - var str = ''; - var cmd = ev.button.value; - if (ev.button.menucmd) { - value = cmd; - cmd = ev.button.menucmd; - } - this._lastButton = ev.button; - if (this.STOP_EXEC_COMMAND) { - YAHOO.log('execCommand skipped because we found the STOP_EXEC_COMMAND flag set to true', 'warn', 'SimpleEditor'); - YAHOO.log('NOEXEC::execCommand::(' + cmd + '), (' + value + ')', 'warn', 'SimpleEditor'); - this.STOP_EXEC_COMMAND = false; - return false; - } else { - this.execCommand(cmd, value); - if (!this.browser.webkit) { - var Fself = this; - setTimeout(function() { - Fself.focus.call(Fself); - }, 5); - } - } - Event.stopEvent(ev); - }, - /** - * @private - * @method _setupAfterElement - * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation. - */ - _setupAfterElement: function() { - if (!this.beforeElement) { - this.beforeElement = document.createElement('h2'); - this.beforeElement.className = 'yui-editor-skipheader'; - this.beforeElement.tabIndex = '-1'; - this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR; - this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling')); - } - if (!this.afterElement) { - this.afterElement = document.createElement('h2'); - this.afterElement.className = 'yui-editor-skipheader'; - this.afterElement.tabIndex = '-1'; - this.afterElement.innerHTML = this.STR_LEAVE_EDITOR; - this.get('element_cont').get('firstChild').appendChild(this.afterElement); - } - }, - /** - * @private - * @method _disableEditor - * @param {Boolean} disabled Pass true to disable, false to enable - * @description Creates a mask to place over the Editor. - */ - _disableEditor: function(disabled) { - var iframe, par, html, height; - if (!this.get('disabled_iframe')) { - iframe = this._createIframe(); - iframe.set('id', 'disabled_' + this.get('iframe').get('id')); - iframe.setStyle('height', '100%'); - iframe.setStyle('display', 'none'); - iframe.setStyle('visibility', 'visible'); - this.set('disabled_iframe', iframe); - par = this.get('iframe').get('parentNode'); - par.appendChild(iframe.get('element')); - } - if (!iframe) { - iframe = this.get('disabled_iframe'); - } - if (disabled) { - this._orgIframe = this.get('iframe'); - - if (this.toolbar) { - this.toolbar.set('disabled', true); - } - - html = this.getEditorHTML(); - height = this.get('iframe').get('offsetHeight'); - iframe.setStyle('visibility', ''); - iframe.setStyle('position', ''); - iframe.setStyle('top', ''); - iframe.setStyle('left', ''); - this._orgIframe.setStyle('visibility', 'hidden'); - this._orgIframe.setStyle('position', 'absolute'); - this._orgIframe.setStyle('top', '-99999px'); - this._orgIframe.setStyle('left', '-99999px'); - this.set('iframe', iframe); - this._setInitialContent(true); - - if (!this._mask) { - this._mask = document.createElement('DIV'); - Dom.addClass(this._mask, 'yui-editor-masked'); - if (this.browser.ie) { - this._mask.style.height = height + 'px'; - } - this.get('iframe').get('parentNode').appendChild(this._mask); - } - this.on('editorContentReloaded', function() { - this._getDoc().body._rteLoaded = false; - this.setEditorHTML(html); - iframe.setStyle('display', 'block'); - this.unsubscribeAll('editorContentReloaded'); - }); - } else { - if (this._mask) { - this._mask.parentNode.removeChild(this._mask); - this._mask = null; - if (this.toolbar) { - this.toolbar.set('disabled', false); - } - iframe.setStyle('visibility', 'hidden'); - iframe.setStyle('position', 'absolute'); - iframe.setStyle('top', '-99999px'); - iframe.setStyle('left', '-99999px'); - this._orgIframe.setStyle('visibility', ''); - this._orgIframe.setStyle('position', ''); - this._orgIframe.setStyle('top', ''); - this._orgIframe.setStyle('left', ''); - this.set('iframe', this._orgIframe); - - this.focus(); - var self = this; - window.setTimeout(function() { - self.nodeChange.call(self); - }, 100); - } - } - }, - /** - * @property SEP_DOMPATH - * @description The value to place in between the Dom path items - * @type String - */ - SEP_DOMPATH: '<', - /** - * @property STR_LEAVE_EDITOR - * @description The accessibility string for the element after the iFrame - * @type String - */ - STR_LEAVE_EDITOR: 'You have left the Rich Text Editor.', - /** - * @property STR_BEFORE_EDITOR - * @description The accessibility string for the element before the iFrame - * @type String - */ - STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Shift + Escape to place focus on the toolbar and navigate between options with your arrow keys. To exit this text editor use the Escape key and continue tabbing.

              Common formatting keyboard shortcuts:

              • Control Shift B sets text to bold
              • Control Shift I sets text to italic
              • Control Shift U underlines text
              • Control Shift L adds an HTML link
              ', - /** - * @property STR_TITLE - * @description The Title of the HTML document that is created in the iFrame - * @type String - */ - STR_TITLE: 'Rich Text Area.', - /** - * @property STR_IMAGE_HERE - * @description The text to place in the URL textbox when using the blankimage. - * @type String - */ - STR_IMAGE_HERE: 'Image URL Here', - /** - * @property STR_IMAGE_URL - * @description The label string for Image URL - * @type String - */ - STR_IMAGE_URL: 'Image URL', - /** - * @property STR_LINK_URL - * @description The label string for the Link URL. - * @type String - */ - STR_LINK_URL: 'Link URL', - /** - * @protected - * @property STOP_EXEC_COMMAND - * @description Set to true when you want the default execCommand function to not process anything - * @type Boolean - */ - STOP_EXEC_COMMAND: false, - /** - * @protected - * @property STOP_NODE_CHANGE - * @description Set to true when you want the default nodeChange function to not process anything - * @type Boolean - */ - STOP_NODE_CHANGE: false, - /** - * @protected - * @property CLASS_NOEDIT - * @description CSS class applied to elements that are not editable. - * @type String - */ - CLASS_NOEDIT: 'yui-noedit', - /** - * @protected - * @property CLASS_CONTAINER - * @description Default CSS class to apply to the editors container element - * @type String - */ - CLASS_CONTAINER: 'yui-editor-container', - /** - * @protected - * @property CLASS_EDITABLE - * @description Default CSS class to apply to the editors iframe element - * @type String - */ - CLASS_EDITABLE: 'yui-editor-editable', - /** - * @protected - * @property CLASS_EDITABLE_CONT - * @description Default CSS class to apply to the editors iframe's parent element - * @type String - */ - CLASS_EDITABLE_CONT: 'yui-editor-editable-container', - /** - * @protected - * @property CLASS_PREFIX - * @description Default prefix for dynamically created class names - * @type String - */ - CLASS_PREFIX: 'yui-editor', - /** - * @property browser - * @description Standard browser detection - * @type Object - */ - browser: function() { - var br = YAHOO.env.ua; - //Check for webkit3 - if (br.webkit >= 420) { - br.webkit3 = br.webkit; - } else { - br.webkit3 = 0; - } - if (br.webkit >= 530) { - br.webkit4 = br.webkit; - } else { - br.webkit4 = 0; - } - br.mac = false; - //Check for Mac - if (navigator.userAgent.indexOf('Macintosh') !== -1) { - br.mac = true; - } - - return br; - }(), - /** - * @method init - * @description The Editor class' initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.log('init', 'info', 'SimpleEditor'); - - if (!this._defaultToolbar) { - this._defaultToolbar = { - collapse: true, - titlebar: 'Text Editing Tools', - draggable: false, - buttons: [ - { group: 'fontstyle', label: 'Font Name and Size', - buttons: [ - { type: 'select', label: 'Arial', value: 'fontname', disabled: true, - menu: [ - { text: 'Arial', checked: true }, - { text: 'Arial Black' }, - { text: 'Comic Sans MS' }, - { text: 'Courier New' }, - { text: 'Lucida Console' }, - { text: 'Tahoma' }, - { text: 'Times New Roman' }, - { text: 'Trebuchet MS' }, - { text: 'Verdana' } - ] - }, - { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true } - ] - }, - { type: 'separator' }, - { group: 'textstyle', label: 'Font Style', - buttons: [ - { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' }, - { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' }, - { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' }, - { type: 'push', label: 'Strike Through', value: 'strikethrough' }, - { type: 'separator' }, - { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true }, - { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true } - - ] - }, - { type: 'separator' }, - { group: 'indentlist', label: 'Lists', - buttons: [ - { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' }, - { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' } - ] - }, - { type: 'separator' }, - { group: 'insertitem', label: 'Insert Item', - buttons: [ - { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true }, - { type: 'push', label: 'Insert Image', value: 'insertimage' } - ] - } - ] - }; - } - - YAHOO.widget.SimpleEditor.superclass.init.call(this, p_oElement, p_oAttributes); - YAHOO.widget.EditorInfo._instances[this.get('id')] = this; - - - this.currentElement = []; - this.on('contentReady', function() { - this.DOMReady = true; - this.fireQueue(); - }, this, true); - - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the editor. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the editor. - */ - initAttributes: function(attr) { - YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this, attr); - var self = this; - - /** - * @config setDesignMode - * @description Should the Editor set designMode on the document. Default: true. - * @default true - * @type Boolean - */ - this.setAttributeConfig('setDesignMode', { - value: ((attr.setDesignMode === false) ? false : true) - }); - /** - * @config nodeChangeDelay - * @description Do we wrap the nodeChange method in a timeout for performance. Default: true. - * @default true - * @type Boolean - */ - this.setAttributeConfig('nodeChangeDelay', { - value: ((attr.nodeChangeDelay === false) ? false : true) - }); - /** - * @config maxUndo - * @description The max number of undo levels to store. - * @default 30 - * @type Number - */ - this.setAttributeConfig('maxUndo', { - writeOnce: true, - value: attr.maxUndo || 30 - }); - - /** - * @config ptags - * @description If true, the editor uses <P> tags instead of <br> tags. (Use Shift + Enter to get a <br>) - * @default false - * @type Boolean - */ - this.setAttributeConfig('ptags', { - writeOnce: true, - value: attr.ptags || false - }); - /** - * @config insert - * @description If true, selection is not required for: fontname, fontsize, forecolor, backcolor. - * @default false - * @type Boolean - */ - this.setAttributeConfig('insert', { - writeOnce: true, - value: attr.insert || false, - method: function(insert) { - if (insert) { - var buttons = { - fontname: true, - fontsize: true, - forecolor: true, - backcolor: true - }; - var tmp = this._defaultToolbar.buttons; - for (var i = 0; i < tmp.length; i++) { - if (tmp[i].buttons) { - for (var a = 0; a < tmp[i].buttons.length; a++) { - if (tmp[i].buttons[a].value) { - if (buttons[tmp[i].buttons[a].value]) { - delete tmp[i].buttons[a].disabled; - } - } - } - } - } - } - } - }); - /** - * @config container - * @description Used when dynamically creating the Editor from Javascript with no default textarea. - * We will create one and place it in this container. If no container is passed we will append to document.body. - * @default false - * @type HTMLElement - */ - this.setAttributeConfig('container', { - writeOnce: true, - value: attr.container || false - }); - /** - * @config plainText - * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds. - * @default false - * @type Boolean - */ - this.setAttributeConfig('plainText', { - writeOnce: true, - value: attr.plainText || false - }); - /** - * @private - * @config iframe - * @description Internal config for holding the iframe element. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('iframe', { - value: null - }); - /** - * @private - * @config disabled_iframe - * @description Internal config for holding the iframe element used when disabling the Editor. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('disabled_iframe', { - value: null - }); - /** - * @private - * @depreciated - No longer used, should use this.get('element') - * @config textarea - * @description Internal config for holding the textarea element (replaced with element). - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('textarea', { - value: null, - writeOnce: true - }); - /** - * @config nodeChangeThreshold - * @description The number of seconds that need to be in between nodeChange processing - * @default 3 - * @type Number - */ - this.setAttributeConfig('nodeChangeThreshold', { - value: attr.nodeChangeThreshold || 3, - validator: YAHOO.lang.isNumber - }); - /** - * @config allowNoEdit - * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes. - * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key. - * @default false - * @type Boolean - */ - this.setAttributeConfig('allowNoEdit', { - value: attr.allowNoEdit || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @config limitCommands - * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar. - * @default false - * @type Boolean - */ - this.setAttributeConfig('limitCommands', { - value: attr.limitCommands || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @config element_cont - * @description Internal config for the editors container - * @default false - * @type HTMLElement - */ - this.setAttributeConfig('element_cont', { - value: attr.element_cont - }); - /** - * @private - * @config editor_wrapper - * @description The outter wrapper for the entire editor. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('editor_wrapper', { - value: attr.editor_wrapper || null, - writeOnce: true - }); - /** - * @attribute height - * @description The height of the editor iframe container, not including the toolbar.. - * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument - * @type String - */ - this.setAttributeConfig('height', { - value: attr.height || Dom.getStyle(self.get('element'), 'height'), - method: function(height) { - if (this._rendered) { - //We have been rendered, change the height - if (this.get('animate')) { - var anim = new YAHOO.util.Anim(this.get('iframe').get('parentNode'), { - height: { - to: parseInt(height, 10) - } - }, 0.5); - anim.animate(); - } else { - Dom.setStyle(this.get('iframe').get('parentNode'), 'height', height); - } - } - } - }); - /** - * @config autoHeight - * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height. - * @default false - * @type Boolean || Number - */ - this.setAttributeConfig('autoHeight', { - value: attr.autoHeight || false, - method: function(a) { - if (a) { - if (this.get('iframe')) { - this.get('iframe').get('element').setAttribute('scrolling', 'no'); - } - this.on('afterNodeChange', this._handleAutoHeight, this, true); - this.on('editorKeyDown', this._handleAutoHeight, this, true); - this.on('editorKeyPress', this._handleAutoHeight, this, true); - } else { - if (this.get('iframe')) { - this.get('iframe').get('element').setAttribute('scrolling', 'auto'); - } - this.unsubscribe('afterNodeChange', this._handleAutoHeight); - this.unsubscribe('editorKeyDown', this._handleAutoHeight); - this.unsubscribe('editorKeyPress', this._handleAutoHeight); - } - } - }); - /** - * @attribute width - * @description The width of the editor container. - * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument - * @type String - */ - this.setAttributeConfig('width', { - value: attr.width || Dom.getStyle(this.get('element'), 'width'), - method: function(width) { - if (this._rendered) { - //We have been rendered, change the width - if (this.get('animate')) { - var anim = new YAHOO.util.Anim(this.get('element_cont').get('element'), { - width: { - to: parseInt(width, 10) - } - }, 0.5); - anim.animate(); - } else { - this.get('element_cont').setStyle('width', width); - } - } - } - }); - - /** - * @attribute blankimage - * @description The URL for the image placeholder to put in when inserting an image. - * @default The yahooapis.com address for the current release + 'assets/blankimage.png' - * @type String - */ - this.setAttributeConfig('blankimage', { - value: attr.blankimage || this._getBlankImage() - }); - /** - * @attribute css - * @description The Base CSS used to format the content of the editor - * @default
              html {
              -                height: 95%;
              -            }
              -            body {
              -                height: 100%;
              -                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
              -            }
              -            a {
              -                color: blue;
              -                text-decoration: underline;
              -                cursor: pointer;
              -            }
              -            .warning-localfile {
              -                border-bottom: 1px dashed red !important;
              -            }
              -            .yui-busy {
              -                cursor: wait !important;
              -            }
              -            img.selected { //Safari image selection
              -                border: 2px dotted #808080;
              -            }
              -            img {
              -                cursor: pointer !important;
              -                border: none;
              -            }
              -            
              - * @type String - */ - this.setAttributeConfig('css', { - value: attr.css || this._defaultCSS, - writeOnce: true - }); - /** - * @attribute html - * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item) - * @default This HTML requires a few things if you are to override: -

              {TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS} and {CONTENT} need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.

              -

              onload="document.body._rteLoaded = true;" : the onload statement must be there or the editor will not finish loading.

              - -
              -                <html>
              -                    <head>
              -                        <title>{TITLE}</title>
              -                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
              -                        <style>
              -                        {CSS}
              -                        </style>
              -                        <style>
              -                        {HIDDEN_CSS}
              -                        </style>
              -                        <style>
              -                        {EXTRA_CSS}
              -                        </style>
              -                    </head>
              -                <body onload="document.body._rteLoaded = true;">
              -                {CONTENT}
              -                </body>
              -                </html>
              -                
              -
              - * @type String - */ - this.setAttributeConfig('html', { - value: attr.html || '{TITLE}{CONTENT}', - writeOnce: true - }); - - /** - * @attribute extracss - * @description Extra user defined css to load after the default SimpleEditor CSS - * @default '' - * @type String - */ - this.setAttributeConfig('extracss', { - value: attr.extracss || '', - writeOnce: true - }); - - /** - * @attribute handleSubmit - * @description Config handles if the editor will attach itself to the textareas parent form's submit handler. - If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form. - Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted. - * @default false - * @type Boolean - */ - this.setAttributeConfig('handleSubmit', { - value: attr.handleSubmit || false, - method: function(exec) { - if (this.get('element').form) { - if (!this._formButtons) { - this._formButtons = []; - } - if (exec) { - Event.on(this.get('element').form, 'submit', this._handleFormSubmit, this, true); - var i = this.get('element').form.getElementsByTagName('input'); - for (var s = 0; s < i.length; s++) { - var type = i[s].getAttribute('type'); - if (type && (type.toLowerCase() == 'submit')) { - Event.on(i[s], 'click', this._handleFormButtonClick, this, true); - this._formButtons[this._formButtons.length] = i[s]; - } - } - } else { - Event.removeListener(this.get('element').form, 'submit', this._handleFormSubmit); - if (this._formButtons) { - Event.removeListener(this._formButtons, 'click', this._handleFormButtonClick); - } - } - } - } - }); - /** - * @attribute disabled - * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place. - All Toolbar buttons are also disabled so they cannot be used. - * @default false - * @type Boolean - */ - - this.setAttributeConfig('disabled', { - value: false, - method: function(disabled) { - if (this._rendered) { - this._disableEditor(disabled); - } - } - }); - /** - * @config saveEl - * @description When save HTML is called, this element will be updated as well as the source of data. - * @default element - * @type HTMLElement - */ - this.setAttributeConfig('saveEl', { - value: this.get('element') - }); - /** - * @config toolbar_cont - * @description Internal config for the toolbars container - * @default false - * @type Boolean - */ - this.setAttributeConfig('toolbar_cont', { - value: null, - writeOnce: true - }); - /** - * @attribute toolbar - * @description The default toolbar config. - * @type Object - */ - this.setAttributeConfig('toolbar', { - value: attr.toolbar || this._defaultToolbar, - writeOnce: true, - method: function(toolbar) { - if (!toolbar.buttonType) { - toolbar.buttonType = this._defaultToolbar.buttonType; - } - this._defaultToolbar = toolbar; - } - }); - /** - * @attribute animate - * @description Should the editor animate window movements - * @default false unless Animation is found, then true - * @type Boolean - */ - this.setAttributeConfig('animate', { - value: ((attr.animate) ? ((YAHOO.util.Anim) ? true : false) : false), - validator: function(value) { - var ret = true; - if (!YAHOO.util.Anim) { - ret = false; - } - return ret; - } - }); - /** - * @config panel - * @description A reference to the panel we are using for windows. - * @default false - * @type Boolean - */ - this.setAttributeConfig('panel', { - value: null, - writeOnce: true, - validator: function(value) { - var ret = true; - if (!YAHOO.widget.Overlay) { - ret = false; - } - return ret; - } - }); - /** - * @attribute focusAtStart - * @description Should we focus the window when the content is ready? - * @default false - * @type Boolean - */ - this.setAttributeConfig('focusAtStart', { - value: attr.focusAtStart || false, - writeOnce: true, - method: function(fs) { - if (fs) { - this.on('editorContentLoaded', function() { - var self = this; - setTimeout(function() { - self.focus.call(self); - self.editorDirty = false; - }, 400); - }, this, true); - } - } - }); - /** - * @attribute dompath - * @description Toggle the display of the current Dom path below the editor - * @default false - * @type Boolean - */ - this.setAttributeConfig('dompath', { - value: attr.dompath || false, - method: function(dompath) { - if (dompath && !this.dompath) { - this.dompath = document.createElement('DIV'); - this.dompath.id = this.get('id') + '_dompath'; - Dom.addClass(this.dompath, 'dompath'); - this.get('element_cont').get('firstChild').appendChild(this.dompath); - if (this.get('iframe')) { - this._writeDomPath(); - } - } else if (!dompath && this.dompath) { - this.dompath.parentNode.removeChild(this.dompath); - this.dompath = null; - } - } - }); - /** - * @attribute markup - * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml - * @default "semantic" - * @type String - */ - this.setAttributeConfig('markup', { - value: attr.markup || 'semantic', - validator: function(markup) { - switch (markup.toLowerCase()) { - case 'semantic': - case 'css': - case 'default': - case 'xhtml': - return true; - } - return false; - } - }); - /** - * @attribute removeLineBreaks - * @description Should we remove linebreaks and extra spaces on cleanup - * @default false - * @type Boolean - */ - this.setAttributeConfig('removeLineBreaks', { - value: attr.removeLineBreaks || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @config drag - * @description Set this config to make the Editor draggable, pass 'proxy' to make use YAHOO.util.DDProxy. - * @type {Boolean/String} - */ - this.setAttributeConfig('drag', { - writeOnce: true, - value: attr.drag || false - }); - - /** - * @config resize - * @description Set this to true to make the Editor Resizable with YAHOO.util.Resize. The default config is available: myEditor._resizeConfig - * Animation will be ignored while performing this resize to allow for the dynamic change in size of the toolbar. - * @type Boolean - */ - this.setAttributeConfig('resize', { - writeOnce: true, - value: attr.resize || false - }); - - /** - * @config filterWord - * @description Attempt to filter out MS Word HTML from the Editor's output. - * @type Boolean - */ - this.setAttributeConfig('filterWord', { - value: attr.filterWord || false, - validator: YAHOO.lang.isBoolean - }); - - }, - /** - * @private - * @method _getBlankImage - * @description Retrieves the full url of the image to use as the blank image. - * @return {String} The URL to the blank image - */ - _getBlankImage: function() { - if (!this.DOMReady) { - this._queue[this._queue.length] = ['_getBlankImage', arguments]; - return ''; - } - var img = ''; - if (!this._blankImageLoaded) { - if (YAHOO.widget.EditorInfo.blankImage) { - this.set('blankimage', YAHOO.widget.EditorInfo.blankImage); - this._blankImageLoaded = true; - } else { - var div = document.createElement('div'); - div.style.position = 'absolute'; - div.style.top = '-9999px'; - div.style.left = '-9999px'; - div.className = this.CLASS_PREFIX + '-blankimage'; - document.body.appendChild(div); - img = YAHOO.util.Dom.getStyle(div, 'background-image'); - img = img.replace('url(', '').replace(')', '').replace(/"/g, ''); - //Adobe AIR Code - img = img.replace('app:/', ''); - this.set('blankimage', img); - this._blankImageLoaded = true; - div.parentNode.removeChild(div); - YAHOO.widget.EditorInfo.blankImage = img; - } - } else { - img = this.get('blankimage'); - } - return img; - }, - /** - * @private - * @method _handleAutoHeight - * @description Handles resizing the editor's height based on the content - */ - _handleAutoHeight: function() { - var doc = this._getDoc(), - body = doc.body, - docEl = doc.documentElement; - - var height = parseInt(Dom.getStyle(this.get('editor_wrapper'), 'height'), 10); - var newHeight = body.scrollHeight; - if (this.browser.webkit) { - newHeight = docEl.scrollHeight; - } - if (newHeight < parseInt(this.get('height'), 10)) { - newHeight = parseInt(this.get('height'), 10); - } - if ((height != newHeight) && (newHeight >= parseInt(this.get('height'), 10))) { - var anim = this.get('animate'); - this.set('animate', false); - this.set('height', newHeight + 'px'); - this.set('animate', anim); - if (this.browser.ie) { - //Internet Explorer needs this - this.get('iframe').setStyle('height', '99%'); - this.get('iframe').setStyle('zoom', '1'); - var self = this; - window.setTimeout(function() { - self.get('iframe').setStyle('height', '100%'); - }, 1); - } - } - }, - /** - * @private - * @property _formButtons - * @description Array of buttons that are in the Editor's parent form (for handleSubmit) - * @type Array - */ - _formButtons: null, - /** - * @private - * @property _formButtonClicked - * @description The form button that was clicked to submit the form. - * @type HTMLElement - */ - _formButtonClicked: null, - /** - * @private - * @method _handleFormButtonClick - * @description The click listener assigned to each submit button in the Editor's parent form. - * @param {Event} ev The click event - */ - _handleFormButtonClick: function(ev) { - var tar = Event.getTarget(ev); - this._formButtonClicked = tar; - }, - /** - * @private - * @method _handleFormSubmit - * @description Handles the form submission. - * @param {Object} ev The Form Submit Event - */ - _handleFormSubmit: function(ev) { - this.saveHTML(); - - var form = this.get('element').form, - tar = this._formButtonClicked || false; - - Event.removeListener(form, 'submit', this._handleFormSubmit); - if (YAHOO.env.ua.ie) { - //form.fireEvent("onsubmit"); - if (tar && !tar.disabled) { - tar.click(); - } - } else { // Gecko, Opera, and Safari - if (tar && !tar.disabled) { - tar.click(); - } - var oEvent = document.createEvent("HTMLEvents"); - oEvent.initEvent("submit", true, true); - form.dispatchEvent(oEvent); - if (YAHOO.env.ua.webkit) { - if (YAHOO.lang.isFunction(form.submit)) { - form.submit(); - } - } - } - //2.6.0 - //Removed this, not need since removing Safari 2.x - //Event.stopEvent(ev); - }, - /** - * @private - * @method _handleFontSize - * @description Handles the font size button in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleFontSize: function(o) { - var button = this.toolbar.getButtonById(o.button.id); - var value = button.get('label') + 'px'; - this.execCommand('fontsize', value); - return false; - }, - /** - * @private - * @description Handles the colorpicker buttons in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleColorPicker: function(o) { - var cmd = o.button; - var value = '#' + o.color; - if ((cmd == 'forecolor') || (cmd == 'backcolor')) { - this.execCommand(cmd, value); - } - }, - /** - * @private - * @method _handleAlign - * @description Handles the alignment buttons in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleAlign: function(o) { - var cmd = null; - for (var i = 0; i < o.button.menu.length; i++) { - if (o.button.menu[i].value == o.button.value) { - cmd = o.button.menu[i].value; - } - } - var value = this._getSelection(); - - this.execCommand(cmd, value); - return false; - }, - /** - * @private - * @method _handleAfterNodeChange - * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state). - */ - _handleAfterNodeChange: function() { - var path = this._getDomPath(), - elm = null, - family = null, - fontsize = null, - validFont = false, - fn_button = this.toolbar.getButtonByValue('fontname'), - fs_button = this.toolbar.getButtonByValue('fontsize'), - hd_button = this.toolbar.getButtonByValue('heading'); - - for (var i = 0; i < path.length; i++) { - elm = path[i]; - - var tag = elm.tagName.toLowerCase(); - - - if (elm.getAttribute('tag')) { - tag = elm.getAttribute('tag'); - } - - family = elm.getAttribute('face'); - if (Dom.getStyle(elm, 'font-family')) { - family = Dom.getStyle(elm, 'font-family'); - //Adobe AIR Code - family = family.replace(/'/g, ''); - } - - if (tag.substring(0, 1) == 'h') { - if (hd_button) { - for (var h = 0; h < hd_button._configs.menu.value.length; h++) { - if (hd_button._configs.menu.value[h].value.toLowerCase() == tag) { - hd_button.set('label', hd_button._configs.menu.value[h].text); - } - } - this._updateMenuChecked('heading', tag); - } - } - } - - if (fn_button) { - for (var b = 0; b < fn_button._configs.menu.value.length; b++) { - if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) { - validFont = true; - family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button - } - } - if (!validFont) { - family = fn_button._configs.label._initialConfig.value; - } - var familyLabel = '' + family + ''; - if (fn_button.get('label') != familyLabel) { - fn_button.set('label', familyLabel); - this._updateMenuChecked('fontname', family); - } - } - - if (fs_button) { - fontsize = parseInt(Dom.getStyle(elm, 'fontSize'), 10); - if ((fontsize === null) || isNaN(fontsize)) { - fontsize = fs_button._configs.label._initialConfig.value; - } - fs_button.set('label', ''+fontsize); - } - - if (!this._isElement(elm, 'body') && !this._isElement(elm, 'img')) { - this.toolbar.enableButton(fn_button); - this.toolbar.enableButton(fs_button); - this.toolbar.enableButton('forecolor'); - this.toolbar.enableButton('backcolor'); - } - if (this._isElement(elm, 'img')) { - if (YAHOO.widget.Overlay) { - this.toolbar.enableButton('createlink'); - } - } - if (this._hasParent(elm, 'blockquote')) { - this.toolbar.selectButton('indent'); - this.toolbar.disableButton('indent'); - this.toolbar.enableButton('outdent'); - } - if (this._hasParent(elm, 'ol') || this._hasParent(elm, 'ul')) { - this.toolbar.disableButton('indent'); - } - this._lastButton = null; - - }, - /** - * @private - * @method _handleInsertImageClick - * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked. - */ - _handleInsertImageClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('insertimage')) { - YAHOO.log('Toolbar Button for (insertimage) was not found, skipping exec.', 'info', 'SimpleEditor'); - return false; - } - } - - this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing - var _handleAEC = function() { - var el = this.currentElement[0], - src = 'http://'; - if (!el) { - el = this._getSelectedElement(); - } - if (el) { - if (el.getAttribute('src')) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - src = this.STR_IMAGE_HERE; - } - } - } - var str = prompt(this.STR_IMAGE_URL + ': ', src); - if ((str !== '') && (str !== null)) { - el.setAttribute('src', str); - } else if (str === '') { - el.parentNode.removeChild(el); - this.currentElement = []; - this.nodeChange(); - } else if ((str === null)) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - el.parentNode.removeChild(el); - this.currentElement = []; - this.nodeChange(); - } - } - this.closeWindow(); - this.toolbar.set('disabled', false); - this.unsubscribe('afterExecCommand', _handleAEC, this, true); - }; - this.on('afterExecCommand', _handleAEC, this, true); - }, - /** - * @private - * @method _handleInsertImageWindowClose - * @description Handles the closing of the Image Properties Window. - */ - _handleInsertImageWindowClose: function() { - this.nodeChange(); - }, - /** - * @private - * @method _isLocalFile - * @param {String} url THe url/string to check - * @description Checks to see if a string (href or img src) is possibly a local file reference.. - */ - _isLocalFile: function(url) { - if ((url) && (url !== '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) { - return true; - } - return false; - }, - /** - * @private - * @method _handleCreateLinkClick - * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked. - */ - _handleCreateLinkClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - YAHOO.log('Toolbar Button for (createlink) was not found, skipping exec.', 'info', 'SimpleEditor'); - return false; - } - } - - this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing - - var _handleAEC = function() { - var el = this.currentElement[0], - url = ''; - - if (el) { - if (el.getAttribute('href', 2) !== null) { - url = el.getAttribute('href', 2); - } - } - var str = prompt(this.STR_LINK_URL + ': ', url); - if ((str !== '') && (str !== null)) { - var urlValue = str; - if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - //Found an @ sign, prefix with mailto: - urlValue = 'mailto:' + urlValue; - } else { - /* :// not found adding */ - if (urlValue.substring(0, 1) != '#') { - //urlValue = 'http:/'+'/' + urlValue; - } - } - } - el.setAttribute('href', urlValue); - } else if (str !== null) { - var _span = this._getDoc().createElement('span'); - _span.innerHTML = el.innerHTML; - Dom.addClass(_span, 'yui-non'); - el.parentNode.replaceChild(_span, el); - } - this.closeWindow(); - this.toolbar.set('disabled', false); - this.unsubscribe('afterExecCommand', _handleAEC, this, true); - }; - this.on('afterExecCommand', _handleAEC, this); - - }, - /** - * @private - * @method _handleCreateLinkWindowClose - * @description Handles the closing of the Link Properties Window. - */ - _handleCreateLinkWindowClose: function() { - this.nodeChange(); - this.currentElement = []; - }, - /** - * @method render - * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load. - */ - render: function() { - if (this._rendered) { - return false; - } - YAHOO.log('Render', 'info', 'SimpleEditor'); - if (!this.DOMReady) { - YAHOO.log('!DOMReady', 'info', 'SimpleEditor'); - this._queue[this._queue.length] = ['render', arguments]; - return false; - } - if (this.get('element')) { - if (this.get('element').tagName) { - this._textarea = true; - if (this.get('element').tagName.toLowerCase() !== 'textarea') { - this._textarea = false; - } - } else { - YAHOO.log('No Valid Element', 'error', 'SimpleEditor'); - return false; - } - } else { - YAHOO.log('No Element', 'error', 'SimpleEditor'); - return false; - } - this._rendered = true; - var self = this; - window.setTimeout(function() { - self._render.call(self); - }, 4); - }, - /** - * @private - * @method _render - * @description Causes the toolbar and the editor to render and replace the textarea. - */ - _render: function() { - var self = this; - this.set('textarea', this.get('element')); - - this.get('element_cont').setStyle('display', 'none'); - this.get('element_cont').addClass(this.CLASS_CONTAINER); - - this.set('iframe', this._createIframe()); - - window.setTimeout(function() { - self._setInitialContent.call(self); - }, 10); - - this.get('editor_wrapper').appendChild(this.get('iframe').get('element')); - - if (this.get('disabled')) { - this._disableEditor(true); - } - - var tbarConf = this.get('toolbar'); - //Create Toolbar instance - if (tbarConf instanceof Toolbar) { - this.toolbar = tbarConf; - //Set the toolbar to disabled until content is loaded - this.toolbar.set('disabled', true); - } else { - //Set the toolbar to disabled until content is loaded - tbarConf.disabled = true; - this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf); - } - - YAHOO.log('fireEvent::toolbarLoaded', 'info', 'SimpleEditor'); - this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar }); - - - this.toolbar.on('toolbarCollapsed', function() { - if (this.currentWindow) { - this.moveWindow(); - } - }, this, true); - this.toolbar.on('toolbarExpanded', function() { - if (this.currentWindow) { - this.moveWindow(); - } - }, this, true); - this.toolbar.on('fontsizeClick', this._handleFontSize, this, true); - - this.toolbar.on('colorPickerClicked', function(o) { - this._handleColorPicker(o); - return false; //Stop the buttonClick event - }, this, true); - - this.toolbar.on('alignClick', this._handleAlign, this, true); - this.on('afterNodeChange', this._handleAfterNodeChange, this, true); - this.toolbar.on('insertimageClick', this._handleInsertImageClick, this, true); - this.on('windowinsertimageClose', this._handleInsertImageWindowClose, this, true); - this.toolbar.on('createlinkClick', this._handleCreateLinkClick, this, true); - this.on('windowcreatelinkClose', this._handleCreateLinkWindowClose, this, true); - - - //Replace Textarea with editable area - this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element')); - - - this.setStyle('visibility', 'hidden'); - this.setStyle('position', 'absolute'); - this.setStyle('top', '-9999px'); - this.setStyle('left', '-9999px'); - this.get('element_cont').appendChild(this.get('element')); - this.get('element_cont').setStyle('display', 'block'); - - - Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT); - this.get('iframe').addClass(this.CLASS_EDITABLE); - - //Set height and width of editor container - this.get('element_cont').setStyle('width', this.get('width')); - Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height')); - - this.get('iframe').setStyle('width', '100%'); //WIDTH - this.get('iframe').setStyle('height', '100%'); - - this._setupDD(); - - window.setTimeout(function() { - self._setupAfterElement.call(self); - }, 0); - this.fireEvent('afterRender', { type: 'afterRender', target: this }); - }, - /** - * @method execCommand - * @param {String} action The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml) - * @param {String} value (optional) The value for a given action such as action: fontname value: 'Verdana' - * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions - */ - execCommand: function(action, value) { - var beforeExec = this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments }); - if ((beforeExec === false) || (this.STOP_EXEC_COMMAND)) { - this.STOP_EXEC_COMMAND = false; - return false; - } - this._lastCommand = action; - this._setMarkupType(action); - if (this.browser.ie) { - this._getWindow().focus(); - } - var exec = true; - - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue(action)) { - YAHOO.log('Toolbar Button for (' + action + ') was not found, skipping exec.', 'info', 'SimpleEditor'); - exec = false; - } - } - - this.editorDirty = true; - - if ((typeof this['cmd_' + action.toLowerCase()] == 'function') && exec) { - YAHOO.log('Found execCommand override method: (cmd_' + action.toLowerCase() + ')', 'info', 'SimpleEditor'); - var retValue = this['cmd_' + action.toLowerCase()](value); - exec = retValue[0]; - if (retValue[1]) { - action = retValue[1]; - } - if (retValue[2]) { - value = retValue[2]; - } - } - if (exec) { - YAHOO.log('execCommand::(' + action + '), (' + value + ')', 'info', 'SimpleEditor'); - try { - this._getDoc().execCommand(action, false, value); - } catch(e) { - YAHOO.log('execCommand Failed', 'error', 'SimpleEditor'); - } - } else { - YAHOO.log('OVERRIDE::execCommand::(' + action + '),(' + value + ') skipped', 'warn', 'SimpleEditor'); - } - this.on('afterExecCommand', function() { - this.unsubscribeAll('afterExecCommand'); - this.nodeChange(); - }, this, true); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - - }, - /* {{{ Command Overrides */ - - /** - * @method cmd_bold - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('bold') is used. - */ - cmd_bold: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span') && this._hasSelection()) { - if (el.style.fontWeight == 'bold') { - el.style.fontWeight = ''; - var b = this._getDoc().createElement('b'), - par = el.parentNode; - par.replaceChild(b, el); - b.appendChild(el); - } - } - } - return [true]; - }, - /** - * @method cmd_italic - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('italic') is used. - */ - - cmd_italic: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span') && this._hasSelection()) { - if (el.style.fontStyle == 'italic') { - el.style.fontStyle = ''; - var i = this._getDoc().createElement('i'), - par = el.parentNode; - par.replaceChild(i, el); - i.appendChild(el); - } - } - } - return [true]; - }, - - - /** - * @method cmd_underline - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('underline') is used. - */ - cmd_underline: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span')) { - if (el.style.textDecoration == 'underline') { - el.style.textDecoration = 'none'; - } else { - el.style.textDecoration = 'underline'; - } - return [false]; - } - } - return [true]; - }, - /** - * @method cmd_backcolor - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('backcolor') is used. - */ - cmd_backcolor: function(value) { - var exec = true, - el = this._getSelectedElement(), - action = 'backcolor'; - - if (this.browser.gecko || this.browser.opera) { - this._setEditorStyle(true); - action = 'hilitecolor'; - } - - if (!this._isElement(el, 'body') && !this._hasSelection()) { - el.style.backgroundColor = value; - this._selectNode(el); - exec = false; - } else { - if (this.get('insert')) { - el = this._createInsertElement({ backgroundColor: value }); - } else { - this._createCurrentElement('span', { backgroundColor: value, color: el.style.color, fontSize: el.style.fontSize, fontFamily: el.style.fontFamily }); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - - return [exec, action]; - }, - /** - * @method cmd_forecolor - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('forecolor') is used. - */ - cmd_forecolor: function(value) { - var exec = true, - el = this._getSelectedElement(); - - if (!this._isElement(el, 'body') && !this._hasSelection()) { - Dom.setStyle(el, 'color', value); - this._selectNode(el); - exec = false; - } else { - if (this.get('insert')) { - el = this._createInsertElement({ color: value }); - } else { - this._createCurrentElement('span', { color: value, fontSize: el.style.fontSize, fontFamily: el.style.fontFamily, backgroundColor: el.style.backgroundColor }); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - return [exec]; - }, - /** - * @method cmd_unlink - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('unlink') is used. - */ - cmd_unlink: function(value) { - this._swapEl(this.currentElement[0], 'span', function(el) { - el.className = 'yui-non'; - }); - return [false]; - }, - /** - * @method cmd_createlink - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('createlink') is used. - */ - cmd_createlink: function(value) { - var el = this._getSelectedElement(), _a = null; - if (this._hasParent(el, 'a')) { - this.currentElement[0] = this._hasParent(el, 'a'); - } else if (this._isElement(el, 'li')) { - _a = this._getDoc().createElement('a'); - _a.innerHTML = el.innerHTML; - el.innerHTML = ''; - el.appendChild(_a); - this.currentElement[0] = _a; - } else if (!this._isElement(el, 'a')) { - this._createCurrentElement('a'); - _a = this._swapEl(this.currentElement[0], 'a'); - this.currentElement[0] = _a; - } else { - this.currentElement[0] = el; - } - return [false]; - }, - /** - * @method cmd_insertimage - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertimage') is used. - */ - cmd_insertimage: function(value) { - var exec = true, _img = null, action = 'insertimage', - el = this._getSelectedElement(); - - if (value === '') { - value = this.get('blankimage'); - } - - /* - * @knownissue Safari Cursor Position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - - YAHOO.log('InsertImage: ' + el.tagName, 'info', 'SimpleEditor'); - if (this._isElement(el, 'img')) { - this.currentElement[0] = el; - exec = false; - } else { - if (this._getDoc().queryCommandEnabled(action)) { - this._getDoc().execCommand(action, false, value); - var imgs = this._getDoc().getElementsByTagName('img'); - for (var i = 0; i < imgs.length; i++) { - if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) { - YAHOO.util.Dom.addClass(imgs[i], 'yui-img'); - this.currentElement[0] = imgs[i]; - } - } - exec = false; - } else { - if (el == this._getDoc().body) { - _img = this._getDoc().createElement('img'); - _img.setAttribute('src', value); - YAHOO.util.Dom.addClass(_img, 'yui-img'); - this._getDoc().body.appendChild(_img); - } else { - this._createCurrentElement('img'); - _img = this._getDoc().createElement('img'); - _img.setAttribute('src', value); - YAHOO.util.Dom.addClass(_img, 'yui-img'); - this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]); - } - this.currentElement[0] = _img; - exec = false; - } - } - return [exec]; - }, - /** - * @method cmd_inserthtml - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('inserthtml') is used. - */ - cmd_inserthtml: function(value) { - var exec = true, action = 'inserthtml', _span = null, _range = null; - /* - * @knownissue Safari cursor position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) { - YAHOO.log('More Safari DOM tricks (inserthtml)', 'info', 'EditorSafari'); - this._createCurrentElement('img'); - _span = this._getDoc().createElement('span'); - _span.innerHTML = value; - this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]); - exec = false; - } else if (this.browser.ie) { - _range = this._getRange(); - if (_range.item) { - _range.item(0).outerHTML = value; - } else { - _range.pasteHTML(value); - } - exec = false; - } - return [exec]; - }, - /** - * @method cmd_list - * @param tag The tag of the list you want to create (eg, ul or ol) - * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods. - */ - cmd_list: function(tag) { - var exec = true, list = null, li = 0, el = null, str = '', - selEl = this._getSelectedElement(), action = 'insertorderedlist'; - if (tag == 'ul') { - action = 'insertunorderedlist'; - } - /* - * @knownissue Safari 2.+ doesn't support ordered and unordered lists - * @browser Safari 2.x - * The issue with this workaround is that when applied to a set of text - * that has BR's in it, Safari may or may not pick up the individual items as - * list items. This is fixed in WebKit (Safari 3) - * 2.6.0: Seems there are still some issues with List Creation and Safari 3, reverting to previously working Safari 2.x code - */ - //if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) { - if ((this.browser.webkit && !this.browser.webkit4) || (this.browser.opera)) { - if (this._isElement(selEl, 'li') && this._isElement(selEl.parentNode, tag)) { - YAHOO.log('We already have a list, undo it', 'info', 'SimpleEditor'); - el = selEl.parentNode; - list = this._getDoc().createElement('span'); - YAHOO.util.Dom.addClass(list, 'yui-non'); - str = ''; - var lis = el.getElementsByTagName('li'), p_tag = ((this.browser.opera && this.get('ptags')) ? 'p' : 'div'); - for (li = 0; li < lis.length; li++) { - str += '<' + p_tag + '>' + lis[li].innerHTML + ''; - } - list.innerHTML = str; - this.currentElement[0] = el; - this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]); - } else { - YAHOO.log('Create list item', 'info', 'SimpleEditor'); - this._createCurrentElement(tag.toLowerCase()); - list = this._getDoc().createElement(tag); - for (li = 0; li < this.currentElement.length; li++) { - var newli = this._getDoc().createElement('li'); - newli.innerHTML = this.currentElement[li].innerHTML + '  '; - list.appendChild(newli); - if (li > 0) { - this.currentElement[li].parentNode.removeChild(this.currentElement[li]); - } - } - var b_tag = ((this.browser.opera) ? '
              ' : '
              '), - items = list.firstChild.innerHTML.split(b_tag), i, item; - if (items.length > 0) { - list.innerHTML = ''; - for (i = 0; i < items.length; i++) { - item = this._getDoc().createElement('li'); - item.innerHTML = items[i]; - list.appendChild(item); - } - } - - this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]); - this.currentElement[0] = list; - var _h = this.currentElement[0].firstChild; - _h = Dom.getElementsByClassName('yui-non', 'span', _h)[0]; - if (this.browser.webkit) { - this._getSelection().setBaseAndExtent(_h, 1, _h, _h.innerText.length); - } - } - exec = false; - } else { - el = this._getSelectedElement(); - YAHOO.log(el.tagName); - if (this._isElement(el, 'li') && this._isElement(el.parentNode, tag) || (this.browser.ie && this._isElement(this._getRange().parentElement, 'li')) || (this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { //we are in a list.. - YAHOO.log('We already have a list, undo it', 'info', 'SimpleEditor'); - if (this.browser.ie) { - if ((this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { - el = el.getElementsByTagName('li')[0]; - } - YAHOO.log('Undo IE', 'info', 'SimpleEditor'); - str = ''; - var lis2 = el.parentNode.getElementsByTagName('li'); - for (var j = 0; j < lis2.length; j++) { - str += lis2[j].innerHTML + '
              '; - } - var newEl = this._getDoc().createElement('span'); - newEl.innerHTML = str; - el.parentNode.parentNode.replaceChild(newEl, el.parentNode); - } else { - this.nodeChange(); - this._getDoc().execCommand(action, '', el.parentNode); - this.nodeChange(); - } - exec = false; - } - if (this.browser.opera) { - var self = this; - window.setTimeout(function() { - var liso = self._getDoc().getElementsByTagName('li'); - for (var i = 0; i < liso.length; i++) { - if (liso[i].innerHTML.toLowerCase() == '
              ') { - liso[i].parentNode.parentNode.removeChild(liso[i].parentNode); - } - } - },30); - } - if (this.browser.ie && exec) { - var html = ''; - if (this._getRange().html) { - html = '
            • ' + this._getRange().html+ '
            • '; - } else { - var t = this._getRange().text.split('\n'); - if (t.length > 1) { - html = ''; - for (var ie = 0; ie < t.length; ie++) { - html += '
            • ' + t[ie] + '
            • '; - } - } else { - var txt = this._getRange().text; - if (txt === '') { - html = '
            • ' + txt + '
            • '; - } else { - html = '
            • ' + txt + '
            • '; - } - } - } - this._getRange().pasteHTML('<' + tag + '>' + html + ''); - var new_item = this._getDoc().getElementById('new_list_item'); - if (new_item) { - var range = this._getDoc().body.createTextRange(); - range.moveToElementText(new_item); - range.collapse(false); - range.select(); - new_item.id = ''; - } - exec = false; - } - } - return exec; - }, - /** - * @method cmd_insertorderedlist - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertorderedlist ') is used. - */ - cmd_insertorderedlist: function(value) { - return [this.cmd_list('ol')]; - }, - /** - * @method cmd_insertunorderedlist - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertunorderedlist') is used. - */ - cmd_insertunorderedlist: function(value) { - return [this.cmd_list('ul')]; - }, - /** - * @method cmd_fontname - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontname') is used. - */ - cmd_fontname: function(value) { - var exec = true, - selEl = this._getSelectedElement(); - - this.currentFont = value; - if (selEl && selEl.tagName && !this._hasSelection() && !this._isElement(selEl, 'body') && !this.get('insert')) { - YAHOO.util.Dom.setStyle(selEl, 'font-family', value); - exec = false; - } else if (this.get('insert') && !this._hasSelection()) { - YAHOO.log('No selection and no selected element and we are in insert mode', 'info', 'SimpleEditor'); - var el = this._createInsertElement({ fontFamily: value }); - exec = false; - } - return [exec]; - }, - /** - * @method cmd_fontsize - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontsize') is used. - */ - cmd_fontsize: function(value) { - var el = null, go = true; - el = this._getSelectedElement(); - if (this.browser.webkit) { - if (this.currentElement[0]) { - if (el == this.currentElement[0]) { - go = false; - YAHOO.util.Dom.setStyle(el, 'fontSize', value); - this._selectNode(el); - this.currentElement[0] = el; - } - } - } - if (go) { - if (!this._isElement(this._getSelectedElement(), 'body') && (!this._hasSelection())) { - el = this._getSelectedElement(); - YAHOO.util.Dom.setStyle(el, 'fontSize', value); - if (this.get('insert') && this.browser.ie) { - var r = this._getRange(); - r.collapse(false); - r.select(); - } else { - this._selectNode(el); - } - } else if (this.currentElement && (this.currentElement.length > 0) && (!this._hasSelection()) && (!this.get('insert'))) { - YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value); - } else { - if (this.get('insert') && !this._hasSelection()) { - el = this._createInsertElement({ fontSize: value }); - this.currentElement[0] = el; - this._selectNode(this.currentElement[0]); - } else { - this._createCurrentElement('span', {'fontSize': value, fontFamily: el.style.fontFamily, color: el.style.color, backgroundColor: el.style.backgroundColor }); - this._selectNode(this.currentElement[0]); - } - } - } - return [false]; - }, - /* }}} */ - /** - * @private - * @method _swapEl - * @param {HTMLElement} el The element to swap with - * @param {String} tagName The tagname of the element that you wish to create - * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function. - * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place. - */ - _swapEl: function(el, tagName, callback) { - var _el = this._getDoc().createElement(tagName); - if (el) { - _el.innerHTML = el.innerHTML; - } - if (typeof callback == 'function') { - callback.call(this, _el); - } - if (el) { - el.parentNode.replaceChild(_el, el); - } - return _el; - }, - /** - * @private - * @method _createInsertElement - * @description Creates a new "currentElement" then adds some text (and other things) to make it selectable and stylable. Then the user can continue typing. - * @param {Object} css (optional) Object literal containing styles to apply to the new element. - * @return {HTMLElement} - */ - _createInsertElement: function(css) { - this._createCurrentElement('span', css); - var el = this.currentElement[0]; - if (this.browser.webkit) { - //Little Safari Hackery here.. - el.innerHTML = ' '; - el = el.firstChild; - this._getSelection().setBaseAndExtent(el, 1, el, el.innerText.length); - } else if (this.browser.ie || this.browser.opera) { - el.innerHTML = ' '; - } - this.focus(); - this._selectNode(el, true); - return el; - }, - /** - * @private - * @method _createCurrentElement - * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create - * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element. - * @description This is a work around for the various browser issues with execCommand. This method will run execCommand('fontname', false, 'yui-tmp') on the given selection. - * It will then search the document for an element with the font-family set to yui-tmp and replace that with another span that has other information in it, then assign the new span to the - * this.currentElement array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit. - */ - _createCurrentElement: function(tagName, tagStyle) { - tagName = ((tagName) ? tagName : 'a'); - var tar = null, - el = [], - _doc = this._getDoc(); - - if (this.currentFont) { - if (!tagStyle) { - tagStyle = {}; - } - tagStyle.fontFamily = this.currentFont; - this.currentFont = null; - } - this.currentElement = []; - - var _elCreate = function(tagName, tagStyle) { - var el = null; - tagName = ((tagName) ? tagName : 'span'); - tagName = tagName.toLowerCase(); - switch (tagName) { - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - el = _doc.createElement(tagName); - break; - default: - el = _doc.createElement(tagName); - if (tagName === 'span') { - YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName); - YAHOO.util.Dom.addClass(el, 'yui-tag'); - el.setAttribute('tag', tagName); - } - - for (var k in tagStyle) { - if (YAHOO.lang.hasOwnProperty(tagStyle, k)) { - el.style[k] = tagStyle[k]; - } - } - break; - } - return el; - }; - - if (!this._hasSelection()) { - if (this._getDoc().queryCommandEnabled('insertimage')) { - this._getDoc().execCommand('insertimage', false, 'yui-tmp-img'); - var imgs = this._getDoc().getElementsByTagName('img'); - for (var j = 0; j < imgs.length; j++) { - if (imgs[j].getAttribute('src', 2) == 'yui-tmp-img') { - el = _elCreate(tagName, tagStyle); - imgs[j].parentNode.replaceChild(el, imgs[j]); - this.currentElement[this.currentElement.length] = el; - } - } - } else { - if (this.currentEvent) { - tar = YAHOO.util.Event.getTarget(this.currentEvent); - } else { - //For Safari.. - tar = this._getDoc().body; - } - } - if (tar) { - /* - * @knownissue Safari Cursor Position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - el = _elCreate(tagName, tagStyle); - if (this._isElement(tar, 'body') || this._isElement(tar, 'html')) { - if (this._isElement(tar, 'html')) { - tar = this._getDoc().body; - } - tar.appendChild(el); - } else if (tar.nextSibling) { - tar.parentNode.insertBefore(el, tar.nextSibling); - } else { - tar.parentNode.appendChild(el); - } - //this.currentElement = el; - this.currentElement[this.currentElement.length] = el; - this.currentEvent = null; - if (this.browser.webkit) { - //Force Safari to focus the new element - this._getSelection().setBaseAndExtent(el, 0, el, 0); - if (this.browser.webkit3) { - this._getSelection().collapseToStart(); - } else { - this._getSelection().collapse(true); - } - } - } - } else { - //Force CSS Styling for this action... - this._setEditorStyle(true); - this._getDoc().execCommand('fontname', false, 'yui-tmp'); - var _tmp = [], __tmp, __els = ['font', 'span', 'i', 'b', 'u']; - - if (!this._isElement(this._getSelectedElement(), 'body')) { - __els[__els.length] = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName); - __els[__els.length] = this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName); - } - for (var _els = 0; _els < __els.length; _els++) { - var _tmp1 = this._getDoc().getElementsByTagName(__els[_els]); - for (var e = 0; e < _tmp1.length; e++) { - _tmp[_tmp.length] = _tmp1[e]; - } - } - - - for (var i = 0; i < _tmp.length; i++) { - if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) { - if (tagName !== 'span') { - el = _elCreate(tagName, tagStyle); - } else { - el = _elCreate(_tmp[i].tagName, tagStyle); - } - el.innerHTML = _tmp[i].innerHTML; - if (this._isElement(_tmp[i], 'ol') || (this._isElement(_tmp[i], 'ul'))) { - var fc = _tmp[i].getElementsByTagName('li')[0]; - _tmp[i].style.fontFamily = 'inherit'; - fc.style.fontFamily = 'inherit'; - el.innerHTML = fc.innerHTML; - fc.innerHTML = ''; - fc.appendChild(el); - this.currentElement[this.currentElement.length] = el; - } else if (this._isElement(_tmp[i], 'li')) { - _tmp[i].innerHTML = ''; - _tmp[i].appendChild(el); - _tmp[i].style.fontFamily = 'inherit'; - this.currentElement[this.currentElement.length] = el; - } else { - if (_tmp[i].parentNode) { - _tmp[i].parentNode.replaceChild(el, _tmp[i]); - this.currentElement[this.currentElement.length] = el; - this.currentEvent = null; - if (this.browser.webkit) { - //Force Safari to focus the new element - this._getSelection().setBaseAndExtent(el, 0, el, 0); - if (this.browser.webkit3) { - this._getSelection().collapseToStart(); - } else { - this._getSelection().collapse(true); - } - } - if (this.browser.ie && tagStyle && tagStyle.fontSize) { - this._getSelection().empty(); - } - if (this.browser.gecko) { - this._getSelection().collapseToStart(); - } - } - } - } - } - var len = this.currentElement.length; - for (var o = 0; o < len; o++) { - if ((o + 1) != len) { //Skip the last one in the list - if (this.currentElement[o] && this.currentElement[o].nextSibling) { - if (this._isElement(this.currentElement[o], 'br')) { - this.currentElement[this.currentElement.length] = this.currentElement[o].nextSibling; - } - } - } - } - } - }, - /** - * @method saveHTML - * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea. - * @return String - */ - saveHTML: function() { - var html = this.cleanHTML(); - if (this._textarea) { - this.get('element').value = html; - } else { - this.get('element').innerHTML = html; - } - if (this.get('saveEl') !== this.get('element')) { - var out = this.get('saveEl'); - if (Lang.isString(out)) { - out = Dom.get(out); - } - if (out) { - if (out.tagName.toLowerCase() === 'textarea') { - out.value = html; - } else { - out.innerHTML = html; - } - } - } - return html; - }, - /** - * @method setEditorHTML - * @param {String} incomingHTML The html content to load into the editor - * @description Loads HTML into the editors body - */ - setEditorHTML: function(incomingHTML) { - var html = this._cleanIncomingHTML(incomingHTML); - html = html.replace(/RIGHT_BRACKET/gi, '{'); - html = html.replace(/LEFT_BRACKET/gi, '}'); - this._getDoc().body.innerHTML = html; - this.nodeChange(); - }, - /** - * @method getEditorHTML - * @description Gets the unprocessed/unfiltered HTML from the editor - */ - getEditorHTML: function() { - try { - var b = this._getDoc().body; - if (b === null) { - YAHOO.log('Body is null, returning null.', 'error', 'SimpleEditor'); - return null; - } - return this._getDoc().body.innerHTML; - } catch (e) { - return ''; - } - }, - /** - * @method show - * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none. - */ - show: function() { - if (this.browser.gecko) { - this._setDesignMode('on'); - this.focus(); - } - if (this.browser.webkit) { - var self = this; - window.setTimeout(function() { - self._setInitialContent.call(self); - }, 10); - } - //Adding this will close all other Editor window's when showing this one. - if (this.currentWindow) { - this.closeWindow(); - } - //Put the iframe back in place - this.get('iframe').setStyle('position', 'static'); - this.get('iframe').setStyle('left', ''); - }, - /** - * @method hide - * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows. - */ - hide: function() { - //Adding this will close all other Editor window's. - if (this.currentWindow) { - this.closeWindow(); - } - if (this._fixNodesTimer) { - clearTimeout(this._fixNodesTimer); - this._fixNodesTimer = null; - } - if (this._nodeChangeTimer) { - clearTimeout(this._nodeChangeTimer); - this._nodeChangeTimer = null; - } - this._lastNodeChange = 0; - //Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements. - this.get('iframe').setStyle('position', 'absolute'); - this.get('iframe').setStyle('left', '-9999px'); - }, - /** - * @method _cleanIncomingHTML - * @param {String} html The unfiltered HTML - * @description Process the HTML with a few regexes to clean it up and stabilize the input - * @return {String} The filtered HTML - */ - _cleanIncomingHTML: function(html) { - html = html.replace(/{/gi, 'RIGHT_BRACKET'); - html = html.replace(/}/gi, 'LEFT_BRACKET'); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/strong>/gi, '
              '); - - //replace embed before em check - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/embed>/gi, ''); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/em>/gi, '
              '); - html = html.replace(/_moz_dirty=""/gi, ''); - - //Put embed tags back in.. - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/YUI_EMBED>/gi, ''); - if (this.get('plainText')) { - YAHOO.log('Filtering as plain text', 'info', 'SimpleEditor'); - html = html.replace(/\n/g, '
              ').replace(/\r/g, '
              '); - html = html.replace(/ /gi, '  '); //Replace all double spaces - html = html.replace(/\t/gi, '    '); //Replace all tabs - } - //Removing Script Tags from the Editor - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/script([^>]*)>/gi, ''); - html = html.replace(/<script([^>]*)>/gi, ''); - html = html.replace(/<\/script([^>]*)>/gi, ''); - //Replace the line feeds - html = html.replace(/\r\n/g, '').replace(/\n/g, '').replace(/\r/g, ''); - - //Remove Bad HTML elements (used to be script nodes) - html = html.replace(new RegExp(']*)>(.*?)<\/bad>', 'gi'), ''); - //Replace the lines feeds - html = html.replace(//g, '\n'); - return html; - }, - /** - * @method cleanHTML - * @param {String} html The unfiltered HTML - * @description Process the HTML with a few regexes to clean it up and stabilize the output - * @return {String} The filtered HTML - */ - cleanHTML: function(html) { - //Start Filtering Output - //Begin RegExs.. - if (!html) { - html = this.getEditorHTML(); - } - var markup = this.get('markup'); - //Make some backups... - html = this.pre_filter_linebreaks(html, markup); - - //Filter MS Word - html = this.filter_msword(html); - - html = html.replace(/]*)\/>/gi, ''); - html = html.replace(/]*)>/gi, ''); - - html = html.replace(/]*)\/>/gi, ''); - html = html.replace(/]*)>/gi, ''); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/ul>/gi, '<\/YUI_UL>'); - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/blockquote>/gi, '<\/YUI_BQ>'); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/embed>/gi, '<\/YUI_EMBED>'); - - //Convert b and i tags to strong and em tags - if ((markup == 'semantic') || (markup == 'xhtml')) { - html = html.replace(/]*)?>/gi, ''); - html = html.replace(/<\/i>/gi, ''); - html = html.replace(/]*)?>/gi, ''); - html = html.replace(/<\/b>/gi, ''); - } - - html = html.replace(/_moz_dirty=""/gi, ''); - - //normalize strikethrough - html = html.replace(//gi, '/span>'); - - - //Case Changing - if (this.browser.ie) { - html = html.replace(/text-decoration/gi, 'text-decoration'); - html = html.replace(/font-weight/gi, 'font-weight'); - html = html.replace(/_width="([^>]*)"/gi, ''); - html = html.replace(/_height="([^>]*)"/gi, ''); - //Cleanup Image URL's - var url = this._baseHREF.replace(/\//gi, '\\/'), - re = new RegExp('src="' + url, 'gi'); - html = html.replace(re, 'src="'); - } - html = html.replace(//gi, ''); - html = html.replace(//gi, ''); - if ((markup == 'semantic') || (markup == 'xhtml') || (markup == 'css')) { - html = html.replace(new RegExp(']*)face="([^>]*)">(.*?)<\/font>', 'gi'), '$3'); - html = html.replace(/([^>]*)<\/span>', 'gi'), '$1'); - html = html.replace(new RegExp('([^>]*)<\/span>', 'gi'), '$1'); - } - html = html.replace(/\/u>/gi, '/span>'); - if (markup == 'css') { - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/em>/gi, ''); - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/strong>/gi, ''); - html = html.replace(//gi, '/span>'); - html = html.replace(//gi, '/span>'); - } - html = html.replace(/ /gi, ' '); //Replace all double spaces and replace with a single - } else { - html = html.replace(//gi, '/u>'); - } - html = html.replace(/]*)>/gi, ''); - html = html.replace(/\/ol>/gi, '/ol>'); - html = html.replace(/
            • /gi, '/li>'); - html = this.filter_safari(html); - - html = this.filter_internals(html); - - html = this.filter_all_rgb(html); - - //Replace our backups with the real thing - html = this.post_filter_linebreaks(html, markup); - - if (markup == 'xhtml') { - html = html.replace(/]*)>/g, ''); - html = html.replace(/]*)>/g, ''); - } else { - html = html.replace(/]*)>/g, ''); - html = html.replace(/]*)>/g, ''); - } - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_UL>/g, '<\/ul>'); - - html = this.filter_invalid_lists(html); - - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_BQ>/g, '<\/blockquote>'); - - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_EMBED>/g, '<\/embed>'); - - //This should fix &'s in URL's - html = html.replace(/ & /gi, ' YUI_AMP '); - html = html.replace(/ &/gi, ' YUI_AMP_F '); - html = html.replace(/& /gi, ' YUI_AMP_R '); - html = html.replace(/&/gi, '&'); - html = html.replace(/ YUI_AMP /gi, ' & '); - html = html.replace(/ YUI_AMP_F /gi, ' &'); - html = html.replace(/ YUI_AMP_R /gi, '& '); - - //Trim the output, removing whitespace from the beginning and end - html = YAHOO.lang.trim(html); - - if (this.get('removeLineBreaks')) { - html = html.replace(/\n/g, '').replace(/\r/g, ''); - html = html.replace(/ /gi, ' '); //Replace all double spaces and replace with a single - } - - for (var v in this.invalidHTML) { - if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) { - if (Lang.isObject(v) && v.keepContents) { - html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '$1'); - } else { - html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), ''); - } - } - } - - /* LATER -- Add DOM manipulation - console.log(html); - var frag = document.createDocumentFragment(); - frag.innerHTML = html; - - var ps = frag.getElementsByTagName('p'), - len = ps.length; - for (var i = 0; i < len; i++) { - var ps2 = ps[i].getElementsByTagName('p'); - if (ps2.length) { - - } - - } - html = frag.innerHTML; - console.log(html); - */ - - this.fireEvent('cleanHTML', { type: 'cleanHTML', target: this, html: html }); - - return html; - }, - /** - * @method filter_msword - * @param String html The HTML string to filter - * @description Filters out msword html attributes and other junk. Activate with filterWord: true in config - */ - filter_msword: function(html) { - if (!this.get('filterWord')) { - return html; - } - //Remove the ms o: tags - html = html.replace(/\s*<\/o:p>/g, ''); - html = html.replace(/[\s\S]*?<\/o:p>/g, ' '); - - //Remove the ms w: tags - html = html.replace( /]*>[\s\S]*?<\/w:[^>]*>/gi, ''); - - //Remove mso-? styles. - html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, ''); - - //Remove more bogus MS styles. - html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, ''); - html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\""); - html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, ''); - html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\""); - html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\""); - html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ); - html = html.replace( /\s*tab-stops:[^;"]*;?/gi, ''); - html = html.replace( /\s*tab-stops:[^"]*/gi, ''); - - //Remove XML declarations - html = html.replace(/<\\?\?xml[^>]*>/gi, ''); - - //Remove lang - html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); - - //Remove language tags - html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3"); - - //Remove onmouseover and onmouseout events (from MS Word comments effect) - html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3"); - html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3"); - - return html; - }, - /** - * @method filter_invalid_lists - * @param String html The HTML string to filter - * @description Filters invalid ol and ul list markup, converts this:
              1. ..
              to this:
              1. ..
            • - */ - filter_invalid_lists: function(html) { - html = html.replace(/<\/li>\n/gi, ''); - - html = html.replace(/<\/li>
                /gi, '
                1. '); - html = html.replace(/<\/ol>/gi, '
              1. '); - html = html.replace(/<\/ol><\/li>\n/gi, "
              "); - - html = html.replace(/<\/li>
                /gi, '
                • '); - html = html.replace(/<\/ul>/gi, '
              • '); - html = html.replace(/<\/ul><\/li>\n?/gi, "
              "); - - html = html.replace(/<\/li>/gi, ""); - html = html.replace(/<\/ol>/gi, "
        "); - html = html.replace(/
          /gi, "
            "); - html = html.replace(/
              /gi, "
                "); - return html; - }, - /** - * @method filter_safari - * @param String html The HTML string to filter - * @description Filters strings specific to Safari - * @return String - */ - filter_safari: function(html) { - if (this.browser.webkit) { - // - html = html.replace(/([^>])<\/span>/gi, '    '); - html = html.replace(/Apple-style-span/gi, ''); - html = html.replace(/style="line-height: normal;"/gi, ''); - html = html.replace(/yui-wk-div/gi, ''); - html = html.replace(/yui-wk-p/gi, ''); - - - //Remove bogus LI's - html = html.replace(/
              • <\/li>/gi, ''); - html = html.replace(/
              • <\/li>/gi, ''); - html = html.replace(/
              • <\/li>/gi, ''); - //Remove bogus DIV's - updated from just removing the div's to replacing /div with a break - if (this.get('ptags')) { - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/div>/gi, '

                '); - } else { - //html = html.replace(/
                /gi, '
                '); - html = html.replace(/]*)>([ tnr]*)<\/div>/gi, '
                '); - html = html.replace(/<\/div>/gi, ''); - } - } - return html; - }, - /** - * @method filter_internals - * @param String html The HTML string to filter - * @description Filters internal RTE strings and bogus attrs we don't want - * @return String - */ - filter_internals: function(html) { - html = html.replace(/\r/g, ''); - //Fix stuff we don't want - html = html.replace(/<\/?(body|head|html)[^>]*>/gi, ''); - //Fix last BR in LI - html = html.replace(/<\/li>/gi, '
              • '); - - html = html.replace(/yui-tag-span/gi, ''); - html = html.replace(/yui-tag/gi, ''); - html = html.replace(/yui-non/gi, ''); - html = html.replace(/yui-img/gi, ''); - html = html.replace(/ tag="span"/gi, ''); - html = html.replace(/ class=""/gi, ''); - html = html.replace(/ style=""/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ target=""/gi, ''); - html = html.replace(/ title=""/gi, ''); - - if (this.browser.ie) { - html = html.replace(/ class= /gi, ''); - html = html.replace(/ class= >/gi, ''); - } - - return html; - }, - /** - * @method filter_all_rgb - * @param String str The HTML string to filter - * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00" - * @return String - */ - filter_all_rgb: function(str) { - var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi"); - var arr = str.match(exp); - if (Lang.isArray(arr)) { - for (var i = 0; i < arr.length; i++) { - var color = this.filter_rgb(arr[i]); - str = str.replace(arr[i].toString(), color); - } - } - - return str; - }, - /** - * @method filter_rgb - * @param String css The CSS string containing rgb(#,#,#); - * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00 - * @return String - */ - filter_rgb: function(css) { - if (css.toLowerCase().indexOf('rgb') != -1) { - var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"); - var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(','); - - if (rgb.length == 5) { - var r = parseInt(rgb[1], 10).toString(16); - var g = parseInt(rgb[2], 10).toString(16); - var b = parseInt(rgb[3], 10).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - css = "#" + r + g + b; - } - } - return css; - }, - /** - * @method pre_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - pre_filter_linebreaks: function(html, markup) { - if (this.browser.webkit) { - html = html.replace(/
                /gi, ''); - html = html.replace(/
                /gi, ''); - } - html = html.replace(/
                /gi, ''); - html = html.replace(/
                /gi, ''); - html = html.replace(//gi, ''); - html = html.replace(/
                /gi, ''); - html = html.replace(/
                <\/div>/gi, ''); - html = html.replace(/

                ( | )<\/p>/g, ''); - html = html.replace(/


                 <\/p>/gi, ''); - html = html.replace(/

                 <\/p>/gi, ''); - //Fix last BR - html = html.replace(/$/, ''); - //Fix last BR in P - html = html.replace(/<\/p>/g, '

                '); - if (this.browser.ie) { - html = html.replace(/    /g, '\t'); - } - return html; - }, - /** - * @method post_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - post_filter_linebreaks: function(html, markup) { - if (markup == 'xhtml') { - html = html.replace(//g, '
                '); - } else { - html = html.replace(//g, '
                '); - } - return html; - }, - /** - * @method clearEditorDoc - * @description Clear the doc of the Editor - */ - clearEditorDoc: function() { - this._getDoc().body.innerHTML = ' '; - }, - /** - * @method openWindow - * @description Override Method for Advanced Editor - */ - openWindow: function(win) { - }, - /** - * @method moveWindow - * @description Override Method for Advanced Editor - */ - moveWindow: function() { - }, - /** - * @private - * @method _closeWindow - * @description Override Method for Advanced Editor - */ - _closeWindow: function() { - }, - /** - * @method closeWindow - * @description Override Method for Advanced Editor - */ - closeWindow: function() { - //this.unsubscribeAll('afterExecCommand'); - this.toolbar.resetAllButtons(); - this.focus(); - }, - /** - * @method destroy - * @description Destroys the editor, all of it's elements and objects. - * @return {Boolean} - */ - destroy: function() { - if (this._nodeChangeDelayTimer) { - clearTimeout(this._nodeChangeDelayTimer); - } - this.hide(); - - YAHOO.log('Destroying Editor', 'warn', 'SimpleEditor'); - if (this.resize) { - YAHOO.log('Destroying Resize', 'warn', 'SimpleEditor'); - this.resize.destroy(); - } - if (this.dd) { - YAHOO.log('Unreg DragDrop Instance', 'warn', 'SimpleEditor'); - this.dd.unreg(); - } - if (this.get('panel')) { - YAHOO.log('Destroying Editor Panel', 'warn', 'SimpleEditor'); - this.get('panel').destroy(); - } - this.saveHTML(); - this.toolbar.destroy(); - YAHOO.log('Restoring TextArea', 'info', 'SimpleEditor'); - this.setStyle('visibility', 'visible'); - this.setStyle('position', 'static'); - this.setStyle('top', ''); - this.setStyle('left', ''); - var textArea = this.get('element'); - this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element')); - this.get('element_cont').get('element').innerHTML = ''; - this.set('handleSubmit', false); //Remove the submit handler - return true; - }, - /** - * @method toString - * @description Returns a string representing the editor. - * @return {String} - */ - toString: function() { - var str = 'SimpleEditor'; - if (this.get && this.get('element_cont')) { - str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : '')); - } - return str; - } - }); - -/** -* @event toolbarLoaded -* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event cleanHTML -* @description Event is fired after the cleanHTML method is called. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterRender -* @description Event is fired after the render process finishes. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorContentLoaded -* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeNodeChange -* @description Event fires at the beginning of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterNodeChange -* @description Event fires at the end of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeExecCommand -* @description Event fires at the beginning of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterExecCommand -* @description Event fires at the end of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ - -/** -* @event editorWindowFocus -* @description Fires when the iframe is focused. Note, this is window focus event, not an Editor focus event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorWindowBlur -* @description Fires when the iframe is blurred. Note, this is window blur event, not an Editor blur event. -* @type YAHOO.util.CustomEvent -*/ - - -/** - * @description Singleton object used to track the open window objects and panels across the various open editors - * @class EditorInfo - * @static -*/ -YAHOO.widget.EditorInfo = { - /** - * @private - * @property _instances - * @description A reference to all editors on the page. - * @type Object - */ - _instances: {}, - /** - * @private - * @property blankImage - * @description A reference to the blankImage url - * @type String - */ - blankImage: '', - /** - * @private - * @property window - * @description A reference to the currently open window object in any editor on the page. - * @type Object YAHOO.widget.EditorWindow - */ - window: {}, - /** - * @private - * @property panel - * @description A reference to the currently open panel in any editor on the page. - * @type Object YAHOO.widget.Overlay - */ - panel: null, - /** - * @method getEditorById - * @description Returns a reference to the Editor object associated with the given textarea - * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of - * @return Object YAHOO.widget.Editor - */ - getEditorById: function(id) { - if (!YAHOO.lang.isString(id)) { - //Not a string, assume a node Reference - id = id.id; - } - if (this._instances[id]) { - return this._instances[id]; - } - return false; - }, - /** - * @method saveAll - * @description Saves all Editor instances on the page. If a form reference is passed, only Editor's bound to this form will be saved. - * @param {HTMLElement} form The form to check if this Editor instance belongs to - */ - saveAll: function(form) { - var i, e, items = YAHOO.widget.EditorInfo._instances; - if (form) { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - e = items[i]; - if (e.get('element').form && (e.get('element').form == form)) { - e.saveHTML(); - } - } - } - } else { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - items[i].saveHTML(); - } - } - } - }, - /** - * @method toString - * @description Returns a string representing the EditorInfo. - * @return {String} - */ - toString: function() { - var len = 0; - for (var i in this._instances) { - if (Lang.hasOwnProperty(this._instances, i)) { - len++; - } - } - return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')'; - } -}; - - - - -})(); -YAHOO.register("simpleeditor", YAHOO.widget.SimpleEditor, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-min.js deleted file mode 100644 index 859c78e9c8..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor-min.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var B=YAHOO.util.Dom,A=YAHOO.util.Event,C=YAHOO.lang;if(YAHOO.widget.Button){YAHOO.widget.ToolbarButtonAdvanced=YAHOO.widget.Button;YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType="rich";YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue=function(F){var E=this.getMenu().getItems();if(E.length===0){this.getMenu()._onBeforeShow();E=this.getMenu().getItems();}for(var D=0;D'+G+""; -this._titlebar.appendChild(F);A.on(F.firstChild,"click",function(H){A.stopEvent(H);});A.on([F,F.firstChild],"focus",function(){this._handleFocus();},this,true);}if(this.get("firstChild")){this.insertBefore(this._titlebar,this.get("firstChild"));}else{this.appendChild(this._titlebar);}if(this.get("collapse")){this.set("collapse",true);}}else{if(this._titlebar){if(this._titlebar&&this._titlebar.parentNode){this._titlebar.parentNode.removeChild(this._titlebar);}}}}});this.setAttributeConfig("collapse",{value:false,method:function(H){if(this._titlebar){var G=null;var F=C.getElementsByClassName("collapse","span",this._titlebar);if(H){if(F.length>0){return true;}G=document.createElement("SPAN");G.innerHTML="X";G.title=this.STR_COLLAPSE;C.addClass(G,"collapse");this._titlebar.appendChild(G);A.addListener(G,"click",function(){if(C.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}else{this.collapse();}},this,true);}else{G=C.getElementsByClassName("collapse","span",this._titlebar);if(G[0]){if(C.hasClass(this.get("cont").parentNode,"yui-toolbar-container-collapsed")){this.collapse(false);}G[0].parentNode.removeChild(G[0]);}}}}});this.setAttributeConfig("draggable",{value:(E.draggable||false),method:function(F){if(F&&!this.get("titlebar")){if(!this._dragHandle){this._dragHandle=document.createElement("SPAN");this._dragHandle.innerHTML="|";this._dragHandle.setAttribute("title","Click to drag the toolbar");this._dragHandle.id=this.get("id")+"_draghandle";C.addClass(this._dragHandle,this.CLASS_DRAGHANDLE);if(this.get("cont").hasChildNodes()){this.get("cont").insertBefore(this._dragHandle,this.get("cont").firstChild);}else{this.get("cont").appendChild(this._dragHandle);}this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._dragHandle.id);}}else{if(this._dragHandle){this._dragHandle.parentNode.removeChild(this._dragHandle);this._dragHandle=null;this.dd=null;}}if(this._titlebar){if(F){this.dd=new YAHOO.util.DD(this.get("id"));this.dd.setHandleElId(this._titlebar);C.addClass(this._titlebar,"draggable");}else{C.removeClass(this._titlebar,"draggable");if(this.dd){this.dd.unreg();this.dd=null;}}}},validator:function(G){var F=true;if(!YAHOO.util.DD){F=false;}return F;}});},addButtonGroup:function(J){if(!this.get("element")){this._queue[this._queue.length]=["addButtonGroup",arguments];return false;}if(!this.hasClass(this.CLASS_PREFIX+"-grouped")){this.addClass(this.CLASS_PREFIX+"-grouped");}var L=document.createElement("DIV");C.addClass(L,this.CLASS_PREFIX+"-group");C.addClass(L,this.CLASS_PREFIX+"-group-"+J.group);if(J.label){var F=document.createElement("h3");F.innerHTML=J.label;L.appendChild(F);}if(!this.get("grouplabels")){C.addClass(this.get("cont"),this.CLASS_PREFIX,"-nogrouplabels");}this.get("cont").appendChild(L);var I=document.createElement("ul");L.appendChild(I);if(!this._buttonGroupList){this._buttonGroupList={};}this._buttonGroupList[J.group]=I;var K=[],H;for(var G=0;G'+F.replace("#","")+"";}}G+="X";window.setTimeout(function(){E.innerHTML=G;},0);A.on(E,"mouseover",function(M){var K=this._colorPicker;var L=K.getElementsByTagName("em")[0];var J=K.getElementsByTagName("strong")[0];var I=A.getTarget(M);if(I.tagName.toLowerCase()=="a"){L.style.backgroundColor=I.style.backgroundColor;J.innerHTML=this._colorData["#"+I.innerHTML]+"
                "+I.innerHTML;}},this,true);A.on(E,"focus",function(I){A.stopEvent(I);});A.on(E,"click",function(I){A.stopEvent(I);});A.on(E,"mousedown",function(J){A.stopEvent(J);var I=A.getTarget(J);if(I.tagName.toLowerCase()=="a"){var L=this.fireEvent("colorPickerClicked",{type:"colorPickerClicked",target:this,button:this._colorPicker._button,color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML]});if(L!==false){var K={color:I.innerHTML,colorName:this._colorData["#"+I.innerHTML],value:this._colorPicker._button};this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:K});}this.getButtonByValue(this._colorPicker._button).getMenu().hide();}},this,true);},_resetColorPicker:function(){var F=this._colorPicker.getElementsByTagName("em")[0];var E=this._colorPicker.getElementsByTagName("strong")[0];F.style.backgroundColor="transparent";E.innerHTML="";},_makeColorButton:function(E){if(!this._colorPicker){this._createColorPicker(this.get("id"));}E.type="color";E.menu=new YAHOO.widget.Overlay(this.get("id")+"_"+E.value+"_menu",{visible:false,position:"absolute",iframe:true});E.menu.setBody("");E.menu.render(this.get("cont"));C.addClass(E.menu.element,"yui-button-menu");C.addClass(E.menu.element,"yui-color-button-menu");E.menu.beforeShowEvent.subscribe(function(){E.menu.cfg.setProperty("zindex",5);E.menu.cfg.setProperty("context",[this.getButtonById(E.id).get("element"),"tl","bl"]);this._resetColorPicker();var F=this._colorPicker;if(F.parentNode){F.parentNode.removeChild(F);}E.menu.setBody("");E.menu.appendToBody(F);this._colorPicker.style.display="block";},this,true);return E;},_makeSpinButton:function(R,L){R.addClass(this.CLASS_PREFIX+"-spinbutton");var S=this,N=R._button.parentNode.parentNode,I=L.range,H=document.createElement("a"),G=document.createElement("a");H.href="#";G.href="#";H.tabIndex="-1";G.tabIndex="-1";H.className="up";H.title=this.STR_SPIN_UP;H.innerHTML=this.STR_SPIN_UP;G.className="down";G.title=this.STR_SPIN_DOWN;G.innerHTML=this.STR_SPIN_DOWN;N.appendChild(H);N.appendChild(G);var M=YAHOO.lang.substitute(this.STR_SPIN_LABEL,{VALUE:R.get("label")});R.set("title",M);var Q=function(T){T=((TI[1])?I[1]:T);return T;};var P=this.browser;var F=false;var K=this.STR_SPIN_LABEL;if(this._titlebar&&this._titlebar.firstChild){F=this._titlebar.firstChild;}var E=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10);V++;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var O=function(U){YAHOO.util.Event.stopEvent(U);if(!R.get("disabled")&&(U.keyCode!=9)){var V=parseInt(R.get("label"),10); -V--;V=Q(V);R.set("label",""+V);var T=YAHOO.lang.substitute(K,{VALUE:R.get("label")});R.set("title",T);if(!P.webkit&&F){}S._buttonClick(U,L);}};var J=function(T){if(T.keyCode==38){E(T);}else{if(T.keyCode==40){O(T);}else{if(T.keyCode==107&&T.shiftKey){E(T);}else{if(T.keyCode==109&&T.shiftKey){O(T);}}}}};R.on("keydown",J,this,true);A.on(H,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(G,"mousedown",function(T){A.stopEvent(T);},this,true);A.on(H,"click",E,this,true);A.on(G,"click",O,this,true);},_buttonClick:function(L,F){var E=true;if(L&&L.type=="keypress"){if(L.keyCode==9){E=false;}else{if((L.keyCode===13)||(L.keyCode===0)||(L.keyCode===32)){}else{E=false;}}}if(E){var N=true,H=false;F.isSelected=this.isSelected(F.id);if(F.value){H=this.fireEvent(F.value+"Click",{type:F.value+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(F.menucmd&&N){H=this.fireEvent(F.menucmd+"Click",{type:F.menucmd+"Click",target:this.get("element"),button:F});if(H===false){N=false;}}if(N){this.fireEvent("buttonClick",{type:"buttonClick",target:this.get("element"),button:F});}if(F.type=="select"){var K=this.getButtonById(F.id);if(K.buttonType=="rich"){var J=F.value;for(var I=0;I'+J+"");var M=K.getMenu().getItems();for(var G=0;G(this._buttonList.length-1)){this._navCounter=0;}if(this._navCounter<0){this._navCounter=(this._buttonList.length-1);}if(this._buttonList[this._navCounter]){var E=this._buttonList[this._navCounter].get("element");if(this.browser.ie){E=this._buttonList[this._navCounter].get("element").getElementsByTagName("a")[0];}if(this._buttonList[this._navCounter].get("disabled")){this._navigateButtons(F);}else{E.focus();}}break;}},_handleFocus:function(){if(!this._keyNav){var E="keypress";if(this.browser.ie){E="keydown";}A.on(this.get("element"),E,this._navigateButtons,this,true);this._keyNav=true;this._navCounter=-1;}},getButtonById:function(G){var E=this._buttonList.length;for(var F=0;F'+H[E]._oText.nodeValue+"");}else{H[E].cfg.setProperty("checked",false);}}}}}else{return false;}},deselectButton:function(F){var E=B.call(this,F);if(E){E.removeClass("yui-button-selected");E.removeClass("yui-button-"+E.get("value")+"-selected");E.removeClass("yui-button-hover");E._selected=false;}else{return false;}},deselectAllButtons:function(){var E=this._buttonList.length;for(var F=0;F0)){var I=0;for(var G=0;G',editorDirty:null,_defaultCSS:"html { height: 95%; } body { padding: 7px; background-color: #fff; font: 13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div.yui-wk-p { margin: 11px 0; } body.ptags.webkit div.yui-wk-div { margin: 0; }",_defaultToolbar:null,_lastButton:null,_baseHREF:function(){var E=document.location.href;if(E.indexOf("?")!==-1){E=E.substring(0,E.indexOf("?"));}E=E.substring(0,E.lastIndexOf("/"))+"/";return E;}(),_lastImage:null,_blankImageLoaded:null,_fixNodesTimer:null,_nodeChangeTimer:null,_nodeChangeDelayTimer:null,_lastNodeChangeEvent:null,_lastNodeChange:0,_rendered:null,DOMReady:null,_selection:null,_mask:null,_showingHiddenElements:null,currentWindow:null,currentEvent:null,operaEvent:null,currentFont:null,currentElement:null,dompath:null,beforeElement:null,afterElement:null,invalidHTML:{form:true,input:true,button:true,select:true,link:true,html:true,body:true,iframe:true,script:true,style:true,textarea:true},toolbar:null,_contentTimer:null,_contentTimerMax:500,_contentTimerCounter:0,_disabled:["createlink","fontname","fontsize","forecolor","backcolor"],_alwaysDisabled:{undo:true,redo:true},_alwaysEnabled:{},_semantic:{"bold":true,"italic":true,"underline":true},_tag2cmd:{"b":"bold","strong":"bold","i":"italic","em":"italic","u":"underline","sup":"superscript","sub":"subscript","img":"insertimage","a":"createlink","ul":"insertunorderedlist","ol":"insertorderedlist"},_createIframe:function(){var I=document.createElement("iframe");I.id=this.get("id")+"_editor";var G={border:"0",frameBorder:"0",marginWidth:"0",marginHeight:"0",leftMargin:"0",topMargin:"0",allowTransparency:"true",width:"100%"};if(this.get("autoHeight")){G.scrolling="no";}for(var H in G){if(D.hasOwnProperty(G,H)){I.setAttribute(H,G[H]);}}var F="javascript:;";if(this.browser.ie){F="javascript:false;";}I.setAttribute("src",F);var E=new YAHOO.util.Element(I); -E.setStyle("visibility","hidden");return E;},_isElement:function(F,E){if(F&&F.tagName&&(F.tagName.toLowerCase()==E)){return true;}if(F&&F.getAttribute&&(F.getAttribute("tag")==E)){return true;}return false;},_hasParent:function(F,E){if(!F||!F.parentNode){return false;}while(F.parentNode){if(this._isElement(F,E)){return F;}if(F.parentNode){F=F.parentNode;}else{return false;}}return false;},_getDoc:function(){var E=false;try{if(this.get("iframe").get("element").contentWindow.document){E=this.get("iframe").get("element").contentWindow.document;return E;}}catch(F){return false;}},_getWindow:function(){return this.get("iframe").get("element").contentWindow;},focus:function(){this._getWindow().focus();},_focusWindow:function(){this.focus();},_hasSelection:function(){var G=this._getSelection();var E=this._getRange();var F=false;if(!G||!E){return F;}if(this.browser.ie||this.browser.opera){if(E.text){F=true;}if(E.html){F=true;}}else{if(this.browser.webkit){if(G+""!==""){F=true;}}else{if(G&&(G.toString()!=="")&&(G!==undefined)){F=true;}}}return F;},_getSelection:function(){var E=null;if(this._getDoc()&&this._getWindow()){if(this._getDoc().selection){E=this._getDoc().selection;}else{E=this._getWindow().getSelection();}if(this.browser.webkit){if(E.baseNode){this._selection={};this._selection.baseNode=E.baseNode;this._selection.baseOffset=E.baseOffset;this._selection.extentNode=E.extentNode;this._selection.extentOffset=E.extentOffset;}else{if(this._selection!==null){E=this._getWindow().getSelection();E.setBaseAndExtent(this._selection.baseNode,this._selection.baseOffset,this._selection.extentNode,this._selection.extentOffset);this._selection=null;}}}}return E;},_selectNode:function(F,I){if(!F){return false;}var G=this._getSelection(),E=null;if(this.browser.ie){try{E=this._getDoc().body.createTextRange();E.moveToElementText(F);E.select();}catch(H){}}else{if(this.browser.webkit){if(I){G.setBaseAndExtent(F,1,F,F.innerText.length);}else{G.setBaseAndExtent(F,0,F,F.innerText.length);}}else{if(this.browser.opera){G=this._getWindow().getSelection();E=this._getDoc().createRange();E.selectNode(F);G.removeAllRanges();G.addRange(E);}else{E=this._getDoc().createRange();E.selectNodeContents(F);G.removeAllRanges();G.addRange(E);}}}this.nodeChange();},_getRange:function(){var E=this._getSelection();if(E===null){return null;}if(this.browser.webkit&&!E.getRangeAt){var H=this._getDoc().createRange();try{H.setStart(E.anchorNode,E.anchorOffset);H.setEnd(E.focusNode,E.focusOffset);}catch(G){H=this._getWindow().getSelection()+"";}return H;}if(this.browser.ie||this.browser.opera){try{return E.createRange();}catch(F){return null;}}if(E.rangeCount>0){return E.getRangeAt(0);}return null;},_setDesignMode:function(E){if(this.get("setDesignMode")){try{this._getDoc().designMode=((E.toLowerCase()=="off")?"off":"on");}catch(F){}}},_toggleDesignMode:function(){var F=this._getDoc().designMode,E=((F.toLowerCase()=="on")?"off":"on");this._setDesignMode(E);return E;},_focused:null,_handleFocus:function(E){if(!this._focused){this._focused=true;this.fireEvent("editorWindowFocus",{type:"editorWindowFocus",target:this});}},_handleBlur:function(E){if(this._focused){this._focused=false;this.fireEvent("editorWindowBlur",{type:"editorWindowBlur",target:this});}},_initEditorEvents:function(){var F=this._getDoc(),E=this._getWindow();A.on(F,"mouseup",this._handleMouseUp,this,true);A.on(F,"mousedown",this._handleMouseDown,this,true);A.on(F,"click",this._handleClick,this,true);A.on(F,"dblclick",this._handleDoubleClick,this,true);A.on(F,"keypress",this._handleKeyPress,this,true);A.on(F,"keyup",this._handleKeyUp,this,true);A.on(F,"keydown",this._handleKeyDown,this,true);A.on(E,"focus",this._handleFocus,this,true);A.on(E,"blur",this._handleBlur,this,true);},_removeEditorEvents:function(){var F=this._getDoc(),E=this._getWindow();A.removeListener(F,"mouseup",this._handleMouseUp,this,true);A.removeListener(F,"mousedown",this._handleMouseDown,this,true);A.removeListener(F,"click",this._handleClick,this,true);A.removeListener(F,"dblclick",this._handleDoubleClick,this,true);A.removeListener(F,"keypress",this._handleKeyPress,this,true);A.removeListener(F,"keyup",this._handleKeyUp,this,true);A.removeListener(F,"keydown",this._handleKeyDown,this,true);A.removeListener(E,"focus",this._handleFocus,this,true);A.removeListener(E,"blur",this._handleBlur,this,true);},_fixWebkitDivs:function(){if(this.browser.webkit){var E=this._getDoc().body.getElementsByTagName("div");C.addClass(E,"yui-wk-div");}},_initEditor:function(F){if(this._editorInit){return;}this._editorInit=true;if(this.browser.ie){this._getDoc().body.style.margin="0";}if(!this.get("disabled")){this._setDesignMode("on");this._contentTimerCounter=0;}if(!this._getDoc().body){this._contentTimerCounter=0;this._editorInit=false;this._checkLoaded();return false;}if(!F){this.toolbar.on("buttonClick",this._handleToolbarClick,this,true);}if(!this.get("disabled")){this._initEditorEvents();this.toolbar.set("disabled",false);}if(F){this.fireEvent("editorContentReloaded",{type:"editorreloaded",target:this});}else{this.fireEvent("editorContentLoaded",{type:"editorLoaded",target:this});}this._fixWebkitDivs();if(this.get("dompath")){var E=this;setTimeout(function(){E._writeDomPath.call(E);E._setupResize.call(E);},150);}var H=[];for(var G in this.browser){if(this.browser[G]){H.push(G);}}if(this.get("ptags")){H.push("ptags");}C.addClass(this._getDoc().body,H.join(" "));this.nodeChange(true);},_checkLoaded:function(F){this._editorInit=false;this._contentTimerCounter++;if(this._contentTimer){clearTimeout(this._contentTimer);}if(this._contentTimerCounter>this._contentTimerMax){return false;}var H=false;try{if(this._getDoc()&&this._getDoc().body){if(this.browser.ie){if(this._getDoc().body.readyState=="complete"){H=true;}}else{if(this._getDoc().body._rteLoaded===true){H=true;}}}}catch(G){H=false;}if(H===true){this._initEditor(F);}else{var E=this;this._contentTimer=setTimeout(function(){E._checkLoaded.call(E,F);},20);}},_setInitialContent:function(F){var I=((this._textarea)?this.get("element").value:this.get("element").innerHTML),K=null; -if(I===""){I="
                ";}var G=D.substitute(this.get("html"),{TITLE:this.STR_TITLE,CONTENT:this._cleanIncomingHTML(I),CSS:this.get("css"),HIDDEN_CSS:((this.get("hiddencss"))?this.get("hiddencss"):"/* No Hidden CSS */"),EXTRA_CSS:((this.get("extracss"))?this.get("extracss"):"/* No Extra CSS */")}),E=true;G=G.replace(/RIGHT_BRACKET/gi,"{");G=G.replace(/LEFT_BRACKET/gi,"}");if(document.compatMode!="BackCompat"){G=this._docType+"\n"+G;}else{}if(this.browser.ie||this.browser.webkit||this.browser.opera||(navigator.userAgent.indexOf("Firefox/1.5")!=-1)){try{if(this.browser.air){K=this._getDoc().implementation.createHTMLDocument();var L=this._getDoc();L.open();L.close();K.open();K.write(G);K.close();var H=L.importNode(K.getElementsByTagName("html")[0],true);L.replaceChild(H,L.getElementsByTagName("html")[0]);L.body._rteLoaded=true;}else{K=this._getDoc();K.open();K.write(G);K.close();}}catch(J){E=false;}}else{this.get("iframe").get("element").src="data:text/html;charset=utf-8,"+encodeURIComponent(G);}this.get("iframe").setStyle("visibility","");if(E){this._checkLoaded(F);}},_setMarkupType:function(E){switch(this.get("markup")){case"css":this._setEditorStyle(true);break;case"default":this._setEditorStyle(false);break;case"semantic":case"xhtml":if(this._semantic[E]){this._setEditorStyle(false);}else{this._setEditorStyle(true);}break;}},_setEditorStyle:function(F){try{this._getDoc().execCommand("useCSS",false,!F);}catch(E){}},_getSelectedElement:function(){var J=this._getDoc(),G=null,H=null,K=null,F=true;if(this.browser.ie){this.currentEvent=this._getWindow().event;G=this._getRange();if(G){K=G.item?G.item(0):G.parentElement();if(this._hasSelection()){}if(K===J.body){K=null;}}if((this.currentEvent!==null)&&(this.currentEvent.keyCode===0)){K=A.getTarget(this.currentEvent);}}else{H=this._getSelection();G=this._getRange();if(!H||!G){return null;}if(!this._hasSelection()&&this.browser.webkit3){}if(this.browser.gecko){if(G.startContainer){if(G.startContainer.nodeType===3){K=G.startContainer.parentNode;}else{if(G.startContainer.nodeType===1){K=G.startContainer;}}if(this.currentEvent){var E=A.getTarget(this.currentEvent);if(!this._isElement(E,"html")){if(K!==E){K=E;}}}}}if(F){if(H.anchorNode&&(H.anchorNode.nodeType==3)){if(H.anchorNode.parentNode){K=H.anchorNode.parentNode;}if(H.anchorNode.nextSibling!=H.focusNode.nextSibling){K=H.anchorNode.nextSibling;}}if(this._isElement(K,"br")){K=null;}if(!K){K=G.commonAncestorContainer;if(!G.collapsed){if(G.startContainer==G.endContainer){if(G.startOffset-G.endOffset<2){if(G.startContainer.hasChildNodes()){K=G.startContainer.childNodes[G.startOffset];}}}}}}}if(this.currentEvent!==null){try{switch(this.currentEvent.type){case"click":case"mousedown":case"mouseup":if(this.browser.webkit){K=A.getTarget(this.currentEvent);}break;default:break;}}catch(I){}}else{if((this.currentElement&&this.currentElement[0])&&(!this.browser.ie)){}}if(this.browser.opera||this.browser.webkit){if(this.currentEvent&&!K){K=YAHOO.util.Event.getTarget(this.currentEvent);}}if(!K||!K.tagName){K=J.body;}if(this._isElement(K,"html")){K=J.body;}if(this._isElement(K,"body")){K=J.body;}if(K&&!K.parentNode){K=J.body;}if(K===undefined){K=null;}return K;},_getDomPath:function(E){if(!E){E=this._getSelectedElement();}var F=[];while(E!==null){if(E.ownerDocument!=this._getDoc()){E=null;break;}if(E.nodeName&&E.nodeType&&(E.nodeType==1)){F[F.length]=E;}if(this._isElement(E,"body")){break;}E=E.parentNode;}if(F.length===0){if(this._getDoc()&&this._getDoc().body){F[0]=this._getDoc().body;}}return F.reverse();},_writeDomPath:function(){var K=this._getDomPath(),I=[],G="",L="";for(var E=0;E10){L=''+L.substring(0,10)+"..."+"";}else{L=''+L+"";}I[I.length]=L;}}var H=I.join(" "+this.SEP_DOMPATH+" ");if(this.dompath.innerHTML!=H){this.dompath.innerHTML=H;}},_fixNodes:function(){try{var K=this._getDoc(),H=[];for(var E in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,E)){if(E.toLowerCase()!="span"){var F=K.body.getElementsByTagName(E);if(F.length){for(var G=0;G-1;E--){if(C.hasClass(J[E],this.CLASS_NOEDIT)){try{this._getDoc().execCommand("enableObjectResizing",false,"false");}catch(I){}this.nodeChange();A.stopEvent(G);return true;}}try{this._getDoc().execCommand("enableObjectResizing",false,"true");}catch(H){}}return false;},_setCurrentEvent:function(E){this.currentEvent=E;},_handleClick:function(G){var F=this.fireEvent("beforeEditorClick",{type:"beforeEditorClick",target:this,ev:G});if(F===false){return false;}if(this._isNonEditable(G)){return false; -}this._setCurrentEvent(G);if(this.currentWindow){this.closeWindow();}if(this.currentWindow){this.closeWindow();}if(this.browser.webkit){var E=A.getTarget(G);if(this._isElement(E,"a")||this._isElement(E.parentNode,"a")){A.stopEvent(G);this.nodeChange();}}else{this.nodeChange();}this.fireEvent("editorClick",{type:"editorClick",target:this,ev:G});},_handleMouseUp:function(G){var F=this.fireEvent("beforeEditorMouseUp",{type:"beforeEditorMouseUp",target:this,ev:G});if(F===false){return false;}if(this._isNonEditable(G)){return false;}var E=this;if(this.browser.opera){var H=A.getTarget(G);if(this._isElement(H,"img")){this.nodeChange();if(this.operaEvent){clearTimeout(this.operaEvent);this.operaEvent=null;this._handleDoubleClick(G);}else{this.operaEvent=window.setTimeout(function(){E.operaEvent=false;},700);}}}if(this.browser.webkit||this.browser.opera){if(this.browser.webkit){A.stopEvent(G);}}this.nodeChange();this.fireEvent("editorMouseUp",{type:"editorMouseUp",target:this,ev:G});},_handleMouseDown:function(F){var E=this.fireEvent("beforeEditorMouseDown",{type:"beforeEditorMouseDown",target:this,ev:F});if(E===false){return false;}if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this.browser.webkit&&this._hasSelection()){var H=this._getSelection();if(!this.browser.webkit3){H.collapse(true);}else{H.collapseToStart();}}if(this.browser.webkit&&this._lastImage){C.removeClass(this._lastImage,"selected");this._lastImage=null;}if(this._isElement(G,"img")||this._isElement(G,"a")){if(this.browser.webkit){A.stopEvent(F);if(this._isElement(G,"img")){C.addClass(G,"selected");this._lastImage=G;}}if(this.currentWindow){this.closeWindow();}this.nodeChange();}this.fireEvent("editorMouseDown",{type:"editorMouseDown",target:this,ev:F});},_handleDoubleClick:function(F){var E=this.fireEvent("beforeEditorDoubleClick",{type:"beforeEditorDoubleClick",target:this,ev:F});if(E===false){return false;}if(this._isNonEditable(F)){return false;}this._setCurrentEvent(F);var G=A.getTarget(F);if(this._isElement(G,"img")){this.currentElement[0]=G;this.toolbar.fireEvent("insertimageClick",{type:"insertimageClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}else{if(this._hasParent(G,"a")){this.currentElement[0]=this._hasParent(G,"a");this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});}}this.nodeChange();this.fireEvent("editorDoubleClick",{type:"editorDoubleClick",target:this,ev:F});},_handleKeyUp:function(G){var F=this.fireEvent("beforeEditorKeyUp",{type:"beforeEditorKeyUp",target:this,ev:G});if(F===false){return false;}if(this._isNonEditable(G)){return false;}this._storeUndo();this._setCurrentEvent(G);switch(G.keyCode){case this._keyMap.SELECT_ALL.key:if(this._checkKey(this._keyMap.SELECT_ALL,G)){this.nodeChange();}break;case 32:case 35:case 36:case 37:case 38:case 39:case 40:case 46:case 8:case this._keyMap.CLOSE_WINDOW.key:if((G.keyCode==this._keyMap.CLOSE_WINDOW.key)&&this.currentWindow){if(this._checkKey(this._keyMap.CLOSE_WINDOW,G)){this.closeWindow();}}else{if(!this.browser.ie){if(this._nodeChangeTimer){clearTimeout(this._nodeChangeTimer);}var E=this;this._nodeChangeTimer=setTimeout(function(){E._nodeChangeTimer=null;E.nodeChange.call(E);},100);}else{this.nodeChange();}this.editorDirty=true;}break;}this.fireEvent("editorKeyUp",{type:"editorKeyUp",target:this,ev:G});},_handleKeyPress:function(G){var F=this.fireEvent("beforeEditorKeyPress",{type:"beforeEditorKeyPress",target:this,ev:G});if(F===false){return false;}if(this.get("allowNoEdit")){if(G&&G.keyCode&&(G.keyCode==63272)){A.stopEvent(G);}}if(this._isNonEditable(G)){return false;}this._setCurrentEvent(G);this._storeUndo();if(this.browser.opera){if(G.keyCode===13){var E=this._getSelectedElement();if(!this._isElement(E,"li")){this.execCommand("inserthtml","
                ");A.stopEvent(G);}}}if(this.browser.webkit){if(!this.browser.webkit3){if(G.keyCode&&(G.keyCode==122)&&(G.metaKey)){if(this._hasParent(this._getSelectedElement(),"li")){A.stopEvent(G);}}}this._listFix(G);}this._fixListDupIds();this.fireEvent("editorKeyPress",{type:"editorKeyPress",target:this,ev:G});},_handleKeyDown:function(X){var Z=this.fireEvent("beforeEditorKeyDown",{type:"beforeEditorKeyDown",target:this,ev:X});if(Z===false){return false;}var U=null,E=null;if(this._isNonEditable(X)){return false;}this._setCurrentEvent(X);if(this.currentWindow){this.closeWindow();}if(this.currentWindow){this.closeWindow();}var N=false,S=null,P=null,R=false;switch(X.keyCode){case this._keyMap.FOCUS_TOOLBAR.key:if(this._checkKey(this._keyMap.FOCUS_TOOLBAR,X)){var W=this.toolbar.getElementsByTagName("h2")[0];if(W&&W.firstChild){W.firstChild.focus();}}else{if(this._checkKey(this._keyMap.FOCUS_AFTER,X)){this.afterElement.focus();}}A.stopEvent(X);N=false;break;case this._keyMap.CREATE_LINK.key:if(this._hasSelection()){if(this._checkKey(this._keyMap.CREATE_LINK,X)){var F=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){F=false;}}if(F){this.execCommand("createlink","");this.toolbar.fireEvent("createlinkClick",{type:"createlinkClick",target:this.toolbar});this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});N=false;}}}break;case this._keyMap.UNDO.key:case this._keyMap.REDO.key:if(this._checkKey(this._keyMap.REDO,X)){S="redo";N=true;}else{if(this._checkKey(this._keyMap.UNDO,X)){S="undo";N=true;}}break;case this._keyMap.BOLD.key:if(this._checkKey(this._keyMap.BOLD,X)){S="bold";N=true;}break;case this._keyMap.FONT_SIZE_UP.key:case this._keyMap.FONT_SIZE_DOWN.key:var K=false,T=false;if(this._checkKey(this._keyMap.FONT_SIZE_UP,X)){K=true;}if(this._checkKey(this._keyMap.FONT_SIZE_DOWN,X)){T=true;}if(K||T){var H=this.toolbar.getButtonByValue("fontsize"),G=parseInt(H.get("label"),10),I=(G+1);if(T){I=(G-1);}S="fontsize";P=I+"px";N=true;}break;case this._keyMap.ITALIC.key:if(this._checkKey(this._keyMap.ITALIC,X)){S="italic"; -N=true;}break;case this._keyMap.UNDERLINE.key:if(this._checkKey(this._keyMap.UNDERLINE,X)){S="underline";N=true;}break;case 9:if(this.browser.ie){E=this._getRange();U=this._getSelectedElement();if(!this._isElement(U,"li")){if(E){E.pasteHTML("    ");E.collapse(false);E.select();}A.stopEvent(X);}}if(this.browser.gecko>1.8){U=this._getSelectedElement();if(this._isElement(U,"li")){if(X.shiftKey){this._getDoc().execCommand("outdent",null,"");}else{this._getDoc().execCommand("indent",null,"");}}else{if(!this._hasSelection()){this.execCommand("inserthtml","    ");}}A.stopEvent(X);}break;case 13:var M=null,V=0;if(this.get("ptags")&&!X.shiftKey){if(this.browser.gecko){U=this._getSelectedElement();if(!this._hasParent(U,"li")){if(this._hasParent(U,"p")){M=this._getDoc().createElement("p");M.innerHTML=" ";C.insertAfter(M,U);this._selectNode(M.firstChild);}else{if(this._isElement(U,"body")){this.execCommand("insertparagraph",null);var O=this._getDoc().body.getElementsByTagName("p");for(V=0;V');var L=this._getDoc().getElementById("yui-br"),Y=this._getDoc().createElement("br"),J=this._getDoc().createElement("span");L.parentNode.replaceChild(Y,L);J.className="yui-non";J.innerHTML=" ";C.insertAfter(J,Y);this._selectNode(J);}A.stopEvent(X);}}if(this.browser.ie){E=this._getRange();U=this._getSelectedElement();if(!this._isElement(U,"li")){if(E){E.pasteHTML("
                ");E.collapse(false);E.select();}A.stopEvent(X);}}}break;}if(this.browser.ie){this._listFix(X);}if(N&&S){this.execCommand(S,P);A.stopEvent(X);this.nodeChange();}this._storeUndo();this.fireEvent("editorKeyDown",{type:"editorKeyDown",target:this,ev:X});},_fixListRunning:null,_fixListDupIds:function(){if(this._fixListRunning){return false;}if(this._getDoc()){this._fixListRunning=true;var E=this._getDoc().body.getElementsByTagName("li"),F=0,G={};for(F=0;F'+E+" ";}else{I.innerHTML='  ';}}}else{if(E){I.innerHTML=E+" ";}else{I.innerHTML=" ";}}I.parentNode.replaceChild(J,I);J.appendChild(I);if(this.browser.webkit){this._getSelection().setBaseAndExtent(I.firstChild,1,I.firstChild,I.firstChild.innerText.length);if(!this.browser.webkit3){I.parentNode.parentNode.style.display="list-item";setTimeout(function(){I.parentNode.parentNode.style.display="block";},1);}}else{if(this.browser.ie){G=this._getDoc().body.createTextRange();G.moveToElementText(I);G.collapse(false);G.select();}else{this._selectNode(I);}}A.stopEvent(K);}if(this.browser.webkit){A.stopEvent(K);}this.nodeChange();}},nodeChange:function(E){var F=this;this._storeUndo();if(this.get("nodeChangeDelay")){this._nodeChangeDelayTimer=window.setTimeout(function(){F._nodeChangeDelayTimer=null;F._nodeChange.apply(F,arguments);},0);}else{this._nodeChange();}},_nodeChange:function(F){var H=parseInt(this.get("nodeChangeThreshold"),10),O=Math.round(new Date().getTime()/1000),R=this;if(F===true){this._lastNodeChange=0;}if((this._lastNodeChange+H)0){for(var V=0;V'+Y+"");this._updateMenuChecked("fontname",Y);}if(L){L.set("label",L._configs.label._initialConfig.value);}var K=this.toolbar.getButtonByValue("heading");if(K){K.set("label",K._configs.label._initialConfig.value);this._updateMenuChecked("heading","none");}var I=this.toolbar.getButtonByValue("insertimage");if(I&&this.currentWindow&&(this.currentWindow.name=="insertimage")){this.toolbar.disableButton(I);}if(this._lastButton&&this._lastButton.isSelected){this.toolbar.deselectButton(this._lastButton.id);}this._undoNodeChange();}}this.fireEvent("afterNodeChange",{type:"afterNodeChange",target:this});},_updateMenuChecked:function(E,F,H){if(!H){H=this.toolbar;}var G=H.getButtonByValue(E);G.checkValue(F);},_handleToolbarClick:function(F){var H="";var I="";var G=F.button.value;if(F.button.menucmd){H=G;G=F.button.menucmd;}this._lastButton=F.button;if(this.STOP_EXEC_COMMAND){this.STOP_EXEC_COMMAND=false;return false;}else{this.execCommand(G,H);if(!this.browser.webkit){var E=this;setTimeout(function(){E.focus.call(E);},5);}}A.stopEvent(F);},_setupAfterElement:function(){if(!this.beforeElement){this.beforeElement=document.createElement("h2");this.beforeElement.className="yui-editor-skipheader";this.beforeElement.tabIndex="-1";this.beforeElement.innerHTML=this.STR_BEFORE_EDITOR;this.get("element_cont").get("firstChild").insertBefore(this.beforeElement,this.toolbar.get("nextSibling"));}if(!this.afterElement){this.afterElement=document.createElement("h2");this.afterElement.className="yui-editor-skipheader";this.afterElement.tabIndex="-1";this.afterElement.innerHTML=this.STR_LEAVE_EDITOR;this.get("element_cont").get("firstChild").appendChild(this.afterElement);}},_disableEditor:function(J){var I,H,G,E;if(!this.get("disabled_iframe")){I=this._createIframe();I.set("id","disabled_"+this.get("iframe").get("id"));I.setStyle("height","100%");I.setStyle("display","none");I.setStyle("visibility","visible");this.set("disabled_iframe",I);H=this.get("iframe").get("parentNode");H.appendChild(I.get("element"));}if(!I){I=this.get("disabled_iframe");}if(J){this._orgIframe=this.get("iframe");if(this.toolbar){this.toolbar.set("disabled",true);}G=this.getEditorHTML();E=this.get("iframe").get("offsetHeight");I.setStyle("visibility","");I.setStyle("position","");I.setStyle("top","");I.setStyle("left","");this._orgIframe.setStyle("visibility","hidden");this._orgIframe.setStyle("position","absolute");this._orgIframe.setStyle("top","-99999px");this._orgIframe.setStyle("left","-99999px");this.set("iframe",I);this._setInitialContent(true);if(!this._mask){this._mask=document.createElement("DIV");C.addClass(this._mask,"yui-editor-masked");if(this.browser.ie){this._mask.style.height=E+"px";}this.get("iframe").get("parentNode").appendChild(this._mask);}this.on("editorContentReloaded",function(){this._getDoc().body._rteLoaded=false;this.setEditorHTML(G);I.setStyle("display","block");this.unsubscribeAll("editorContentReloaded");});}else{if(this._mask){this._mask.parentNode.removeChild(this._mask);this._mask=null;if(this.toolbar){this.toolbar.set("disabled",false);}I.setStyle("visibility","hidden");I.setStyle("position","absolute");I.setStyle("top","-99999px");I.setStyle("left","-99999px");this._orgIframe.setStyle("visibility","");this._orgIframe.setStyle("position","");this._orgIframe.setStyle("top","");this._orgIframe.setStyle("left","");this.set("iframe",this._orgIframe);this.focus();var F=this;window.setTimeout(function(){F.nodeChange.call(F);},100);}}},SEP_DOMPATH:"<",STR_LEAVE_EDITOR:"You have left the Rich Text Editor.",STR_BEFORE_EDITOR:"This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Shift + Escape to place focus on the toolbar and navigate between options with your arrow keys. To exit this text editor use the Escape key and continue tabbing.

                Common formatting keyboard shortcuts:

                • Control Shift B sets text to bold
                • Control Shift I sets text to italic
                • Control Shift U underlines text
                • Control Shift L adds an HTML link
                ",STR_TITLE:"Rich Text Area.",STR_IMAGE_HERE:"Image URL Here",STR_IMAGE_URL:"Image URL",STR_LINK_URL:"Link URL",STOP_EXEC_COMMAND:false,STOP_NODE_CHANGE:false,CLASS_NOEDIT:"yui-noedit",CLASS_CONTAINER:"yui-editor-container",CLASS_EDITABLE:"yui-editor-editable",CLASS_EDITABLE_CONT:"yui-editor-editable-container",CLASS_PREFIX:"yui-editor",browser:function(){var E=YAHOO.env.ua; -if(E.webkit>=420){E.webkit3=E.webkit;}else{E.webkit3=0;}if(E.webkit>=530){E.webkit4=E.webkit;}else{E.webkit4=0;}E.mac=false;if(navigator.userAgent.indexOf("Macintosh")!==-1){E.mac=true;}return E;}(),init:function(F,E){if(!this._defaultToolbar){this._defaultToolbar={collapse:true,titlebar:"Text Editing Tools",draggable:false,buttons:[{group:"fontstyle",label:"Font Name and Size",buttons:[{type:"select",label:"Arial",value:"fontname",disabled:true,menu:[{text:"Arial",checked:true},{text:"Arial Black"},{text:"Comic Sans MS"},{text:"Courier New"},{text:"Lucida Console"},{text:"Tahoma"},{text:"Times New Roman"},{text:"Trebuchet MS"},{text:"Verdana"}]},{type:"spin",label:"13",value:"fontsize",range:[9,75],disabled:true}]},{type:"separator"},{group:"textstyle",label:"Font Style",buttons:[{type:"push",label:"Bold CTRL + SHIFT + B",value:"bold"},{type:"push",label:"Italic CTRL + SHIFT + I",value:"italic"},{type:"push",label:"Underline CTRL + SHIFT + U",value:"underline"},{type:"push",label:"Strike Through",value:"strikethrough"},{type:"separator"},{type:"color",label:"Font Color",value:"forecolor",disabled:true},{type:"color",label:"Background Color",value:"backcolor",disabled:true}]},{type:"separator"},{group:"indentlist",label:"Lists",buttons:[{type:"push",label:"Create an Unordered List",value:"insertunorderedlist"},{type:"push",label:"Create an Ordered List",value:"insertorderedlist"}]},{type:"separator"},{group:"insertitem",label:"Insert Item",buttons:[{type:"push",label:"HTML Link CTRL + SHIFT + L",value:"createlink",disabled:true},{type:"push",label:"Insert Image",value:"insertimage"}]}]};}YAHOO.widget.SimpleEditor.superclass.init.call(this,F,E);YAHOO.widget.EditorInfo._instances[this.get("id")]=this;this.currentElement=[];this.on("contentReady",function(){this.DOMReady=true;this.fireQueue();},this,true);},initAttributes:function(E){YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this,E);var F=this;this.setAttributeConfig("setDesignMode",{value:((E.setDesignMode===false)?false:true)});this.setAttributeConfig("nodeChangeDelay",{value:((E.nodeChangeDelay===false)?false:true)});this.setAttributeConfig("maxUndo",{writeOnce:true,value:E.maxUndo||30});this.setAttributeConfig("ptags",{writeOnce:true,value:E.ptags||false});this.setAttributeConfig("insert",{writeOnce:true,value:E.insert||false,method:function(K){if(K){var J={fontname:true,fontsize:true,forecolor:true,backcolor:true};var I=this._defaultToolbar.buttons;for(var H=0;H{TITLE}{CONTENT}',writeOnce:true});this.setAttributeConfig("extracss",{value:E.extracss||"",writeOnce:true});this.setAttributeConfig("handleSubmit",{value:E.handleSubmit||false,method:function(G){if(this.get("element").form){if(!this._formButtons){this._formButtons=[];}if(G){A.on(this.get("element").form,"submit",this._handleFormSubmit,this,true);var H=this.get("element").form.getElementsByTagName("input");for(var J=0;J=parseInt(this.get("height"),10))){var I=this.get("animate");this.set("animate",false);this.set("height",G+"px");this.set("animate",I);if(this.browser.ie){this.get("iframe").setStyle("height","99%");this.get("iframe").setStyle("zoom","1");var H=this;window.setTimeout(function(){H.get("iframe").setStyle("height","100%");},1);}}},_formButtons:null,_formButtonClicked:null,_handleFormButtonClick:function(F){var E=A.getTarget(F);this._formButtonClicked=E;},_handleFormSubmit:function(H){this.saveHTML();var G=this.get("element").form,E=this._formButtonClicked||false;A.removeListener(G,"submit",this._handleFormSubmit);if(YAHOO.env.ua.ie){if(E&&!E.disabled){E.click();}}else{if(E&&!E.disabled){E.click();}var F=document.createEvent("HTMLEvents");F.initEvent("submit",true,true);G.dispatchEvent(F);if(YAHOO.env.ua.webkit){if(YAHOO.lang.isFunction(G.submit)){G.submit();}}}},_handleFontSize:function(G){var E=this.toolbar.getButtonById(G.button.id);var F=E.get("label")+"px";this.execCommand("fontsize",F);return false;},_handleColorPicker:function(G){var F=G.button;var E="#"+G.color;if((F=="forecolor")||(F=="backcolor")){this.execCommand(F,E);}},_handleAlign:function(H){var G=null;for(var E=0;E'+H+"";if(J.get("label")!=N){J.set("label",N);this._updateMenuChecked("fontname",H);}}if(K){M=parseInt(C.getStyle(L,"fontSize"),10);if((M===null)||isNaN(M)){M=K._configs.label._initialConfig.value;}K.set("label",""+M);}if(!this._isElement(L,"body")&&!this._isElement(L,"img")){this.toolbar.enableButton(J);this.toolbar.enableButton(K);this.toolbar.enableButton("forecolor");this.toolbar.enableButton("backcolor");}if(this._isElement(L,"img")){if(YAHOO.widget.Overlay){this.toolbar.enableButton("createlink");}}if(this._hasParent(L,"blockquote")){this.toolbar.selectButton("indent");this.toolbar.disableButton("indent");this.toolbar.enableButton("outdent");}if(this._hasParent(L,"ol")||this._hasParent(L,"ul")){this.toolbar.disableButton("indent");}this._lastButton=null;},_handleInsertImageClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("insertimage")){return false; -}}this.toolbar.set("disabled",true);var E=function(){var F=this.currentElement[0],H="http://";if(!F){F=this._getSelectedElement();}if(F){if(F.getAttribute("src")){H=F.getAttribute("src",2);if(H.indexOf(this.get("blankimage"))!=-1){H=this.STR_IMAGE_HERE;}}}var G=prompt(this.STR_IMAGE_URL+": ",H);if((G!=="")&&(G!==null)){F.setAttribute("src",G);}else{if(G===""){F.parentNode.removeChild(F);this.currentElement=[];this.nodeChange();}else{if((G===null)){H=F.getAttribute("src",2);if(H.indexOf(this.get("blankimage"))!=-1){F.parentNode.removeChild(F);this.currentElement=[];this.nodeChange();}}}}this.closeWindow();this.toolbar.set("disabled",false);this.unsubscribe("afterExecCommand",E,this,true);};this.on("afterExecCommand",E,this,true);},_handleInsertImageWindowClose:function(){this.nodeChange();},_isLocalFile:function(E){if((E)&&(E!=="")&&((E.indexOf("file:/")!=-1)||(E.indexOf(":\\")!=-1))){return true;}return false;},_handleCreateLinkClick:function(){if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue("createlink")){return false;}}this.toolbar.set("disabled",true);var E=function(){var H=this.currentElement[0],G="";if(H){if(H.getAttribute("href",2)!==null){G=H.getAttribute("href",2);}}var J=prompt(this.STR_LINK_URL+": ",G);if((J!=="")&&(J!==null)){var I=J;if((I.indexOf(":/"+"/")==-1)&&(I.substring(0,1)!="/")&&(I.substring(0,6).toLowerCase()!="mailto")){if((I.indexOf("@")!=-1)&&(I.substring(0,6).toLowerCase()!="mailto")){I="mailto:"+I;}else{if(I.substring(0,1)!="#"){}}}H.setAttribute("href",I);}else{if(J!==null){var F=this._getDoc().createElement("span");F.innerHTML=H.innerHTML;C.addClass(F,"yui-non");H.parentNode.replaceChild(F,H);}}this.closeWindow();this.toolbar.set("disabled",false);this.unsubscribe("afterExecCommand",E,this,true);};this.on("afterExecCommand",E,this);},_handleCreateLinkWindowClose:function(){this.nodeChange();this.currentElement=[];},render:function(){if(this._rendered){return false;}if(!this.DOMReady){this._queue[this._queue.length]=["render",arguments];return false;}if(this.get("element")){if(this.get("element").tagName){this._textarea=true;if(this.get("element").tagName.toLowerCase()!=="textarea"){this._textarea=false;}}else{return false;}}else{return false;}this._rendered=true;var E=this;window.setTimeout(function(){E._render.call(E);},4);},_render:function(){var E=this;this.set("textarea",this.get("element"));this.get("element_cont").setStyle("display","none");this.get("element_cont").addClass(this.CLASS_CONTAINER);this.set("iframe",this._createIframe());window.setTimeout(function(){E._setInitialContent.call(E);},10);this.get("editor_wrapper").appendChild(this.get("iframe").get("element"));if(this.get("disabled")){this._disableEditor(true);}var F=this.get("toolbar");if(F instanceof B){this.toolbar=F;this.toolbar.set("disabled",true);}else{F.disabled=true;this.toolbar=new B(this.get("toolbar_cont"),F);}this.fireEvent("toolbarLoaded",{type:"toolbarLoaded",target:this.toolbar});this.toolbar.on("toolbarCollapsed",function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on("toolbarExpanded",function(){if(this.currentWindow){this.moveWindow();}},this,true);this.toolbar.on("fontsizeClick",this._handleFontSize,this,true);this.toolbar.on("colorPickerClicked",function(G){this._handleColorPicker(G);return false;},this,true);this.toolbar.on("alignClick",this._handleAlign,this,true);this.on("afterNodeChange",this._handleAfterNodeChange,this,true);this.toolbar.on("insertimageClick",this._handleInsertImageClick,this,true);this.on("windowinsertimageClose",this._handleInsertImageWindowClose,this,true);this.toolbar.on("createlinkClick",this._handleCreateLinkClick,this,true);this.on("windowcreatelinkClose",this._handleCreateLinkWindowClose,this,true);this.get("parentNode").replaceChild(this.get("element_cont").get("element"),this.get("element"));this.setStyle("visibility","hidden");this.setStyle("position","absolute");this.setStyle("top","-9999px");this.setStyle("left","-9999px");this.get("element_cont").appendChild(this.get("element"));this.get("element_cont").setStyle("display","block");C.addClass(this.get("iframe").get("parentNode"),this.CLASS_EDITABLE_CONT);this.get("iframe").addClass(this.CLASS_EDITABLE);this.get("element_cont").setStyle("width",this.get("width"));C.setStyle(this.get("iframe").get("parentNode"),"height",this.get("height"));this.get("iframe").setStyle("width","100%");this.get("iframe").setStyle("height","100%");this._setupDD();window.setTimeout(function(){E._setupAfterElement.call(E);},0);this.fireEvent("afterRender",{type:"afterRender",target:this});},execCommand:function(G,F){var J=this.fireEvent("beforeExecCommand",{type:"beforeExecCommand",target:this,args:arguments});if((J===false)||(this.STOP_EXEC_COMMAND)){this.STOP_EXEC_COMMAND=false;return false;}this._lastCommand=G;this._setMarkupType(G);if(this.browser.ie){this._getWindow().focus();}var E=true;if(this.get("limitCommands")){if(!this.toolbar.getButtonByValue(G)){E=false;}}this.editorDirty=true;if((typeof this["cmd_"+G.toLowerCase()]=="function")&&E){var I=this["cmd_"+G.toLowerCase()](F);E=I[0];if(I[1]){G=I[1];}if(I[2]){F=I[2];}}if(E){try{this._getDoc().execCommand(G,false,F);}catch(H){}}else{}this.on("afterExecCommand",function(){this.unsubscribeAll("afterExecCommand");this.nodeChange();},this,true);this.fireEvent("afterExecCommand",{type:"afterExecCommand",target:this});},cmd_bold:function(H){if(!this.browser.webkit){var G=this._getSelectedElement();if(G&&this._isElement(G,"span")&&this._hasSelection()){if(G.style.fontWeight=="bold"){G.style.fontWeight="";var E=this._getDoc().createElement("b"),F=G.parentNode;F.replaceChild(E,G);E.appendChild(G);}}}return[true];},cmd_italic:function(H){if(!this.browser.webkit){var G=this._getSelectedElement();if(G&&this._isElement(G,"span")&&this._hasSelection()){if(G.style.fontStyle=="italic"){G.style.fontStyle="";var E=this._getDoc().createElement("i"),F=G.parentNode;F.replaceChild(E,G);E.appendChild(G);}}}return[true];},cmd_underline:function(F){if(!this.browser.webkit){var E=this._getSelectedElement(); -if(E&&this._isElement(E,"span")){if(E.style.textDecoration=="underline"){E.style.textDecoration="none";}else{E.style.textDecoration="underline";}return[false];}}return[true];},cmd_backcolor:function(H){var E=true,F=this._getSelectedElement(),G="backcolor";if(this.browser.gecko||this.browser.opera){this._setEditorStyle(true);G="hilitecolor";}if(!this._isElement(F,"body")&&!this._hasSelection()){F.style.backgroundColor=H;this._selectNode(F);E=false;}else{if(this.get("insert")){F=this._createInsertElement({backgroundColor:H});}else{this._createCurrentElement("span",{backgroundColor:H,color:F.style.color,fontSize:F.style.fontSize,fontFamily:F.style.fontFamily});this._selectNode(this.currentElement[0]);}E=false;}return[E,G];},cmd_forecolor:function(G){var E=true,F=this._getSelectedElement();if(!this._isElement(F,"body")&&!this._hasSelection()){C.setStyle(F,"color",G);this._selectNode(F);E=false;}else{if(this.get("insert")){F=this._createInsertElement({color:G});}else{this._createCurrentElement("span",{color:G,fontSize:F.style.fontSize,fontFamily:F.style.fontFamily,backgroundColor:F.style.backgroundColor});this._selectNode(this.currentElement[0]);}E=false;}return[E];},cmd_unlink:function(E){this._swapEl(this.currentElement[0],"span",function(F){F.className="yui-non";});return[false];},cmd_createlink:function(G){var F=this._getSelectedElement(),E=null;if(this._hasParent(F,"a")){this.currentElement[0]=this._hasParent(F,"a");}else{if(this._isElement(F,"li")){E=this._getDoc().createElement("a");E.innerHTML=F.innerHTML;F.innerHTML="";F.appendChild(E);this.currentElement[0]=E;}else{if(!this._isElement(F,"a")){this._createCurrentElement("a");E=this._swapEl(this.currentElement[0],"a");this.currentElement[0]=E;}else{this.currentElement[0]=F;}}}return[false];},cmd_insertimage:function(J){var E=true,F=null,I="insertimage",H=this._getSelectedElement();if(J===""){J=this.get("blankimage");}if(this._isElement(H,"img")){this.currentElement[0]=H;E=false;}else{if(this._getDoc().queryCommandEnabled(I)){this._getDoc().execCommand(I,false,J);var K=this._getDoc().getElementsByTagName("img");for(var G=0;G"+F[N].innerHTML+"";}Z.innerHTML=U;this.currentElement[0]=G;this.currentElement[0].parentNode.replaceChild(Z,this.currentElement[0]);}else{this._createCurrentElement(e.toLowerCase());Z=this._getDoc().createElement(e);for(N=0;N  ';Z.appendChild(K);if(N>0){this.currentElement[N].parentNode.removeChild(this.currentElement[N]);}}var T=((this.browser.opera)?"
                ":"
                "),S=Z.firstChild.innerHTML.split(T),Y,a;if(S.length>0){Z.innerHTML="";for(Y=0;Y";}var c=this._getDoc().createElement("span");c.innerHTML=U;G.parentNode.parentNode.replaceChild(c,G.parentNode);}else{this.nodeChange();this._getDoc().execCommand(W,"",G.parentNode);this.nodeChange();}V=false;}if(this.browser.opera){var R=this;window.setTimeout(function(){var f=R._getDoc().getElementsByTagName("li");for(var g=0;g"){f[g].parentNode.parentNode.removeChild(f[g].parentNode);}}},30);}if(this.browser.ie&&V){var L="";if(this._getRange().html){L="
              • "+this._getRange().html+"
              • ";}else{var M=this._getRange().text.split("\n");if(M.length>1){L="";for(var Q=0;Q"+M[Q]+"";}}else{var P=this._getRange().text;if(P===""){L='
              • '+P+"
              • ";}else{L="
              • "+P+"
              • ";}}}this._getRange().pasteHTML("<"+e+">"+L+"");var E=this._getDoc().getElementById("new_list_item");if(E){var O=this._getDoc().body.createTextRange(); -O.moveToElementText(E);O.collapse(false);O.select();E.id="";}V=false;}}return V;},cmd_insertorderedlist:function(E){return[this.cmd_list("ol")];},cmd_insertunorderedlist:function(E){return[this.cmd_list("ul")];},cmd_fontname:function(H){var E=true,G=this._getSelectedElement();this.currentFont=H;if(G&&G.tagName&&!this._hasSelection()&&!this._isElement(G,"body")&&!this.get("insert")){YAHOO.util.Dom.setStyle(G,"font-family",H);E=false;}else{if(this.get("insert")&&!this._hasSelection()){var F=this._createInsertElement({fontFamily:H});E=false;}}return[E];},cmd_fontsize:function(H){var E=null,G=true;E=this._getSelectedElement();if(this.browser.webkit){if(this.currentElement[0]){if(E==this.currentElement[0]){G=false;YAHOO.util.Dom.setStyle(E,"fontSize",H);this._selectNode(E);this.currentElement[0]=E;}}}if(G){if(!this._isElement(this._getSelectedElement(),"body")&&(!this._hasSelection())){E=this._getSelectedElement();YAHOO.util.Dom.setStyle(E,"fontSize",H);if(this.get("insert")&&this.browser.ie){var F=this._getRange();F.collapse(false);F.select();}else{this._selectNode(E);}}else{if(this.currentElement&&(this.currentElement.length>0)&&(!this._hasSelection())&&(!this.get("insert"))){YAHOO.util.Dom.setStyle(this.currentElement,"fontSize",H);}else{if(this.get("insert")&&!this._hasSelection()){E=this._createInsertElement({fontSize:H});this.currentElement[0]=E;this._selectNode(this.currentElement[0]);}else{this._createCurrentElement("span",{"fontSize":H,fontFamily:E.style.fontFamily,color:E.style.color,backgroundColor:E.style.backgroundColor});this._selectNode(this.currentElement[0]);}}}}return[false];},_swapEl:function(F,E,H){var G=this._getDoc().createElement(E);if(F){G.innerHTML=F.innerHTML;}if(typeof H=="function"){H.call(this,G);}if(F){F.parentNode.replaceChild(G,F);}return G;},_createInsertElement:function(E){this._createCurrentElement("span",E);var F=this.currentElement[0];if(this.browser.webkit){F.innerHTML=' ';F=F.firstChild;this._getSelection().setBaseAndExtent(F,1,F,F.innerText.length);}else{if(this.browser.ie||this.browser.opera){F.innerHTML=" ";}}this.focus();this._selectNode(F,true);return F;},_createCurrentElement:function(G,J){G=((G)?G:"a");var R=null,F=[],H=this._getDoc();if(this.currentFont){if(!J){J={};}J.fontFamily=this.currentFont;this.currentFont=null;}this.currentElement=[];var M=function(X,Z){var Y=null;X=((X)?X:"span");X=X.toLowerCase();switch(X){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":Y=H.createElement(X);break;default:Y=H.createElement(X);if(X==="span"){YAHOO.util.Dom.addClass(Y,"yui-tag-"+X);YAHOO.util.Dom.addClass(Y,"yui-tag");Y.setAttribute("tag",X);}for(var W in Z){if(YAHOO.lang.hasOwnProperty(Z,W)){Y.style[W]=Z[W];}}break;}return Y;};if(!this._hasSelection()){if(this._getDoc().queryCommandEnabled("insertimage")){this._getDoc().execCommand("insertimage",false,"yui-tmp-img");var L=this._getDoc().getElementsByTagName("img");for(var Q=0;Q]*)>/gi,"");E=E.replace(/<\/strong>/gi,"
                ");E=E.replace(/]*)>/gi,"");E=E.replace(/<\/embed>/gi,"");E=E.replace(/]*)>/gi,"");E=E.replace(/<\/em>/gi,"
                ");E=E.replace(/_moz_dirty=""/gi,"");E=E.replace(/]*)>/gi,"");E=E.replace(/<\/YUI_EMBED>/gi,"");if(this.get("plainText")){E=E.replace(/\n/g,"
                ").replace(/\r/g,"
                ");E=E.replace(/ /gi,"  ");E=E.replace(/\t/gi,"    ");}E=E.replace(/]*)>/gi,"");E=E.replace(/<\/script([^>]*)>/gi,"");E=E.replace(/<script([^>]*)>/gi,"");E=E.replace(/<\/script([^>]*)>/gi,"");E=E.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\r/g,"");E=E.replace(new RegExp("]*)>(.*?)","gi"),"");E=E.replace(//g,"\n");return E;},cleanHTML:function(H){if(!H){H=this.getEditorHTML();}var F=this.get("markup");H=this.pre_filter_linebreaks(H,F);H=this.filter_msword(H);H=H.replace(/]*)\/>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/]*)\/>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/ul>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/blockquote>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/embed>/gi,"");if((F=="semantic")||(F=="xhtml")){H=H.replace(/]*)?>/gi,"");H=H.replace(/<\/i>/gi,"");H=H.replace(/]*)?>/gi,"");H=H.replace(/<\/b>/gi,"");}H=H.replace(/_moz_dirty=""/gi,"");H=H.replace(//gi,"/span>");if(this.browser.ie){H=H.replace(/text-decoration/gi,"text-decoration");H=H.replace(/font-weight/gi,"font-weight");H=H.replace(/_width="([^>]*)"/gi,"");H=H.replace(/_height="([^>]*)"/gi,"");var G=this._baseHREF.replace(/\//gi,"\\/"),I=new RegExp('src="'+G,"gi");H=H.replace(I,'src="');}H=H.replace(//gi,"");H=H.replace(//gi,"");if((F=="semantic")||(F=="xhtml")||(F=="css")){H=H.replace(new RegExp(']*)face="([^>]*)">(.*?)',"gi"),'$3');H=H.replace(/([^>]*)',"gi"),"$1");H=H.replace(new RegExp('([^>]*)',"gi"),"$1");}H=H.replace(/\/u>/gi,"/span>");if(F=="css"){H=H.replace(/]*)>/gi,"");H=H.replace(/<\/em>/gi,"");H=H.replace(/]*)>/gi,"");H=H.replace(/<\/strong>/gi,"");H=H.replace(//gi,"/span>");H=H.replace(//gi,"/span>");}H=H.replace(/ /gi," ");}else{H=H.replace(//gi,"/u>");}H=H.replace(/]*)>/gi,"");H=H.replace(/\/ol>/gi,"/ol>");H=H.replace(/
              • /gi,"/li>");H=this.filter_safari(H);H=this.filter_internals(H);H=this.filter_all_rgb(H);H=this.post_filter_linebreaks(H,F);if(F=="xhtml"){H=H.replace(/]*)>/g,"");H=H.replace(/]*)>/g,"");}else{H=H.replace(/]*)>/g,"");H=H.replace(/]*)>/g,"");}H=H.replace(/]*)>/g,"");H=H.replace(/<\/YUI_UL>/g,"
              ");H=this.filter_invalid_lists(H);H=H.replace(/]*)>/g,"");H=H.replace(/<\/YUI_BQ>/g,"");H=H.replace(/]*)>/g,"");H=H.replace(/<\/YUI_EMBED>/g,"");H=H.replace(/ & /gi," YUI_AMP ");H=H.replace(/ &/gi," YUI_AMP_F ");H=H.replace(/& /gi," YUI_AMP_R ");H=H.replace(/&/gi,"&");H=H.replace(/ YUI_AMP /gi," & ");H=H.replace(/ YUI_AMP_F /gi," &");H=H.replace(/ YUI_AMP_R /gi,"& ");H=YAHOO.lang.trim(H);if(this.get("removeLineBreaks")){H=H.replace(/\n/g,"").replace(/\r/g,"");H=H.replace(/ /gi," ");}for(var E in this.invalidHTML){if(YAHOO.lang.hasOwnProperty(this.invalidHTML,E)){if(D.isObject(E)&&E.keepContents){H=H.replace(new RegExp("<"+E+"([^>]*)>(.*?)","gi"),"$1");}else{H=H.replace(new RegExp("<"+E+"([^>]*)>(.*?)","gi"),"");}}}this.fireEvent("cleanHTML",{type:"cleanHTML",target:this,html:H});return H;},filter_msword:function(E){if(!this.get("filterWord")){return E;}E=E.replace(/\s*<\/o:p>/g,"");E=E.replace(/[\s\S]*?<\/o:p>/g," ");E=E.replace(/]*>[\s\S]*?<\/w:[^>]*>/gi,"");E=E.replace(/\s*mso-[^:]+:[^;"]+;?/gi,"");E=E.replace(/\s*MARGIN: 0cm 0cm 0pt\s*;/gi,"");E=E.replace(/\s*MARGIN: 0cm 0cm 0pt\s*"/gi,'"');E=E.replace(/\s*TEXT-INDENT: 0cm\s*;/gi,"");E=E.replace(/\s*TEXT-INDENT: 0cm\s*"/gi,'"');E=E.replace(/\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi,'"'); -E=E.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi,'"');E=E.replace(/\s*tab-stops:[^;"]*;?/gi,"");E=E.replace(/\s*tab-stops:[^"]*/gi,"");E=E.replace(/<\\?\?xml[^>]*>/gi,"");E=E.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");E=E.replace(/<(\w[^>]*) language=([^ |>]*)([^>]*)/gi,"<$1$3");E=E.replace(/<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi,"<$1$3");E=E.replace(/<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi,"<$1$3");return E;},filter_invalid_lists:function(E){E=E.replace(/<\/li>\n/gi,"");E=E.replace(/<\/li>
                /gi,"
                1. ");E=E.replace(/<\/ol>/gi,"
              1. ");E=E.replace(/<\/ol><\/li>\n/gi,"
              ");E=E.replace(/<\/li>
                /gi,"
                • ");E=E.replace(/<\/ul>/gi,"
              • ");E=E.replace(/<\/ul><\/li>\n?/gi,"
              ");E=E.replace(/<\/li>/gi,"");E=E.replace(/<\/ol>/gi,"
          ");E=E.replace(/
            /gi,"
              ");E=E.replace(/
                /gi,"
                  ");return E;},filter_safari:function(E){if(this.browser.webkit){E=E.replace(/([^>])<\/span>/gi,"    ");E=E.replace(/Apple-style-span/gi,"");E=E.replace(/style="line-height: normal;"/gi,"");E=E.replace(/yui-wk-div/gi,"");E=E.replace(/yui-wk-p/gi,"");E=E.replace(/
                • <\/li>/gi,"");E=E.replace(/
                • <\/li>/gi,"");E=E.replace(/
                • <\/li>/gi,"");if(this.get("ptags")){E=E.replace(/]*)>/g,"");E=E.replace(/<\/div>/gi,"

                  ");}else{E=E.replace(/]*)>([ tnr]*)<\/div>/gi,"
                  ");E=E.replace(/<\/div>/gi,"");}}return E;},filter_internals:function(E){E=E.replace(/\r/g,"");E=E.replace(/<\/?(body|head|html)[^>]*>/gi,"");E=E.replace(/<\/li>/gi,"
                • ");E=E.replace(/yui-tag-span/gi,"");E=E.replace(/yui-tag/gi,"");E=E.replace(/yui-non/gi,"");E=E.replace(/yui-img/gi,"");E=E.replace(/ tag="span"/gi,"");E=E.replace(/ class=""/gi,"");E=E.replace(/ style=""/gi,"");E=E.replace(/ class=" "/gi,"");E=E.replace(/ class=" "/gi,"");E=E.replace(/ target=""/gi,"");E=E.replace(/ title=""/gi,"");if(this.browser.ie){E=E.replace(/ class= /gi,"");E=E.replace(/ class= >/gi,"");}return E;},filter_all_rgb:function(I){var H=new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)","gi");var E=I.match(H);if(D.isArray(E)){for(var G=0;G/gi,"");F=F.replace(/
                  /gi,"");}F=F.replace(/
                  /gi,"");F=F.replace(/
                  /gi,"");F=F.replace(//gi,"");F=F.replace(/
                  /gi,"");F=F.replace(/
                  <\/div>/gi,"");F=F.replace(/

                  ( | )<\/p>/g,"");F=F.replace(/


                   <\/p>/gi,"");F=F.replace(/

                   <\/p>/gi,"");F=F.replace(/$/,"");F=F.replace(/<\/p>/g,"

                  ");if(this.browser.ie){F=F.replace(/    /g,"\t");}return F;},post_filter_linebreaks:function(F,E){if(E=="xhtml"){F=F.replace(//g,"
                  ");}else{F=F.replace(//g,"
                  ");}return F;},clearEditorDoc:function(){this._getDoc().body.innerHTML=" ";},openWindow:function(E){},moveWindow:function(){},_closeWindow:function(){},closeWindow:function(){this.toolbar.resetAllButtons();this.focus();},destroy:function(){if(this._nodeChangeDelayTimer){clearTimeout(this._nodeChangeDelayTimer);}this.hide();if(this.resize){this.resize.destroy();}if(this.dd){this.dd.unreg();}if(this.get("panel")){this.get("panel").destroy();}this.saveHTML();this.toolbar.destroy();this.setStyle("visibility","visible");this.setStyle("position","static");this.setStyle("top","");this.setStyle("left","");var E=this.get("element");this.get("element_cont").get("parentNode").replaceChild(E,this.get("element_cont").get("element"));this.get("element_cont").get("element").innerHTML="";this.set("handleSubmit",false);return true;},toString:function(){var E="SimpleEditor";if(this.get&&this.get("element_cont")){E="SimpleEditor (#"+this.get("element_cont").get("id")+")"+((this.get("disabled")?" Disabled":""));}return E;}});YAHOO.widget.EditorInfo={_instances:{},blankImage:"",window:{},panel:null,getEditorById:function(E){if(!YAHOO.lang.isString(E)){E=E.id;}if(this._instances[E]){return this._instances[E];}return false;},saveAll:function(G){var F,H,E=YAHOO.widget.EditorInfo._instances;if(G){for(F in E){if(D.hasOwnProperty(E,F)){H=E[F];if(H.get("element").form&&(H.get("element").form==G)){H.saveHTML();}}}}else{for(F in E){if(D.hasOwnProperty(E,F)){E[F].saveHTML();}}}},toString:function(){var E=0;for(var F in this._instances){if(D.hasOwnProperty(this._instances,F)){E++;}}return"Editor Info ("+E+" registered intance"+((E>1)?"s":"")+")";}};})();YAHOO.register("simpleeditor",YAHOO.widget.SimpleEditor,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor.js deleted file mode 100644 index f59b1e58be..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/editor/simpleeditor.js +++ /dev/null @@ -1,7406 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - /** - * @module editor - * @description

                  Creates a rich custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar

                  - * @class ToolbarButtonAdvanced - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, container_core, menu, button - * - * Provides a toolbar button based on the button and menu widgets. - * @constructor - * @class ToolbarButtonAdvanced - * @param {String/HTMLElement} el The element to turn into a button. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - if (YAHOO.widget.Button) { - YAHOO.widget.ToolbarButtonAdvanced = YAHOO.widget.Button; - /** - * @property buttonType - * @private - * @description Tells if the Button is a Rich Button or a Simple Button - */ - YAHOO.widget.ToolbarButtonAdvanced.prototype.buttonType = 'rich'; - /** - * @method checkValue - * @param {String} value The value of the option that we want to mark as selected - * @description Select an option by value - */ - YAHOO.widget.ToolbarButtonAdvanced.prototype.checkValue = function(value) { - var _menuItems = this.getMenu().getItems(); - if (_menuItems.length === 0) { - this.getMenu()._onBeforeShow(); - _menuItems = this.getMenu().getItems(); - } - for (var i = 0; i < _menuItems.length; i++) { - _menuItems[i].cfg.setProperty('checked', false); - if (_menuItems[i].value == value) { - _menuItems[i].cfg.setProperty('checked', true); - } - } - }; - } else { - YAHOO.widget.ToolbarButtonAdvanced = function() {}; - } - - - /** - * @description

                  Creates a basic custom Toolbar Button. Primarily used with the Rich Text Editor's Toolbar

                  Provides a toolbar button based on the button and menu widgets, <select> elements are used in place of menu's.

                  - * @class ToolbarButton - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event - * @extends YAHOO.util.Element - * - * - * @constructor - * @param {String/HTMLElement} el The element to turn into a button. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.ToolbarButton = function(el, attrs) { - - if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) { - attrs = el; - } - var local_attrs = (attrs || {}); - - var oConfig = { - element: null, - attributes: local_attrs - }; - - if (!oConfig.attributes.type) { - oConfig.attributes.type = 'push'; - } - - oConfig.element = document.createElement('span'); - oConfig.element.setAttribute('unselectable', 'on'); - oConfig.element.className = 'yui-button yui-' + oConfig.attributes.type + '-button'; - oConfig.element.innerHTML = 'LABEL'; - oConfig.element.firstChild.firstChild.tabIndex = '-1'; - oConfig.attributes.id = (oConfig.attributes.id || Dom.generateId()); - oConfig.element.id = oConfig.attributes.id; - - YAHOO.widget.ToolbarButton.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - YAHOO.extend(YAHOO.widget.ToolbarButton, YAHOO.util.Element, { - /** - * @property buttonType - * @private - * @description Tells if the Button is a Rich Button or a Simple Button - */ - buttonType: 'normal', - /** - * @method _handleMouseOver - * @private - * @description Adds classes to the button elements on mouseover (hover) - */ - _handleMouseOver: function() { - if (!this.get('disabled')) { - this.addClass('yui-button-hover'); - this.addClass('yui-' + this.get('type') + '-button-hover'); - } - }, - /** - * @method _handleMouseOut - * @private - * @description Removes classes from the button elements on mouseout (hover) - */ - _handleMouseOut: function() { - this.removeClass('yui-button-hover'); - this.removeClass('yui-' + this.get('type') + '-button-hover'); - }, - /** - * @method checkValue - * @param {String} value The value of the option that we want to mark as selected - * @description Select an option by value - */ - checkValue: function(value) { - if (this.get('type') == 'menu') { - var opts = this._button.options; - for (var i = 0; i < opts.length; i++) { - if (opts[i].value == value) { - opts.selectedIndex = i; - } - } - } - }, - /** - * @method init - * @description The ToolbarButton class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.widget.ToolbarButton.superclass.init.call(this, p_oElement, p_oAttributes); - - this.on('mouseover', this._handleMouseOver, this, true); - this.on('mouseout', this._handleMouseOut, this, true); - this.on('click', function(ev) { - Event.stopEvent(ev); - return false; - }, this, true); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the toolbar. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the toolbar. - */ - initAttributes: function(attr) { - YAHOO.widget.ToolbarButton.superclass.initAttributes.call(this, attr); - /** - * @attribute value - * @description The value of the button - * @type String - */ - this.setAttributeConfig('value', { - value: attr.value - }); - /** - * @attribute menu - * @description The menu attribute, see YAHOO.widget.Button - * @type Object - */ - this.setAttributeConfig('menu', { - value: attr.menu || false - }); - /** - * @attribute type - * @description The type of button to create: push, menu, color, select, spin - * @type String - */ - this.setAttributeConfig('type', { - value: attr.type, - writeOnce: true, - method: function(type) { - var el, opt; - if (!this._button) { - this._button = this.get('element').getElementsByTagName('a')[0]; - } - switch (type) { - case 'select': - case 'menu': - el = document.createElement('select'); - el.id = this.get('id'); - var menu = this.get('menu'); - for (var i = 0; i < menu.length; i++) { - opt = document.createElement('option'); - opt.innerHTML = menu[i].text; - opt.value = menu[i].value; - if (menu[i].checked) { - opt.selected = true; - } - el.appendChild(opt); - } - this._button.parentNode.replaceChild(el, this._button); - Event.on(el, 'change', this._handleSelect, this, true); - this._button = el; - break; - } - } - }); - - /** - * @attribute disabled - * @description Set the button into a disabled state - * @type String - */ - this.setAttributeConfig('disabled', { - value: attr.disabled || false, - method: function(disabled) { - if (disabled) { - this.addClass('yui-button-disabled'); - this.addClass('yui-' + this.get('type') + '-button-disabled'); - } else { - this.removeClass('yui-button-disabled'); - this.removeClass('yui-' + this.get('type') + '-button-disabled'); - } - if ((this.get('type') == 'menu') || (this.get('type') == 'select')) { - this._button.disabled = disabled; - } - } - }); - - /** - * @attribute label - * @description The text label for the button - * @type String - */ - this.setAttributeConfig('label', { - value: attr.label, - method: function(label) { - if (!this._button) { - this._button = this.get('element').getElementsByTagName('a')[0]; - } - if (this.get('type') == 'push') { - this._button.innerHTML = label; - } - } - }); - - /** - * @attribute title - * @description The title of the button - * @type String - */ - this.setAttributeConfig('title', { - value: attr.title - }); - - /** - * @config container - * @description The container that the button is rendered to, handled by Toolbar - * @type String - */ - this.setAttributeConfig('container', { - value: null, - writeOnce: true, - method: function(cont) { - this.appendTo(cont); - } - }); - - }, - /** - * @private - * @method _handleSelect - * @description The event fired when a change event gets fired on a select element - * @param {Event} ev The change event. - */ - _handleSelect: function(ev) { - var tar = Event.getTarget(ev); - var value = tar.options[tar.selectedIndex].value; - this.fireEvent('change', {type: 'change', value: value }); - }, - /** - * @method getMenu - * @description A stub function to mimic YAHOO.widget.Button's getMenu method - */ - getMenu: function() { - return this.get('menu'); - }, - /** - * @method destroy - * @description Destroy the button - */ - destroy: function() { - Event.purgeElement(this.get('element'), true); - this.get('element').parentNode.removeChild(this.get('element')); - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - }, - /** - * @method fireEvent - * @description Overridden fireEvent method to prevent DOM events from firing if the button is disabled. - */ - fireEvent: function(p_sType, p_aArgs) { - // Disabled buttons should not respond to DOM events - if (this.DOM_EVENTS[p_sType] && this.get('disabled')) { - Event.stopEvent(p_aArgs); - return; - } - - YAHOO.widget.ToolbarButton.superclass.fireEvent.call(this, p_sType, p_aArgs); - }, - /** - * @method toString - * @description Returns a string representing the toolbar. - * @return {String} - */ - toString: function() { - return 'ToolbarButton (' + this.get('id') + ')'; - } - - }); -})(); -/** - * @module editor - * @description

                  Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor

                  - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, toolbarbutton - * @optional container_core, dragdrop - */ -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - var getButton = function(id) { - var button = id; - if (Lang.isString(id)) { - button = this.getButtonById(id); - } - if (Lang.isNumber(id)) { - button = this.getButtonByIndex(id); - } - if ((!(button instanceof YAHOO.widget.ToolbarButton)) && (!(button instanceof YAHOO.widget.ToolbarButtonAdvanced))) { - button = this.getButtonByValue(id); - } - if ((button instanceof YAHOO.widget.ToolbarButton) || (button instanceof YAHOO.widget.ToolbarButtonAdvanced)) { - return button; - } - return false; - }; - - /** - * Provides a rich toolbar widget based on the button and menu widgets - * @constructor - * @class Toolbar - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The element to turn into a toolbar. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - YAHOO.widget.Toolbar = function(el, attrs) { - - if (Lang.isObject(arguments[0]) && !Dom.get(el).nodeType) { - attrs = el; - } - var local_attrs = {}; - if (attrs) { - Lang.augmentObject(local_attrs, attrs); //Break the config reference - } - - - var oConfig = { - element: null, - attributes: local_attrs - }; - - - if (Lang.isString(el) && Dom.get(el)) { - oConfig.element = Dom.get(el); - } else if (Lang.isObject(el) && Dom.get(el) && Dom.get(el).nodeType) { - oConfig.element = Dom.get(el); - } - - - if (!oConfig.element) { - oConfig.element = document.createElement('DIV'); - oConfig.element.id = Dom.generateId(); - - if (local_attrs.container && Dom.get(local_attrs.container)) { - Dom.get(local_attrs.container).appendChild(oConfig.element); - } - } - - - if (!oConfig.element.id) { - oConfig.element.id = ((Lang.isString(el)) ? el : Dom.generateId()); - } - - var fs = document.createElement('fieldset'); - var lg = document.createElement('legend'); - lg.innerHTML = 'Toolbar'; - fs.appendChild(lg); - - var cont = document.createElement('DIV'); - oConfig.attributes.cont = cont; - Dom.addClass(cont, 'yui-toolbar-subcont'); - fs.appendChild(cont); - oConfig.element.appendChild(fs); - - oConfig.element.tabIndex = -1; - - - oConfig.attributes.element = oConfig.element; - oConfig.attributes.id = oConfig.element.id; - - this._configuredButtons = []; - - YAHOO.widget.Toolbar.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - - }; - - YAHOO.extend(YAHOO.widget.Toolbar, YAHOO.util.Element, { - /** - * @protected - * @property _configuredButtons - * @type Array - */ - _configuredButtons: null, - /** - * @method _addMenuClasses - * @private - * @description This method is called from Menu's renderEvent to add a few more classes to the menu items - * @param {String} ev The event that fired. - * @param {Array} na Array of event information. - * @param {Object} o Button config object. - */ - _addMenuClasses: function(ev, na, o) { - Dom.addClass(this.element, 'yui-toolbar-' + o.get('value') + '-menu'); - if (Dom.hasClass(o._button.parentNode.parentNode, 'yui-toolbar-select')) { - Dom.addClass(this.element, 'yui-toolbar-select-menu'); - } - var items = this.getItems(); - for (var i = 0; i < items.length; i++) { - Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-').toLowerCase() : items[i]._oText.nodeValue.replace(/ /g, '-').toLowerCase())); - Dom.addClass(items[i].element, 'yui-toolbar-' + o.get('value') + '-' + ((items[i].value) ? items[i].value.replace(/ /g, '-') : items[i]._oText.nodeValue.replace(/ /g, '-'))); - } - }, - /** - * @property buttonType - * @description The default button to use - * @type Object - */ - buttonType: YAHOO.widget.ToolbarButton, - /** - * @property dd - * @description The DragDrop instance associated with the Toolbar - * @type Object - */ - dd: null, - /** - * @property _colorData - * @description Object reference containing colors hex and text values. - * @type Object - */ - _colorData: { -/* {{{ _colorData */ - '#111111': 'Obsidian', - '#2D2D2D': 'Dark Gray', - '#434343': 'Shale', - '#5B5B5B': 'Flint', - '#737373': 'Gray', - '#8B8B8B': 'Concrete', - '#A2A2A2': 'Gray', - '#B9B9B9': 'Titanium', - '#000000': 'Black', - '#D0D0D0': 'Light Gray', - '#E6E6E6': 'Silver', - '#FFFFFF': 'White', - '#BFBF00': 'Pumpkin', - '#FFFF00': 'Yellow', - '#FFFF40': 'Banana', - '#FFFF80': 'Pale Yellow', - '#FFFFBF': 'Butter', - '#525330': 'Raw Siena', - '#898A49': 'Mildew', - '#AEA945': 'Olive', - '#7F7F00': 'Paprika', - '#C3BE71': 'Earth', - '#E0DCAA': 'Khaki', - '#FCFAE1': 'Cream', - '#60BF00': 'Cactus', - '#80FF00': 'Chartreuse', - '#A0FF40': 'Green', - '#C0FF80': 'Pale Lime', - '#DFFFBF': 'Light Mint', - '#3B5738': 'Green', - '#668F5A': 'Lime Gray', - '#7F9757': 'Yellow', - '#407F00': 'Clover', - '#8A9B55': 'Pistachio', - '#B7C296': 'Light Jade', - '#E6EBD5': 'Breakwater', - '#00BF00': 'Spring Frost', - '#00FF80': 'Pastel Green', - '#40FFA0': 'Light Emerald', - '#80FFC0': 'Sea Foam', - '#BFFFDF': 'Sea Mist', - '#033D21': 'Dark Forrest', - '#438059': 'Moss', - '#7FA37C': 'Medium Green', - '#007F40': 'Pine', - '#8DAE94': 'Yellow Gray Green', - '#ACC6B5': 'Aqua Lung', - '#DDEBE2': 'Sea Vapor', - '#00BFBF': 'Fog', - '#00FFFF': 'Cyan', - '#40FFFF': 'Turquoise Blue', - '#80FFFF': 'Light Aqua', - '#BFFFFF': 'Pale Cyan', - '#033D3D': 'Dark Teal', - '#347D7E': 'Gray Turquoise', - '#609A9F': 'Green Blue', - '#007F7F': 'Seaweed', - '#96BDC4': 'Green Gray', - '#B5D1D7': 'Soapstone', - '#E2F1F4': 'Light Turquoise', - '#0060BF': 'Summer Sky', - '#0080FF': 'Sky Blue', - '#40A0FF': 'Electric Blue', - '#80C0FF': 'Light Azure', - '#BFDFFF': 'Ice Blue', - '#1B2C48': 'Navy', - '#385376': 'Biscay', - '#57708F': 'Dusty Blue', - '#00407F': 'Sea Blue', - '#7792AC': 'Sky Blue Gray', - '#A8BED1': 'Morning Sky', - '#DEEBF6': 'Vapor', - '#0000BF': 'Deep Blue', - '#0000FF': 'Blue', - '#4040FF': 'Cerulean Blue', - '#8080FF': 'Evening Blue', - '#BFBFFF': 'Light Blue', - '#212143': 'Deep Indigo', - '#373E68': 'Sea Blue', - '#444F75': 'Night Blue', - '#00007F': 'Indigo Blue', - '#585E82': 'Dockside', - '#8687A4': 'Blue Gray', - '#D2D1E1': 'Light Blue Gray', - '#6000BF': 'Neon Violet', - '#8000FF': 'Blue Violet', - '#A040FF': 'Violet Purple', - '#C080FF': 'Violet Dusk', - '#DFBFFF': 'Pale Lavender', - '#302449': 'Cool Shale', - '#54466F': 'Dark Indigo', - '#655A7F': 'Dark Violet', - '#40007F': 'Violet', - '#726284': 'Smoky Violet', - '#9E8FA9': 'Slate Gray', - '#DCD1DF': 'Violet White', - '#BF00BF': 'Royal Violet', - '#FF00FF': 'Fuchsia', - '#FF40FF': 'Magenta', - '#FF80FF': 'Orchid', - '#FFBFFF': 'Pale Magenta', - '#4A234A': 'Dark Purple', - '#794A72': 'Medium Purple', - '#936386': 'Cool Granite', - '#7F007F': 'Purple', - '#9D7292': 'Purple Moon', - '#C0A0B6': 'Pale Purple', - '#ECDAE5': 'Pink Cloud', - '#BF005F': 'Hot Pink', - '#FF007F': 'Deep Pink', - '#FF409F': 'Grape', - '#FF80BF': 'Electric Pink', - '#FFBFDF': 'Pink', - '#451528': 'Purple Red', - '#823857': 'Purple Dino', - '#A94A76': 'Purple Gray', - '#7F003F': 'Rose', - '#BC6F95': 'Antique Mauve', - '#D8A5BB': 'Cool Marble', - '#F7DDE9': 'Pink Granite', - '#C00000': 'Apple', - '#FF0000': 'Fire Truck', - '#FF4040': 'Pale Red', - '#FF8080': 'Salmon', - '#FFC0C0': 'Warm Pink', - '#441415': 'Sepia', - '#82393C': 'Rust', - '#AA4D4E': 'Brick', - '#800000': 'Brick Red', - '#BC6E6E': 'Mauve', - '#D8A3A4': 'Shrimp Pink', - '#F8DDDD': 'Shell Pink', - '#BF5F00': 'Dark Orange', - '#FF7F00': 'Orange', - '#FF9F40': 'Grapefruit', - '#FFBF80': 'Canteloupe', - '#FFDFBF': 'Wax', - '#482C1B': 'Dark Brick', - '#855A40': 'Dirt', - '#B27C51': 'Tan', - '#7F3F00': 'Nutmeg', - '#C49B71': 'Mustard', - '#E1C4A8': 'Pale Tan', - '#FDEEE0': 'Marble' -/* }}} */ - }, - /** - * @property _colorPicker - * @description The HTML Element containing the colorPicker - * @type HTMLElement - */ - _colorPicker: null, - /** - * @property STR_COLLAPSE - * @description String for Toolbar Collapse Button - * @type String - */ - STR_COLLAPSE: 'Collapse Toolbar', - /** - * @property STR_EXPAND - * @description String for Toolbar Collapse Button - Expand - * @type String - */ - STR_EXPAND: 'Expand Toolbar', - /** - * @property STR_SPIN_LABEL - * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute - * @type String - */ - STR_SPIN_LABEL: 'Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.', - /** - * @property STR_SPIN_UP - * @description String for spinbutton up - * @type String - */ - STR_SPIN_UP: 'Click to increase the value of this input', - /** - * @property STR_SPIN_DOWN - * @description String for spinbutton down - * @type String - */ - STR_SPIN_DOWN: 'Click to decrease the value of this input', - /** - * @property _titlebar - * @description Object reference to the titlebar - * @type HTMLElement - */ - _titlebar: null, - /** - * @property browser - * @description Standard browser detection - * @type Object - */ - browser: YAHOO.env.ua, - /** - * @protected - * @property _buttonList - * @description Internal property list of current buttons in the toolbar - * @type Array - */ - _buttonList: null, - /** - * @protected - * @property _buttonGroupList - * @description Internal property list of current button groups in the toolbar - * @type Array - */ - _buttonGroupList: null, - /** - * @protected - * @property _sep - * @description Internal reference to the separator HTML Element for cloning - * @type HTMLElement - */ - _sep: null, - /** - * @protected - * @property _sepCount - * @description Internal refernce for counting separators, so we can give them a useful class name for styling - * @type Number - */ - _sepCount: null, - /** - * @protected - * @property draghandle - * @type HTMLElement - */ - _dragHandle: null, - /** - * @protected - * @property _toolbarConfigs - * @type Object - */ - _toolbarConfigs: { - renderer: true - }, - /** - * @protected - * @property CLASS_CONTAINER - * @description Default CSS class to apply to the toolbar container element - * @type String - */ - CLASS_CONTAINER: 'yui-toolbar-container', - /** - * @protected - * @property CLASS_DRAGHANDLE - * @description Default CSS class to apply to the toolbar's drag handle element - * @type String - */ - CLASS_DRAGHANDLE: 'yui-toolbar-draghandle', - /** - * @protected - * @property CLASS_SEPARATOR - * @description Default CSS class to apply to all separators in the toolbar - * @type String - */ - CLASS_SEPARATOR: 'yui-toolbar-separator', - /** - * @protected - * @property CLASS_DISABLED - * @description Default CSS class to apply when the toolbar is disabled - * @type String - */ - CLASS_DISABLED: 'yui-toolbar-disabled', - /** - * @protected - * @property CLASS_PREFIX - * @description Default prefix for dynamically created class names - * @type String - */ - CLASS_PREFIX: 'yui-toolbar', - /** - * @method init - * @description The Toolbar class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.widget.Toolbar.superclass.init.call(this, p_oElement, p_oAttributes); - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the toolbar. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the toolbar. - */ - initAttributes: function(attr) { - YAHOO.widget.Toolbar.superclass.initAttributes.call(this, attr); - this.addClass(this.CLASS_CONTAINER); - - /** - * @attribute buttonType - * @description The buttonType to use (advanced or basic) - * @type String - */ - this.setAttributeConfig('buttonType', { - value: attr.buttonType || 'basic', - writeOnce: true, - validator: function(type) { - switch (type) { - case 'advanced': - case 'basic': - return true; - } - return false; - }, - method: function(type) { - if (type == 'advanced') { - if (YAHOO.widget.Button) { - this.buttonType = YAHOO.widget.ToolbarButtonAdvanced; - } else { - this.buttonType = YAHOO.widget.ToolbarButton; - } - } else { - this.buttonType = YAHOO.widget.ToolbarButton; - } - } - }); - - - /** - * @attribute buttons - * @description Object specifying the buttons to include in the toolbar - * Example: - *
                  -            * {
                  -            *   { id: 'b3', type: 'button', label: 'Underline', value: 'underline' },
                  -            *   { type: 'separator' },
                  -            *   { id: 'b4', type: 'menu', label: 'Align', value: 'align',
                  -            *       menu: [
                  -            *           { text: "Left", value: 'alignleft' },
                  -            *           { text: "Center", value: 'aligncenter' },
                  -            *           { text: "Right", value: 'alignright' }
                  -            *       ]
                  -            *   }
                  -            * }
                  -            * 
                  - * @type Array - */ - - this.setAttributeConfig('buttons', { - value: [], - writeOnce: true, - method: function(data) { - var i, button, buttons, len, b; - for (i in data) { - if (Lang.hasOwnProperty(data, i)) { - if (data[i].type == 'separator') { - this.addSeparator(); - } else if (data[i].group !== undefined) { - buttons = this.addButtonGroup(data[i]); - if (buttons) { - len = buttons.length; - for(b = 0; b < len; b++) { - if (buttons[b]) { - this._configuredButtons[this._configuredButtons.length] = buttons[b].id; - } - } - } - - } else { - button = this.addButton(data[i]); - if (button) { - this._configuredButtons[this._configuredButtons.length] = button.id; - } - } - } - } - } - }); - - /** - * @attribute disabled - * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on. - * @default false - * @type Boolean - */ - this.setAttributeConfig('disabled', { - value: false, - method: function(disabled) { - if (this.get('disabled') === disabled) { - return false; - } - if (disabled) { - this.addClass(this.CLASS_DISABLED); - this.set('draggable', false); - this.disableAllButtons(); - } else { - this.removeClass(this.CLASS_DISABLED); - if (this._configs.draggable._initialConfig.value) { - //Draggable by default, set it back - this.set('draggable', true); - } - this.resetAllButtons(); - } - } - }); - - /** - * @config cont - * @description The container for the toolbar. - * @type HTMLElement - */ - this.setAttributeConfig('cont', { - value: attr.cont, - readOnly: true - }); - - - /** - * @attribute grouplabels - * @description Boolean indicating if the toolbar should show the group label's text string. - * @default true - * @type Boolean - */ - this.setAttributeConfig('grouplabels', { - value: ((attr.grouplabels === false) ? false : true), - method: function(grouplabels) { - if (grouplabels) { - Dom.removeClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels')); - } else { - Dom.addClass(this.get('cont'), (this.CLASS_PREFIX + '-nogrouplabels')); - } - } - }); - /** - * @attribute titlebar - * @description Boolean indicating if the toolbar should have a titlebar. If - * passed a string, it will use that as the titlebar text - * @default false - * @type Boolean or String - */ - this.setAttributeConfig('titlebar', { - value: false, - method: function(titlebar) { - if (titlebar) { - if (this._titlebar && this._titlebar.parentNode) { - this._titlebar.parentNode.removeChild(this._titlebar); - } - this._titlebar = document.createElement('DIV'); - this._titlebar.tabIndex = '-1'; - Event.on(this._titlebar, 'focus', function() { - this._handleFocus(); - }, this, true); - Dom.addClass(this._titlebar, this.CLASS_PREFIX + '-titlebar'); - if (Lang.isString(titlebar)) { - var h2 = document.createElement('h2'); - h2.tabIndex = '-1'; - h2.innerHTML = '' + titlebar + ''; - this._titlebar.appendChild(h2); - Event.on(h2.firstChild, 'click', function(ev) { - Event.stopEvent(ev); - }); - Event.on([h2, h2.firstChild], 'focus', function() { - this._handleFocus(); - }, this, true); - } - if (this.get('firstChild')) { - this.insertBefore(this._titlebar, this.get('firstChild')); - } else { - this.appendChild(this._titlebar); - } - if (this.get('collapse')) { - this.set('collapse', true); - } - } else if (this._titlebar) { - if (this._titlebar && this._titlebar.parentNode) { - this._titlebar.parentNode.removeChild(this._titlebar); - } - } - } - }); - - - /** - * @attribute collapse - * @description Boolean indicating if the titlebar should have a collapse button. - * The collapse button will not remove the toolbar, it will minimize it to the titlebar - * @default false - * @type Boolean - */ - this.setAttributeConfig('collapse', { - value: false, - method: function(collapse) { - if (this._titlebar) { - var collapseEl = null; - var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapse) { - if (el.length > 0) { - //There is already a collapse button - return true; - } - collapseEl = document.createElement('SPAN'); - collapseEl.innerHTML = 'X'; - collapseEl.title = this.STR_COLLAPSE; - - Dom.addClass(collapseEl, 'collapse'); - this._titlebar.appendChild(collapseEl); - Event.addListener(collapseEl, 'click', function() { - if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) { - this.collapse(false); //Expand Toolbar - } else { - this.collapse(); //Collapse Toolbar - } - }, this, true); - } else { - collapseEl = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapseEl[0]) { - if (Dom.hasClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed')) { - //We are closed, reopen the titlebar.. - this.collapse(false); //Expand Toolbar - } - collapseEl[0].parentNode.removeChild(collapseEl[0]); - } - } - } - } - }); - - /** - * @attribute draggable - * @description Boolean indicating if the toolbar should be draggable. - * @default false - * @type Boolean - */ - - this.setAttributeConfig('draggable', { - value: (attr.draggable || false), - method: function(draggable) { - if (draggable && !this.get('titlebar')) { - if (!this._dragHandle) { - this._dragHandle = document.createElement('SPAN'); - this._dragHandle.innerHTML = '|'; - this._dragHandle.setAttribute('title', 'Click to drag the toolbar'); - this._dragHandle.id = this.get('id') + '_draghandle'; - Dom.addClass(this._dragHandle, this.CLASS_DRAGHANDLE); - if (this.get('cont').hasChildNodes()) { - this.get('cont').insertBefore(this._dragHandle, this.get('cont').firstChild); - } else { - this.get('cont').appendChild(this._dragHandle); - } - this.dd = new YAHOO.util.DD(this.get('id')); - this.dd.setHandleElId(this._dragHandle.id); - - } - } else { - if (this._dragHandle) { - this._dragHandle.parentNode.removeChild(this._dragHandle); - this._dragHandle = null; - this.dd = null; - } - } - if (this._titlebar) { - if (draggable) { - this.dd = new YAHOO.util.DD(this.get('id')); - this.dd.setHandleElId(this._titlebar); - Dom.addClass(this._titlebar, 'draggable'); - } else { - Dom.removeClass(this._titlebar, 'draggable'); - if (this.dd) { - this.dd.unreg(); - this.dd = null; - } - } - } - }, - validator: function(value) { - var ret = true; - if (!YAHOO.util.DD) { - ret = false; - } - return ret; - } - }); - - }, - /** - * @method addButtonGroup - * @description Add a new button group to the toolbar. (uses addButton) - * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs as well as the group label) - */ - addButtonGroup: function(oGroup) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addButtonGroup', arguments]; - return false; - } - - if (!this.hasClass(this.CLASS_PREFIX + '-grouped')) { - this.addClass(this.CLASS_PREFIX + '-grouped'); - } - var div = document.createElement('DIV'); - Dom.addClass(div, this.CLASS_PREFIX + '-group'); - Dom.addClass(div, this.CLASS_PREFIX + '-group-' + oGroup.group); - if (oGroup.label) { - var label = document.createElement('h3'); - label.innerHTML = oGroup.label; - div.appendChild(label); - } - if (!this.get('grouplabels')) { - Dom.addClass(this.get('cont'), this.CLASS_PREFIX, '-nogrouplabels'); - } - - this.get('cont').appendChild(div); - - //For accessibility, let's put all of the group buttons in an Unordered List - var ul = document.createElement('ul'); - div.appendChild(ul); - - if (!this._buttonGroupList) { - this._buttonGroupList = {}; - } - - this._buttonGroupList[oGroup.group] = ul; - - //An array of the button ids added to this group - //This is used for destruction later... - var addedButtons = [], - button; - - - for (var i = 0; i < oGroup.buttons.length; i++) { - var li = document.createElement('li'); - li.className = this.CLASS_PREFIX + '-groupitem'; - ul.appendChild(li); - if ((oGroup.buttons[i].type !== undefined) && oGroup.buttons[i].type == 'separator') { - this.addSeparator(li); - } else { - oGroup.buttons[i].container = li; - button = this.addButton(oGroup.buttons[i]); - if (button) { - addedButtons[addedButtons.length] = button.id; - } - } - } - return addedButtons; - }, - /** - * @method addButtonToGroup - * @description Add a new button to a toolbar group. Buttons supported: - * push, split, menu, select, color, spin - * @param {Object} oButton Object literal reference to the Button's Config - * @param {String} group The Group identifier passed into the initial config - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addButtonToGroup: function(oButton, group, after) { - var groupCont = this._buttonGroupList[group], - li = document.createElement('li'); - - li.className = this.CLASS_PREFIX + '-groupitem'; - oButton.container = li; - this.addButton(oButton, after); - groupCont.appendChild(li); - }, - /** - * @method addButton - * @description Add a new button to the toolbar. Buttons supported: - * push, split, menu, select, color, spin - * @param {Object} oButton Object literal reference to the Button's Config - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addButton: function(oButton, after) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addButton', arguments]; - return false; - } - if (!this._buttonList) { - this._buttonList = []; - } - if (!oButton.container) { - oButton.container = this.get('cont'); - } - - if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) { - if (Lang.isArray(oButton.menu)) { - for (var i in oButton.menu) { - if (Lang.hasOwnProperty(oButton.menu, i)) { - var funcObject = { - fn: function(ev, x, oMenu) { - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue); - }, - scope: this - }; - oButton.menu[i].onclick = funcObject; - } - } - } - } - var _oButton = {}, skip = false; - for (var o in oButton) { - if (Lang.hasOwnProperty(oButton, o)) { - if (!this._toolbarConfigs[o]) { - _oButton[o] = oButton[o]; - } - } - } - if (oButton.type == 'select') { - _oButton.type = 'menu'; - } - if (oButton.type == 'spin') { - _oButton.type = 'push'; - } - if (_oButton.type == 'color') { - if (YAHOO.widget.Overlay) { - _oButton = this._makeColorButton(_oButton); - } else { - skip = true; - } - } - if (_oButton.menu) { - if ((YAHOO.widget.Overlay) && (oButton.menu instanceof YAHOO.widget.Overlay)) { - oButton.menu.showEvent.subscribe(function() { - this._button = _oButton; - }); - } else { - for (var m = 0; m < _oButton.menu.length; m++) { - if (!_oButton.menu[m].value) { - _oButton.menu[m].value = _oButton.menu[m].text; - } - } - if (this.browser.webkit) { - _oButton.focusmenu = false; - } - } - } - if (skip) { - oButton = false; - } else { - //Add to .get('buttons') manually - this._configs.buttons.value[this._configs.buttons.value.length] = oButton; - - var tmp = new this.buttonType(_oButton); - tmp.get('element').tabIndex = '-1'; - tmp.get('element').setAttribute('role', 'button'); - tmp._selected = true; - - if (this.get('disabled')) { - //Toolbar is disabled, disable the new button too! - tmp.set('disabled', true); - } - if (!oButton.id) { - oButton.id = tmp.get('id'); - } - - if (after) { - var el = tmp.get('element'); - var nextSib = null; - if (after.get) { - nextSib = after.get('element').nextSibling; - } else if (after.nextSibling) { - nextSib = after.nextSibling; - } - if (nextSib) { - nextSib.parentNode.insertBefore(el, nextSib); - } - } - tmp.addClass(this.CLASS_PREFIX + '-' + tmp.get('value')); - - var icon = document.createElement('span'); - icon.className = this.CLASS_PREFIX + '-icon'; - tmp.get('element').insertBefore(icon, tmp.get('firstChild')); - if (tmp._button.tagName.toLowerCase() == 'button') { - tmp.get('element').setAttribute('unselectable', 'on'); - //Replace the Button HTML Element with an a href if it exists - var a = document.createElement('a'); - a.innerHTML = tmp._button.innerHTML; - a.href = '#'; - a.tabIndex = '-1'; - Event.on(a, 'click', function(ev) { - Event.stopEvent(ev); - }); - tmp._button.parentNode.replaceChild(a, tmp._button); - tmp._button = a; - } - - if (oButton.type == 'select') { - if (tmp._button.tagName.toLowerCase() == 'select') { - icon.parentNode.removeChild(icon); - var iel = tmp._button, - parEl = tmp.get('element'); - parEl.parentNode.replaceChild(iel, parEl); - //The 'element' value is currently the orphaned element - //In order for "destroy" to execute we need to get('element') to reference the correct node. - //I'm not sure if there is a direct approach to setting this value. - tmp._configs.element.value = iel; - } else { - //Don't put a class on it if it's a real select element - tmp.addClass(this.CLASS_PREFIX + '-select'); - } - } - if (oButton.type == 'spin') { - if (!Lang.isArray(oButton.range)) { - oButton.range = [ 10, 100 ]; - } - this._makeSpinButton(tmp, oButton); - } - tmp.get('element').setAttribute('title', tmp.get('label')); - if (oButton.type != 'spin') { - if ((YAHOO.widget.Overlay) && (_oButton.menu instanceof YAHOO.widget.Overlay)) { - var showPicker = function(ev) { - var exec = true; - if (ev.keyCode && (ev.keyCode == 9)) { - exec = false; - } - if (exec) { - if (this._colorPicker) { - this._colorPicker._button = oButton.value; - } - var menuEL = tmp.getMenu().element; - if (Dom.getStyle(menuEL, 'visibility') == 'hidden') { - tmp.getMenu().show(); - } else { - tmp.getMenu().hide(); - } - } - YAHOO.util.Event.stopEvent(ev); - }; - tmp.on('mousedown', showPicker, oButton, this); - tmp.on('keydown', showPicker, oButton, this); - - } else if ((oButton.type != 'menu') && (oButton.type != 'select')) { - tmp.on('keypress', this._buttonClick, oButton, this); - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - this._buttonClick(ev, oButton); - }, oButton, this); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - } else { - //Stop the mousedown event so we can trap the selection in the editor! - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('change', function(ev) { - if (!ev.target) { - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ev.value; - this._buttonClick(ev, oButton); - } - }, this, true); - - var self = this; - //Hijack the mousedown event in the menu and make it fire a button click.. - tmp.on('appendTo', function() { - var tmp = this; - if (tmp.getMenu() && tmp.getMenu().mouseDownEvent) { - tmp.getMenu().mouseDownEvent.subscribe(function(ev, args) { - var oMenu = args[1]; - YAHOO.util.Event.stopEvent(args[0]); - tmp._onMenuClick(args[0], tmp); - if (!oButton.menucmd) { - oButton.menucmd = oButton.value; - } - oButton.value = ((oMenu.value) ? oMenu.value : oMenu._oText.nodeValue); - self._buttonClick.call(self, args[1], oButton); - tmp._hideMenu(); - return false; - }); - tmp.getMenu().clickEvent.subscribe(function(ev, args) { - YAHOO.util.Event.stopEvent(args[0]); - }); - tmp.getMenu().mouseUpEvent.subscribe(function(ev, args) { - YAHOO.util.Event.stopEvent(args[0]); - }); - } - }); - - } - } else { - //Stop the mousedown event so we can trap the selection in the editor! - tmp.on('mousedown', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }); - } - if (this.browser.ie) { - /* - //Add a couple of new events for IE - tmp.DOM_EVENTS.focusin = true; - tmp.DOM_EVENTS.focusout = true; - - //Stop them so we don't loose focus in the Editor - tmp.on('focusin', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - - tmp.on('focusout', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - tmp.on('click', function(ev) { - YAHOO.util.Event.stopEvent(ev); - }, oButton, this); - */ - } - if (this.browser.webkit) { - //This will keep the document from gaining focus and the editor from loosing it.. - //Forcefully remove the focus calls in button! - tmp.hasFocus = function() { - return true; - }; - } - this._buttonList[this._buttonList.length] = tmp; - if ((oButton.type == 'menu') || (oButton.type == 'split') || (oButton.type == 'select')) { - if (Lang.isArray(oButton.menu)) { - var menu = tmp.getMenu(); - if (menu && menu.renderEvent) { - menu.renderEvent.subscribe(this._addMenuClasses, tmp); - if (oButton.renderer) { - menu.renderEvent.subscribe(oButton.renderer, tmp); - } - } - } - } - } - return oButton; - }, - /** - * @method addSeparator - * @description Add a new button separator to the toolbar. - * @param {HTMLElement} cont Optional HTML element to insert this button into. - * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM. - */ - addSeparator: function(cont, after) { - if (!this.get('element')) { - this._queue[this._queue.length] = ['addSeparator', arguments]; - return false; - } - var sepCont = ((cont) ? cont : this.get('cont')); - if (!this.get('element')) { - this._queue[this._queue.length] = ['addSeparator', arguments]; - return false; - } - if (this._sepCount === null) { - this._sepCount = 0; - } - if (!this._sep) { - this._sep = document.createElement('SPAN'); - Dom.addClass(this._sep, this.CLASS_SEPARATOR); - this._sep.innerHTML = '|'; - } - var _sep = this._sep.cloneNode(true); - this._sepCount++; - Dom.addClass(_sep, this.CLASS_SEPARATOR + '-' + this._sepCount); - if (after) { - var nextSib = null; - if (after.get) { - nextSib = after.get('element').nextSibling; - } else if (after.nextSibling) { - nextSib = after.nextSibling; - } else { - nextSib = after; - } - if (nextSib) { - if (nextSib == after) { - nextSib.parentNode.appendChild(_sep); - } else { - nextSib.parentNode.insertBefore(_sep, nextSib); - } - } - } else { - sepCont.appendChild(_sep); - } - return _sep; - }, - /** - * @method _createColorPicker - * @private - * @description Creates the core DOM reference to the color picker menu item. - * @param {String} id the id of the toolbar to prefix this DOM container with. - */ - _createColorPicker: function(id) { - if (Dom.get(id + '_colors')) { - Dom.get(id + '_colors').parentNode.removeChild(Dom.get(id + '_colors')); - } - var picker = document.createElement('div'); - picker.className = 'yui-toolbar-colors'; - picker.id = id + '_colors'; - picker.style.display = 'none'; - Event.on(window, 'load', function() { - document.body.appendChild(picker); - }, this, true); - - this._colorPicker = picker; - - var html = ''; - for (var i in this._colorData) { - if (Lang.hasOwnProperty(this._colorData, i)) { - html += '' + i.replace('#', '') + ''; - } - } - html += 'X'; - window.setTimeout(function() { - picker.innerHTML = html; - }, 0); - - Event.on(picker, 'mouseover', function(ev) { - var picker = this._colorPicker; - var em = picker.getElementsByTagName('em')[0]; - var strong = picker.getElementsByTagName('strong')[0]; - var tar = Event.getTarget(ev); - if (tar.tagName.toLowerCase() == 'a') { - em.style.backgroundColor = tar.style.backgroundColor; - strong.innerHTML = this._colorData['#' + tar.innerHTML] + '
                  ' + tar.innerHTML; - } - }, this, true); - Event.on(picker, 'focus', function(ev) { - Event.stopEvent(ev); - }); - Event.on(picker, 'click', function(ev) { - Event.stopEvent(ev); - }); - Event.on(picker, 'mousedown', function(ev) { - Event.stopEvent(ev); - var tar = Event.getTarget(ev); - if (tar.tagName.toLowerCase() == 'a') { - var retVal = this.fireEvent('colorPickerClicked', { type: 'colorPickerClicked', target: this, button: this._colorPicker._button, color: tar.innerHTML, colorName: this._colorData['#' + tar.innerHTML] } ); - if (retVal !== false) { - var info = { - color: tar.innerHTML, - colorName: this._colorData['#' + tar.innerHTML], - value: this._colorPicker._button - }; - - this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info }); - } - this.getButtonByValue(this._colorPicker._button).getMenu().hide(); - } - }, this, true); - }, - /** - * @method _resetColorPicker - * @private - * @description Clears the currently selected color or mouseover color in the color picker. - */ - _resetColorPicker: function() { - var em = this._colorPicker.getElementsByTagName('em')[0]; - var strong = this._colorPicker.getElementsByTagName('strong')[0]; - em.style.backgroundColor = 'transparent'; - strong.innerHTML = ''; - }, - /** - * @method _makeColorButton - * @private - * @description Called to turn a "color" button into a menu button with an Overlay for the menu. - * @param {Object} _oButton YAHOO.widget.ToolbarButton reference - */ - _makeColorButton: function(_oButton) { - if (!this._colorPicker) { - this._createColorPicker(this.get('id')); - } - _oButton.type = 'color'; - _oButton.menu = new YAHOO.widget.Overlay(this.get('id') + '_' + _oButton.value + '_menu', { visible: false, position: 'absolute', iframe: true }); - _oButton.menu.setBody(''); - _oButton.menu.render(this.get('cont')); - Dom.addClass(_oButton.menu.element, 'yui-button-menu'); - Dom.addClass(_oButton.menu.element, 'yui-color-button-menu'); - _oButton.menu.beforeShowEvent.subscribe(function() { - _oButton.menu.cfg.setProperty('zindex', 5); //Re Adjust the overlays zIndex.. not sure why. - _oButton.menu.cfg.setProperty('context', [this.getButtonById(_oButton.id).get('element'), 'tl', 'bl']); //Re Adjust the overlay.. not sure why. - //Move the DOM reference of the color picker to the Overlay that we are about to show. - this._resetColorPicker(); - var _p = this._colorPicker; - if (_p.parentNode) { - _p.parentNode.removeChild(_p); - } - _oButton.menu.setBody(''); - _oButton.menu.appendToBody(_p); - this._colorPicker.style.display = 'block'; - }, this, true); - return _oButton; - }, - /** - * @private - * @method _makeSpinButton - * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values. - * @param {Object} _button YAHOO.widget.ToolbarButton reference - * @param {Object} oButton Object literal containing the buttons initial config - */ - _makeSpinButton: function(_button, oButton) { - _button.addClass(this.CLASS_PREFIX + '-spinbutton'); - var self = this, - _par = _button._button.parentNode.parentNode, //parentNode of Button Element for appending child - range = oButton.range, - _b1 = document.createElement('a'), - _b2 = document.createElement('a'); - _b1.href = '#'; - _b2.href = '#'; - _b1.tabIndex = '-1'; - _b2.tabIndex = '-1'; - - //Setup the up and down arrows - _b1.className = 'up'; - _b1.title = this.STR_SPIN_UP; - _b1.innerHTML = this.STR_SPIN_UP; - _b2.className = 'down'; - _b2.title = this.STR_SPIN_DOWN; - _b2.innerHTML = this.STR_SPIN_DOWN; - - //Append them to the container - _par.appendChild(_b1); - _par.appendChild(_b2); - - var label = YAHOO.lang.substitute(this.STR_SPIN_LABEL, { VALUE: _button.get('label') }); - _button.set('title', label); - - var cleanVal = function(value) { - value = ((value < range[0]) ? range[0] : value); - value = ((value > range[1]) ? range[1] : value); - return value; - }; - - var br = this.browser; - var tbar = false; - var strLabel = this.STR_SPIN_LABEL; - if (this._titlebar && this._titlebar.firstChild) { - tbar = this._titlebar.firstChild; - } - - var _intUp = function(ev) { - YAHOO.util.Event.stopEvent(ev); - if (!_button.get('disabled') && (ev.keyCode != 9)) { - var value = parseInt(_button.get('label'), 10); - value++; - value = cleanVal(value); - _button.set('label', ''+value); - var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') }); - _button.set('title', label); - if (!br.webkit && tbar) { - //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed - //_button.focus(); - } - self._buttonClick(ev, oButton); - } - }; - - var _intDown = function(ev) { - YAHOO.util.Event.stopEvent(ev); - if (!_button.get('disabled') && (ev.keyCode != 9)) { - var value = parseInt(_button.get('label'), 10); - value--; - value = cleanVal(value); - - _button.set('label', ''+value); - var label = YAHOO.lang.substitute(strLabel, { VALUE: _button.get('label') }); - _button.set('title', label); - if (!br.webkit && tbar) { - //tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed - //_button.focus(); - } - self._buttonClick(ev, oButton); - } - }; - - var _intKeyUp = function(ev) { - if (ev.keyCode == 38) { - _intUp(ev); - } else if (ev.keyCode == 40) { - _intDown(ev); - } else if (ev.keyCode == 107 && ev.shiftKey) { //Plus Key - _intUp(ev); - } else if (ev.keyCode == 109 && ev.shiftKey) { //Minus Key - _intDown(ev); - } - }; - - //Handle arrow keys.. - _button.on('keydown', _intKeyUp, this, true); - - //Listen for the click on the up button and act on it - //Listen for the click on the down button and act on it - Event.on(_b1, 'mousedown',function(ev) { - Event.stopEvent(ev); - }, this, true); - Event.on(_b2, 'mousedown', function(ev) { - Event.stopEvent(ev); - }, this, true); - Event.on(_b1, 'click', _intUp, this, true); - Event.on(_b2, 'click', _intDown, this, true); - }, - /** - * @protected - * @method _buttonClick - * @description Click handler for all buttons in the toolbar. - * @param {String} ev The event that was passed in. - * @param {Object} info Object literal of information about the button that was clicked. - */ - _buttonClick: function(ev, info) { - var doEvent = true; - - if (ev && ev.type == 'keypress') { - if (ev.keyCode == 9) { - doEvent = false; - } else if ((ev.keyCode === 13) || (ev.keyCode === 0) || (ev.keyCode === 32)) { - } else { - doEvent = false; - } - } - - if (doEvent) { - var fireNextEvent = true, - retValue = false; - - info.isSelected = this.isSelected(info.id); - - if (info.value) { - retValue = this.fireEvent(info.value + 'Click', { type: info.value + 'Click', target: this.get('element'), button: info }); - if (retValue === false) { - fireNextEvent = false; - } - } - - if (info.menucmd && fireNextEvent) { - retValue = this.fireEvent(info.menucmd + 'Click', { type: info.menucmd + 'Click', target: this.get('element'), button: info }); - if (retValue === false) { - fireNextEvent = false; - } - } - if (fireNextEvent) { - this.fireEvent('buttonClick', { type: 'buttonClick', target: this.get('element'), button: info }); - } - - if (info.type == 'select') { - var button = this.getButtonById(info.id); - if (button.buttonType == 'rich') { - var txt = info.value; - for (var i = 0; i < info.menu.length; i++) { - if (info.menu[i].value == info.value) { - txt = info.menu[i].text; - break; - } - } - button.set('label', '' + txt + ''); - var _items = button.getMenu().getItems(); - for (var m = 0; m < _items.length; m++) { - if (_items[m].value.toLowerCase() == info.value.toLowerCase()) { - _items[m].cfg.setProperty('checked', true); - } else { - _items[m].cfg.setProperty('checked', false); - } - } - } - } - if (ev) { - Event.stopEvent(ev); - } - } - }, - /** - * @private - * @property _keyNav - * @description Flag to determine if the arrow nav listeners have been attached - * @type Boolean - */ - _keyNav: null, - /** - * @private - * @property _navCounter - * @description Internal counter for walking the buttons in the toolbar with the arrow keys - * @type Number - */ - _navCounter: null, - /** - * @private - * @method _navigateButtons - * @description Handles the navigation/focus of toolbar buttons with the Arrow Keys - * @param {Event} ev The Key Event - */ - _navigateButtons: function(ev) { - switch (ev.keyCode) { - case 37: - case 39: - if (ev.keyCode == 37) { - this._navCounter--; - } else { - this._navCounter++; - } - if (this._navCounter > (this._buttonList.length - 1)) { - this._navCounter = 0; - } - if (this._navCounter < 0) { - this._navCounter = (this._buttonList.length - 1); - } - if (this._buttonList[this._navCounter]) { - var el = this._buttonList[this._navCounter].get('element'); - if (this.browser.ie) { - el = this._buttonList[this._navCounter].get('element').getElementsByTagName('a')[0]; - } - if (this._buttonList[this._navCounter].get('disabled')) { - this._navigateButtons(ev); - } else { - el.focus(); - } - } - break; - } - }, - /** - * @private - * @method _handleFocus - * @description Sets up the listeners for the arrow key navigation - */ - _handleFocus: function() { - if (!this._keyNav) { - var ev = 'keypress'; - if (this.browser.ie) { - ev = 'keydown'; - } - Event.on(this.get('element'), ev, this._navigateButtons, this, true); - this._keyNav = true; - this._navCounter = -1; - } - }, - /** - * @method getButtonById - * @description Gets a button instance from the toolbar by is Dom id. - * @param {String} id The Dom id to query for. - * @return {YAHOO.widget.ToolbarButton} - */ - getButtonById: function(id) { - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - if (this._buttonList[i] && this._buttonList[i].get('id') == id) { - return this._buttonList[i]; - } - } - return false; - }, - /** - * @method getButtonByValue - * @description Gets a button instance or a menuitem instance from the toolbar by it's value. - * @param {String} value The button value to query for. - * @return {YAHOO.widget.ToolbarButton or YAHOO.widget.MenuItem} - */ - getButtonByValue: function(value) { - var _buttons = this.get('buttons'); - if (!_buttons) { - return false; - } - var len = _buttons.length; - for (var i = 0; i < len; i++) { - if (_buttons[i].group !== undefined) { - for (var m = 0; m < _buttons[i].buttons.length; m++) { - if ((_buttons[i].buttons[m].value == value) || (_buttons[i].buttons[m].menucmd == value)) { - return this.getButtonById(_buttons[i].buttons[m].id); - } - if (_buttons[i].buttons[m].menu) { //Menu Button, loop through the values - for (var s = 0; s < _buttons[i].buttons[m].menu.length; s++) { - if (_buttons[i].buttons[m].menu[s].value == value) { - return this.getButtonById(_buttons[i].buttons[m].id); - } - } - } - } - } else { - if ((_buttons[i].value == value) || (_buttons[i].menucmd == value)) { - return this.getButtonById(_buttons[i].id); - } - if (_buttons[i].menu) { //Menu Button, loop through the values - for (var j = 0; j < _buttons[i].menu.length; j++) { - if (_buttons[i].menu[j].value == value) { - return this.getButtonById(_buttons[i].id); - } - } - } - } - } - return false; - }, - /** - * @method getButtonByIndex - * @description Gets a button instance from the toolbar by is index in _buttonList. - * @param {Number} index The index of the button in _buttonList. - * @return {YAHOO.widget.ToolbarButton} - */ - getButtonByIndex: function(index) { - if (this._buttonList[index]) { - return this._buttonList[index]; - } else { - return false; - } - }, - /** - * @method getButtons - * @description Returns an array of buttons in the current toolbar - * @return {Array} - */ - getButtons: function() { - return this._buttonList; - }, - /** - * @method disableButton - * @description Disables a button in the toolbar. - * @param {String/Number} id Disable a button by it's id, index or value. - * @return {Boolean} - */ - disableButton: function(id) { - var button = getButton.call(this, id); - if (button) { - button.set('disabled', true); - } else { - return false; - } - }, - /** - * @method enableButton - * @description Enables a button in the toolbar. - * @param {String/Number} id Enable a button by it's id, index or value. - * @return {Boolean} - */ - enableButton: function(id) { - if (this.get('disabled')) { - return false; - } - var button = getButton.call(this, id); - if (button) { - if (button.get('disabled')) { - button.set('disabled', false); - } - } else { - return false; - } - }, - /** - * @method isSelected - * @description Tells if a button is selected or not. - * @param {String/Number} id A button by it's id, index or value. - * @return {Boolean} - */ - isSelected: function(id) { - var button = getButton.call(this, id); - if (button) { - return button._selected; - } - return false; - }, - /** - * @method selectButton - * @description Selects a button in the toolbar. - * @param {String/Number} id Select a button by it's id, index or value. - * @param {String} value If this is a Menu Button, check this item in the menu - * @return {Boolean} - */ - selectButton: function(id, value) { - var button = getButton.call(this, id); - if (button) { - button.addClass('yui-button-selected'); - button.addClass('yui-button-' + button.get('value') + '-selected'); - button._selected = true; - if (value) { - if (button.buttonType == 'rich') { - var _items = button.getMenu().getItems(); - for (var m = 0; m < _items.length; m++) { - if (_items[m].value == value) { - _items[m].cfg.setProperty('checked', true); - button.set('label', '' + _items[m]._oText.nodeValue + ''); - } else { - _items[m].cfg.setProperty('checked', false); - } - } - } - } - } else { - return false; - } - }, - /** - * @method deselectButton - * @description Deselects a button in the toolbar. - * @param {String/Number} id Deselect a button by it's id, index or value. - * @return {Boolean} - */ - deselectButton: function(id) { - var button = getButton.call(this, id); - if (button) { - button.removeClass('yui-button-selected'); - button.removeClass('yui-button-' + button.get('value') + '-selected'); - button.removeClass('yui-button-hover'); - button._selected = false; - } else { - return false; - } - }, - /** - * @method deselectAllButtons - * @description Deselects all buttons in the toolbar. - * @return {Boolean} - */ - deselectAllButtons: function() { - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.deselectButton(this._buttonList[i]); - } - }, - /** - * @method disableAllButtons - * @description Disables all buttons in the toolbar. - * @return {Boolean} - */ - disableAllButtons: function() { - if (this.get('disabled')) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.disableButton(this._buttonList[i]); - } - }, - /** - * @method enableAllButtons - * @description Enables all buttons in the toolbar. - * @return {Boolean} - */ - enableAllButtons: function() { - if (this.get('disabled')) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - this.enableButton(this._buttonList[i]); - } - }, - /** - * @method resetAllButtons - * @description Resets all buttons to their initial state. - * @param {Object} _ex Except these buttons - * @return {Boolean} - */ - resetAllButtons: function(_ex) { - if (!Lang.isObject(_ex)) { - _ex = {}; - } - if (this.get('disabled') || !this._buttonList) { - return false; - } - var len = this._buttonList.length; - for (var i = 0; i < len; i++) { - var _button = this._buttonList[i]; - if (_button) { - var disabled = _button._configs.disabled._initialConfig.value; - if (_ex[_button.get('id')]) { - this.enableButton(_button); - this.selectButton(_button); - } else { - if (disabled) { - this.disableButton(_button); - } else { - this.enableButton(_button); - } - this.deselectButton(_button); - } - } - } - }, - /** - * @method destroyButton - * @description Destroy a button in the toolbar. - * @param {String/Number} id Destroy a button by it's id or index. - * @return {Boolean} - */ - destroyButton: function(id) { - var button = getButton.call(this, id); - if (button) { - var thisID = button.get('id'), - new_list = [], i = 0, - len = this._buttonList.length; - - button.destroy(); - - for (i = 0; i < len; i++) { - if (this._buttonList[i].get('id') != thisID) { - new_list[new_list.length]= this._buttonList[i]; - } - } - - this._buttonList = new_list; - } else { - return false; - } - }, - /** - * @method destroy - * @description Destroys the toolbar, all of it's elements and objects. - * @return {Boolean} - */ - destroy: function() { - var len = this._configuredButtons.length, j, i; - for(b = 0; b < len; b++) { - this.destroyButton(this._configuredButtons[b]); - } - - this._configuredButtons = null; - - this.get('element').innerHTML = ''; - this.get('element').className = ''; - //Brutal Object Destroy - for (i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - return true; - }, - /** - * @method collapse - * @description Programatically collapse the toolbar. - * @param {Boolean} collapse True to collapse, false to expand. - */ - collapse: function(collapse) { - var el = Dom.getElementsByClassName('collapse', 'span', this._titlebar); - if (collapse === false) { - Dom.removeClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed'); - if (el[0]) { - Dom.removeClass(el[0], 'collapsed'); - el[0].title = this.STR_COLLAPSE; - } - this.fireEvent('toolbarExpanded', { type: 'toolbarExpanded', target: this }); - } else { - if (el[0]) { - Dom.addClass(el[0], 'collapsed'); - el[0].title = this.STR_EXPAND; - } - Dom.addClass(this.get('cont').parentNode, 'yui-toolbar-container-collapsed'); - this.fireEvent('toolbarCollapsed', { type: 'toolbarCollapsed', target: this }); - } - }, - /** - * @method toString - * @description Returns a string representing the toolbar. - * @return {String} - */ - toString: function() { - return 'Toolbar (#' + this.get('element').id + ') with ' + this._buttonList.length + ' buttons.'; - } - }); -/** -* @event buttonClick -* @param {Object} o The object passed to this handler is the button config used to create the button. -* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event valueClick -* @param {Object} o The object passed to this handler is the button config used to create the button. -* @description This is a special dynamic event that is created and dispatched based on the value property -* of the button config. See Element.addListener for more information on listening for this event. -* Example: -*
                  -* buttons : [
                  -*   { type: 'button', value: 'test', value: 'testButton' }
                  -* ]
                  -*
                  -* With the valueClick event you could subscribe to this buttons click event with this: -* tbar.in('testButtonClick', function() { alert('test button clicked'); }) -* @type YAHOO.util.CustomEvent -*/ -/** -* @event toolbarExpanded -* @description Fires when the toolbar is expanded via the collapse button. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event toolbarCollapsed -* @description Fires when the toolbar is collapsed via the collapse button. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -})(); -/** - * @module editor - * @description

                  The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.

                  - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, toolbar - * @optional animation, container_core, resize, dragdrop - */ - -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang, - Toolbar = YAHOO.widget.Toolbar; - - /** - * The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization. - * @constructor - * @class SimpleEditor - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The textarea element to turn into an editor. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - YAHOO.widget.SimpleEditor = function(el, attrs) { - - var o = {}; - if (Lang.isObject(el) && (!el.tagName) && !attrs) { - Lang.augmentObject(o, el); //Break the config reference - el = document.createElement('textarea'); - this.DOMReady = true; - if (o.container) { - var c = Dom.get(o.container); - c.appendChild(el); - } else { - document.body.appendChild(el); - } - } else { - if (attrs) { - Lang.augmentObject(o, attrs); //Break the config reference - } - } - - var oConfig = { - element: null, - attributes: o - }, id = null; - - if (Lang.isString(el)) { - id = el; - } else { - if (oConfig.attributes.id) { - id = oConfig.attributes.id; - } else { - this.DOMReady = true; - id = Dom.generateId(el); - } - } - oConfig.element = el; - - var element_cont = document.createElement('DIV'); - oConfig.attributes.element_cont = new YAHOO.util.Element(element_cont, { - id: id + '_container' - }); - var div = document.createElement('div'); - Dom.addClass(div, 'first-child'); - oConfig.attributes.element_cont.appendChild(div); - - if (!oConfig.attributes.toolbar_cont) { - oConfig.attributes.toolbar_cont = document.createElement('DIV'); - oConfig.attributes.toolbar_cont.id = id + '_toolbar'; - div.appendChild(oConfig.attributes.toolbar_cont); - } - var editorWrapper = document.createElement('DIV'); - div.appendChild(editorWrapper); - oConfig.attributes.editor_wrapper = editorWrapper; - - YAHOO.widget.SimpleEditor.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - - YAHOO.extend(YAHOO.widget.SimpleEditor, YAHOO.util.Element, { - /** - * @private - * @property _resizeConfig - * @description The default config for the Resize Utility - */ - _resizeConfig: { - handles: ['br'], - autoRatio: true, - status: true, - proxy: true, - useShim: true, - setSize: false - }, - /** - * @private - * @method _setupResize - * @description Creates the Resize instance and binds its events. - */ - _setupResize: function() { - if (!YAHOO.util.DD || !YAHOO.util.Resize) { return false; } - if (this.get('resize')) { - var config = {}; - Lang.augmentObject(config, this._resizeConfig); //Break the config reference - this.resize = new YAHOO.util.Resize(this.get('element_cont').get('element'), config); - this.resize.on('resize', function(args) { - var anim = this.get('animate'); - this.set('animate', false); - this.set('width', args.width + 'px'); - var h = args.height, - th = (this.toolbar.get('element').clientHeight + 2), - dh = 0; - if (this.dompath) { - dh = (this.dompath.clientHeight + 1); //It has a 1px top border.. - } - var newH = (h - th - dh); - this.set('height', newH + 'px'); - this.get('element_cont').setStyle('height', ''); - this.set('animate', anim); - }, this, true); - } - }, - /** - * @property resize - * @description A reference to the Resize object - * @type YAHOO.util.Resize - */ - resize: null, - /** - * @private - * @method _setupDD - * @description Sets up the DD instance used from the 'drag' config option. - */ - _setupDD: function() { - if (!YAHOO.util.DD) { return false; } - if (this.get('drag')) { - var d = this.get('drag'), - dd = YAHOO.util.DD; - if (d === 'proxy') { - dd = YAHOO.util.DDProxy; - } - - this.dd = new dd(this.get('element_cont').get('element')); - this.toolbar.addClass('draggable'); - this.dd.setHandleElId(this.toolbar._titlebar); - } - }, - /** - * @property dd - * @description A reference to the DragDrop object. - * @type YAHOO.util.DD/YAHOO.util.DDProxy - */ - dd: null, - /** - * @private - * @property _lastCommand - * @description A cache of the last execCommand (used for Undo/Redo so they don't mark an undo level) - * @type String - */ - _lastCommand: null, - _undoNodeChange: function() {}, - _storeUndo: function() {}, - /** - * @private - * @method _checkKey - * @description Checks a keyMap entry against a key event - * @param {Object} k The _keyMap object - * @param {Event} e The Mouse Event - * @return {Boolean} - */ - _checkKey: function(k, e) { - var ret = false; - if ((e.keyCode === k.key)) { - if (k.mods && (k.mods.length > 0)) { - var val = 0; - for (var i = 0; i < k.mods.length; i++) { - if (this.browser.mac) { - if (k.mods[i] == 'ctrl') { - k.mods[i] = 'meta'; - } - } - if (e[k.mods[i] + 'Key'] === true) { - val++; - } - } - if (val === k.mods.length) { - ret = true; - } - } else { - ret = true; - } - } - return ret; - }, - /** - * @private - * @property _keyMap - * @description Named key maps for various actions in the Editor. Example: CLOSE_WINDOW: { key: 87, mods: ['shift', 'ctrl'] }. - * This entry shows that when key 87 (W) is found with the modifiers of shift and control, the window will close. You can customize this object to tweak keyboard shortcuts. - * @type {Object/Mixed} - */ - _keyMap: { - SELECT_ALL: { - key: 65, //A key - mods: ['ctrl'] - }, - CLOSE_WINDOW: { - key: 87, //W key - mods: ['shift', 'ctrl'] - }, - FOCUS_TOOLBAR: { - key: 27, - mods: ['shift'] - }, - FOCUS_AFTER: { - key: 27 - }, - FONT_SIZE_UP: { - key: 38, - mods: ['shift', 'ctrl'] - }, - FONT_SIZE_DOWN: { - key: 40, - mods: ['shift', 'ctrl'] - }, - CREATE_LINK: { - key: 76, - mods: ['shift', 'ctrl'] - }, - BOLD: { - key: 66, - mods: ['shift', 'ctrl'] - }, - ITALIC: { - key: 73, - mods: ['shift', 'ctrl'] - }, - UNDERLINE: { - key: 85, - mods: ['shift', 'ctrl'] - }, - UNDO: { - key: 90, - mods: ['ctrl'] - }, - REDO: { - key: 90, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_LEFT: { - key: 219, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_CENTER: { - key: 220, - mods: ['shift', 'ctrl'] - }, - JUSTIFY_RIGHT: { - key: 221, - mods: ['shift', 'ctrl'] - } - }, - /** - * @private - * @method _cleanClassName - * @description Makes a useable classname from dynamic data, by dropping it to lowercase and replacing spaces with -'s. - * @param {String} str The classname to clean up - * @return {String} - */ - _cleanClassName: function(str) { - return str.replace(/ /g, '-').toLowerCase(); - }, - /** - * @property _textarea - * @description Flag to determine if we are using a textarea or an HTML Node. - * @type Boolean - */ - _textarea: null, - /** - * @property _docType - * @description The DOCTYPE to use in the editable container. - * @type String - */ - _docType: '', - /** - * @property editorDirty - * @description This flag will be set when certain things in the Editor happen. It is to be used by the developer to check to see if content has changed. - * @type Boolean - */ - editorDirty: null, - /** - * @property _defaultCSS - * @description The default CSS used in the config for 'css'. This way you can add to the config like this: { css: YAHOO.widget.SimpleEditor.prototype._defaultCSS + 'ADD MYY CSS HERE' } - * @type String - */ - _defaultCSS: 'html { height: 95%; } body { padding: 7px; background-color: #fff; font: 13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } .warning-localfile { border-bottom: 1px dashed red !important; } .yui-busy { cursor: wait !important; } img.selected { border: 2px dotted #808080; } img { cursor: pointer !important; border: none; } body.ptags.webkit div.yui-wk-p { margin: 11px 0; } body.ptags.webkit div.yui-wk-div { margin: 0; }', - /** - * @property _defaultToolbar - * @private - * @description Default toolbar config. - * @type Object - */ - _defaultToolbar: null, - /** - * @property _lastButton - * @private - * @description The last button pressed, so we don't disable it. - * @type Object - */ - _lastButton: null, - /** - * @property _baseHREF - * @private - * @description The base location of the editable page (this page) so that relative paths for image work. - * @type String - */ - _baseHREF: function() { - var href = document.location.href; - if (href.indexOf('?') !== -1) { //Remove the query string - href = href.substring(0, href.indexOf('?')); - } - href = href.substring(0, href.lastIndexOf('/')) + '/'; - return href; - }(), - /** - * @property _lastImage - * @private - * @description Safari reference for the last image selected (for styling as selected). - * @type HTMLElement - */ - _lastImage: null, - /** - * @property _blankImageLoaded - * @private - * @description Don't load the blank image more than once.. - * @type Boolean - */ - _blankImageLoaded: null, - /** - * @property _fixNodesTimer - * @private - * @description Holder for the fixNodes timer - * @type Date - */ - _fixNodesTimer: null, - /** - * @property _nodeChangeTimer - * @private - * @description Holds a reference to the nodeChange setTimeout call - * @type Number - */ - _nodeChangeTimer: null, - /** - * @property _nodeChangeDelayTimer - * @private - * @description Holds a reference to the nodeChangeDelay setTimeout call - * @type Number - */ - _nodeChangeDelayTimer: null, - /** - * @property _lastNodeChangeEvent - * @private - * @description Flag to determine the last event that fired a node change - * @type Event - */ - _lastNodeChangeEvent: null, - /** - * @property _lastNodeChange - * @private - * @description Flag to determine when the last node change was fired - * @type Date - */ - _lastNodeChange: 0, - /** - * @property _rendered - * @private - * @description Flag to determine if editor has been rendered or not - * @type Boolean - */ - _rendered: null, - /** - * @property DOMReady - * @private - * @description Flag to determine if DOM is ready or not - * @type Boolean - */ - DOMReady: null, - /** - * @property _selection - * @private - * @description Holder for caching iframe selections - * @type Object - */ - _selection: null, - /** - * @property _mask - * @private - * @description DOM Element holder for the editor Mask when disabled - * @type Object - */ - _mask: null, - /** - * @property _showingHiddenElements - * @private - * @description Status of the hidden elements button - * @type Boolean - */ - _showingHiddenElements: null, - /** - * @property currentWindow - * @description A reference to the currently open EditorWindow - * @type Object - */ - currentWindow: null, - /** - * @property currentEvent - * @description A reference to the current editor event - * @type Event - */ - currentEvent: null, - /** - * @property operaEvent - * @private - * @description setTimeout holder for Opera and Image DoubleClick event.. - * @type Object - */ - operaEvent: null, - /** - * @property currentFont - * @description A reference to the last font selected from the Toolbar - * @type HTMLElement - */ - currentFont: null, - /** - * @property currentElement - * @description A reference to the current working element in the editor - * @type Array - */ - currentElement: null, - /** - * @property dompath - * @description A reference to the dompath container for writing the current working dom path to. - * @type HTMLElement - */ - dompath: null, - /** - * @property beforeElement - * @description A reference to the H2 placed before the editor for Accessibilty. - * @type HTMLElement - */ - beforeElement: null, - /** - * @property afterElement - * @description A reference to the H2 placed after the editor for Accessibilty. - * @type HTMLElement - */ - afterElement: null, - /** - * @property invalidHTML - * @description Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found. If you set the value of a key to "{ keepContents: true }", then the element will be replaced with a yui-non span to be filtered out when cleanHTML is called. The only tag that is ignored here is the span tag as it will force the Editor into a loop and freeze the browser. However.. all of these tags will be removed in the cleanHTML routine. - * @type Object - */ - invalidHTML: { - form: true, - input: true, - button: true, - select: true, - link: true, - html: true, - body: true, - iframe: true, - script: true, - style: true, - textarea: true - }, - /** - * @property toolbar - * @description Local property containing the YAHOO.widget.Toolbar instance - * @type YAHOO.widget.Toolbar - */ - toolbar: null, - /** - * @private - * @property _contentTimer - * @description setTimeout holder for documentReady check - */ - _contentTimer: null, - /** - * @private - * @property _contentTimerMax - * @description The number of times the loaded content should be checked before giving up. Default: 500 - */ - _contentTimerMax: 500, - /** - * @private - * @property _contentTimerCounter - * @description Counter to check the number of times the body is polled for before giving up - * @type Number - */ - _contentTimerCounter: 0, - /** - * @private - * @property _disabled - * @description The Toolbar items that should be disabled if there is no selection present in the editor. - * @type Array - */ - _disabled: [ 'createlink', 'fontname', 'fontsize', 'forecolor', 'backcolor' ], - /** - * @private - * @property _alwaysDisabled - * @description The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor. - * @type Object - */ - _alwaysDisabled: { undo: true, redo: true }, - /** - * @private - * @property _alwaysEnabled - * @description The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor. - * @type Object - */ - _alwaysEnabled: { }, - /** - * @private - * @property _semantic - * @description The Toolbar commands that we should attempt to make tags out of instead of using styles. - * @type Object - */ - _semantic: { 'bold': true, 'italic' : true, 'underline' : true }, - /** - * @private - * @property _tag2cmd - * @description A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button. - * @type Object - */ - _tag2cmd: { - 'b': 'bold', - 'strong': 'bold', - 'i': 'italic', - 'em': 'italic', - 'u': 'underline', - 'sup': 'superscript', - 'sub': 'subscript', - 'img': 'insertimage', - 'a' : 'createlink', - 'ul' : 'insertunorderedlist', - 'ol' : 'insertorderedlist' - }, - - /** - * @private _createIframe - * @description Creates the DOM and YUI Element for the iFrame editor area. - * @param {String} id The string ID to prefix the iframe with - * @return {Object} iFrame object - */ - _createIframe: function() { - var ifrmDom = document.createElement('iframe'); - ifrmDom.id = this.get('id') + '_editor'; - var config = { - border: '0', - frameBorder: '0', - marginWidth: '0', - marginHeight: '0', - leftMargin: '0', - topMargin: '0', - allowTransparency: 'true', - width: '100%' - }; - if (this.get('autoHeight')) { - config.scrolling = 'no'; - } - for (var i in config) { - if (Lang.hasOwnProperty(config, i)) { - ifrmDom.setAttribute(i, config[i]); - } - } - var isrc = 'javascript:;'; - if (this.browser.ie) { - //isrc = 'about:blank'; - //TODO - Check this, I have changed it before.. - isrc = 'javascript:false;'; - } - ifrmDom.setAttribute('src', isrc); - var ifrm = new YAHOO.util.Element(ifrmDom); - ifrm.setStyle('visibility', 'hidden'); - return ifrm; - }, - /** - * @private _isElement - * @description Checks to see if an Element reference is a valid one and has a certain tag type - * @param {HTMLElement} el The element to check - * @param {String} tag The tag that the element needs to be - * @return {Boolean} - */ - _isElement: function(el, tag) { - if (el && el.tagName && (el.tagName.toLowerCase() == tag)) { - return true; - } - if (el && el.getAttribute && (el.getAttribute('tag') == tag)) { - return true; - } - return false; - }, - /** - * @private _hasParent - * @description Checks to see if an Element reference or one of it's parents is a valid one and has a certain tag type - * @param {HTMLElement} el The element to check - * @param {String} tag The tag that the element needs to be - * @return HTMLElement - */ - _hasParent: function(el, tag) { - if (!el || !el.parentNode) { - return false; - } - - while (el.parentNode) { - if (this._isElement(el, tag)) { - return el; - } - if (el.parentNode) { - el = el.parentNode; - } else { - return false; - } - } - return false; - }, - /** - * @private - * @method _getDoc - * @description Get the Document of the IFRAME - * @return {Object} - */ - _getDoc: function() { - var value = false; - try { - if (this.get('iframe').get('element').contentWindow.document) { - value = this.get('iframe').get('element').contentWindow.document; - return value; - } - } catch (e) { - return false; - } - }, - /** - * @private - * @method _getWindow - * @description Get the Window of the IFRAME - * @return {Object} - */ - _getWindow: function() { - return this.get('iframe').get('element').contentWindow; - }, - /** - * @method focus - * @description Attempt to set the focus of the iframes window. - */ - focus: function() { - this._getWindow().focus(); - }, - /** - * @private - * @depreciated - This should not be used, moved to this.focus(); - * @method _focusWindow - * @description Attempt to set the focus of the iframes window. - */ - _focusWindow: function() { - this.focus(); - }, - /** - * @private - * @method _hasSelection - * @description Determines if there is a selection in the editor document. - * @return {Boolean} - */ - _hasSelection: function() { - var sel = this._getSelection(); - var range = this._getRange(); - var hasSel = false; - - if (!sel || !range) { - return hasSel; - } - - //Internet Explorer - if (this.browser.ie || this.browser.opera) { - if (range.text) { - hasSel = true; - } - if (range.html) { - hasSel = true; - } - } else { - if (this.browser.webkit) { - if (sel+'' !== '') { - hasSel = true; - } - } else { - if (sel && (sel.toString() !== '') && (sel !== undefined)) { - hasSel = true; - } - } - } - return hasSel; - }, - /** - * @private - * @method _getSelection - * @description Handles the different selection objects across the A-Grade list. - * @return {Object} Selection Object - */ - _getSelection: function() { - var _sel = null; - if (this._getDoc() && this._getWindow()) { - if (this._getDoc().selection) { - _sel = this._getDoc().selection; - } else { - _sel = this._getWindow().getSelection(); - } - //Handle Safari's lack of Selection Object - if (this.browser.webkit) { - if (_sel.baseNode) { - this._selection = {}; - this._selection.baseNode = _sel.baseNode; - this._selection.baseOffset = _sel.baseOffset; - this._selection.extentNode = _sel.extentNode; - this._selection.extentOffset = _sel.extentOffset; - } else if (this._selection !== null) { - _sel = this._getWindow().getSelection(); - _sel.setBaseAndExtent( - this._selection.baseNode, - this._selection.baseOffset, - this._selection.extentNode, - this._selection.extentOffset); - this._selection = null; - } - } - } - return _sel; - }, - /** - * @private - * @method _selectNode - * @description Places the highlight around a given node - * @param {HTMLElement} node The node to select - */ - _selectNode: function(node, collapse) { - if (!node) { - return false; - } - var sel = this._getSelection(), - range = null; - - if (this.browser.ie) { - try { //IE freaks out here sometimes.. - range = this._getDoc().body.createTextRange(); - range.moveToElementText(node); - range.select(); - } catch (e) { - } - } else if (this.browser.webkit) { - if (collapse) { - sel.setBaseAndExtent(node, 1, node, node.innerText.length); - } else { - sel.setBaseAndExtent(node, 0, node, node.innerText.length); - } - } else if (this.browser.opera) { - sel = this._getWindow().getSelection(); - range = this._getDoc().createRange(); - range.selectNode(node); - sel.removeAllRanges(); - sel.addRange(range); - } else { - range = this._getDoc().createRange(); - range.selectNodeContents(node); - sel.removeAllRanges(); - sel.addRange(range); - } - //TODO - Check Performance - this.nodeChange(); - }, - /** - * @private - * @method _getRange - * @description Handles the different range objects across the A-Grade list. - * @return {Object} Range Object - */ - _getRange: function() { - var sel = this._getSelection(); - - if (sel === null) { - return null; - } - - if (this.browser.webkit && !sel.getRangeAt) { - var _range = this._getDoc().createRange(); - try { - _range.setStart(sel.anchorNode, sel.anchorOffset); - _range.setEnd(sel.focusNode, sel.focusOffset); - } catch (e) { - _range = this._getWindow().getSelection()+''; - } - return _range; - } - - if (this.browser.ie || this.browser.opera) { - try { - return sel.createRange(); - } catch (e2) { - return null; - } - } - - if (sel.rangeCount > 0) { - return sel.getRangeAt(0); - } - return null; - }, - /** - * @private - * @method _setDesignMode - * @description Sets the designMode property of the iFrame document's body. - * @param {String} state This should be either on or off - */ - _setDesignMode: function(state) { - if (this.get('setDesignMode')) { - try { - this._getDoc().designMode = ((state.toLowerCase() == 'off') ? 'off' : 'on'); - } catch(e) { } - } - }, - /** - * @private - * @method _toggleDesignMode - * @description Toggles the designMode property of the iFrame document on and off. - * @return {String} The state that it was set to. - */ - _toggleDesignMode: function() { - var _dMode = this._getDoc().designMode, - _state = ((_dMode.toLowerCase() == 'on') ? 'off' : 'on'); - this._setDesignMode(_state); - return _state; - }, - /** - * @private - * @property _focused - * @description Holder for trapping focus/blur state and prevent double events - * @type Boolean - */ - _focused: null, - /** - * @private - * @method _handleFocus - * @description Handles the focus of the iframe. Note, this is window focus event, not an Editor focus event. - * @param {Event} e The DOM Event - */ - _handleFocus: function(e) { - if (!this._focused) { - this._focused = true; - this.fireEvent('editorWindowFocus', { type: 'editorWindowFocus', target: this }); - } - }, - /** - * @private - * @method _handleBlur - * @description Handles the blur of the iframe. Note, this is window blur event, not an Editor blur event. - * @param {Event} e The DOM Event - */ - _handleBlur: function(e) { - if (this._focused) { - this._focused = false; - this.fireEvent('editorWindowBlur', { type: 'editorWindowBlur', target: this }); - } - }, - /** - * @private - * @method _initEditorEvents - * @description This method sets up the listeners on the Editors document. - */ - _initEditorEvents: function() { - //Setup Listeners on iFrame - var doc = this._getDoc(), - win = this._getWindow(); - - Event.on(doc, 'mouseup', this._handleMouseUp, this, true); - Event.on(doc, 'mousedown', this._handleMouseDown, this, true); - Event.on(doc, 'click', this._handleClick, this, true); - Event.on(doc, 'dblclick', this._handleDoubleClick, this, true); - Event.on(doc, 'keypress', this._handleKeyPress, this, true); - Event.on(doc, 'keyup', this._handleKeyUp, this, true); - Event.on(doc, 'keydown', this._handleKeyDown, this, true); - /* TODO -- Everyone but Opera works here.. - Event.on(doc, 'paste', function() { - }, this, true); - */ - - //Focus and blur.. - Event.on(win, 'focus', this._handleFocus, this, true); - Event.on(win, 'blur', this._handleBlur, this, true); - }, - /** - * @private - * @method _removeEditorEvents - * @description This method removes the listeners on the Editors document (for disabling). - */ - _removeEditorEvents: function() { - //Remove Listeners on iFrame - var doc = this._getDoc(), - win = this._getWindow(); - - Event.removeListener(doc, 'mouseup', this._handleMouseUp, this, true); - Event.removeListener(doc, 'mousedown', this._handleMouseDown, this, true); - Event.removeListener(doc, 'click', this._handleClick, this, true); - Event.removeListener(doc, 'dblclick', this._handleDoubleClick, this, true); - Event.removeListener(doc, 'keypress', this._handleKeyPress, this, true); - Event.removeListener(doc, 'keyup', this._handleKeyUp, this, true); - Event.removeListener(doc, 'keydown', this._handleKeyDown, this, true); - - //Focus and blur.. - Event.removeListener(win, 'focus', this._handleFocus, this, true); - Event.removeListener(win, 'blur', this._handleBlur, this, true); - }, - _fixWebkitDivs: function() { - if (this.browser.webkit) { - var divs = this._getDoc().body.getElementsByTagName('div'); - Dom.addClass(divs, 'yui-wk-div'); - } - }, - /** - * @private - * @method _initEditor - * @param {Boolean} raw Don't add events. - * @description This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners. - */ - _initEditor: function(raw) { - if (this._editorInit) { - return; - } - this._editorInit = true; - if (this.browser.ie) { - this._getDoc().body.style.margin = '0'; - } - if (!this.get('disabled')) { - this._setDesignMode('on'); - this._contentTimerCounter = 0; - } - if (!this._getDoc().body) { - this._contentTimerCounter = 0; - this._editorInit = false; - this._checkLoaded(); - return false; - } - - if (!raw) { - this.toolbar.on('buttonClick', this._handleToolbarClick, this, true); - } - if (!this.get('disabled')) { - this._initEditorEvents(); - this.toolbar.set('disabled', false); - } - - if (raw) { - this.fireEvent('editorContentReloaded', { type: 'editorreloaded', target: this }); - } else { - this.fireEvent('editorContentLoaded', { type: 'editorLoaded', target: this }); - } - this._fixWebkitDivs(); - if (this.get('dompath')) { - var self = this; - setTimeout(function() { - self._writeDomPath.call(self); - self._setupResize.call(self); - }, 150); - } - var br = []; - for (var i in this.browser) { - if (this.browser[i]) { - br.push(i); - } - } - if (this.get('ptags')) { - br.push('ptags'); - } - Dom.addClass(this._getDoc().body, br.join(' ')); - this.nodeChange(true); - }, - /** - * @private - * @method _checkLoaded - * @param {Boolean} raw Don't add events. - * @description Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor. - */ - _checkLoaded: function(raw) { - this._editorInit = false; - this._contentTimerCounter++; - if (this._contentTimer) { - clearTimeout(this._contentTimer); - } - if (this._contentTimerCounter > this._contentTimerMax) { - return false; - } - var init = false; - try { - if (this._getDoc() && this._getDoc().body) { - if (this.browser.ie) { - if (this._getDoc().body.readyState == 'complete') { - init = true; - } - } else { - if (this._getDoc().body._rteLoaded === true) { - init = true; - } - } - } - } catch (e) { - init = false; - } - - if (init === true) { - //The onload event has fired, clean up after ourselves and fire the _initEditor method - this._initEditor(raw); - } else { - var self = this; - this._contentTimer = setTimeout(function() { - self._checkLoaded.call(self, raw); - }, 20); - } - }, - /** - * @private - * @method _setInitialContent - * @param {Boolean} raw Don't add events. - * @description This method will open the iframes content document and write the textareas value into it, then start the body.onload checking. - */ - _setInitialContent: function(raw) { - - var value = ((this._textarea) ? this.get('element').value : this.get('element').innerHTML), - doc = null; - - if (value === '') { - value = '
                  '; - } - - var html = Lang.substitute(this.get('html'), { - TITLE: this.STR_TITLE, - CONTENT: this._cleanIncomingHTML(value), - CSS: this.get('css'), - HIDDEN_CSS: ((this.get('hiddencss')) ? this.get('hiddencss') : '/* No Hidden CSS */'), - EXTRA_CSS: ((this.get('extracss')) ? this.get('extracss') : '/* No Extra CSS */') - }), - check = true; - - html = html.replace(/RIGHT_BRACKET/gi, '{'); - html = html.replace(/LEFT_BRACKET/gi, '}'); - - if (document.compatMode != 'BackCompat') { - html = this._docType + "\n" + html; - } else { - } - - if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1)) { - //Firefox 1.5 doesn't like setting designMode on an document created with a data url - try { - //Adobe AIR Code - if (this.browser.air) { - doc = this._getDoc().implementation.createHTMLDocument(); - var origDoc = this._getDoc(); - origDoc.open(); - origDoc.close(); - doc.open(); - doc.write(html); - doc.close(); - var node = origDoc.importNode(doc.getElementsByTagName("html")[0], true); - origDoc.replaceChild(node, origDoc.getElementsByTagName("html")[0]); - origDoc.body._rteLoaded = true; - } else { - doc = this._getDoc(); - doc.open(); - doc.write(html); - doc.close(); - } - } catch (e) { - //Safari will only be here if we are hidden - check = false; - } - } else { - //This keeps Firefox 2 from writing the iframe to history preserving the back buttons functionality - this.get('iframe').get('element').src = 'data:text/html;charset=utf-8,' + encodeURIComponent(html); - } - this.get('iframe').setStyle('visibility', ''); - if (check) { - this._checkLoaded(raw); - } - }, - /** - * @private - * @method _setMarkupType - * @param {String} action The action to take. Possible values are: css, default or semantic - * @description This method will turn on/off the useCSS execCommand. - */ - _setMarkupType: function(action) { - switch (this.get('markup')) { - case 'css': - this._setEditorStyle(true); - break; - case 'default': - this._setEditorStyle(false); - break; - case 'semantic': - case 'xhtml': - if (this._semantic[action]) { - this._setEditorStyle(false); - } else { - this._setEditorStyle(true); - } - break; - } - }, - /** - * Set the editor to use CSS instead of HTML - * @param {Booleen} stat True/False - */ - _setEditorStyle: function(stat) { - try { - this._getDoc().execCommand('useCSS', false, !stat); - } catch (ex) { - } - }, - /** - * @private - * @method _getSelectedElement - * @description This method will attempt to locate the element that was last interacted with, either via selection, location or event. - * @return {HTMLElement} The currently selected element. - */ - _getSelectedElement: function() { - var doc = this._getDoc(), - range = null, - sel = null, - elm = null, - check = true; - - if (this.browser.ie) { - this.currentEvent = this._getWindow().event; //Event utility assumes window.event, so we need to reset it to this._getWindow().event; - range = this._getRange(); - if (range) { - elm = range.item ? range.item(0) : range.parentElement(); - if (this._hasSelection()) { - //TODO - //WTF.. Why can't I get an element reference here?!??! - } - if (elm === doc.body) { - elm = null; - } - } - if ((this.currentEvent !== null) && (this.currentEvent.keyCode === 0)) { - elm = Event.getTarget(this.currentEvent); - } - } else { - sel = this._getSelection(); - range = this._getRange(); - - if (!sel || !range) { - return null; - } - //TODO - if (!this._hasSelection() && this.browser.webkit3) { - //check = false; - } - if (this.browser.gecko) { - //Added in 2.6.0 - if (range.startContainer) { - if (range.startContainer.nodeType === 3) { - elm = range.startContainer.parentNode; - } else if (range.startContainer.nodeType === 1) { - elm = range.startContainer; - } - //Added in 2.7.0 - if (this.currentEvent) { - var tar = Event.getTarget(this.currentEvent); - if (!this._isElement(tar, 'html')) { - if (elm !== tar) { - elm = tar; - } - } - } - } - } - - if (check) { - if (sel.anchorNode && (sel.anchorNode.nodeType == 3)) { - if (sel.anchorNode.parentNode) { //next check parentNode - elm = sel.anchorNode.parentNode; - } - if (sel.anchorNode.nextSibling != sel.focusNode.nextSibling) { - elm = sel.anchorNode.nextSibling; - } - } - if (this._isElement(elm, 'br')) { - elm = null; - } - if (!elm) { - elm = range.commonAncestorContainer; - if (!range.collapsed) { - if (range.startContainer == range.endContainer) { - if (range.startOffset - range.endOffset < 2) { - if (range.startContainer.hasChildNodes()) { - elm = range.startContainer.childNodes[range.startOffset]; - } - } - } - } - } - } - } - - if (this.currentEvent !== null) { - try { - switch (this.currentEvent.type) { - case 'click': - case 'mousedown': - case 'mouseup': - if (this.browser.webkit) { - elm = Event.getTarget(this.currentEvent); - } - break; - default: - //Do nothing - break; - } - } catch (e) { - } - } else if ((this.currentElement && this.currentElement[0]) && (!this.browser.ie)) { - //TODO is this still needed? - //elm = this.currentElement[0]; - } - - - if (this.browser.opera || this.browser.webkit) { - if (this.currentEvent && !elm) { - elm = YAHOO.util.Event.getTarget(this.currentEvent); - } - } - if (!elm || !elm.tagName) { - elm = doc.body; - } - if (this._isElement(elm, 'html')) { - //Safari sometimes gives us the HTML node back.. - elm = doc.body; - } - if (this._isElement(elm, 'body')) { - //make sure that body means this body not the parent.. - elm = doc.body; - } - if (elm && !elm.parentNode) { //Not in document - elm = doc.body; - } - if (elm === undefined) { - elm = null; - } - return elm; - }, - /** - * @private - * @method _getDomPath - * @description This method will attempt to build the DOM path from the currently selected element. - * @param HTMLElement el The element to start with, if not provided _getSelectedElement is used - * @return {Array} An array of node references that will create the DOM Path. - */ - _getDomPath: function(el) { - if (!el) { - el = this._getSelectedElement(); - } - var domPath = []; - while (el !== null) { - if (el.ownerDocument != this._getDoc()) { - el = null; - break; - } - //Check to see if we get el.nodeName and nodeType - if (el.nodeName && el.nodeType && (el.nodeType == 1)) { - domPath[domPath.length] = el; - } - - if (this._isElement(el, 'body')) { - break; - } - - el = el.parentNode; - } - if (domPath.length === 0) { - if (this._getDoc() && this._getDoc().body) { - domPath[0] = this._getDoc().body; - } - } - return domPath.reverse(); - }, - /** - * @private - * @method _writeDomPath - * @description Write the current DOM path out to the dompath container below the editor. - */ - _writeDomPath: function() { - var path = this._getDomPath(), - pathArr = [], - classPath = '', - pathStr = ''; - - for (var i = 0; i < path.length; i++) { - var tag = path[i].tagName.toLowerCase(); - if ((tag == 'ol') && (path[i].type)) { - tag += ':' + path[i].type; - } - if (Dom.hasClass(path[i], 'yui-tag')) { - tag = path[i].getAttribute('tag'); - } - if ((this.get('markup') == 'semantic') || (this.get('markup') == 'xhtml')) { - switch (tag) { - case 'b': tag = 'strong'; break; - case 'i': tag = 'em'; break; - } - } - if (!Dom.hasClass(path[i], 'yui-non')) { - if (Dom.hasClass(path[i], 'yui-tag')) { - pathStr = tag; - } else { - classPath = ((path[i].className !== '') ? '.' + path[i].className.replace(/ /g, '.') : ''); - if ((classPath.indexOf('yui') != -1) || (classPath.toLowerCase().indexOf('apple-style-span') != -1)) { - classPath = ''; - } - pathStr = tag + ((path[i].id) ? '#' + path[i].id : '') + classPath; - } - switch (tag) { - case 'body': - pathStr = 'body'; - break; - case 'a': - if (path[i].getAttribute('href', 2)) { - pathStr += ':' + path[i].getAttribute('href', 2).replace('mailto:', '').replace('http:/'+'/', '').replace('https:/'+'/', ''); //May need to add others here ftp - } - break; - case 'img': - var h = path[i].height; - var w = path[i].width; - if (path[i].style.height) { - h = parseInt(path[i].style.height, 10); - } - if (path[i].style.width) { - w = parseInt(path[i].style.width, 10); - } - pathStr += '(' + w + 'x' + h + ')'; - break; - } - - if (pathStr.length > 10) { - pathStr = '' + pathStr.substring(0, 10) + '...' + ''; - } else { - pathStr = '' + pathStr + ''; - } - pathArr[pathArr.length] = pathStr; - } - } - var str = pathArr.join(' ' + this.SEP_DOMPATH + ' '); - //Prevent flickering - if (this.dompath.innerHTML != str) { - this.dompath.innerHTML = str; - } - }, - /** - * @private - * @method _fixNodes - * @description Fix href and imgs as well as remove invalid HTML. - */ - _fixNodes: function() { - try { - var doc = this._getDoc(), - els = []; - - for (var v in this.invalidHTML) { - if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) { - if (v.toLowerCase() != 'span') { - var tags = doc.body.getElementsByTagName(v); - if (tags.length) { - for (var i = 0; i < tags.length; i++) { - els.push(tags[i]); - } - } - } - } - } - for (var h = 0; h < els.length; h++) { - if (els[h].parentNode) { - if (Lang.isObject(this.invalidHTML[els[h].tagName.toLowerCase()]) && this.invalidHTML[els[h].tagName.toLowerCase()].keepContents) { - this._swapEl(els[h], 'span', function(el) { - el.className = 'yui-non'; - }); - } else { - els[h].parentNode.removeChild(els[h]); - } - } - } - var imgs = this._getDoc().getElementsByTagName('img'); - Dom.addClass(imgs, 'yui-img'); - } catch(e) {} - }, - /** - * @private - * @method _isNonEditable - * @param Event ev The Dom event being checked - * @description Method is called at the beginning of all event handlers to check if this element or a parent element has the class yui-noedit (this.CLASS_NOEDIT) applied. - * If it does, then this method will stop the event and return true. The event handlers will then return false and stop the nodeChange from occuring. This method will also - * disable and enable the Editor's toolbar based on the noedit state. - * @return Boolean - */ - _isNonEditable: function(ev) { - if (this.get('allowNoEdit')) { - var el = Event.getTarget(ev); - if (this._isElement(el, 'html')) { - el = null; - } - var path = this._getDomPath(el); - for (var i = (path.length - 1); i > -1; i--) { - if (Dom.hasClass(path[i], this.CLASS_NOEDIT)) { - //if (this.toolbar.get('disabled') === false) { - // this.toolbar.set('disabled', true); - //} - try { - this._getDoc().execCommand('enableObjectResizing', false, 'false'); - } catch (e) {} - this.nodeChange(); - Event.stopEvent(ev); - return true; - } - } - //if (this.toolbar.get('disabled') === true) { - //Should only happen once.. - //this.toolbar.set('disabled', false); - try { - this._getDoc().execCommand('enableObjectResizing', false, 'true'); - } catch (e2) {} - //} - } - return false; - }, - /** - * @private - * @method _setCurrentEvent - * @param {Event} ev The event to cache - * @description Sets the current event property - */ - _setCurrentEvent: function(ev) { - this.currentEvent = ev; - }, - /** - * @private - * @method _handleClick - * @param {Event} ev The event we are working on. - * @description Handles all click events inside the iFrame document. - */ - _handleClick: function(ev) { - var ret = this.fireEvent('beforeEditorClick', { type: 'beforeEditorClick', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - if (this.currentWindow) { - this.closeWindow(); - } - if (this.currentWindow) { - this.closeWindow(); - } - if (this.browser.webkit) { - var tar =Event.getTarget(ev); - if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) { - Event.stopEvent(ev); - this.nodeChange(); - } - } else { - this.nodeChange(); - } - this.fireEvent('editorClick', { type: 'editorClick', target: this, ev: ev }); - }, - /** - * @private - * @method _handleMouseUp - * @param {Event} ev The event we are working on. - * @description Handles all mouseup events inside the iFrame document. - */ - _handleMouseUp: function(ev) { - var ret = this.fireEvent('beforeEditorMouseUp', { type: 'beforeEditorMouseUp', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - //Don't set current event for mouseup. - //It get's fired after a menu is closed and gives up a bogus event to work with - //this._setCurrentEvent(ev); - var self = this; - if (this.browser.opera) { - /* - * @knownissue Opera appears to stop the MouseDown, Click and DoubleClick events on an image inside of a document with designMode on.. - * @browser Opera - * @description This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event. - */ - var sel = Event.getTarget(ev); - if (this._isElement(sel, 'img')) { - this.nodeChange(); - if (this.operaEvent) { - clearTimeout(this.operaEvent); - this.operaEvent = null; - this._handleDoubleClick(ev); - } else { - this.operaEvent = window.setTimeout(function() { - self.operaEvent = false; - }, 700); - } - } - } - //This will stop Safari from selecting the entire document if you select all the text in the editor - if (this.browser.webkit || this.browser.opera) { - if (this.browser.webkit) { - Event.stopEvent(ev); - } - } - this.nodeChange(); - this.fireEvent('editorMouseUp', { type: 'editorMouseUp', target: this, ev: ev }); - }, - /** - * @private - * @method _handleMouseDown - * @param {Event} ev The event we are working on. - * @description Handles all mousedown events inside the iFrame document. - */ - _handleMouseDown: function(ev) { - var ret = this.fireEvent('beforeEditorMouseDown', { type: 'beforeEditorMouseDown', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - var sel = Event.getTarget(ev); - if (this.browser.webkit && this._hasSelection()) { - var _sel = this._getSelection(); - if (!this.browser.webkit3) { - _sel.collapse(true); - } else { - _sel.collapseToStart(); - } - } - if (this.browser.webkit && this._lastImage) { - Dom.removeClass(this._lastImage, 'selected'); - this._lastImage = null; - } - if (this._isElement(sel, 'img') || this._isElement(sel, 'a')) { - if (this.browser.webkit) { - Event.stopEvent(ev); - if (this._isElement(sel, 'img')) { - Dom.addClass(sel, 'selected'); - this._lastImage = sel; - } - } - if (this.currentWindow) { - this.closeWindow(); - } - this.nodeChange(); - } - this.fireEvent('editorMouseDown', { type: 'editorMouseDown', target: this, ev: ev }); - }, - /** - * @private - * @method _handleDoubleClick - * @param {Event} ev The event we are working on. - * @description Handles all doubleclick events inside the iFrame document. - */ - _handleDoubleClick: function(ev) { - var ret = this.fireEvent('beforeEditorDoubleClick', { type: 'beforeEditorDoubleClick', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - var sel = Event.getTarget(ev); - if (this._isElement(sel, 'img')) { - this.currentElement[0] = sel; - this.toolbar.fireEvent('insertimageClick', { type: 'insertimageClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - } else if (this._hasParent(sel, 'a')) { //Handle elements inside an a - this.currentElement[0] = this._hasParent(sel, 'a'); - this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - } - this.nodeChange(); - this.fireEvent('editorDoubleClick', { type: 'editorDoubleClick', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyUp - * @param {Event} ev The event we are working on. - * @description Handles all keyup events inside the iFrame document. - */ - _handleKeyUp: function(ev) { - var ret = this.fireEvent('beforeEditorKeyUp', { type: 'beforeEditorKeyUp', target: this, ev: ev }); - if (ret === false) { - return false; - } - if (this._isNonEditable(ev)) { - return false; - } - this._storeUndo(); - this._setCurrentEvent(ev); - switch (ev.keyCode) { - case this._keyMap.SELECT_ALL.key: - if (this._checkKey(this._keyMap.SELECT_ALL, ev)) { - this.nodeChange(); - } - break; - case 32: //Space Bar - case 35: //End - case 36: //Home - case 37: //Left Arrow - case 38: //Up Arrow - case 39: //Right Arrow - case 40: //Down Arrow - case 46: //Forward Delete - case 8: //Delete - case this._keyMap.CLOSE_WINDOW.key: //W key if window is open - if ((ev.keyCode == this._keyMap.CLOSE_WINDOW.key) && this.currentWindow) { - if (this._checkKey(this._keyMap.CLOSE_WINDOW, ev)) { - this.closeWindow(); - } - } else { - if (!this.browser.ie) { - if (this._nodeChangeTimer) { - clearTimeout(this._nodeChangeTimer); - } - var self = this; - this._nodeChangeTimer = setTimeout(function() { - self._nodeChangeTimer = null; - self.nodeChange.call(self); - }, 100); - } else { - this.nodeChange(); - } - this.editorDirty = true; - } - break; - } - this.fireEvent('editorKeyUp', { type: 'editorKeyUp', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyPress - * @param {Event} ev The event we are working on. - * @description Handles all keypress events inside the iFrame document. - */ - _handleKeyPress: function(ev) { - var ret = this.fireEvent('beforeEditorKeyPress', { type: 'beforeEditorKeyPress', target: this, ev: ev }); - if (ret === false) { - return false; - } - - if (this.get('allowNoEdit')) { - //if (ev && ev.keyCode && ((ev.keyCode == 46) || ev.keyCode == 63272)) { - if (ev && ev.keyCode && (ev.keyCode == 63272)) { - //Forward delete key - Event.stopEvent(ev); - } - } - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - this._storeUndo(); - if (this.browser.opera) { - if (ev.keyCode === 13) { - var tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - this.execCommand('inserthtml', '
                  '); - Event.stopEvent(ev); - } - } - } - if (this.browser.webkit) { - if (!this.browser.webkit3) { - if (ev.keyCode && (ev.keyCode == 122) && (ev.metaKey)) { - //This is CMD + z (for undo) - if (this._hasParent(this._getSelectedElement(), 'li')) { - Event.stopEvent(ev); - } - } - } - this._listFix(ev); - } - this._fixListDupIds(); - this.fireEvent('editorKeyPress', { type: 'editorKeyPress', target: this, ev: ev }); - }, - /** - * @private - * @method _handleKeyDown - * @param {Event} ev The event we are working on. - * @description Handles all keydown events inside the iFrame document. - */ - _handleKeyDown: function(ev) { - var ret = this.fireEvent('beforeEditorKeyDown', { type: 'beforeEditorKeyDown', target: this, ev: ev }); - if (ret === false) { - return false; - } - var tar = null, _range = null; - if (this._isNonEditable(ev)) { - return false; - } - this._setCurrentEvent(ev); - if (this.currentWindow) { - this.closeWindow(); - } - if (this.currentWindow) { - this.closeWindow(); - } - var doExec = false, - action = null, - value = null, - exec = false; - - - switch (ev.keyCode) { - case this._keyMap.FOCUS_TOOLBAR.key: - if (this._checkKey(this._keyMap.FOCUS_TOOLBAR, ev)) { - var h = this.toolbar.getElementsByTagName('h2')[0]; - if (h && h.firstChild) { - h.firstChild.focus(); - } - } else if (this._checkKey(this._keyMap.FOCUS_AFTER, ev)) { - //Focus After Element - Esc - this.afterElement.focus(); - } - Event.stopEvent(ev); - doExec = false; - break; - //case 76: //L - case this._keyMap.CREATE_LINK.key: //L - if (this._hasSelection()) { - if (this._checkKey(this._keyMap.CREATE_LINK, ev)) { - var makeLink = true; - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - makeLink = false; - } - } - if (makeLink) { - this.execCommand('createlink', ''); - this.toolbar.fireEvent('createlinkClick', { type: 'createlinkClick', target: this.toolbar }); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - doExec = false; - } - } - } - break; - //case 90: //Z - case this._keyMap.UNDO.key: - case this._keyMap.REDO.key: - if (this._checkKey(this._keyMap.REDO, ev)) { - action = 'redo'; - doExec = true; - } else if (this._checkKey(this._keyMap.UNDO, ev)) { - action = 'undo'; - doExec = true; - } - break; - //case 66: //B - case this._keyMap.BOLD.key: - if (this._checkKey(this._keyMap.BOLD, ev)) { - action = 'bold'; - doExec = true; - } - break; - case this._keyMap.FONT_SIZE_UP.key: - case this._keyMap.FONT_SIZE_DOWN.key: - var uk = false, dk = false; - if (this._checkKey(this._keyMap.FONT_SIZE_UP, ev)) { - uk = true; - } - if (this._checkKey(this._keyMap.FONT_SIZE_DOWN, ev)) { - dk = true; - } - if (uk || dk) { - var fs_button = this.toolbar.getButtonByValue('fontsize'), - label = parseInt(fs_button.get('label'), 10), - newValue = (label + 1); - - if (dk) { - newValue = (label - 1); - } - - action = 'fontsize'; - value = newValue + 'px'; - doExec = true; - } - break; - //case 73: //I - case this._keyMap.ITALIC.key: - if (this._checkKey(this._keyMap.ITALIC, ev)) { - action = 'italic'; - doExec = true; - } - break; - //case 85: //U - case this._keyMap.UNDERLINE.key: - if (this._checkKey(this._keyMap.UNDERLINE, ev)) { - action = 'underline'; - doExec = true; - } - break; - case 9: - if (this.browser.ie) { - //Insert a tab in Internet Explorer - _range = this._getRange(); - tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - if (_range) { - _range.pasteHTML('    '); - _range.collapse(false); - _range.select(); - } - Event.stopEvent(ev); - } - } - //Firefox 3 code - if (this.browser.gecko > 1.8) { - tar = this._getSelectedElement(); - if (this._isElement(tar, 'li')) { - if (ev.shiftKey) { - this._getDoc().execCommand('outdent', null, ''); - } else { - this._getDoc().execCommand('indent', null, ''); - } - - } else if (!this._hasSelection()) { - this.execCommand('inserthtml', '    '); - } - Event.stopEvent(ev); - } - break; - case 13: - var p = null, i = 0; - if (this.get('ptags') && !ev.shiftKey) { - if (this.browser.gecko) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - if (this._hasParent(tar, 'p')) { - p = this._getDoc().createElement('p'); - p.innerHTML = ' '; - Dom.insertAfter(p, tar); - this._selectNode(p.firstChild); - } else if (this._isElement(tar, 'body')) { - this.execCommand('insertparagraph', null); - var ps = this._getDoc().body.getElementsByTagName('p'); - for (i = 0; i < ps.length; i++) { - if (ps[i].getAttribute('_moz_dirty') !== null) { - p = this._getDoc().createElement('p'); - p.innerHTML = ' '; - Dom.insertAfter(p, ps[i]); - this._selectNode(p.firstChild); - ps[i].removeAttribute('_moz_dirty'); - } - } - } else { - doExec = true; - action = 'insertparagraph'; - } - Event.stopEvent(ev); - } - } - if (this.browser.webkit) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - this.execCommand('insertparagraph', null); - var divs = this._getDoc().body.getElementsByTagName('div'); - for (i = 0; i < divs.length; i++) { - if (!Dom.hasClass(divs[i], 'yui-wk-div')) { - Dom.addClass(divs[i], 'yui-wk-p'); - } - } - Event.stopEvent(ev); - } - } - } else { - if (this.browser.webkit) { - tar = this._getSelectedElement(); - if (!this._hasParent(tar, 'li')) { - if (this.browser.webkit4) { - this.execCommand('insertlinebreak'); - } else { - this.execCommand('inserthtml', ''); - var holder = this._getDoc().getElementById('yui-br'), - br = this._getDoc().createElement('br'), - caret = this._getDoc().createElement('span'); - - holder.parentNode.replaceChild(br, holder); - caret.className = 'yui-non'; - caret.innerHTML = ' '; - Dom.insertAfter(caret, br); - this._selectNode(caret); - } - Event.stopEvent(ev); - } - } - if (this.browser.ie) { - //Insert a
                  instead of a

                  in Internet Explorer - _range = this._getRange(); - tar = this._getSelectedElement(); - if (!this._isElement(tar, 'li')) { - if (_range) { - _range.pasteHTML('
                  '); - _range.collapse(false); - _range.select(); - } - Event.stopEvent(ev); - } - } - } - break; - } - if (this.browser.ie) { - this._listFix(ev); - } - if (doExec && action) { - this.execCommand(action, value); - Event.stopEvent(ev); - this.nodeChange(); - } - this._storeUndo(); - this.fireEvent('editorKeyDown', { type: 'editorKeyDown', target: this, ev: ev }); - }, - /** - * @private - * @property _fixListRunning - * @type Boolean - * @description Keeps more than one _fixListDupIds from running at the same time. - */ - _fixListRunning: null, - /** - * @private - * @method _fixListDupIds - * @description Some browsers will duplicate the id of an LI when created in designMode. - * This method will fix the duplicate id issue. However it will only preserve the first element - * in the document list with the unique id. - */ - _fixListDupIds: function() { - if (this._fixListRunning) { - return false; - } - if (this._getDoc()) { - this._fixListRunning = true; - var lis = this._getDoc().body.getElementsByTagName('li'), - i = 0, ids = {}; - for (i = 0; i < lis.length; i++) { - if (lis[i].id) { - if (ids[lis[i].id]) { - lis[i].id = ''; - } - ids[lis[i].id] = true; - } - } - this._fixListRunning = false; - } - }, - /** - * @private - * @method _listFix - * @param {Event} ev The event we are working on. - * @description Handles the Enter key, Tab Key and Shift + Tab keys for List Items. - */ - _listFix: function(ev) { - var testLi = null, par = null, preContent = false, range = null; - //Enter Key - if (this.browser.webkit) { - if (ev.keyCode && (ev.keyCode == 13)) { - if (this._hasParent(this._getSelectedElement(), 'li')) { - var tar = this._hasParent(this._getSelectedElement(), 'li'); - if (tar.previousSibling) { - if (tar.firstChild && (tar.firstChild.length == 1)) { - this._selectNode(tar); - } - } - } - } - } - //Shift + Tab Key - if (ev.keyCode && ((!this.browser.webkit3 && (ev.keyCode == 25)) || ((this.browser.webkit3 || !this.browser.webkit) && ((ev.keyCode == 9) && ev.shiftKey)))) { - testLi = this._getSelectedElement(); - if (this._hasParent(testLi, 'li')) { - testLi = this._hasParent(testLi, 'li'); - if (this._hasParent(testLi, 'ul') || this._hasParent(testLi, 'ol')) { - par = this._hasParent(testLi, 'ul'); - if (!par) { - par = this._hasParent(testLi, 'ol'); - } - if (this._isElement(par.previousSibling, 'li')) { - par.removeChild(testLi); - par.parentNode.insertBefore(testLi, par.nextSibling); - if (this.browser.ie) { - range = this._getDoc().body.createTextRange(); - range.moveToElementText(testLi); - range.collapse(false); - range.select(); - } - if (this.browser.webkit) { - this._selectNode(testLi.firstChild); - } - Event.stopEvent(ev); - } - } - } - } - //Tab Key - if (ev.keyCode && ((ev.keyCode == 9) && (!ev.shiftKey))) { - var preLi = this._getSelectedElement(); - if (this._hasParent(preLi, 'li')) { - preContent = this._hasParent(preLi, 'li').innerHTML; - } - if (this.browser.webkit) { - this._getDoc().execCommand('inserttext', false, '\t'); - } - testLi = this._getSelectedElement(); - if (this._hasParent(testLi, 'li')) { - par = this._hasParent(testLi, 'li'); - var newUl = this._getDoc().createElement(par.parentNode.tagName.toLowerCase()); - if (this.browser.webkit) { - var span = Dom.getElementsByClassName('Apple-tab-span', 'span', par); - //Remove the span element that Safari puts in - if (span[0]) { - par.removeChild(span[0]); - par.innerHTML = Lang.trim(par.innerHTML); - //Put the HTML from the LI into this new LI - if (preContent) { - par.innerHTML = '' + preContent + ' '; - } else { - par.innerHTML = '  '; - } - } - } else { - if (preContent) { - par.innerHTML = preContent + ' '; - } else { - par.innerHTML = ' '; - } - } - - par.parentNode.replaceChild(newUl, par); - newUl.appendChild(par); - if (this.browser.webkit) { - this._getSelection().setBaseAndExtent(par.firstChild, 1, par.firstChild, par.firstChild.innerText.length); - if (!this.browser.webkit3) { - par.parentNode.parentNode.style.display = 'list-item'; - setTimeout(function() { - par.parentNode.parentNode.style.display = 'block'; - }, 1); - } - } else if (this.browser.ie) { - range = this._getDoc().body.createTextRange(); - range.moveToElementText(par); - range.collapse(false); - range.select(); - } else { - this._selectNode(par); - } - Event.stopEvent(ev); - } - if (this.browser.webkit) { - Event.stopEvent(ev); - } - this.nodeChange(); - } - }, - /** - * @method nodeChange - * @param {Boolean} force Optional paramenter to skip the threshold counter - * @description Handles setting up the toolbar buttons, getting the Dom path, fixing nodes. - */ - nodeChange: function(force) { - var NCself = this; - this._storeUndo(); - if (this.get('nodeChangeDelay')) { - this._nodeChangeDelayTimer = window.setTimeout(function() { - NCself._nodeChangeDelayTimer = null; - NCself._nodeChange.apply(NCself, arguments); - }, 0); - } else { - this._nodeChange(); - } - }, - /** - * @private - * @method _nodeChange - * @param {Boolean} force Optional paramenter to skip the threshold counter - * @description Fired from nodeChange in a setTimeout. - */ - _nodeChange: function(force) { - var threshold = parseInt(this.get('nodeChangeThreshold'), 10), - thisNodeChange = Math.round(new Date().getTime() / 1000), - self = this; - - if (force === true) { - this._lastNodeChange = 0; - } - - if ((this._lastNodeChange + threshold) < thisNodeChange) { - if (this._fixNodesTimer === null) { - this._fixNodesTimer = window.setTimeout(function() { - self._fixNodes.call(self); - self._fixNodesTimer = null; - }, 0); - } - } - this._lastNodeChange = thisNodeChange; - if (this.currentEvent) { - try { - this._lastNodeChangeEvent = this.currentEvent.type; - } catch (e) {} - } - - var beforeNodeChange = this.fireEvent('beforeNodeChange', { type: 'beforeNodeChange', target: this }); - if (beforeNodeChange === false) { - return false; - } - if (this.get('dompath')) { - window.setTimeout(function() { - self._writeDomPath.call(self); - }, 0); - } - //Check to see if we are disabled before continuing - if (!this.get('disabled')) { - if (this.STOP_NODE_CHANGE) { - //Reset this var for next action - this.STOP_NODE_CHANGE = false; - return false; - } else { - var sel = this._getSelection(), - range = this._getRange(), - el = this._getSelectedElement(), - fn_button = this.toolbar.getButtonByValue('fontname'), - fs_button = this.toolbar.getButtonByValue('fontsize'), - undo_button = this.toolbar.getButtonByValue('undo'), - redo_button = this.toolbar.getButtonByValue('redo'); - - //Handle updating the toolbar with active buttons - var _ex = {}; - if (this._lastButton) { - _ex[this._lastButton.id] = true; - //this._lastButton = null; - } - if (!this._isElement(el, 'body')) { - if (fn_button) { - _ex[fn_button.get('id')] = true; - } - if (fs_button) { - _ex[fs_button.get('id')] = true; - } - } - if (redo_button) { - delete _ex[redo_button.get('id')]; - } - this.toolbar.resetAllButtons(_ex); - - //Handle disabled buttons - for (var d = 0; d < this._disabled.length; d++) { - var _button = this.toolbar.getButtonByValue(this._disabled[d]); - if (_button && _button.get) { - if (this._lastButton && (_button.get('id') === this._lastButton.id)) { - //Skip - } else { - if (!this._hasSelection() && !this.get('insert')) { - switch (this._disabled[d]) { - case 'fontname': - case 'fontsize': - break; - default: - //No Selection - disable - this.toolbar.disableButton(_button); - } - } else { - if (!this._alwaysDisabled[this._disabled[d]]) { - this.toolbar.enableButton(_button); - } - } - if (!this._alwaysEnabled[this._disabled[d]]) { - this.toolbar.deselectButton(_button); - } - } - } - } - var path = this._getDomPath(); - var tag = null, cmd = null; - for (var i = 0; i < path.length; i++) { - tag = path[i].tagName.toLowerCase(); - if (path[i].getAttribute('tag')) { - tag = path[i].getAttribute('tag').toLowerCase(); - } - cmd = this._tag2cmd[tag]; - if (cmd === undefined) { - cmd = []; - } - if (!Lang.isArray(cmd)) { - cmd = [cmd]; - } - - //Bold and Italic styles - if (path[i].style.fontWeight.toLowerCase() == 'bold') { - cmd[cmd.length] = 'bold'; - } - if (path[i].style.fontStyle.toLowerCase() == 'italic') { - cmd[cmd.length] = 'italic'; - } - if (path[i].style.textDecoration.toLowerCase() == 'underline') { - cmd[cmd.length] = 'underline'; - } - if (path[i].style.textDecoration.toLowerCase() == 'line-through') { - cmd[cmd.length] = 'strikethrough'; - } - if (cmd.length > 0) { - for (var j = 0; j < cmd.length; j++) { - this.toolbar.selectButton(cmd[j]); - this.toolbar.enableButton(cmd[j]); - } - } - //Handle Alignment - switch (path[i].style.textAlign.toLowerCase()) { - case 'left': - case 'right': - case 'center': - case 'justify': - var alignType = path[i].style.textAlign.toLowerCase(); - if (path[i].style.textAlign.toLowerCase() == 'justify') { - alignType = 'full'; - } - this.toolbar.selectButton('justify' + alignType); - this.toolbar.enableButton('justify' + alignType); - break; - } - } - //After for loop - - //Reset Font Family and Size to the inital configs - if (fn_button) { - var family = fn_button._configs.label._initialConfig.value; - fn_button.set('label', '' + family + ''); - this._updateMenuChecked('fontname', family); - } - - if (fs_button) { - fs_button.set('label', fs_button._configs.label._initialConfig.value); - } - - var hd_button = this.toolbar.getButtonByValue('heading'); - if (hd_button) { - hd_button.set('label', hd_button._configs.label._initialConfig.value); - this._updateMenuChecked('heading', 'none'); - } - var img_button = this.toolbar.getButtonByValue('insertimage'); - if (img_button && this.currentWindow && (this.currentWindow.name == 'insertimage')) { - this.toolbar.disableButton(img_button); - } - if (this._lastButton && this._lastButton.isSelected) { - this.toolbar.deselectButton(this._lastButton.id); - } - this._undoNodeChange(); - } - } - - this.fireEvent('afterNodeChange', { type: 'afterNodeChange', target: this }); - }, - /** - * @private - * @method _updateMenuChecked - * @param {Object} button The command identifier of the button you want to check - * @param {String} value The value of the menu item you want to check - * @param {YAHOO.widget.Toolbar} The Toolbar instance the button belongs to (defaults to this.toolbar) - * @description Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on. - */ - _updateMenuChecked: function(button, value, tbar) { - if (!tbar) { - tbar = this.toolbar; - } - var _button = tbar.getButtonByValue(button); - _button.checkValue(value); - }, - /** - * @private - * @method _handleToolbarClick - * @param {Event} ev The event that triggered the button click - * @description This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button. - */ - _handleToolbarClick: function(ev) { - var value = ''; - var str = ''; - var cmd = ev.button.value; - if (ev.button.menucmd) { - value = cmd; - cmd = ev.button.menucmd; - } - this._lastButton = ev.button; - if (this.STOP_EXEC_COMMAND) { - this.STOP_EXEC_COMMAND = false; - return false; - } else { - this.execCommand(cmd, value); - if (!this.browser.webkit) { - var Fself = this; - setTimeout(function() { - Fself.focus.call(Fself); - }, 5); - } - } - Event.stopEvent(ev); - }, - /** - * @private - * @method _setupAfterElement - * @description Creates the accessibility h2 header and places it after the iframe in the Dom for navigation. - */ - _setupAfterElement: function() { - if (!this.beforeElement) { - this.beforeElement = document.createElement('h2'); - this.beforeElement.className = 'yui-editor-skipheader'; - this.beforeElement.tabIndex = '-1'; - this.beforeElement.innerHTML = this.STR_BEFORE_EDITOR; - this.get('element_cont').get('firstChild').insertBefore(this.beforeElement, this.toolbar.get('nextSibling')); - } - if (!this.afterElement) { - this.afterElement = document.createElement('h2'); - this.afterElement.className = 'yui-editor-skipheader'; - this.afterElement.tabIndex = '-1'; - this.afterElement.innerHTML = this.STR_LEAVE_EDITOR; - this.get('element_cont').get('firstChild').appendChild(this.afterElement); - } - }, - /** - * @private - * @method _disableEditor - * @param {Boolean} disabled Pass true to disable, false to enable - * @description Creates a mask to place over the Editor. - */ - _disableEditor: function(disabled) { - var iframe, par, html, height; - if (!this.get('disabled_iframe')) { - iframe = this._createIframe(); - iframe.set('id', 'disabled_' + this.get('iframe').get('id')); - iframe.setStyle('height', '100%'); - iframe.setStyle('display', 'none'); - iframe.setStyle('visibility', 'visible'); - this.set('disabled_iframe', iframe); - par = this.get('iframe').get('parentNode'); - par.appendChild(iframe.get('element')); - } - if (!iframe) { - iframe = this.get('disabled_iframe'); - } - if (disabled) { - this._orgIframe = this.get('iframe'); - - if (this.toolbar) { - this.toolbar.set('disabled', true); - } - - html = this.getEditorHTML(); - height = this.get('iframe').get('offsetHeight'); - iframe.setStyle('visibility', ''); - iframe.setStyle('position', ''); - iframe.setStyle('top', ''); - iframe.setStyle('left', ''); - this._orgIframe.setStyle('visibility', 'hidden'); - this._orgIframe.setStyle('position', 'absolute'); - this._orgIframe.setStyle('top', '-99999px'); - this._orgIframe.setStyle('left', '-99999px'); - this.set('iframe', iframe); - this._setInitialContent(true); - - if (!this._mask) { - this._mask = document.createElement('DIV'); - Dom.addClass(this._mask, 'yui-editor-masked'); - if (this.browser.ie) { - this._mask.style.height = height + 'px'; - } - this.get('iframe').get('parentNode').appendChild(this._mask); - } - this.on('editorContentReloaded', function() { - this._getDoc().body._rteLoaded = false; - this.setEditorHTML(html); - iframe.setStyle('display', 'block'); - this.unsubscribeAll('editorContentReloaded'); - }); - } else { - if (this._mask) { - this._mask.parentNode.removeChild(this._mask); - this._mask = null; - if (this.toolbar) { - this.toolbar.set('disabled', false); - } - iframe.setStyle('visibility', 'hidden'); - iframe.setStyle('position', 'absolute'); - iframe.setStyle('top', '-99999px'); - iframe.setStyle('left', '-99999px'); - this._orgIframe.setStyle('visibility', ''); - this._orgIframe.setStyle('position', ''); - this._orgIframe.setStyle('top', ''); - this._orgIframe.setStyle('left', ''); - this.set('iframe', this._orgIframe); - - this.focus(); - var self = this; - window.setTimeout(function() { - self.nodeChange.call(self); - }, 100); - } - } - }, - /** - * @property SEP_DOMPATH - * @description The value to place in between the Dom path items - * @type String - */ - SEP_DOMPATH: '<', - /** - * @property STR_LEAVE_EDITOR - * @description The accessibility string for the element after the iFrame - * @type String - */ - STR_LEAVE_EDITOR: 'You have left the Rich Text Editor.', - /** - * @property STR_BEFORE_EDITOR - * @description The accessibility string for the element before the iFrame - * @type String - */ - STR_BEFORE_EDITOR: 'This text field can contain stylized text and graphics. To cycle through all formatting options, use the keyboard shortcut Shift + Escape to place focus on the toolbar and navigate between options with your arrow keys. To exit this text editor use the Escape key and continue tabbing.

                  Common formatting keyboard shortcuts:

                  • Control Shift B sets text to bold
                  • Control Shift I sets text to italic
                  • Control Shift U underlines text
                  • Control Shift L adds an HTML link
                  ', - /** - * @property STR_TITLE - * @description The Title of the HTML document that is created in the iFrame - * @type String - */ - STR_TITLE: 'Rich Text Area.', - /** - * @property STR_IMAGE_HERE - * @description The text to place in the URL textbox when using the blankimage. - * @type String - */ - STR_IMAGE_HERE: 'Image URL Here', - /** - * @property STR_IMAGE_URL - * @description The label string for Image URL - * @type String - */ - STR_IMAGE_URL: 'Image URL', - /** - * @property STR_LINK_URL - * @description The label string for the Link URL. - * @type String - */ - STR_LINK_URL: 'Link URL', - /** - * @protected - * @property STOP_EXEC_COMMAND - * @description Set to true when you want the default execCommand function to not process anything - * @type Boolean - */ - STOP_EXEC_COMMAND: false, - /** - * @protected - * @property STOP_NODE_CHANGE - * @description Set to true when you want the default nodeChange function to not process anything - * @type Boolean - */ - STOP_NODE_CHANGE: false, - /** - * @protected - * @property CLASS_NOEDIT - * @description CSS class applied to elements that are not editable. - * @type String - */ - CLASS_NOEDIT: 'yui-noedit', - /** - * @protected - * @property CLASS_CONTAINER - * @description Default CSS class to apply to the editors container element - * @type String - */ - CLASS_CONTAINER: 'yui-editor-container', - /** - * @protected - * @property CLASS_EDITABLE - * @description Default CSS class to apply to the editors iframe element - * @type String - */ - CLASS_EDITABLE: 'yui-editor-editable', - /** - * @protected - * @property CLASS_EDITABLE_CONT - * @description Default CSS class to apply to the editors iframe's parent element - * @type String - */ - CLASS_EDITABLE_CONT: 'yui-editor-editable-container', - /** - * @protected - * @property CLASS_PREFIX - * @description Default prefix for dynamically created class names - * @type String - */ - CLASS_PREFIX: 'yui-editor', - /** - * @property browser - * @description Standard browser detection - * @type Object - */ - browser: function() { - var br = YAHOO.env.ua; - //Check for webkit3 - if (br.webkit >= 420) { - br.webkit3 = br.webkit; - } else { - br.webkit3 = 0; - } - if (br.webkit >= 530) { - br.webkit4 = br.webkit; - } else { - br.webkit4 = 0; - } - br.mac = false; - //Check for Mac - if (navigator.userAgent.indexOf('Macintosh') !== -1) { - br.mac = true; - } - - return br; - }(), - /** - * @method init - * @description The Editor class' initialization method - */ - init: function(p_oElement, p_oAttributes) { - - if (!this._defaultToolbar) { - this._defaultToolbar = { - collapse: true, - titlebar: 'Text Editing Tools', - draggable: false, - buttons: [ - { group: 'fontstyle', label: 'Font Name and Size', - buttons: [ - { type: 'select', label: 'Arial', value: 'fontname', disabled: true, - menu: [ - { text: 'Arial', checked: true }, - { text: 'Arial Black' }, - { text: 'Comic Sans MS' }, - { text: 'Courier New' }, - { text: 'Lucida Console' }, - { text: 'Tahoma' }, - { text: 'Times New Roman' }, - { text: 'Trebuchet MS' }, - { text: 'Verdana' } - ] - }, - { type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true } - ] - }, - { type: 'separator' }, - { group: 'textstyle', label: 'Font Style', - buttons: [ - { type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' }, - { type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' }, - { type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' }, - { type: 'push', label: 'Strike Through', value: 'strikethrough' }, - { type: 'separator' }, - { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true }, - { type: 'color', label: 'Background Color', value: 'backcolor', disabled: true } - - ] - }, - { type: 'separator' }, - { group: 'indentlist', label: 'Lists', - buttons: [ - { type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' }, - { type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' } - ] - }, - { type: 'separator' }, - { group: 'insertitem', label: 'Insert Item', - buttons: [ - { type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true }, - { type: 'push', label: 'Insert Image', value: 'insertimage' } - ] - } - ] - }; - } - - YAHOO.widget.SimpleEditor.superclass.init.call(this, p_oElement, p_oAttributes); - YAHOO.widget.EditorInfo._instances[this.get('id')] = this; - - - this.currentElement = []; - this.on('contentReady', function() { - this.DOMReady = true; - this.fireQueue(); - }, this, true); - - }, - /** - * @method initAttributes - * @description Initializes all of the configuration attributes used to create - * the editor. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the editor. - */ - initAttributes: function(attr) { - YAHOO.widget.SimpleEditor.superclass.initAttributes.call(this, attr); - var self = this; - - /** - * @config setDesignMode - * @description Should the Editor set designMode on the document. Default: true. - * @default true - * @type Boolean - */ - this.setAttributeConfig('setDesignMode', { - value: ((attr.setDesignMode === false) ? false : true) - }); - /** - * @config nodeChangeDelay - * @description Do we wrap the nodeChange method in a timeout for performance. Default: true. - * @default true - * @type Boolean - */ - this.setAttributeConfig('nodeChangeDelay', { - value: ((attr.nodeChangeDelay === false) ? false : true) - }); - /** - * @config maxUndo - * @description The max number of undo levels to store. - * @default 30 - * @type Number - */ - this.setAttributeConfig('maxUndo', { - writeOnce: true, - value: attr.maxUndo || 30 - }); - - /** - * @config ptags - * @description If true, the editor uses <P> tags instead of <br> tags. (Use Shift + Enter to get a <br>) - * @default false - * @type Boolean - */ - this.setAttributeConfig('ptags', { - writeOnce: true, - value: attr.ptags || false - }); - /** - * @config insert - * @description If true, selection is not required for: fontname, fontsize, forecolor, backcolor. - * @default false - * @type Boolean - */ - this.setAttributeConfig('insert', { - writeOnce: true, - value: attr.insert || false, - method: function(insert) { - if (insert) { - var buttons = { - fontname: true, - fontsize: true, - forecolor: true, - backcolor: true - }; - var tmp = this._defaultToolbar.buttons; - for (var i = 0; i < tmp.length; i++) { - if (tmp[i].buttons) { - for (var a = 0; a < tmp[i].buttons.length; a++) { - if (tmp[i].buttons[a].value) { - if (buttons[tmp[i].buttons[a].value]) { - delete tmp[i].buttons[a].disabled; - } - } - } - } - } - } - } - }); - /** - * @config container - * @description Used when dynamically creating the Editor from Javascript with no default textarea. - * We will create one and place it in this container. If no container is passed we will append to document.body. - * @default false - * @type HTMLElement - */ - this.setAttributeConfig('container', { - writeOnce: true, - value: attr.container || false - }); - /** - * @config plainText - * @description Process the inital textarea data as if it was plain text. Accounting for spaces, tabs and line feeds. - * @default false - * @type Boolean - */ - this.setAttributeConfig('plainText', { - writeOnce: true, - value: attr.plainText || false - }); - /** - * @private - * @config iframe - * @description Internal config for holding the iframe element. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('iframe', { - value: null - }); - /** - * @private - * @config disabled_iframe - * @description Internal config for holding the iframe element used when disabling the Editor. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('disabled_iframe', { - value: null - }); - /** - * @private - * @depreciated - No longer used, should use this.get('element') - * @config textarea - * @description Internal config for holding the textarea element (replaced with element). - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('textarea', { - value: null, - writeOnce: true - }); - /** - * @config nodeChangeThreshold - * @description The number of seconds that need to be in between nodeChange processing - * @default 3 - * @type Number - */ - this.setAttributeConfig('nodeChangeThreshold', { - value: attr.nodeChangeThreshold || 3, - validator: YAHOO.lang.isNumber - }); - /** - * @config allowNoEdit - * @description Should the editor check for non-edit fields. It should be noted that this technique is not perfect. If the user does the right things, they will still be able to make changes. - * Such as highlighting an element below and above the content and hitting a toolbar button or a shortcut key. - * @default false - * @type Boolean - */ - this.setAttributeConfig('allowNoEdit', { - value: attr.allowNoEdit || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @config limitCommands - * @description Should the Editor limit the allowed execCommands to the ones available in the toolbar. If true, then execCommand and keyboard shortcuts will fail if they are not defined in the toolbar. - * @default false - * @type Boolean - */ - this.setAttributeConfig('limitCommands', { - value: attr.limitCommands || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @config element_cont - * @description Internal config for the editors container - * @default false - * @type HTMLElement - */ - this.setAttributeConfig('element_cont', { - value: attr.element_cont - }); - /** - * @private - * @config editor_wrapper - * @description The outter wrapper for the entire editor. - * @default null - * @type HTMLElement - */ - this.setAttributeConfig('editor_wrapper', { - value: attr.editor_wrapper || null, - writeOnce: true - }); - /** - * @attribute height - * @description The height of the editor iframe container, not including the toolbar.. - * @default Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument - * @type String - */ - this.setAttributeConfig('height', { - value: attr.height || Dom.getStyle(self.get('element'), 'height'), - method: function(height) { - if (this._rendered) { - //We have been rendered, change the height - if (this.get('animate')) { - var anim = new YAHOO.util.Anim(this.get('iframe').get('parentNode'), { - height: { - to: parseInt(height, 10) - } - }, 0.5); - anim.animate(); - } else { - Dom.setStyle(this.get('iframe').get('parentNode'), 'height', height); - } - } - } - }); - /** - * @config autoHeight - * @description Remove the scrollbars from the edit area and resize it to fit the content. It will not go any lower than the current config height. - * @default false - * @type Boolean || Number - */ - this.setAttributeConfig('autoHeight', { - value: attr.autoHeight || false, - method: function(a) { - if (a) { - if (this.get('iframe')) { - this.get('iframe').get('element').setAttribute('scrolling', 'no'); - } - this.on('afterNodeChange', this._handleAutoHeight, this, true); - this.on('editorKeyDown', this._handleAutoHeight, this, true); - this.on('editorKeyPress', this._handleAutoHeight, this, true); - } else { - if (this.get('iframe')) { - this.get('iframe').get('element').setAttribute('scrolling', 'auto'); - } - this.unsubscribe('afterNodeChange', this._handleAutoHeight); - this.unsubscribe('editorKeyDown', this._handleAutoHeight); - this.unsubscribe('editorKeyPress', this._handleAutoHeight); - } - } - }); - /** - * @attribute width - * @description The width of the editor container. - * @default Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument - * @type String - */ - this.setAttributeConfig('width', { - value: attr.width || Dom.getStyle(this.get('element'), 'width'), - method: function(width) { - if (this._rendered) { - //We have been rendered, change the width - if (this.get('animate')) { - var anim = new YAHOO.util.Anim(this.get('element_cont').get('element'), { - width: { - to: parseInt(width, 10) - } - }, 0.5); - anim.animate(); - } else { - this.get('element_cont').setStyle('width', width); - } - } - } - }); - - /** - * @attribute blankimage - * @description The URL for the image placeholder to put in when inserting an image. - * @default The yahooapis.com address for the current release + 'assets/blankimage.png' - * @type String - */ - this.setAttributeConfig('blankimage', { - value: attr.blankimage || this._getBlankImage() - }); - /** - * @attribute css - * @description The Base CSS used to format the content of the editor - * @default
                  html {
                  -                height: 95%;
                  -            }
                  -            body {
                  -                height: 100%;
                  -                padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
                  -            }
                  -            a {
                  -                color: blue;
                  -                text-decoration: underline;
                  -                cursor: pointer;
                  -            }
                  -            .warning-localfile {
                  -                border-bottom: 1px dashed red !important;
                  -            }
                  -            .yui-busy {
                  -                cursor: wait !important;
                  -            }
                  -            img.selected { //Safari image selection
                  -                border: 2px dotted #808080;
                  -            }
                  -            img {
                  -                cursor: pointer !important;
                  -                border: none;
                  -            }
                  -            
                  - * @type String - */ - this.setAttributeConfig('css', { - value: attr.css || this._defaultCSS, - writeOnce: true - }); - /** - * @attribute html - * @description The default HTML to be written to the iframe document before the contents are loaded (Note that the DOCTYPE attr will be added at render item) - * @default This HTML requires a few things if you are to override: -

                  {TITLE}, {CSS}, {HIDDEN_CSS}, {EXTRA_CSS} and {CONTENT} need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.

                  -

                  onload="document.body._rteLoaded = true;" : the onload statement must be there or the editor will not finish loading.

                  - -
                  -                <html>
                  -                    <head>
                  -                        <title>{TITLE}</title>
                  -                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                  -                        <style>
                  -                        {CSS}
                  -                        </style>
                  -                        <style>
                  -                        {HIDDEN_CSS}
                  -                        </style>
                  -                        <style>
                  -                        {EXTRA_CSS}
                  -                        </style>
                  -                    </head>
                  -                <body onload="document.body._rteLoaded = true;">
                  -                {CONTENT}
                  -                </body>
                  -                </html>
                  -                
                  -
                  - * @type String - */ - this.setAttributeConfig('html', { - value: attr.html || '{TITLE}{CONTENT}', - writeOnce: true - }); - - /** - * @attribute extracss - * @description Extra user defined css to load after the default SimpleEditor CSS - * @default '' - * @type String - */ - this.setAttributeConfig('extracss', { - value: attr.extracss || '', - writeOnce: true - }); - - /** - * @attribute handleSubmit - * @description Config handles if the editor will attach itself to the textareas parent form's submit handler. - If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form. - Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted. - * @default false - * @type Boolean - */ - this.setAttributeConfig('handleSubmit', { - value: attr.handleSubmit || false, - method: function(exec) { - if (this.get('element').form) { - if (!this._formButtons) { - this._formButtons = []; - } - if (exec) { - Event.on(this.get('element').form, 'submit', this._handleFormSubmit, this, true); - var i = this.get('element').form.getElementsByTagName('input'); - for (var s = 0; s < i.length; s++) { - var type = i[s].getAttribute('type'); - if (type && (type.toLowerCase() == 'submit')) { - Event.on(i[s], 'click', this._handleFormButtonClick, this, true); - this._formButtons[this._formButtons.length] = i[s]; - } - } - } else { - Event.removeListener(this.get('element').form, 'submit', this._handleFormSubmit); - if (this._formButtons) { - Event.removeListener(this._formButtons, 'click', this._handleFormButtonClick); - } - } - } - } - }); - /** - * @attribute disabled - * @description This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place. - All Toolbar buttons are also disabled so they cannot be used. - * @default false - * @type Boolean - */ - - this.setAttributeConfig('disabled', { - value: false, - method: function(disabled) { - if (this._rendered) { - this._disableEditor(disabled); - } - } - }); - /** - * @config saveEl - * @description When save HTML is called, this element will be updated as well as the source of data. - * @default element - * @type HTMLElement - */ - this.setAttributeConfig('saveEl', { - value: this.get('element') - }); - /** - * @config toolbar_cont - * @description Internal config for the toolbars container - * @default false - * @type Boolean - */ - this.setAttributeConfig('toolbar_cont', { - value: null, - writeOnce: true - }); - /** - * @attribute toolbar - * @description The default toolbar config. - * @type Object - */ - this.setAttributeConfig('toolbar', { - value: attr.toolbar || this._defaultToolbar, - writeOnce: true, - method: function(toolbar) { - if (!toolbar.buttonType) { - toolbar.buttonType = this._defaultToolbar.buttonType; - } - this._defaultToolbar = toolbar; - } - }); - /** - * @attribute animate - * @description Should the editor animate window movements - * @default false unless Animation is found, then true - * @type Boolean - */ - this.setAttributeConfig('animate', { - value: ((attr.animate) ? ((YAHOO.util.Anim) ? true : false) : false), - validator: function(value) { - var ret = true; - if (!YAHOO.util.Anim) { - ret = false; - } - return ret; - } - }); - /** - * @config panel - * @description A reference to the panel we are using for windows. - * @default false - * @type Boolean - */ - this.setAttributeConfig('panel', { - value: null, - writeOnce: true, - validator: function(value) { - var ret = true; - if (!YAHOO.widget.Overlay) { - ret = false; - } - return ret; - } - }); - /** - * @attribute focusAtStart - * @description Should we focus the window when the content is ready? - * @default false - * @type Boolean - */ - this.setAttributeConfig('focusAtStart', { - value: attr.focusAtStart || false, - writeOnce: true, - method: function(fs) { - if (fs) { - this.on('editorContentLoaded', function() { - var self = this; - setTimeout(function() { - self.focus.call(self); - self.editorDirty = false; - }, 400); - }, this, true); - } - } - }); - /** - * @attribute dompath - * @description Toggle the display of the current Dom path below the editor - * @default false - * @type Boolean - */ - this.setAttributeConfig('dompath', { - value: attr.dompath || false, - method: function(dompath) { - if (dompath && !this.dompath) { - this.dompath = document.createElement('DIV'); - this.dompath.id = this.get('id') + '_dompath'; - Dom.addClass(this.dompath, 'dompath'); - this.get('element_cont').get('firstChild').appendChild(this.dompath); - if (this.get('iframe')) { - this._writeDomPath(); - } - } else if (!dompath && this.dompath) { - this.dompath.parentNode.removeChild(this.dompath); - this.dompath = null; - } - } - }); - /** - * @attribute markup - * @description Should we try to adjust the markup for the following types: semantic, css, default or xhtml - * @default "semantic" - * @type String - */ - this.setAttributeConfig('markup', { - value: attr.markup || 'semantic', - validator: function(markup) { - switch (markup.toLowerCase()) { - case 'semantic': - case 'css': - case 'default': - case 'xhtml': - return true; - } - return false; - } - }); - /** - * @attribute removeLineBreaks - * @description Should we remove linebreaks and extra spaces on cleanup - * @default false - * @type Boolean - */ - this.setAttributeConfig('removeLineBreaks', { - value: attr.removeLineBreaks || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @config drag - * @description Set this config to make the Editor draggable, pass 'proxy' to make use YAHOO.util.DDProxy. - * @type {Boolean/String} - */ - this.setAttributeConfig('drag', { - writeOnce: true, - value: attr.drag || false - }); - - /** - * @config resize - * @description Set this to true to make the Editor Resizable with YAHOO.util.Resize. The default config is available: myEditor._resizeConfig - * Animation will be ignored while performing this resize to allow for the dynamic change in size of the toolbar. - * @type Boolean - */ - this.setAttributeConfig('resize', { - writeOnce: true, - value: attr.resize || false - }); - - /** - * @config filterWord - * @description Attempt to filter out MS Word HTML from the Editor's output. - * @type Boolean - */ - this.setAttributeConfig('filterWord', { - value: attr.filterWord || false, - validator: YAHOO.lang.isBoolean - }); - - }, - /** - * @private - * @method _getBlankImage - * @description Retrieves the full url of the image to use as the blank image. - * @return {String} The URL to the blank image - */ - _getBlankImage: function() { - if (!this.DOMReady) { - this._queue[this._queue.length] = ['_getBlankImage', arguments]; - return ''; - } - var img = ''; - if (!this._blankImageLoaded) { - if (YAHOO.widget.EditorInfo.blankImage) { - this.set('blankimage', YAHOO.widget.EditorInfo.blankImage); - this._blankImageLoaded = true; - } else { - var div = document.createElement('div'); - div.style.position = 'absolute'; - div.style.top = '-9999px'; - div.style.left = '-9999px'; - div.className = this.CLASS_PREFIX + '-blankimage'; - document.body.appendChild(div); - img = YAHOO.util.Dom.getStyle(div, 'background-image'); - img = img.replace('url(', '').replace(')', '').replace(/"/g, ''); - //Adobe AIR Code - img = img.replace('app:/', ''); - this.set('blankimage', img); - this._blankImageLoaded = true; - div.parentNode.removeChild(div); - YAHOO.widget.EditorInfo.blankImage = img; - } - } else { - img = this.get('blankimage'); - } - return img; - }, - /** - * @private - * @method _handleAutoHeight - * @description Handles resizing the editor's height based on the content - */ - _handleAutoHeight: function() { - var doc = this._getDoc(), - body = doc.body, - docEl = doc.documentElement; - - var height = parseInt(Dom.getStyle(this.get('editor_wrapper'), 'height'), 10); - var newHeight = body.scrollHeight; - if (this.browser.webkit) { - newHeight = docEl.scrollHeight; - } - if (newHeight < parseInt(this.get('height'), 10)) { - newHeight = parseInt(this.get('height'), 10); - } - if ((height != newHeight) && (newHeight >= parseInt(this.get('height'), 10))) { - var anim = this.get('animate'); - this.set('animate', false); - this.set('height', newHeight + 'px'); - this.set('animate', anim); - if (this.browser.ie) { - //Internet Explorer needs this - this.get('iframe').setStyle('height', '99%'); - this.get('iframe').setStyle('zoom', '1'); - var self = this; - window.setTimeout(function() { - self.get('iframe').setStyle('height', '100%'); - }, 1); - } - } - }, - /** - * @private - * @property _formButtons - * @description Array of buttons that are in the Editor's parent form (for handleSubmit) - * @type Array - */ - _formButtons: null, - /** - * @private - * @property _formButtonClicked - * @description The form button that was clicked to submit the form. - * @type HTMLElement - */ - _formButtonClicked: null, - /** - * @private - * @method _handleFormButtonClick - * @description The click listener assigned to each submit button in the Editor's parent form. - * @param {Event} ev The click event - */ - _handleFormButtonClick: function(ev) { - var tar = Event.getTarget(ev); - this._formButtonClicked = tar; - }, - /** - * @private - * @method _handleFormSubmit - * @description Handles the form submission. - * @param {Object} ev The Form Submit Event - */ - _handleFormSubmit: function(ev) { - this.saveHTML(); - - var form = this.get('element').form, - tar = this._formButtonClicked || false; - - Event.removeListener(form, 'submit', this._handleFormSubmit); - if (YAHOO.env.ua.ie) { - //form.fireEvent("onsubmit"); - if (tar && !tar.disabled) { - tar.click(); - } - } else { // Gecko, Opera, and Safari - if (tar && !tar.disabled) { - tar.click(); - } - var oEvent = document.createEvent("HTMLEvents"); - oEvent.initEvent("submit", true, true); - form.dispatchEvent(oEvent); - if (YAHOO.env.ua.webkit) { - if (YAHOO.lang.isFunction(form.submit)) { - form.submit(); - } - } - } - //2.6.0 - //Removed this, not need since removing Safari 2.x - //Event.stopEvent(ev); - }, - /** - * @private - * @method _handleFontSize - * @description Handles the font size button in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleFontSize: function(o) { - var button = this.toolbar.getButtonById(o.button.id); - var value = button.get('label') + 'px'; - this.execCommand('fontsize', value); - return false; - }, - /** - * @private - * @description Handles the colorpicker buttons in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleColorPicker: function(o) { - var cmd = o.button; - var value = '#' + o.color; - if ((cmd == 'forecolor') || (cmd == 'backcolor')) { - this.execCommand(cmd, value); - } - }, - /** - * @private - * @method _handleAlign - * @description Handles the alignment buttons in the toolbar. - * @param {Object} o Object returned from Toolbar's buttonClick Event - */ - _handleAlign: function(o) { - var cmd = null; - for (var i = 0; i < o.button.menu.length; i++) { - if (o.button.menu[i].value == o.button.value) { - cmd = o.button.menu[i].value; - } - } - var value = this._getSelection(); - - this.execCommand(cmd, value); - return false; - }, - /** - * @private - * @method _handleAfterNodeChange - * @description Fires after a nodeChange happens to setup the things that where reset on the node change (button state). - */ - _handleAfterNodeChange: function() { - var path = this._getDomPath(), - elm = null, - family = null, - fontsize = null, - validFont = false, - fn_button = this.toolbar.getButtonByValue('fontname'), - fs_button = this.toolbar.getButtonByValue('fontsize'), - hd_button = this.toolbar.getButtonByValue('heading'); - - for (var i = 0; i < path.length; i++) { - elm = path[i]; - - var tag = elm.tagName.toLowerCase(); - - - if (elm.getAttribute('tag')) { - tag = elm.getAttribute('tag'); - } - - family = elm.getAttribute('face'); - if (Dom.getStyle(elm, 'font-family')) { - family = Dom.getStyle(elm, 'font-family'); - //Adobe AIR Code - family = family.replace(/'/g, ''); - } - - if (tag.substring(0, 1) == 'h') { - if (hd_button) { - for (var h = 0; h < hd_button._configs.menu.value.length; h++) { - if (hd_button._configs.menu.value[h].value.toLowerCase() == tag) { - hd_button.set('label', hd_button._configs.menu.value[h].text); - } - } - this._updateMenuChecked('heading', tag); - } - } - } - - if (fn_button) { - for (var b = 0; b < fn_button._configs.menu.value.length; b++) { - if (family && fn_button._configs.menu.value[b].text.toLowerCase() == family.toLowerCase()) { - validFont = true; - family = fn_button._configs.menu.value[b].text; //Put the proper menu name in the button - } - } - if (!validFont) { - family = fn_button._configs.label._initialConfig.value; - } - var familyLabel = '' + family + ''; - if (fn_button.get('label') != familyLabel) { - fn_button.set('label', familyLabel); - this._updateMenuChecked('fontname', family); - } - } - - if (fs_button) { - fontsize = parseInt(Dom.getStyle(elm, 'fontSize'), 10); - if ((fontsize === null) || isNaN(fontsize)) { - fontsize = fs_button._configs.label._initialConfig.value; - } - fs_button.set('label', ''+fontsize); - } - - if (!this._isElement(elm, 'body') && !this._isElement(elm, 'img')) { - this.toolbar.enableButton(fn_button); - this.toolbar.enableButton(fs_button); - this.toolbar.enableButton('forecolor'); - this.toolbar.enableButton('backcolor'); - } - if (this._isElement(elm, 'img')) { - if (YAHOO.widget.Overlay) { - this.toolbar.enableButton('createlink'); - } - } - if (this._hasParent(elm, 'blockquote')) { - this.toolbar.selectButton('indent'); - this.toolbar.disableButton('indent'); - this.toolbar.enableButton('outdent'); - } - if (this._hasParent(elm, 'ol') || this._hasParent(elm, 'ul')) { - this.toolbar.disableButton('indent'); - } - this._lastButton = null; - - }, - /** - * @private - * @method _handleInsertImageClick - * @description Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked. - */ - _handleInsertImageClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('insertimage')) { - return false; - } - } - - this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing - var _handleAEC = function() { - var el = this.currentElement[0], - src = 'http://'; - if (!el) { - el = this._getSelectedElement(); - } - if (el) { - if (el.getAttribute('src')) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - src = this.STR_IMAGE_HERE; - } - } - } - var str = prompt(this.STR_IMAGE_URL + ': ', src); - if ((str !== '') && (str !== null)) { - el.setAttribute('src', str); - } else if (str === '') { - el.parentNode.removeChild(el); - this.currentElement = []; - this.nodeChange(); - } else if ((str === null)) { - src = el.getAttribute('src', 2); - if (src.indexOf(this.get('blankimage')) != -1) { - el.parentNode.removeChild(el); - this.currentElement = []; - this.nodeChange(); - } - } - this.closeWindow(); - this.toolbar.set('disabled', false); - this.unsubscribe('afterExecCommand', _handleAEC, this, true); - }; - this.on('afterExecCommand', _handleAEC, this, true); - }, - /** - * @private - * @method _handleInsertImageWindowClose - * @description Handles the closing of the Image Properties Window. - */ - _handleInsertImageWindowClose: function() { - this.nodeChange(); - }, - /** - * @private - * @method _isLocalFile - * @param {String} url THe url/string to check - * @description Checks to see if a string (href or img src) is possibly a local file reference.. - */ - _isLocalFile: function(url) { - if ((url) && (url !== '') && ((url.indexOf('file:/') != -1) || (url.indexOf(':\\') != -1))) { - return true; - } - return false; - }, - /** - * @private - * @method _handleCreateLinkClick - * @description Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked. - */ - _handleCreateLinkClick: function() { - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue('createlink')) { - return false; - } - } - - this.toolbar.set('disabled', true); //Disable the toolbar when the prompt is showing - - var _handleAEC = function() { - var el = this.currentElement[0], - url = ''; - - if (el) { - if (el.getAttribute('href', 2) !== null) { - url = el.getAttribute('href', 2); - } - } - var str = prompt(this.STR_LINK_URL + ': ', url); - if ((str !== '') && (str !== null)) { - var urlValue = str; - if ((urlValue.indexOf(':/'+'/') == -1) && (urlValue.substring(0,1) != '/') && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - if ((urlValue.indexOf('@') != -1) && (urlValue.substring(0, 6).toLowerCase() != 'mailto')) { - //Found an @ sign, prefix with mailto: - urlValue = 'mailto:' + urlValue; - } else { - /* :// not found adding */ - if (urlValue.substring(0, 1) != '#') { - //urlValue = 'http:/'+'/' + urlValue; - } - } - } - el.setAttribute('href', urlValue); - } else if (str !== null) { - var _span = this._getDoc().createElement('span'); - _span.innerHTML = el.innerHTML; - Dom.addClass(_span, 'yui-non'); - el.parentNode.replaceChild(_span, el); - } - this.closeWindow(); - this.toolbar.set('disabled', false); - this.unsubscribe('afterExecCommand', _handleAEC, this, true); - }; - this.on('afterExecCommand', _handleAEC, this); - - }, - /** - * @private - * @method _handleCreateLinkWindowClose - * @description Handles the closing of the Link Properties Window. - */ - _handleCreateLinkWindowClose: function() { - this.nodeChange(); - this.currentElement = []; - }, - /** - * @method render - * @description Calls the private method _render in a setTimeout to allow for other things on the page to continue to load. - */ - render: function() { - if (this._rendered) { - return false; - } - if (!this.DOMReady) { - this._queue[this._queue.length] = ['render', arguments]; - return false; - } - if (this.get('element')) { - if (this.get('element').tagName) { - this._textarea = true; - if (this.get('element').tagName.toLowerCase() !== 'textarea') { - this._textarea = false; - } - } else { - return false; - } - } else { - return false; - } - this._rendered = true; - var self = this; - window.setTimeout(function() { - self._render.call(self); - }, 4); - }, - /** - * @private - * @method _render - * @description Causes the toolbar and the editor to render and replace the textarea. - */ - _render: function() { - var self = this; - this.set('textarea', this.get('element')); - - this.get('element_cont').setStyle('display', 'none'); - this.get('element_cont').addClass(this.CLASS_CONTAINER); - - this.set('iframe', this._createIframe()); - - window.setTimeout(function() { - self._setInitialContent.call(self); - }, 10); - - this.get('editor_wrapper').appendChild(this.get('iframe').get('element')); - - if (this.get('disabled')) { - this._disableEditor(true); - } - - var tbarConf = this.get('toolbar'); - //Create Toolbar instance - if (tbarConf instanceof Toolbar) { - this.toolbar = tbarConf; - //Set the toolbar to disabled until content is loaded - this.toolbar.set('disabled', true); - } else { - //Set the toolbar to disabled until content is loaded - tbarConf.disabled = true; - this.toolbar = new Toolbar(this.get('toolbar_cont'), tbarConf); - } - - this.fireEvent('toolbarLoaded', { type: 'toolbarLoaded', target: this.toolbar }); - - - this.toolbar.on('toolbarCollapsed', function() { - if (this.currentWindow) { - this.moveWindow(); - } - }, this, true); - this.toolbar.on('toolbarExpanded', function() { - if (this.currentWindow) { - this.moveWindow(); - } - }, this, true); - this.toolbar.on('fontsizeClick', this._handleFontSize, this, true); - - this.toolbar.on('colorPickerClicked', function(o) { - this._handleColorPicker(o); - return false; //Stop the buttonClick event - }, this, true); - - this.toolbar.on('alignClick', this._handleAlign, this, true); - this.on('afterNodeChange', this._handleAfterNodeChange, this, true); - this.toolbar.on('insertimageClick', this._handleInsertImageClick, this, true); - this.on('windowinsertimageClose', this._handleInsertImageWindowClose, this, true); - this.toolbar.on('createlinkClick', this._handleCreateLinkClick, this, true); - this.on('windowcreatelinkClose', this._handleCreateLinkWindowClose, this, true); - - - //Replace Textarea with editable area - this.get('parentNode').replaceChild(this.get('element_cont').get('element'), this.get('element')); - - - this.setStyle('visibility', 'hidden'); - this.setStyle('position', 'absolute'); - this.setStyle('top', '-9999px'); - this.setStyle('left', '-9999px'); - this.get('element_cont').appendChild(this.get('element')); - this.get('element_cont').setStyle('display', 'block'); - - - Dom.addClass(this.get('iframe').get('parentNode'), this.CLASS_EDITABLE_CONT); - this.get('iframe').addClass(this.CLASS_EDITABLE); - - //Set height and width of editor container - this.get('element_cont').setStyle('width', this.get('width')); - Dom.setStyle(this.get('iframe').get('parentNode'), 'height', this.get('height')); - - this.get('iframe').setStyle('width', '100%'); //WIDTH - this.get('iframe').setStyle('height', '100%'); - - this._setupDD(); - - window.setTimeout(function() { - self._setupAfterElement.call(self); - }, 0); - this.fireEvent('afterRender', { type: 'afterRender', target: this }); - }, - /** - * @method execCommand - * @param {String} action The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml) - * @param {String} value (optional) The value for a given action such as action: fontname value: 'Verdana' - * @description This method attempts to try and level the differences in the various browsers and their support for execCommand actions - */ - execCommand: function(action, value) { - var beforeExec = this.fireEvent('beforeExecCommand', { type: 'beforeExecCommand', target: this, args: arguments }); - if ((beforeExec === false) || (this.STOP_EXEC_COMMAND)) { - this.STOP_EXEC_COMMAND = false; - return false; - } - this._lastCommand = action; - this._setMarkupType(action); - if (this.browser.ie) { - this._getWindow().focus(); - } - var exec = true; - - if (this.get('limitCommands')) { - if (!this.toolbar.getButtonByValue(action)) { - exec = false; - } - } - - this.editorDirty = true; - - if ((typeof this['cmd_' + action.toLowerCase()] == 'function') && exec) { - var retValue = this['cmd_' + action.toLowerCase()](value); - exec = retValue[0]; - if (retValue[1]) { - action = retValue[1]; - } - if (retValue[2]) { - value = retValue[2]; - } - } - if (exec) { - try { - this._getDoc().execCommand(action, false, value); - } catch(e) { - } - } else { - } - this.on('afterExecCommand', function() { - this.unsubscribeAll('afterExecCommand'); - this.nodeChange(); - }, this, true); - this.fireEvent('afterExecCommand', { type: 'afterExecCommand', target: this }); - - }, - /* {{{ Command Overrides */ - - /** - * @method cmd_bold - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('bold') is used. - */ - cmd_bold: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span') && this._hasSelection()) { - if (el.style.fontWeight == 'bold') { - el.style.fontWeight = ''; - var b = this._getDoc().createElement('b'), - par = el.parentNode; - par.replaceChild(b, el); - b.appendChild(el); - } - } - } - return [true]; - }, - /** - * @method cmd_italic - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('italic') is used. - */ - - cmd_italic: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span') && this._hasSelection()) { - if (el.style.fontStyle == 'italic') { - el.style.fontStyle = ''; - var i = this._getDoc().createElement('i'), - par = el.parentNode; - par.replaceChild(i, el); - i.appendChild(el); - } - } - } - return [true]; - }, - - - /** - * @method cmd_underline - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('underline') is used. - */ - cmd_underline: function(value) { - if (!this.browser.webkit) { - var el = this._getSelectedElement(); - if (el && this._isElement(el, 'span')) { - if (el.style.textDecoration == 'underline') { - el.style.textDecoration = 'none'; - } else { - el.style.textDecoration = 'underline'; - } - return [false]; - } - } - return [true]; - }, - /** - * @method cmd_backcolor - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('backcolor') is used. - */ - cmd_backcolor: function(value) { - var exec = true, - el = this._getSelectedElement(), - action = 'backcolor'; - - if (this.browser.gecko || this.browser.opera) { - this._setEditorStyle(true); - action = 'hilitecolor'; - } - - if (!this._isElement(el, 'body') && !this._hasSelection()) { - el.style.backgroundColor = value; - this._selectNode(el); - exec = false; - } else { - if (this.get('insert')) { - el = this._createInsertElement({ backgroundColor: value }); - } else { - this._createCurrentElement('span', { backgroundColor: value, color: el.style.color, fontSize: el.style.fontSize, fontFamily: el.style.fontFamily }); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - - return [exec, action]; - }, - /** - * @method cmd_forecolor - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('forecolor') is used. - */ - cmd_forecolor: function(value) { - var exec = true, - el = this._getSelectedElement(); - - if (!this._isElement(el, 'body') && !this._hasSelection()) { - Dom.setStyle(el, 'color', value); - this._selectNode(el); - exec = false; - } else { - if (this.get('insert')) { - el = this._createInsertElement({ color: value }); - } else { - this._createCurrentElement('span', { color: value, fontSize: el.style.fontSize, fontFamily: el.style.fontFamily, backgroundColor: el.style.backgroundColor }); - this._selectNode(this.currentElement[0]); - } - exec = false; - } - return [exec]; - }, - /** - * @method cmd_unlink - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('unlink') is used. - */ - cmd_unlink: function(value) { - this._swapEl(this.currentElement[0], 'span', function(el) { - el.className = 'yui-non'; - }); - return [false]; - }, - /** - * @method cmd_createlink - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('createlink') is used. - */ - cmd_createlink: function(value) { - var el = this._getSelectedElement(), _a = null; - if (this._hasParent(el, 'a')) { - this.currentElement[0] = this._hasParent(el, 'a'); - } else if (this._isElement(el, 'li')) { - _a = this._getDoc().createElement('a'); - _a.innerHTML = el.innerHTML; - el.innerHTML = ''; - el.appendChild(_a); - this.currentElement[0] = _a; - } else if (!this._isElement(el, 'a')) { - this._createCurrentElement('a'); - _a = this._swapEl(this.currentElement[0], 'a'); - this.currentElement[0] = _a; - } else { - this.currentElement[0] = el; - } - return [false]; - }, - /** - * @method cmd_insertimage - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertimage') is used. - */ - cmd_insertimage: function(value) { - var exec = true, _img = null, action = 'insertimage', - el = this._getSelectedElement(); - - if (value === '') { - value = this.get('blankimage'); - } - - /* - * @knownissue Safari Cursor Position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - - if (this._isElement(el, 'img')) { - this.currentElement[0] = el; - exec = false; - } else { - if (this._getDoc().queryCommandEnabled(action)) { - this._getDoc().execCommand(action, false, value); - var imgs = this._getDoc().getElementsByTagName('img'); - for (var i = 0; i < imgs.length; i++) { - if (!YAHOO.util.Dom.hasClass(imgs[i], 'yui-img')) { - YAHOO.util.Dom.addClass(imgs[i], 'yui-img'); - this.currentElement[0] = imgs[i]; - } - } - exec = false; - } else { - if (el == this._getDoc().body) { - _img = this._getDoc().createElement('img'); - _img.setAttribute('src', value); - YAHOO.util.Dom.addClass(_img, 'yui-img'); - this._getDoc().body.appendChild(_img); - } else { - this._createCurrentElement('img'); - _img = this._getDoc().createElement('img'); - _img.setAttribute('src', value); - YAHOO.util.Dom.addClass(_img, 'yui-img'); - this.currentElement[0].parentNode.replaceChild(_img, this.currentElement[0]); - } - this.currentElement[0] = _img; - exec = false; - } - } - return [exec]; - }, - /** - * @method cmd_inserthtml - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('inserthtml') is used. - */ - cmd_inserthtml: function(value) { - var exec = true, action = 'inserthtml', _span = null, _range = null; - /* - * @knownissue Safari cursor position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - if (this.browser.webkit && !this._getDoc().queryCommandEnabled(action)) { - this._createCurrentElement('img'); - _span = this._getDoc().createElement('span'); - _span.innerHTML = value; - this.currentElement[0].parentNode.replaceChild(_span, this.currentElement[0]); - exec = false; - } else if (this.browser.ie) { - _range = this._getRange(); - if (_range.item) { - _range.item(0).outerHTML = value; - } else { - _range.pasteHTML(value); - } - exec = false; - } - return [exec]; - }, - /** - * @method cmd_list - * @param tag The tag of the list you want to create (eg, ul or ol) - * @description This is a combined execCommand override method. It is called from the cmd_insertorderedlist and cmd_insertunorderedlist methods. - */ - cmd_list: function(tag) { - var exec = true, list = null, li = 0, el = null, str = '', - selEl = this._getSelectedElement(), action = 'insertorderedlist'; - if (tag == 'ul') { - action = 'insertunorderedlist'; - } - /* - * @knownissue Safari 2.+ doesn't support ordered and unordered lists - * @browser Safari 2.x - * The issue with this workaround is that when applied to a set of text - * that has BR's in it, Safari may or may not pick up the individual items as - * list items. This is fixed in WebKit (Safari 3) - * 2.6.0: Seems there are still some issues with List Creation and Safari 3, reverting to previously working Safari 2.x code - */ - //if ((this.browser.webkit && !this._getDoc().queryCommandEnabled(action))) { - if ((this.browser.webkit && !this.browser.webkit4) || (this.browser.opera)) { - if (this._isElement(selEl, 'li') && this._isElement(selEl.parentNode, tag)) { - el = selEl.parentNode; - list = this._getDoc().createElement('span'); - YAHOO.util.Dom.addClass(list, 'yui-non'); - str = ''; - var lis = el.getElementsByTagName('li'), p_tag = ((this.browser.opera && this.get('ptags')) ? 'p' : 'div'); - for (li = 0; li < lis.length; li++) { - str += '<' + p_tag + '>' + lis[li].innerHTML + ''; - } - list.innerHTML = str; - this.currentElement[0] = el; - this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]); - } else { - this._createCurrentElement(tag.toLowerCase()); - list = this._getDoc().createElement(tag); - for (li = 0; li < this.currentElement.length; li++) { - var newli = this._getDoc().createElement('li'); - newli.innerHTML = this.currentElement[li].innerHTML + '  '; - list.appendChild(newli); - if (li > 0) { - this.currentElement[li].parentNode.removeChild(this.currentElement[li]); - } - } - var b_tag = ((this.browser.opera) ? '
                  ' : '
                  '), - items = list.firstChild.innerHTML.split(b_tag), i, item; - if (items.length > 0) { - list.innerHTML = ''; - for (i = 0; i < items.length; i++) { - item = this._getDoc().createElement('li'); - item.innerHTML = items[i]; - list.appendChild(item); - } - } - - this.currentElement[0].parentNode.replaceChild(list, this.currentElement[0]); - this.currentElement[0] = list; - var _h = this.currentElement[0].firstChild; - _h = Dom.getElementsByClassName('yui-non', 'span', _h)[0]; - if (this.browser.webkit) { - this._getSelection().setBaseAndExtent(_h, 1, _h, _h.innerText.length); - } - } - exec = false; - } else { - el = this._getSelectedElement(); - if (this._isElement(el, 'li') && this._isElement(el.parentNode, tag) || (this.browser.ie && this._isElement(this._getRange().parentElement, 'li')) || (this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { //we are in a list.. - if (this.browser.ie) { - if ((this.browser.ie && this._isElement(el, 'ul')) || (this.browser.ie && this._isElement(el, 'ol'))) { - el = el.getElementsByTagName('li')[0]; - } - str = ''; - var lis2 = el.parentNode.getElementsByTagName('li'); - for (var j = 0; j < lis2.length; j++) { - str += lis2[j].innerHTML + '
                  '; - } - var newEl = this._getDoc().createElement('span'); - newEl.innerHTML = str; - el.parentNode.parentNode.replaceChild(newEl, el.parentNode); - } else { - this.nodeChange(); - this._getDoc().execCommand(action, '', el.parentNode); - this.nodeChange(); - } - exec = false; - } - if (this.browser.opera) { - var self = this; - window.setTimeout(function() { - var liso = self._getDoc().getElementsByTagName('li'); - for (var i = 0; i < liso.length; i++) { - if (liso[i].innerHTML.toLowerCase() == '
                  ') { - liso[i].parentNode.parentNode.removeChild(liso[i].parentNode); - } - } - },30); - } - if (this.browser.ie && exec) { - var html = ''; - if (this._getRange().html) { - html = '
                • ' + this._getRange().html+ '
                • '; - } else { - var t = this._getRange().text.split('\n'); - if (t.length > 1) { - html = ''; - for (var ie = 0; ie < t.length; ie++) { - html += '
                • ' + t[ie] + '
                • '; - } - } else { - var txt = this._getRange().text; - if (txt === '') { - html = '
                • ' + txt + '
                • '; - } else { - html = '
                • ' + txt + '
                • '; - } - } - } - this._getRange().pasteHTML('<' + tag + '>' + html + ''); - var new_item = this._getDoc().getElementById('new_list_item'); - if (new_item) { - var range = this._getDoc().body.createTextRange(); - range.moveToElementText(new_item); - range.collapse(false); - range.select(); - new_item.id = ''; - } - exec = false; - } - } - return exec; - }, - /** - * @method cmd_insertorderedlist - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertorderedlist ') is used. - */ - cmd_insertorderedlist: function(value) { - return [this.cmd_list('ol')]; - }, - /** - * @method cmd_insertunorderedlist - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('insertunorderedlist') is used. - */ - cmd_insertunorderedlist: function(value) { - return [this.cmd_list('ul')]; - }, - /** - * @method cmd_fontname - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontname') is used. - */ - cmd_fontname: function(value) { - var exec = true, - selEl = this._getSelectedElement(); - - this.currentFont = value; - if (selEl && selEl.tagName && !this._hasSelection() && !this._isElement(selEl, 'body') && !this.get('insert')) { - YAHOO.util.Dom.setStyle(selEl, 'font-family', value); - exec = false; - } else if (this.get('insert') && !this._hasSelection()) { - var el = this._createInsertElement({ fontFamily: value }); - exec = false; - } - return [exec]; - }, - /** - * @method cmd_fontsize - * @param value Value passed from the execCommand method - * @description This is an execCommand override method. It is called from execCommand when the execCommand('fontsize') is used. - */ - cmd_fontsize: function(value) { - var el = null, go = true; - el = this._getSelectedElement(); - if (this.browser.webkit) { - if (this.currentElement[0]) { - if (el == this.currentElement[0]) { - go = false; - YAHOO.util.Dom.setStyle(el, 'fontSize', value); - this._selectNode(el); - this.currentElement[0] = el; - } - } - } - if (go) { - if (!this._isElement(this._getSelectedElement(), 'body') && (!this._hasSelection())) { - el = this._getSelectedElement(); - YAHOO.util.Dom.setStyle(el, 'fontSize', value); - if (this.get('insert') && this.browser.ie) { - var r = this._getRange(); - r.collapse(false); - r.select(); - } else { - this._selectNode(el); - } - } else if (this.currentElement && (this.currentElement.length > 0) && (!this._hasSelection()) && (!this.get('insert'))) { - YAHOO.util.Dom.setStyle(this.currentElement, 'fontSize', value); - } else { - if (this.get('insert') && !this._hasSelection()) { - el = this._createInsertElement({ fontSize: value }); - this.currentElement[0] = el; - this._selectNode(this.currentElement[0]); - } else { - this._createCurrentElement('span', {'fontSize': value, fontFamily: el.style.fontFamily, color: el.style.color, backgroundColor: el.style.backgroundColor }); - this._selectNode(this.currentElement[0]); - } - } - } - return [false]; - }, - /* }}} */ - /** - * @private - * @method _swapEl - * @param {HTMLElement} el The element to swap with - * @param {String} tagName The tagname of the element that you wish to create - * @param {Function} callback (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function. - * @description This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place. - */ - _swapEl: function(el, tagName, callback) { - var _el = this._getDoc().createElement(tagName); - if (el) { - _el.innerHTML = el.innerHTML; - } - if (typeof callback == 'function') { - callback.call(this, _el); - } - if (el) { - el.parentNode.replaceChild(_el, el); - } - return _el; - }, - /** - * @private - * @method _createInsertElement - * @description Creates a new "currentElement" then adds some text (and other things) to make it selectable and stylable. Then the user can continue typing. - * @param {Object} css (optional) Object literal containing styles to apply to the new element. - * @return {HTMLElement} - */ - _createInsertElement: function(css) { - this._createCurrentElement('span', css); - var el = this.currentElement[0]; - if (this.browser.webkit) { - //Little Safari Hackery here.. - el.innerHTML = ' '; - el = el.firstChild; - this._getSelection().setBaseAndExtent(el, 1, el, el.innerText.length); - } else if (this.browser.ie || this.browser.opera) { - el.innerHTML = ' '; - } - this.focus(); - this._selectNode(el, true); - return el; - }, - /** - * @private - * @method _createCurrentElement - * @param {String} tagName (optional defaults to a) The tagname of the element that you wish to create - * @param {Object} tagStyle (optional) Object literal containing styles to apply to the new element. - * @description This is a work around for the various browser issues with execCommand. This method will run execCommand('fontname', false, 'yui-tmp') on the given selection. - * It will then search the document for an element with the font-family set to yui-tmp and replace that with another span that has other information in it, then assign the new span to the - * this.currentElement array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit. - */ - _createCurrentElement: function(tagName, tagStyle) { - tagName = ((tagName) ? tagName : 'a'); - var tar = null, - el = [], - _doc = this._getDoc(); - - if (this.currentFont) { - if (!tagStyle) { - tagStyle = {}; - } - tagStyle.fontFamily = this.currentFont; - this.currentFont = null; - } - this.currentElement = []; - - var _elCreate = function(tagName, tagStyle) { - var el = null; - tagName = ((tagName) ? tagName : 'span'); - tagName = tagName.toLowerCase(); - switch (tagName) { - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - el = _doc.createElement(tagName); - break; - default: - el = _doc.createElement(tagName); - if (tagName === 'span') { - YAHOO.util.Dom.addClass(el, 'yui-tag-' + tagName); - YAHOO.util.Dom.addClass(el, 'yui-tag'); - el.setAttribute('tag', tagName); - } - - for (var k in tagStyle) { - if (YAHOO.lang.hasOwnProperty(tagStyle, k)) { - el.style[k] = tagStyle[k]; - } - } - break; - } - return el; - }; - - if (!this._hasSelection()) { - if (this._getDoc().queryCommandEnabled('insertimage')) { - this._getDoc().execCommand('insertimage', false, 'yui-tmp-img'); - var imgs = this._getDoc().getElementsByTagName('img'); - for (var j = 0; j < imgs.length; j++) { - if (imgs[j].getAttribute('src', 2) == 'yui-tmp-img') { - el = _elCreate(tagName, tagStyle); - imgs[j].parentNode.replaceChild(el, imgs[j]); - this.currentElement[this.currentElement.length] = el; - } - } - } else { - if (this.currentEvent) { - tar = YAHOO.util.Event.getTarget(this.currentEvent); - } else { - //For Safari.. - tar = this._getDoc().body; - } - } - if (tar) { - /* - * @knownissue Safari Cursor Position - * @browser Safari 2.x - * @description The issue here is that we have no way of knowing where the cursor position is - * inside of the iframe, so we have to place the newly inserted data in the best place that we can. - */ - el = _elCreate(tagName, tagStyle); - if (this._isElement(tar, 'body') || this._isElement(tar, 'html')) { - if (this._isElement(tar, 'html')) { - tar = this._getDoc().body; - } - tar.appendChild(el); - } else if (tar.nextSibling) { - tar.parentNode.insertBefore(el, tar.nextSibling); - } else { - tar.parentNode.appendChild(el); - } - //this.currentElement = el; - this.currentElement[this.currentElement.length] = el; - this.currentEvent = null; - if (this.browser.webkit) { - //Force Safari to focus the new element - this._getSelection().setBaseAndExtent(el, 0, el, 0); - if (this.browser.webkit3) { - this._getSelection().collapseToStart(); - } else { - this._getSelection().collapse(true); - } - } - } - } else { - //Force CSS Styling for this action... - this._setEditorStyle(true); - this._getDoc().execCommand('fontname', false, 'yui-tmp'); - var _tmp = [], __tmp, __els = ['font', 'span', 'i', 'b', 'u']; - - if (!this._isElement(this._getSelectedElement(), 'body')) { - __els[__els.length] = this._getDoc().getElementsByTagName(this._getSelectedElement().tagName); - __els[__els.length] = this._getDoc().getElementsByTagName(this._getSelectedElement().parentNode.tagName); - } - for (var _els = 0; _els < __els.length; _els++) { - var _tmp1 = this._getDoc().getElementsByTagName(__els[_els]); - for (var e = 0; e < _tmp1.length; e++) { - _tmp[_tmp.length] = _tmp1[e]; - } - } - - - for (var i = 0; i < _tmp.length; i++) { - if ((YAHOO.util.Dom.getStyle(_tmp[i], 'font-family') == 'yui-tmp') || (_tmp[i].face && (_tmp[i].face == 'yui-tmp'))) { - if (tagName !== 'span') { - el = _elCreate(tagName, tagStyle); - } else { - el = _elCreate(_tmp[i].tagName, tagStyle); - } - el.innerHTML = _tmp[i].innerHTML; - if (this._isElement(_tmp[i], 'ol') || (this._isElement(_tmp[i], 'ul'))) { - var fc = _tmp[i].getElementsByTagName('li')[0]; - _tmp[i].style.fontFamily = 'inherit'; - fc.style.fontFamily = 'inherit'; - el.innerHTML = fc.innerHTML; - fc.innerHTML = ''; - fc.appendChild(el); - this.currentElement[this.currentElement.length] = el; - } else if (this._isElement(_tmp[i], 'li')) { - _tmp[i].innerHTML = ''; - _tmp[i].appendChild(el); - _tmp[i].style.fontFamily = 'inherit'; - this.currentElement[this.currentElement.length] = el; - } else { - if (_tmp[i].parentNode) { - _tmp[i].parentNode.replaceChild(el, _tmp[i]); - this.currentElement[this.currentElement.length] = el; - this.currentEvent = null; - if (this.browser.webkit) { - //Force Safari to focus the new element - this._getSelection().setBaseAndExtent(el, 0, el, 0); - if (this.browser.webkit3) { - this._getSelection().collapseToStart(); - } else { - this._getSelection().collapse(true); - } - } - if (this.browser.ie && tagStyle && tagStyle.fontSize) { - this._getSelection().empty(); - } - if (this.browser.gecko) { - this._getSelection().collapseToStart(); - } - } - } - } - } - var len = this.currentElement.length; - for (var o = 0; o < len; o++) { - if ((o + 1) != len) { //Skip the last one in the list - if (this.currentElement[o] && this.currentElement[o].nextSibling) { - if (this._isElement(this.currentElement[o], 'br')) { - this.currentElement[this.currentElement.length] = this.currentElement[o].nextSibling; - } - } - } - } - } - }, - /** - * @method saveHTML - * @description Cleans the HTML with the cleanHTML method then places that string back into the textarea. - * @return String - */ - saveHTML: function() { - var html = this.cleanHTML(); - if (this._textarea) { - this.get('element').value = html; - } else { - this.get('element').innerHTML = html; - } - if (this.get('saveEl') !== this.get('element')) { - var out = this.get('saveEl'); - if (Lang.isString(out)) { - out = Dom.get(out); - } - if (out) { - if (out.tagName.toLowerCase() === 'textarea') { - out.value = html; - } else { - out.innerHTML = html; - } - } - } - return html; - }, - /** - * @method setEditorHTML - * @param {String} incomingHTML The html content to load into the editor - * @description Loads HTML into the editors body - */ - setEditorHTML: function(incomingHTML) { - var html = this._cleanIncomingHTML(incomingHTML); - html = html.replace(/RIGHT_BRACKET/gi, '{'); - html = html.replace(/LEFT_BRACKET/gi, '}'); - this._getDoc().body.innerHTML = html; - this.nodeChange(); - }, - /** - * @method getEditorHTML - * @description Gets the unprocessed/unfiltered HTML from the editor - */ - getEditorHTML: function() { - try { - var b = this._getDoc().body; - if (b === null) { - return null; - } - return this._getDoc().body.innerHTML; - } catch (e) { - return ''; - } - }, - /** - * @method show - * @description This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none. - */ - show: function() { - if (this.browser.gecko) { - this._setDesignMode('on'); - this.focus(); - } - if (this.browser.webkit) { - var self = this; - window.setTimeout(function() { - self._setInitialContent.call(self); - }, 10); - } - //Adding this will close all other Editor window's when showing this one. - if (this.currentWindow) { - this.closeWindow(); - } - //Put the iframe back in place - this.get('iframe').setStyle('position', 'static'); - this.get('iframe').setStyle('left', ''); - }, - /** - * @method hide - * @description This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows. - */ - hide: function() { - //Adding this will close all other Editor window's. - if (this.currentWindow) { - this.closeWindow(); - } - if (this._fixNodesTimer) { - clearTimeout(this._fixNodesTimer); - this._fixNodesTimer = null; - } - if (this._nodeChangeTimer) { - clearTimeout(this._nodeChangeTimer); - this._nodeChangeTimer = null; - } - this._lastNodeChange = 0; - //Move the iframe off of the screen, so that in containers with visiblity hidden, IE will not cover other elements. - this.get('iframe').setStyle('position', 'absolute'); - this.get('iframe').setStyle('left', '-9999px'); - }, - /** - * @method _cleanIncomingHTML - * @param {String} html The unfiltered HTML - * @description Process the HTML with a few regexes to clean it up and stabilize the input - * @return {String} The filtered HTML - */ - _cleanIncomingHTML: function(html) { - html = html.replace(/{/gi, 'RIGHT_BRACKET'); - html = html.replace(/}/gi, 'LEFT_BRACKET'); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/strong>/gi, '
                  '); - - //replace embed before em check - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/embed>/gi, ''); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/em>/gi, '
                  '); - html = html.replace(/_moz_dirty=""/gi, ''); - - //Put embed tags back in.. - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/YUI_EMBED>/gi, ''); - if (this.get('plainText')) { - html = html.replace(/\n/g, '
                  ').replace(/\r/g, '
                  '); - html = html.replace(/ /gi, '  '); //Replace all double spaces - html = html.replace(/\t/gi, '    '); //Replace all tabs - } - //Removing Script Tags from the Editor - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/script([^>]*)>/gi, ''); - html = html.replace(/<script([^>]*)>/gi, ''); - html = html.replace(/<\/script([^>]*)>/gi, ''); - //Replace the line feeds - html = html.replace(/\r\n/g, '').replace(/\n/g, '').replace(/\r/g, ''); - - //Remove Bad HTML elements (used to be script nodes) - html = html.replace(new RegExp(']*)>(.*?)<\/bad>', 'gi'), ''); - //Replace the lines feeds - html = html.replace(//g, '\n'); - return html; - }, - /** - * @method cleanHTML - * @param {String} html The unfiltered HTML - * @description Process the HTML with a few regexes to clean it up and stabilize the output - * @return {String} The filtered HTML - */ - cleanHTML: function(html) { - //Start Filtering Output - //Begin RegExs.. - if (!html) { - html = this.getEditorHTML(); - } - var markup = this.get('markup'); - //Make some backups... - html = this.pre_filter_linebreaks(html, markup); - - //Filter MS Word - html = this.filter_msword(html); - - html = html.replace(/]*)\/>/gi, ''); - html = html.replace(/]*)>/gi, ''); - - html = html.replace(/]*)\/>/gi, ''); - html = html.replace(/]*)>/gi, ''); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/ul>/gi, '<\/YUI_UL>'); - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/blockquote>/gi, '<\/YUI_BQ>'); - - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/embed>/gi, '<\/YUI_EMBED>'); - - //Convert b and i tags to strong and em tags - if ((markup == 'semantic') || (markup == 'xhtml')) { - html = html.replace(/]*)?>/gi, ''); - html = html.replace(/<\/i>/gi, ''); - html = html.replace(/]*)?>/gi, ''); - html = html.replace(/<\/b>/gi, ''); - } - - html = html.replace(/_moz_dirty=""/gi, ''); - - //normalize strikethrough - html = html.replace(//gi, '/span>'); - - - //Case Changing - if (this.browser.ie) { - html = html.replace(/text-decoration/gi, 'text-decoration'); - html = html.replace(/font-weight/gi, 'font-weight'); - html = html.replace(/_width="([^>]*)"/gi, ''); - html = html.replace(/_height="([^>]*)"/gi, ''); - //Cleanup Image URL's - var url = this._baseHREF.replace(/\//gi, '\\/'), - re = new RegExp('src="' + url, 'gi'); - html = html.replace(re, 'src="'); - } - html = html.replace(//gi, ''); - html = html.replace(//gi, ''); - if ((markup == 'semantic') || (markup == 'xhtml') || (markup == 'css')) { - html = html.replace(new RegExp(']*)face="([^>]*)">(.*?)<\/font>', 'gi'), '$3'); - html = html.replace(/([^>]*)<\/span>', 'gi'), '$1'); - html = html.replace(new RegExp('([^>]*)<\/span>', 'gi'), '$1'); - } - html = html.replace(/\/u>/gi, '/span>'); - if (markup == 'css') { - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/em>/gi, ''); - html = html.replace(/]*)>/gi, ''); - html = html.replace(/<\/strong>/gi, ''); - html = html.replace(//gi, '/span>'); - html = html.replace(//gi, '/span>'); - } - html = html.replace(/ /gi, ' '); //Replace all double spaces and replace with a single - } else { - html = html.replace(//gi, '/u>'); - } - html = html.replace(/]*)>/gi, ''); - html = html.replace(/\/ol>/gi, '/ol>'); - html = html.replace(/
                • /gi, '/li>'); - html = this.filter_safari(html); - - html = this.filter_internals(html); - - html = this.filter_all_rgb(html); - - //Replace our backups with the real thing - html = this.post_filter_linebreaks(html, markup); - - if (markup == 'xhtml') { - html = html.replace(/]*)>/g, ''); - html = html.replace(/]*)>/g, ''); - } else { - html = html.replace(/]*)>/g, ''); - html = html.replace(/]*)>/g, ''); - } - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_UL>/g, '<\/ul>'); - - html = this.filter_invalid_lists(html); - - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_BQ>/g, '<\/blockquote>'); - - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/YUI_EMBED>/g, '<\/embed>'); - - //This should fix &'s in URL's - html = html.replace(/ & /gi, ' YUI_AMP '); - html = html.replace(/ &/gi, ' YUI_AMP_F '); - html = html.replace(/& /gi, ' YUI_AMP_R '); - html = html.replace(/&/gi, '&'); - html = html.replace(/ YUI_AMP /gi, ' & '); - html = html.replace(/ YUI_AMP_F /gi, ' &'); - html = html.replace(/ YUI_AMP_R /gi, '& '); - - //Trim the output, removing whitespace from the beginning and end - html = YAHOO.lang.trim(html); - - if (this.get('removeLineBreaks')) { - html = html.replace(/\n/g, '').replace(/\r/g, ''); - html = html.replace(/ /gi, ' '); //Replace all double spaces and replace with a single - } - - for (var v in this.invalidHTML) { - if (YAHOO.lang.hasOwnProperty(this.invalidHTML, v)) { - if (Lang.isObject(v) && v.keepContents) { - html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), '$1'); - } else { - html = html.replace(new RegExp('<' + v + '([^>]*)>(.*?)<\/' + v + '>', 'gi'), ''); - } - } - } - - /* LATER -- Add DOM manipulation - console.log(html); - var frag = document.createDocumentFragment(); - frag.innerHTML = html; - - var ps = frag.getElementsByTagName('p'), - len = ps.length; - for (var i = 0; i < len; i++) { - var ps2 = ps[i].getElementsByTagName('p'); - if (ps2.length) { - - } - - } - html = frag.innerHTML; - console.log(html); - */ - - this.fireEvent('cleanHTML', { type: 'cleanHTML', target: this, html: html }); - - return html; - }, - /** - * @method filter_msword - * @param String html The HTML string to filter - * @description Filters out msword html attributes and other junk. Activate with filterWord: true in config - */ - filter_msword: function(html) { - if (!this.get('filterWord')) { - return html; - } - //Remove the ms o: tags - html = html.replace(/\s*<\/o:p>/g, ''); - html = html.replace(/[\s\S]*?<\/o:p>/g, ' '); - - //Remove the ms w: tags - html = html.replace( /]*>[\s\S]*?<\/w:[^>]*>/gi, ''); - - //Remove mso-? styles. - html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, ''); - - //Remove more bogus MS styles. - html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, ''); - html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\""); - html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, ''); - html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\""); - html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\""); - html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ); - html = html.replace( /\s*tab-stops:[^;"]*;?/gi, ''); - html = html.replace( /\s*tab-stops:[^"]*/gi, ''); - - //Remove XML declarations - html = html.replace(/<\\?\?xml[^>]*>/gi, ''); - - //Remove lang - html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); - - //Remove language tags - html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3"); - - //Remove onmouseover and onmouseout events (from MS Word comments effect) - html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3"); - html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3"); - - return html; - }, - /** - * @method filter_invalid_lists - * @param String html The HTML string to filter - * @description Filters invalid ol and ul list markup, converts this:
                  1. ..
                  to this:
                  1. ..
                • - */ - filter_invalid_lists: function(html) { - html = html.replace(/<\/li>\n/gi, ''); - - html = html.replace(/<\/li>
                    /gi, '
                    1. '); - html = html.replace(/<\/ol>/gi, '
                  1. '); - html = html.replace(/<\/ol><\/li>\n/gi, "
                  "); - - html = html.replace(/<\/li>
                    /gi, '
                    • '); - html = html.replace(/<\/ul>/gi, '
                  • '); - html = html.replace(/<\/ul><\/li>\n?/gi, "
                  "); - - html = html.replace(/<\/li>/gi, ""); - html = html.replace(/<\/ol>/gi, "
            "); - html = html.replace(/
              /gi, "
                "); - html = html.replace(/
                  /gi, "
                    "); - return html; - }, - /** - * @method filter_safari - * @param String html The HTML string to filter - * @description Filters strings specific to Safari - * @return String - */ - filter_safari: function(html) { - if (this.browser.webkit) { - // - html = html.replace(/([^>])<\/span>/gi, '    '); - html = html.replace(/Apple-style-span/gi, ''); - html = html.replace(/style="line-height: normal;"/gi, ''); - html = html.replace(/yui-wk-div/gi, ''); - html = html.replace(/yui-wk-p/gi, ''); - - - //Remove bogus LI's - html = html.replace(/
                  • <\/li>/gi, ''); - html = html.replace(/
                  • <\/li>/gi, ''); - html = html.replace(/
                  • <\/li>/gi, ''); - //Remove bogus DIV's - updated from just removing the div's to replacing /div with a break - if (this.get('ptags')) { - html = html.replace(/]*)>/g, ''); - html = html.replace(/<\/div>/gi, '

                    '); - } else { - //html = html.replace(/
                    /gi, '
                    '); - html = html.replace(/]*)>([ tnr]*)<\/div>/gi, '
                    '); - html = html.replace(/<\/div>/gi, ''); - } - } - return html; - }, - /** - * @method filter_internals - * @param String html The HTML string to filter - * @description Filters internal RTE strings and bogus attrs we don't want - * @return String - */ - filter_internals: function(html) { - html = html.replace(/\r/g, ''); - //Fix stuff we don't want - html = html.replace(/<\/?(body|head|html)[^>]*>/gi, ''); - //Fix last BR in LI - html = html.replace(/<\/li>/gi, '
                  • '); - - html = html.replace(/yui-tag-span/gi, ''); - html = html.replace(/yui-tag/gi, ''); - html = html.replace(/yui-non/gi, ''); - html = html.replace(/yui-img/gi, ''); - html = html.replace(/ tag="span"/gi, ''); - html = html.replace(/ class=""/gi, ''); - html = html.replace(/ style=""/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ class=" "/gi, ''); - html = html.replace(/ target=""/gi, ''); - html = html.replace(/ title=""/gi, ''); - - if (this.browser.ie) { - html = html.replace(/ class= /gi, ''); - html = html.replace(/ class= >/gi, ''); - } - - return html; - }, - /** - * @method filter_all_rgb - * @param String str The HTML string to filter - * @description Converts all RGB color strings found in passed string to a hex color, example: style="color: rgb(0, 255, 0)" converts to style="color: #00ff00" - * @return String - */ - filter_all_rgb: function(str) { - var exp = new RegExp("rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)", "gi"); - var arr = str.match(exp); - if (Lang.isArray(arr)) { - for (var i = 0; i < arr.length; i++) { - var color = this.filter_rgb(arr[i]); - str = str.replace(arr[i].toString(), color); - } - } - - return str; - }, - /** - * @method filter_rgb - * @param String css The CSS string containing rgb(#,#,#); - * @description Converts an RGB color string to a hex color, example: rgb(0, 255, 0) converts to #00ff00 - * @return String - */ - filter_rgb: function(css) { - if (css.toLowerCase().indexOf('rgb') != -1) { - var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"); - var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(','); - - if (rgb.length == 5) { - var r = parseInt(rgb[1], 10).toString(16); - var g = parseInt(rgb[2], 10).toString(16); - var b = parseInt(rgb[3], 10).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - css = "#" + r + g + b; - } - } - return css; - }, - /** - * @method pre_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - pre_filter_linebreaks: function(html, markup) { - if (this.browser.webkit) { - html = html.replace(/
                    /gi, ''); - html = html.replace(/
                    /gi, ''); - } - html = html.replace(/
                    /gi, ''); - html = html.replace(/
                    /gi, ''); - html = html.replace(//gi, ''); - html = html.replace(/
                    /gi, ''); - html = html.replace(/
                    <\/div>/gi, ''); - html = html.replace(/

                    ( | )<\/p>/g, ''); - html = html.replace(/


                     <\/p>/gi, ''); - html = html.replace(/

                     <\/p>/gi, ''); - //Fix last BR - html = html.replace(/$/, ''); - //Fix last BR in P - html = html.replace(/<\/p>/g, '

                    '); - if (this.browser.ie) { - html = html.replace(/    /g, '\t'); - } - return html; - }, - /** - * @method post_filter_linebreaks - * @param String html The HTML to filter - * @param String markup The markup type to filter to - * @description HTML Pre Filter - * @return String - */ - post_filter_linebreaks: function(html, markup) { - if (markup == 'xhtml') { - html = html.replace(//g, '
                    '); - } else { - html = html.replace(//g, '
                    '); - } - return html; - }, - /** - * @method clearEditorDoc - * @description Clear the doc of the Editor - */ - clearEditorDoc: function() { - this._getDoc().body.innerHTML = ' '; - }, - /** - * @method openWindow - * @description Override Method for Advanced Editor - */ - openWindow: function(win) { - }, - /** - * @method moveWindow - * @description Override Method for Advanced Editor - */ - moveWindow: function() { - }, - /** - * @private - * @method _closeWindow - * @description Override Method for Advanced Editor - */ - _closeWindow: function() { - }, - /** - * @method closeWindow - * @description Override Method for Advanced Editor - */ - closeWindow: function() { - //this.unsubscribeAll('afterExecCommand'); - this.toolbar.resetAllButtons(); - this.focus(); - }, - /** - * @method destroy - * @description Destroys the editor, all of it's elements and objects. - * @return {Boolean} - */ - destroy: function() { - if (this._nodeChangeDelayTimer) { - clearTimeout(this._nodeChangeDelayTimer); - } - this.hide(); - - if (this.resize) { - this.resize.destroy(); - } - if (this.dd) { - this.dd.unreg(); - } - if (this.get('panel')) { - this.get('panel').destroy(); - } - this.saveHTML(); - this.toolbar.destroy(); - this.setStyle('visibility', 'visible'); - this.setStyle('position', 'static'); - this.setStyle('top', ''); - this.setStyle('left', ''); - var textArea = this.get('element'); - this.get('element_cont').get('parentNode').replaceChild(textArea, this.get('element_cont').get('element')); - this.get('element_cont').get('element').innerHTML = ''; - this.set('handleSubmit', false); //Remove the submit handler - return true; - }, - /** - * @method toString - * @description Returns a string representing the editor. - * @return {String} - */ - toString: function() { - var str = 'SimpleEditor'; - if (this.get && this.get('element_cont')) { - str = 'SimpleEditor (#' + this.get('element_cont').get('id') + ')' + ((this.get('disabled') ? ' Disabled' : '')); - } - return str; - } - }); - -/** -* @event toolbarLoaded -* @description Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event cleanHTML -* @description Event is fired after the cleanHTML method is called. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterRender -* @description Event is fired after the render process finishes. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorContentLoaded -* @description Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeNodeChange -* @description Event fires at the beginning of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterNodeChange -* @description Event fires at the end of the nodeChange process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeExecCommand -* @description Event fires at the beginning of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event afterExecCommand -* @description Event fires at the end of the execCommand process. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorClick -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Passed through HTML Event. See Element.addListener for more information on listening for this event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorMouseDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorDoubleClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorClick -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyUp -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyPress -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeEditorKeyDown -* @param {Event} ev The DOM Event that occured -* @description Fires before editor event, returning false will stop the internal processing. -* @type YAHOO.util.CustomEvent -*/ - -/** -* @event editorWindowFocus -* @description Fires when the iframe is focused. Note, this is window focus event, not an Editor focus event. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event editorWindowBlur -* @description Fires when the iframe is blurred. Note, this is window blur event, not an Editor blur event. -* @type YAHOO.util.CustomEvent -*/ - - -/** - * @description Singleton object used to track the open window objects and panels across the various open editors - * @class EditorInfo - * @static -*/ -YAHOO.widget.EditorInfo = { - /** - * @private - * @property _instances - * @description A reference to all editors on the page. - * @type Object - */ - _instances: {}, - /** - * @private - * @property blankImage - * @description A reference to the blankImage url - * @type String - */ - blankImage: '', - /** - * @private - * @property window - * @description A reference to the currently open window object in any editor on the page. - * @type Object YAHOO.widget.EditorWindow - */ - window: {}, - /** - * @private - * @property panel - * @description A reference to the currently open panel in any editor on the page. - * @type Object YAHOO.widget.Overlay - */ - panel: null, - /** - * @method getEditorById - * @description Returns a reference to the Editor object associated with the given textarea - * @param {String/HTMLElement} id The id or reference of the textarea to return the Editor instance of - * @return Object YAHOO.widget.Editor - */ - getEditorById: function(id) { - if (!YAHOO.lang.isString(id)) { - //Not a string, assume a node Reference - id = id.id; - } - if (this._instances[id]) { - return this._instances[id]; - } - return false; - }, - /** - * @method saveAll - * @description Saves all Editor instances on the page. If a form reference is passed, only Editor's bound to this form will be saved. - * @param {HTMLElement} form The form to check if this Editor instance belongs to - */ - saveAll: function(form) { - var i, e, items = YAHOO.widget.EditorInfo._instances; - if (form) { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - e = items[i]; - if (e.get('element').form && (e.get('element').form == form)) { - e.saveHTML(); - } - } - } - } else { - for (i in items) { - if (Lang.hasOwnProperty(items, i)) { - items[i].saveHTML(); - } - } - } - }, - /** - * @method toString - * @description Returns a string representing the EditorInfo. - * @return {String} - */ - toString: function() { - var len = 0; - for (var i in this._instances) { - if (Lang.hasOwnProperty(this._instances, i)) { - len++; - } - } - return 'Editor Info (' + len + ' registered intance' + ((len > 1) ? 's' : '') + ')'; - } -}; - - - - -})(); -YAHOO.register("simpleeditor", YAHOO.widget.SimpleEditor, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-debug.js deleted file mode 100644 index e5b3c619c7..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-debug.js +++ /dev/null @@ -1,141 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Augments the Element Utility with a delegate method that - * facilitates easy creation of delegated event listeners. (Note: Using CSS - * selectors as the filtering criteria for delegated event listeners requires - * inclusion of the Selector Utility.) - * - * @module element-delegate - * @title Element Event Delegation Module - * @namespace YAHOO.util - * @requires element, event-delegate - */ - -(function () { - - var Event = YAHOO.util.Event, - delegates = [], - specialTypes = { - mouseenter: true, - mouseleave: true - }; - - YAHOO.lang.augmentObject(YAHOO.util.Element.prototype, { - - /** - * Appends a delegated event listener. Delegated event listeners - * receive two arguments by default: the DOM event and the element - * specified by the filtering function or CSS selector. - * (Note: Using the delegate method requires the element-delegate - * module. Using CSS selectors as the filtering criteria for delegated - * event listeners requires inclusion of the Selector Utility.) - * @method delegate - * @param {String} type The name of the event to listen for - * @param {Function} fn The handler to call when the event fires - * @param {Function|string} filter Function or CSS selector used to - * determine for what element(s) the event listener should be called. - * When a function is specified, the function should return an - * HTML element. Using a CSS Selector requires the inclusion of the - * CSS Selector Utility. - * @param {Any} obj A variable to pass to the handler - * @param {Object} scope The object to use for the scope of the handler - * @return {boolean} Returns true if the delegated event listener - * was added successfully - * @for Element - */ - delegate: function (type, fn, filter, obj, overrideContext) { - - if (YAHOO.lang.isString(filter) && !YAHOO.util.Selector) { - YAHOO.log("Using a CSS selector to define the filtering criteria for a delegated listener requires the Selector Utility.", "error", "Element"); - return false; - } - - if (!Event._createDelegate) { - YAHOO.log("Using delegate functionality requires the event-delegate module.", "error", "Element"); - return false; - } - - var sType = Event._getType(type), - el = this.get("element"), - fnDelegate, - fnMouseDelegate, - - fnWrapper = function (e) { - - return fnDelegate.call(el, e); - - }; - - if (specialTypes[type]) { - - if (!Event._createMouseDelegate) { - YAHOO.log("Delegating a " + type + " event requires the event-mouseleave module.", "error", "Element"); - return false; - } - - fnMouseDelegate = Event._createMouseDelegate(fn, obj, overrideContext); - - fnDelegate = Event._createDelegate(function (event, matchedEl, container) { - - return fnMouseDelegate.call(matchedEl, event, container); - - }, filter, obj, overrideContext); - - } - else { - fnDelegate = Event._createDelegate(fn, filter, obj, overrideContext); - } - - - delegates.push([el, sType, fn, fnWrapper]); - - return this.on(sType, fnWrapper); - - }, - - - /** - * Remove a delegated event listener - * @method removeDelegate - * @param {String} type The name of the event to listen for - * @param {Function} fn The function call when the event fires - * @return {boolean} Returns true if the unbind was successful, false - * otherwise. - * @for Element - */ - removeDelegate: function (type, fn) { - - var sType = Event._getType(type), - index = Event._getCacheIndex(delegates, this.get("element"), sType, fn), - returnVal, - cacheItem; - - if (index >= 0) { - cacheItem = delegates[index]; - } - - if (cacheItem) { - - returnVal = this.removeListener(cacheItem[1], cacheItem[3]); - - if (returnVal) { - delete delegates[index][2]; - delete delegates[index][3]; - delegates.splice(index, 1); - } - - } - - return returnVal; - - } - - }); - -}()); -YAHOO.register("element-delegate", YAHOO.util.Element, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-min.js deleted file mode 100644 index e745a5ed4d..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var A=YAHOO.util.Event,B=[],C={mouseenter:true,mouseleave:true};YAHOO.lang.augmentObject(YAHOO.util.Element.prototype,{delegate:function(J,L,F,H,I){if(YAHOO.lang.isString(F)&&!YAHOO.util.Selector){return false;}if(!A._createDelegate){return false;}var E=A._getType(J),G=this.get("element"),M,K,D=function(N){return M.call(G,N);};if(C[J]){if(!A._createMouseDelegate){return false;}K=A._createMouseDelegate(L,H,I);M=A._createDelegate(function(P,O,N){return K.call(O,P,N);},F,H,I);}else{M=A._createDelegate(L,F,H,I);}B.push([G,E,L,D]);return this.on(E,D);},removeDelegate:function(H,G){var I=A._getType(H),E=A._getCacheIndex(B,this.get("element"),I,G),F,D;if(E>=0){D=B[E];}if(D){F=this.removeListener(D[1],D[3]);if(F){delete B[E][2];delete B[E][3];B.splice(E,1);}}return F;}});}());YAHOO.register("element-delegate",YAHOO.util.Element,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate.js deleted file mode 100644 index 02ed4bdd99..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/element-delegate/element-delegate.js +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Augments the Element Utility with a delegate method that - * facilitates easy creation of delegated event listeners. (Note: Using CSS - * selectors as the filtering criteria for delegated event listeners requires - * inclusion of the Selector Utility.) - * - * @module element-delegate - * @title Element Event Delegation Module - * @namespace YAHOO.util - * @requires element, event-delegate - */ - -(function () { - - var Event = YAHOO.util.Event, - delegates = [], - specialTypes = { - mouseenter: true, - mouseleave: true - }; - - YAHOO.lang.augmentObject(YAHOO.util.Element.prototype, { - - /** - * Appends a delegated event listener. Delegated event listeners - * receive two arguments by default: the DOM event and the element - * specified by the filtering function or CSS selector. - * (Note: Using the delegate method requires the element-delegate - * module. Using CSS selectors as the filtering criteria for delegated - * event listeners requires inclusion of the Selector Utility.) - * @method delegate - * @param {String} type The name of the event to listen for - * @param {Function} fn The handler to call when the event fires - * @param {Function|string} filter Function or CSS selector used to - * determine for what element(s) the event listener should be called. - * When a function is specified, the function should return an - * HTML element. Using a CSS Selector requires the inclusion of the - * CSS Selector Utility. - * @param {Any} obj A variable to pass to the handler - * @param {Object} scope The object to use for the scope of the handler - * @return {boolean} Returns true if the delegated event listener - * was added successfully - * @for Element - */ - delegate: function (type, fn, filter, obj, overrideContext) { - - if (YAHOO.lang.isString(filter) && !YAHOO.util.Selector) { - return false; - } - - if (!Event._createDelegate) { - return false; - } - - var sType = Event._getType(type), - el = this.get("element"), - fnDelegate, - fnMouseDelegate, - - fnWrapper = function (e) { - - return fnDelegate.call(el, e); - - }; - - if (specialTypes[type]) { - - if (!Event._createMouseDelegate) { - return false; - } - - fnMouseDelegate = Event._createMouseDelegate(fn, obj, overrideContext); - - fnDelegate = Event._createDelegate(function (event, matchedEl, container) { - - return fnMouseDelegate.call(matchedEl, event, container); - - }, filter, obj, overrideContext); - - } - else { - fnDelegate = Event._createDelegate(fn, filter, obj, overrideContext); - } - - - delegates.push([el, sType, fn, fnWrapper]); - - return this.on(sType, fnWrapper); - - }, - - - /** - * Remove a delegated event listener - * @method removeDelegate - * @param {String} type The name of the event to listen for - * @param {Function} fn The function call when the event fires - * @return {boolean} Returns true if the unbind was successful, false - * otherwise. - * @for Element - */ - removeDelegate: function (type, fn) { - - var sType = Event._getType(type), - index = Event._getCacheIndex(delegates, this.get("element"), sType, fn), - returnVal, - cacheItem; - - if (index >= 0) { - cacheItem = delegates[index]; - } - - if (cacheItem) { - - returnVal = this.removeListener(cacheItem[1], cacheItem[3]); - - if (returnVal) { - delete delegates[index][2]; - delete delegates[index][3]; - delegates.splice(index, 1); - } - - } - - return returnVal; - - } - - }); - -}()); -YAHOO.register("element-delegate", YAHOO.util.Element, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-debug.js deleted file mode 100644 index df27eb15bd..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-debug.js +++ /dev/null @@ -1,283 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Augments the Event Utility with a delegate method that - * facilitates easy creation of delegated event listeners. (Note: Using CSS - * selectors as the filtering criteria for delegated event listeners requires - * inclusion of the Selector Utility.) - * - * @module event-delegate - * @title Event Utility Event Delegation Module - * @namespace YAHOO.util - * @requires event - */ - -(function () { - - var Event = YAHOO.util.Event, - Lang = YAHOO.lang, - delegates = [], - - - getMatch = function(el, selector, container) { - - var returnVal; - - if (!el || el === container) { - returnVal = false; - } - else { - returnVal = YAHOO.util.Selector.test(el, selector) ? el: getMatch(el.parentNode, selector, container); - } - - return returnVal; - - }; - - - Lang.augmentObject(Event, { - - /** - * Creates a delegate function used to call event listeners specified - * via the YAHOO.util.Event.delegate method. - * - * @method _createDelegate - * - * @param {Function} fn The method (event listener) to call. - * @param {Function|string} filter Function or CSS selector used to - * determine for what element(s) the event listener should be called. - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the listener. - * @param {Boolean|object} overrideContext If true, the value of the - * obj parameter becomes the execution context - * of the listener. If an object, this object - * becomes the execution context. - * @return {Function} Function that will call the event listener - * specified by the YAHOO.util.Event.delegate method. - * @private - * @for Event - * @static - */ - _createDelegate: function (fn, filter, obj, overrideContext) { - - return function (event) { - - var container = this, - target = Event.getTarget(event), - selector = filter, - - // The user might have specified the document object - // as the delegation container, in which case it is not - // nessary to scope the provided CSS selector(s) to the - // delegation container - bDocument = (container.nodeType === 9), - - matchedEl, - context, - sID, - sIDSelector; - - - if (Lang.isFunction(filter)) { - matchedEl = filter(target); - } - else if (Lang.isString(filter)) { - - if (!bDocument) { - - sID = container.id; - - if (!sID) { - sID = Event.generateId(container); - } - - // Scope all selectors to the container - sIDSelector = ("#" + sID + " "); - selector = (sIDSelector + filter).replace(/,/gi, ("," + sIDSelector)); - - } - - - if (YAHOO.util.Selector.test(target, selector)) { - matchedEl = target; - } - else if (YAHOO.util.Selector.test(target, ((selector.replace(/,/gi, " *,")) + " *"))) { - - // The target is a descendant of an element matching - // the selector, so crawl up to find the ancestor that - // matches the selector - - matchedEl = getMatch(target, selector, container); - - } - - } - - - if (matchedEl) { - - // The default context for delegated listeners is the - // element that matched the filter. - - context = matchedEl; - - if (overrideContext) { - if (overrideContext === true) { - context = obj; - } else { - context = overrideContext; - } - } - - // Call the listener passing in the container and the - // element that matched the filter in case the user - // needs those. - - return fn.call(context, event, matchedEl, container, obj); - - } - - }; - - }, - - - /** - * Appends a delegated event listener. Delegated event listeners - * receive three arguments by default: the DOM event, the element - * specified by the filtering function or CSS selector, and the - * container element (the element to which the event listener is - * bound). (Note: Using the delegate method requires the event-delegate - * module. Using CSS selectors as the filtering criteria for delegated - * event listeners requires inclusion of the Selector Utility.) - * - * @method delegate - * - * @param {String|HTMLElement|Array|NodeList} container An id, an element - * reference, or a collection of ids and/or elements to assign the - * listener to. - * @param {String} type The type of event listener to append - * @param {Function} fn The method the event invokes - * @param {Function|string} filter Function or CSS selector used to - * determine for what element(s) the event listener should be called. - * When a function is specified, the function should return an - * HTML element. Using a CSS Selector requires the inclusion of the - * CSS Selector Utility. - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the listener - * @param {Boolean|object} overrideContext If true, the value of the obj parameter becomes - * the execution context of the listener. If an - * object, this object becomes the execution - * context. - * @return {Boolean} Returns true if the action was successful or defered, - * false if one or more of the elements - * could not have the listener attached, - * or if the operation throws an exception. - * @static - * @for Event - */ - delegate: function (container, type, fn, filter, obj, overrideContext) { - - var sType = type, - fnMouseDelegate, - fnDelegate; - - - if (Lang.isString(filter) && !YAHOO.util.Selector) { - YAHOO.log("Using a CSS selector to define the filtering criteria for a delegated listener requires the Selector Utility.", "error", "Event"); - return false; - } - - - if (type == "mouseenter" || type == "mouseleave") { - - if (!Event._createMouseDelegate) { - YAHOO.log("Delegating a " + type + " event requires the event-mouseenter module.", "error", "Event"); - return false; - } - - // Look up the real event--either mouseover or mouseout - sType = Event._getType(type); - - fnMouseDelegate = Event._createMouseDelegate(fn, obj, overrideContext); - - fnDelegate = Event._createDelegate(function (event, matchedEl, container) { - - return fnMouseDelegate.call(matchedEl, event, container); - - }, filter, obj, overrideContext); - - } - else { - - fnDelegate = Event._createDelegate(fn, filter, obj, overrideContext); - - } - - delegates.push([container, sType, fn, fnDelegate]); - - return Event.on(container, sType, fnDelegate); - - }, - - - /** - * Removes a delegated event listener. - * - * @method removeDelegate - * - * @param {String|HTMLElement|Array|NodeList} container An id, an element - * reference, or a collection of ids and/or elements to remove - * the listener from. - * @param {String} type The type of event to remove. - * @param {Function} fn The method the event invokes. If fn is - * undefined, then all event listeners for the type of event are - * removed. - * @return {boolean} Returns true if the unbind was successful, false - * otherwise. - * @static - * @for Event - */ - removeDelegate: function (container, type, fn) { - - var sType = type, - returnVal = false, - index, - cacheItem; - - // Look up the real event--either mouseover or mouseout - if (type == "mouseenter" || type == "mouseleave") { - sType = Event._getType(type); - } - - index = Event._getCacheIndex(delegates, container, sType, fn); - - if (index >= 0) { - cacheItem = delegates[index]; - } - - - if (container && cacheItem) { - - returnVal = Event.removeListener(cacheItem[0], cacheItem[1], cacheItem[3]); - - if (returnVal) { - delete delegates[index][2]; - delete delegates[index][3]; - delegates.splice(index, 1); - } - - } - - return returnVal; - - } - - }); - -}()); -YAHOO.register("event-delegate", YAHOO.util.Event, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-min.js deleted file mode 100644 index c20abeb4a1..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var A=YAHOO.util.Event,C=YAHOO.lang,B=[],D=function(H,E,F){var G;if(!H||H===F){G=false;}else{G=YAHOO.util.Selector.test(H,E)?H:D(H.parentNode,E,F);}return G;};C.augmentObject(A,{_createDelegate:function(F,E,G,H){return function(I){var J=this,N=A.getTarget(I),L=E,P=(J.nodeType===9),Q,K,O,M;if(C.isFunction(E)){Q=E(N);}else{if(C.isString(E)){if(!P){O=J.id;if(!O){O=A.generateId(J);}M=("#"+O+" ");L=(M+E).replace(/,/gi,(","+M));}if(YAHOO.util.Selector.test(N,L)){Q=N;}else{if(YAHOO.util.Selector.test(N,((L.replace(/,/gi," *,"))+" *"))){Q=D(N,L,J);}}}}if(Q){K=Q;if(H){if(H===true){K=G;}else{K=H;}}return F.call(K,I,Q,J,G);}};},delegate:function(F,J,L,G,H,I){var E=J,K,M;if(C.isString(G)&&!YAHOO.util.Selector){return false;}if(J=="mouseenter"||J=="mouseleave"){if(!A._createMouseDelegate){return false;}E=A._getType(J);K=A._createMouseDelegate(L,H,I);M=A._createDelegate(function(P,O,N){return K.call(O,P,N);},G,H,I);}else{M=A._createDelegate(L,G,H,I);}B.push([F,E,L,M]);return A.on(F,E,M);},removeDelegate:function(F,J,I){var K=J,H=false,G,E;if(J=="mouseenter"||J=="mouseleave"){K=A._getType(J);}G=A._getCacheIndex(B,F,K,I);if(G>=0){E=B[G];}if(F&&E){H=A.removeListener(E[0],E[1],E[3]);if(H){delete B[G][2];delete B[G][3];B.splice(G,1);}}return H;}});}());YAHOO.register("event-delegate",YAHOO.util.Event,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate.js deleted file mode 100644 index 12171d0031..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-delegate/event-delegate.js +++ /dev/null @@ -1,281 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Augments the Event Utility with a delegate method that - * facilitates easy creation of delegated event listeners. (Note: Using CSS - * selectors as the filtering criteria for delegated event listeners requires - * inclusion of the Selector Utility.) - * - * @module event-delegate - * @title Event Utility Event Delegation Module - * @namespace YAHOO.util - * @requires event - */ - -(function () { - - var Event = YAHOO.util.Event, - Lang = YAHOO.lang, - delegates = [], - - - getMatch = function(el, selector, container) { - - var returnVal; - - if (!el || el === container) { - returnVal = false; - } - else { - returnVal = YAHOO.util.Selector.test(el, selector) ? el: getMatch(el.parentNode, selector, container); - } - - return returnVal; - - }; - - - Lang.augmentObject(Event, { - - /** - * Creates a delegate function used to call event listeners specified - * via the YAHOO.util.Event.delegate method. - * - * @method _createDelegate - * - * @param {Function} fn The method (event listener) to call. - * @param {Function|string} filter Function or CSS selector used to - * determine for what element(s) the event listener should be called. - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the listener. - * @param {Boolean|object} overrideContext If true, the value of the - * obj parameter becomes the execution context - * of the listener. If an object, this object - * becomes the execution context. - * @return {Function} Function that will call the event listener - * specified by the YAHOO.util.Event.delegate method. - * @private - * @for Event - * @static - */ - _createDelegate: function (fn, filter, obj, overrideContext) { - - return function (event) { - - var container = this, - target = Event.getTarget(event), - selector = filter, - - // The user might have specified the document object - // as the delegation container, in which case it is not - // nessary to scope the provided CSS selector(s) to the - // delegation container - bDocument = (container.nodeType === 9), - - matchedEl, - context, - sID, - sIDSelector; - - - if (Lang.isFunction(filter)) { - matchedEl = filter(target); - } - else if (Lang.isString(filter)) { - - if (!bDocument) { - - sID = container.id; - - if (!sID) { - sID = Event.generateId(container); - } - - // Scope all selectors to the container - sIDSelector = ("#" + sID + " "); - selector = (sIDSelector + filter).replace(/,/gi, ("," + sIDSelector)); - - } - - - if (YAHOO.util.Selector.test(target, selector)) { - matchedEl = target; - } - else if (YAHOO.util.Selector.test(target, ((selector.replace(/,/gi, " *,")) + " *"))) { - - // The target is a descendant of an element matching - // the selector, so crawl up to find the ancestor that - // matches the selector - - matchedEl = getMatch(target, selector, container); - - } - - } - - - if (matchedEl) { - - // The default context for delegated listeners is the - // element that matched the filter. - - context = matchedEl; - - if (overrideContext) { - if (overrideContext === true) { - context = obj; - } else { - context = overrideContext; - } - } - - // Call the listener passing in the container and the - // element that matched the filter in case the user - // needs those. - - return fn.call(context, event, matchedEl, container, obj); - - } - - }; - - }, - - - /** - * Appends a delegated event listener. Delegated event listeners - * receive three arguments by default: the DOM event, the element - * specified by the filtering function or CSS selector, and the - * container element (the element to which the event listener is - * bound). (Note: Using the delegate method requires the event-delegate - * module. Using CSS selectors as the filtering criteria for delegated - * event listeners requires inclusion of the Selector Utility.) - * - * @method delegate - * - * @param {String|HTMLElement|Array|NodeList} container An id, an element - * reference, or a collection of ids and/or elements to assign the - * listener to. - * @param {String} type The type of event listener to append - * @param {Function} fn The method the event invokes - * @param {Function|string} filter Function or CSS selector used to - * determine for what element(s) the event listener should be called. - * When a function is specified, the function should return an - * HTML element. Using a CSS Selector requires the inclusion of the - * CSS Selector Utility. - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the listener - * @param {Boolean|object} overrideContext If true, the value of the obj parameter becomes - * the execution context of the listener. If an - * object, this object becomes the execution - * context. - * @return {Boolean} Returns true if the action was successful or defered, - * false if one or more of the elements - * could not have the listener attached, - * or if the operation throws an exception. - * @static - * @for Event - */ - delegate: function (container, type, fn, filter, obj, overrideContext) { - - var sType = type, - fnMouseDelegate, - fnDelegate; - - - if (Lang.isString(filter) && !YAHOO.util.Selector) { - return false; - } - - - if (type == "mouseenter" || type == "mouseleave") { - - if (!Event._createMouseDelegate) { - return false; - } - - // Look up the real event--either mouseover or mouseout - sType = Event._getType(type); - - fnMouseDelegate = Event._createMouseDelegate(fn, obj, overrideContext); - - fnDelegate = Event._createDelegate(function (event, matchedEl, container) { - - return fnMouseDelegate.call(matchedEl, event, container); - - }, filter, obj, overrideContext); - - } - else { - - fnDelegate = Event._createDelegate(fn, filter, obj, overrideContext); - - } - - delegates.push([container, sType, fn, fnDelegate]); - - return Event.on(container, sType, fnDelegate); - - }, - - - /** - * Removes a delegated event listener. - * - * @method removeDelegate - * - * @param {String|HTMLElement|Array|NodeList} container An id, an element - * reference, or a collection of ids and/or elements to remove - * the listener from. - * @param {String} type The type of event to remove. - * @param {Function} fn The method the event invokes. If fn is - * undefined, then all event listeners for the type of event are - * removed. - * @return {boolean} Returns true if the unbind was successful, false - * otherwise. - * @static - * @for Event - */ - removeDelegate: function (container, type, fn) { - - var sType = type, - returnVal = false, - index, - cacheItem; - - // Look up the real event--either mouseover or mouseout - if (type == "mouseenter" || type == "mouseleave") { - sType = Event._getType(type); - } - - index = Event._getCacheIndex(delegates, container, sType, fn); - - if (index >= 0) { - cacheItem = delegates[index]; - } - - - if (container && cacheItem) { - - returnVal = Event.removeListener(cacheItem[0], cacheItem[1], cacheItem[3]); - - if (returnVal) { - delete delegates[index][2]; - delete delegates[index][3]; - delegates.splice(index, 1); - } - - } - - return returnVal; - - } - - }); - -}()); -YAHOO.register("event-delegate", YAHOO.util.Event, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-debug.js deleted file mode 100644 index e6d588318d..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-debug.js +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Augments the Event Utility with support for the mouseenter and mouseleave - * events: A mouseenter event fires the first time the mouse enters an - * element; a mouseleave event first the first time the mouse leaves an - * element. - * - * @module event-mouseenter - * @title Event Utility mouseenter and mouseout Module - * @namespace YAHOO.util - * @requires event - */ - -(function () { - - var Event = YAHOO.util.Event, - Lang = YAHOO.lang, - - addListener = Event.addListener, - removeListener = Event.removeListener, - getListeners = Event.getListeners, - - delegates = [], - - specialTypes = { - mouseenter: "mouseover", - mouseleave: "mouseout" - }, - - remove = function(el, type, fn) { - - var index = Event._getCacheIndex(delegates, el, type, fn), - cacheItem, - returnVal; - - if (index >= 0) { - cacheItem = delegates[index]; - } - - if (el && cacheItem) { - - // removeListener will translate the value of type - returnVal = removeListener.call(Event, cacheItem[0], type, cacheItem[3]); - - if (returnVal) { - delete delegates[index][2]; - delete delegates[index][3]; - delegates.splice(index, 1); - } - - } - - return returnVal; - - }; - - - Lang.augmentObject(Event._specialTypes, specialTypes); - - Lang.augmentObject(Event, { - - /** - * Creates a delegate function used to call mouseover and mouseleave - * event listeners specified via the - * YAHOO.util.Event.addListener - * or YAHOO.util.Event.on method. - * - * @method _createMouseDelegate - * - * @param {Function} fn The method (event listener) to call - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the listener - * @param {Boolean|object} overrideContext If true, the value of the - * obj parameter becomes the execution context - * of the listener. If an object, this object - * becomes the execution context. - * @return {Function} Function that will call the event listener - * specified by either the YAHOO.util.Event.addListener - * or YAHOO.util.Event.on method. - * @private - * @static - * @for Event - */ - _createMouseDelegate: function (fn, obj, overrideContext) { - - return function (event, container) { - - var el = this, - relatedTarget = Event.getRelatedTarget(event), - context, - args; - - if (el != relatedTarget && !YAHOO.util.Dom.isAncestor(el, relatedTarget)) { - - context = el; - - if (overrideContext) { - if (overrideContext === true) { - context = obj; - } else { - context = overrideContext; - } - } - - // The default args passed back to a mouseenter or - // mouseleave listener are: the event, the element - // to which the listener is bound, and any object the - // user passed when subscribing - - args = [event, el, obj]; - - // Add the delegation container as an argument when - // delegating mouseenter and mouseleave - - if (container) { - args.splice(2, 0, container); - } - - return fn.apply(context, args); - - } - - }; - - }, - - addListener: function (el, type, fn, obj, overrideContext) { - - var fnDelegate, - returnVal; - - if (specialTypes[type]) { - - fnDelegate = Event._createMouseDelegate(fn, obj, overrideContext); - - fnDelegate.mouseDelegate = true; - - delegates.push([el, type, fn, fnDelegate]); - - // addListener will translate the value of type - returnVal = addListener.call(Event, el, type, fnDelegate); - - } - else { - returnVal = addListener.apply(Event, arguments); - } - - return returnVal; - - }, - - removeListener: function (el, type, fn) { - - var returnVal; - - if (specialTypes[type]) { - returnVal = remove.apply(Event, arguments); - } - else { - returnVal = removeListener.apply(Event, arguments); - } - - return returnVal; - - }, - - getListeners: function (el, type) { - - // If the user specified the type as mouseover or mouseout, - // need to filter out those used by mouseenter and mouseleave. - // If the user specified the type as mouseenter or mouseleave, - // need to filter out the true mouseover and mouseout listeners. - - var listeners = [], - elListeners, - bMouseOverOrOut = (type === "mouseover" || type === "mouseout"), - bMouseDelegate, - i, - l; - - if (type && (bMouseOverOrOut || specialTypes[type])) { - - elListeners = getListeners.call(Event, el, this._getType(type)); - - if (elListeners) { - - for (i=elListeners.length-1; i>-1; i--) { - - l = elListeners[i]; - bMouseDelegate = l.fn.mouseDelegate; - - if ((specialTypes[type] && bMouseDelegate) || (bMouseOverOrOut && !bMouseDelegate)) { - listeners.push(l); - } - - } - - } - - } - else { - listeners = getListeners.apply(Event, arguments); - } - - return (listeners && listeners.length) ? listeners : null; - - } - - }, true); - - Event.on = Event.addListener; - -}()); -YAHOO.register("event-mouseenter", YAHOO.util.Event, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-min.js deleted file mode 100644 index 768157f438..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var B=YAHOO.util.Event,G=YAHOO.lang,E=B.addListener,F=B.removeListener,C=B.getListeners,D=[],H={mouseenter:"mouseover",mouseleave:"mouseout"},A=function(N,M,L){var J=B._getCacheIndex(D,N,M,L),I,K;if(J>=0){I=D[J];}if(N&&I){K=F.call(B,I[0],M,I[3]);if(K){delete D[J][2];delete D[J][3];D.splice(J,1);}}return K;};G.augmentObject(B._specialTypes,H);G.augmentObject(B,{_createMouseDelegate:function(I,J,K){return function(Q,M){var P=this,L=B.getRelatedTarget(Q),O,N;if(P!=L&&!YAHOO.util.Dom.isAncestor(P,L)){O=P;if(K){if(K===true){O=J;}else{O=K;}}N=[Q,P,J];if(M){N.splice(2,0,M);}return I.apply(O,N);}};},addListener:function(M,L,K,N,O){var I,J;if(H[L]){I=B._createMouseDelegate(K,N,O);I.mouseDelegate=true;D.push([M,L,K,I]);J=E.call(B,M,L,I);}else{J=E.apply(B,arguments);}return J;},removeListener:function(L,K,J){var I;if(H[K]){I=A.apply(B,arguments);}else{I=F.apply(B,arguments);}return I;},getListeners:function(N,M){var L=[],P,K=(M==="mouseover"||M==="mouseout"),O,J,I;if(M&&(K||H[M])){P=C.call(B,N,this._getType(M));if(P){for(J=P.length-1;J>-1;J--){I=P[J];O=I.fn.mouseDelegate;if((H[M]&&O)||(K&&!O)){L.push(I);}}}}else{L=C.apply(B,arguments);}return(L&&L.length)?L:null;}},true);B.on=B.addListener;}());YAHOO.register("event-mouseenter",YAHOO.util.Event,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter.js deleted file mode 100644 index e6d588318d..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-mouseenter/event-mouseenter.js +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Augments the Event Utility with support for the mouseenter and mouseleave - * events: A mouseenter event fires the first time the mouse enters an - * element; a mouseleave event first the first time the mouse leaves an - * element. - * - * @module event-mouseenter - * @title Event Utility mouseenter and mouseout Module - * @namespace YAHOO.util - * @requires event - */ - -(function () { - - var Event = YAHOO.util.Event, - Lang = YAHOO.lang, - - addListener = Event.addListener, - removeListener = Event.removeListener, - getListeners = Event.getListeners, - - delegates = [], - - specialTypes = { - mouseenter: "mouseover", - mouseleave: "mouseout" - }, - - remove = function(el, type, fn) { - - var index = Event._getCacheIndex(delegates, el, type, fn), - cacheItem, - returnVal; - - if (index >= 0) { - cacheItem = delegates[index]; - } - - if (el && cacheItem) { - - // removeListener will translate the value of type - returnVal = removeListener.call(Event, cacheItem[0], type, cacheItem[3]); - - if (returnVal) { - delete delegates[index][2]; - delete delegates[index][3]; - delegates.splice(index, 1); - } - - } - - return returnVal; - - }; - - - Lang.augmentObject(Event._specialTypes, specialTypes); - - Lang.augmentObject(Event, { - - /** - * Creates a delegate function used to call mouseover and mouseleave - * event listeners specified via the - * YAHOO.util.Event.addListener - * or YAHOO.util.Event.on method. - * - * @method _createMouseDelegate - * - * @param {Function} fn The method (event listener) to call - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the listener - * @param {Boolean|object} overrideContext If true, the value of the - * obj parameter becomes the execution context - * of the listener. If an object, this object - * becomes the execution context. - * @return {Function} Function that will call the event listener - * specified by either the YAHOO.util.Event.addListener - * or YAHOO.util.Event.on method. - * @private - * @static - * @for Event - */ - _createMouseDelegate: function (fn, obj, overrideContext) { - - return function (event, container) { - - var el = this, - relatedTarget = Event.getRelatedTarget(event), - context, - args; - - if (el != relatedTarget && !YAHOO.util.Dom.isAncestor(el, relatedTarget)) { - - context = el; - - if (overrideContext) { - if (overrideContext === true) { - context = obj; - } else { - context = overrideContext; - } - } - - // The default args passed back to a mouseenter or - // mouseleave listener are: the event, the element - // to which the listener is bound, and any object the - // user passed when subscribing - - args = [event, el, obj]; - - // Add the delegation container as an argument when - // delegating mouseenter and mouseleave - - if (container) { - args.splice(2, 0, container); - } - - return fn.apply(context, args); - - } - - }; - - }, - - addListener: function (el, type, fn, obj, overrideContext) { - - var fnDelegate, - returnVal; - - if (specialTypes[type]) { - - fnDelegate = Event._createMouseDelegate(fn, obj, overrideContext); - - fnDelegate.mouseDelegate = true; - - delegates.push([el, type, fn, fnDelegate]); - - // addListener will translate the value of type - returnVal = addListener.call(Event, el, type, fnDelegate); - - } - else { - returnVal = addListener.apply(Event, arguments); - } - - return returnVal; - - }, - - removeListener: function (el, type, fn) { - - var returnVal; - - if (specialTypes[type]) { - returnVal = remove.apply(Event, arguments); - } - else { - returnVal = removeListener.apply(Event, arguments); - } - - return returnVal; - - }, - - getListeners: function (el, type) { - - // If the user specified the type as mouseover or mouseout, - // need to filter out those used by mouseenter and mouseleave. - // If the user specified the type as mouseenter or mouseleave, - // need to filter out the true mouseover and mouseout listeners. - - var listeners = [], - elListeners, - bMouseOverOrOut = (type === "mouseover" || type === "mouseout"), - bMouseDelegate, - i, - l; - - if (type && (bMouseOverOrOut || specialTypes[type])) { - - elListeners = getListeners.call(Event, el, this._getType(type)); - - if (elListeners) { - - for (i=elListeners.length-1; i>-1; i--) { - - l = elListeners[i]; - bMouseDelegate = l.fn.mouseDelegate; - - if ((specialTypes[type] && bMouseDelegate) || (bMouseOverOrOut && !bMouseDelegate)) { - listeners.push(l); - } - - } - - } - - } - else { - listeners = getListeners.apply(Event, arguments); - } - - return (listeners && listeners.length) ? listeners : null; - - } - - }, true); - - Event.on = Event.addListener; - -}()); -YAHOO.register("event-mouseenter", YAHOO.util.Event, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-debug.js deleted file mode 100644 index dd18b0a2bd..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-debug.js +++ /dev/null @@ -1,622 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ - -/** - * DOM event simulation utility - * @module event-simulate - * @namespace YAHOO.util - * @requires yahoo,dom,event - */ - -/** - * The UserAction object provides functions that simulate events occurring in - * the browser. Since these are simulated events, they do not behave exactly - * as regular, user-initiated events do, but can be used to test simple - * user interactions safely. - * - * @namespace YAHOO.util - * @class UserAction - * @static - */ -YAHOO.util.UserAction = { - - //-------------------------------------------------------------------------- - // Generic event methods - //-------------------------------------------------------------------------- - - /** - * Simulates a key event using the given event information to populate - * the generated event object. This method does browser-equalizing - * calculations to account for differences in the DOM and IE event models - * as well as different browser quirks. Note: keydown causes Safari 2.x to - * crash. - * @method simulateKeyEvent - * @private - * @static - * @param {HTMLElement} target The target of the given event. - * @param {String} type The type of event to fire. This can be any one of - * the following: keyup, keydown, and keypress. - * @param {Boolean} bubbles (Optional) Indicates if the event can be - * bubbled up. DOM Level 3 specifies that all key events bubble by - * default. The default is true. - * @param {Boolean} cancelable (Optional) Indicates if the event can be - * canceled using preventDefault(). DOM Level 3 specifies that all - * key events can be cancelled. The default - * is true. - * @param {Window} view (Optional) The view containing the target. This is - * typically the window object. The default is window. - * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} metaKey (Optional) Indicates if one of the META keys - * is pressed while the event is firing. The default is false. - * @param {int} keyCode (Optional) The code for the key that is in use. - * The default is 0. - * @param {int} charCode (Optional) The Unicode code for the character - * associated with the key being used. The default is 0. - */ - simulateKeyEvent : function (target /*:HTMLElement*/, type /*:String*/, - bubbles /*:Boolean*/, cancelable /*:Boolean*/, - view /*:Window*/, - ctrlKey /*:Boolean*/, altKey /*:Boolean*/, - shiftKey /*:Boolean*/, metaKey /*:Boolean*/, - keyCode /*:int*/, charCode /*:int*/) /*:Void*/ - { - //check target - target = YAHOO.util.Dom.get(target); - if (!target){ - throw new Error("simulateKeyEvent(): Invalid target."); - } - - //check event type - if (YAHOO.lang.isString(type)){ - type = type.toLowerCase(); - switch(type){ - case "keyup": - case "keydown": - case "keypress": - break; - case "textevent": //DOM Level 3 - type = "keypress"; - break; - // @TODO was the fallthrough intentional, if so throw error - default: - throw new Error("simulateKeyEvent(): Event type '" + type + "' not supported."); - } - } else { - throw new Error("simulateKeyEvent(): Event type must be a string."); - } - - //setup default values - if (!YAHOO.lang.isBoolean(bubbles)){ - bubbles = true; //all key events bubble - } - if (!YAHOO.lang.isBoolean(cancelable)){ - cancelable = true; //all key events can be cancelled - } - if (!YAHOO.lang.isObject(view)){ - view = window; //view is typically window - } - if (!YAHOO.lang.isBoolean(ctrlKey)){ - ctrlKey = false; - } - if (!YAHOO.lang.isBoolean(altKey)){ - altKey = false; - } - if (!YAHOO.lang.isBoolean(shiftKey)){ - shiftKey = false; - } - if (!YAHOO.lang.isBoolean(metaKey)){ - metaKey = false; - } - if (!YAHOO.lang.isNumber(keyCode)){ - keyCode = 0; - } - if (!YAHOO.lang.isNumber(charCode)){ - charCode = 0; - } - - //try to create a mouse event - var customEvent /*:MouseEvent*/ = null; - - //check for DOM-compliant browsers first - if (YAHOO.lang.isFunction(document.createEvent)){ - - try { - - //try to create key event - customEvent = document.createEvent("KeyEvents"); - - /* - * Interesting problem: Firefox implemented a non-standard - * version of initKeyEvent() based on DOM Level 2 specs. - * Key event was removed from DOM Level 2 and re-introduced - * in DOM Level 3 with a different interface. Firefox is the - * only browser with any implementation of Key Events, so for - * now, assume it's Firefox if the above line doesn't error. - */ - //TODO: Decipher between Firefox's implementation and a correct one. - customEvent.initKeyEvent(type, bubbles, cancelable, view, ctrlKey, - altKey, shiftKey, metaKey, keyCode, charCode); - - } catch (ex /*:Error*/){ - - /* - * If it got here, that means key events aren't officially supported. - * Safari/WebKit is a real problem now. WebKit 522 won't let you - * set keyCode, charCode, or other properties if you use a - * UIEvent, so we first must try to create a generic event. The - * fun part is that this will throw an error on Safari 2.x. The - * end result is that we need another try...catch statement just to - * deal with this mess. - */ - try { - - //try to create generic event - will fail in Safari 2.x - customEvent = document.createEvent("Events"); - - } catch (uierror /*:Error*/){ - - //the above failed, so create a UIEvent for Safari 2.x - customEvent = document.createEvent("UIEvents"); - - } finally { - - customEvent.initEvent(type, bubbles, cancelable); - - //initialize - customEvent.view = view; - customEvent.altKey = altKey; - customEvent.ctrlKey = ctrlKey; - customEvent.shiftKey = shiftKey; - customEvent.metaKey = metaKey; - customEvent.keyCode = keyCode; - customEvent.charCode = charCode; - - } - - } - - //fire the event - target.dispatchEvent(customEvent); - - } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE - - //create an IE event object - customEvent = document.createEventObject(); - - //assign available properties - customEvent.bubbles = bubbles; - customEvent.cancelable = cancelable; - customEvent.view = view; - customEvent.ctrlKey = ctrlKey; - customEvent.altKey = altKey; - customEvent.shiftKey = shiftKey; - customEvent.metaKey = metaKey; - - /* - * IE doesn't support charCode explicitly. CharCode should - * take precedence over any keyCode value for accurate - * representation. - */ - customEvent.keyCode = (charCode > 0) ? charCode : keyCode; - - //fire the event - target.fireEvent("on" + type, customEvent); - - } else { - throw new Error("simulateKeyEvent(): No event simulation framework present."); - } - }, - - /** - * Simulates a mouse event using the given event information to populate - * the generated event object. This method does browser-equalizing - * calculations to account for differences in the DOM and IE event models - * as well as different browser quirks. - * @method simulateMouseEvent - * @private - * @static - * @param {HTMLElement} target The target of the given event. - * @param {String} type The type of event to fire. This can be any one of - * the following: click, dblclick, mousedown, mouseup, mouseout, - * mouseover, and mousemove. - * @param {Boolean} bubbles (Optional) Indicates if the event can be - * bubbled up. DOM Level 2 specifies that all mouse events bubble by - * default. The default is true. - * @param {Boolean} cancelable (Optional) Indicates if the event can be - * canceled using preventDefault(). DOM Level 2 specifies that all - * mouse events except mousemove can be cancelled. The default - * is true for all events except mousemove, for which the default - * is false. - * @param {Window} view (Optional) The view containing the target. This is - * typically the window object. The default is window. - * @param {int} detail (Optional) The number of times the mouse button has - * been used. The default value is 1. - * @param {int} screenX (Optional) The x-coordinate on the screen at which - * point the event occured. The default is 0. - * @param {int} screenY (Optional) The y-coordinate on the screen at which - * point the event occured. The default is 0. - * @param {int} clientX (Optional) The x-coordinate on the client at which - * point the event occured. The default is 0. - * @param {int} clientY (Optional) The y-coordinate on the client at which - * point the event occured. The default is 0. - * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} metaKey (Optional) Indicates if one of the META keys - * is pressed while the event is firing. The default is false. - * @param {int} button (Optional) The button being pressed while the event - * is executing. The value should be 0 for the primary mouse button - * (typically the left button), 1 for the terciary mouse button - * (typically the middle button), and 2 for the secondary mouse button - * (typically the right button). The default is 0. - * @param {HTMLElement} relatedTarget (Optional) For mouseout events, - * this is the element that the mouse has moved to. For mouseover - * events, this is the element that the mouse has moved from. This - * argument is ignored for all other events. The default is null. - */ - simulateMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, - bubbles /*:Boolean*/, cancelable /*:Boolean*/, - view /*:Window*/, detail /*:int*/, - screenX /*:int*/, screenY /*:int*/, - clientX /*:int*/, clientY /*:int*/, - ctrlKey /*:Boolean*/, altKey /*:Boolean*/, - shiftKey /*:Boolean*/, metaKey /*:Boolean*/, - button /*:int*/, relatedTarget /*:HTMLElement*/) /*:Void*/ - { - - //check target - target = YAHOO.util.Dom.get(target); - if (!target){ - throw new Error("simulateMouseEvent(): Invalid target."); - } - - //check event type - if (YAHOO.lang.isString(type)){ - type = type.toLowerCase(); - switch(type){ - case "mouseover": - case "mouseout": - case "mousedown": - case "mouseup": - case "click": - case "dblclick": - case "mousemove": - break; - default: - throw new Error("simulateMouseEvent(): Event type '" + type + "' not supported."); - } - } else { - throw new Error("simulateMouseEvent(): Event type must be a string."); - } - - //setup default values - if (!YAHOO.lang.isBoolean(bubbles)){ - bubbles = true; //all mouse events bubble - } - if (!YAHOO.lang.isBoolean(cancelable)){ - cancelable = (type != "mousemove"); //mousemove is the only one that can't be cancelled - } - if (!YAHOO.lang.isObject(view)){ - view = window; //view is typically window - } - if (!YAHOO.lang.isNumber(detail)){ - detail = 1; //number of mouse clicks must be at least one - } - if (!YAHOO.lang.isNumber(screenX)){ - screenX = 0; - } - if (!YAHOO.lang.isNumber(screenY)){ - screenY = 0; - } - if (!YAHOO.lang.isNumber(clientX)){ - clientX = 0; - } - if (!YAHOO.lang.isNumber(clientY)){ - clientY = 0; - } - if (!YAHOO.lang.isBoolean(ctrlKey)){ - ctrlKey = false; - } - if (!YAHOO.lang.isBoolean(altKey)){ - altKey = false; - } - if (!YAHOO.lang.isBoolean(shiftKey)){ - shiftKey = false; - } - if (!YAHOO.lang.isBoolean(metaKey)){ - metaKey = false; - } - if (!YAHOO.lang.isNumber(button)){ - button = 0; - } - - //try to create a mouse event - var customEvent /*:MouseEvent*/ = null; - - //check for DOM-compliant browsers first - if (YAHOO.lang.isFunction(document.createEvent)){ - - customEvent = document.createEvent("MouseEvents"); - - //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent() - if (customEvent.initMouseEvent){ - customEvent.initMouseEvent(type, bubbles, cancelable, view, detail, - screenX, screenY, clientX, clientY, - ctrlKey, altKey, shiftKey, metaKey, - button, relatedTarget); - } else { //Safari - - //the closest thing available in Safari 2.x is UIEvents - customEvent = document.createEvent("UIEvents"); - customEvent.initEvent(type, bubbles, cancelable); - customEvent.view = view; - customEvent.detail = detail; - customEvent.screenX = screenX; - customEvent.screenY = screenY; - customEvent.clientX = clientX; - customEvent.clientY = clientY; - customEvent.ctrlKey = ctrlKey; - customEvent.altKey = altKey; - customEvent.metaKey = metaKey; - customEvent.shiftKey = shiftKey; - customEvent.button = button; - customEvent.relatedTarget = relatedTarget; - } - - /* - * Check to see if relatedTarget has been assigned. Firefox - * versions less than 2.0 don't allow it to be assigned via - * initMouseEvent() and the property is readonly after event - * creation, so in order to keep YAHOO.util.getRelatedTarget() - * working, assign to the IE proprietary toElement property - * for mouseout event and fromElement property for mouseover - * event. - */ - if (relatedTarget && !customEvent.relatedTarget){ - if (type == "mouseout"){ - customEvent.toElement = relatedTarget; - } else if (type == "mouseover"){ - customEvent.fromElement = relatedTarget; - } - } - - //fire the event - target.dispatchEvent(customEvent); - - } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE - - //create an IE event object - customEvent = document.createEventObject(); - - //assign available properties - customEvent.bubbles = bubbles; - customEvent.cancelable = cancelable; - customEvent.view = view; - customEvent.detail = detail; - customEvent.screenX = screenX; - customEvent.screenY = screenY; - customEvent.clientX = clientX; - customEvent.clientY = clientY; - customEvent.ctrlKey = ctrlKey; - customEvent.altKey = altKey; - customEvent.metaKey = metaKey; - customEvent.shiftKey = shiftKey; - - //fix button property for IE's wacky implementation - switch(button){ - case 0: - customEvent.button = 1; - break; - case 1: - customEvent.button = 4; - break; - case 2: - //leave as is - break; - default: - customEvent.button = 0; - } - - /* - * Have to use relatedTarget because IE won't allow assignment - * to toElement or fromElement on generic events. This keeps - * YAHOO.util.customEvent.getRelatedTarget() functional. - */ - customEvent.relatedTarget = relatedTarget; - - //fire the event - target.fireEvent("on" + type, customEvent); - - } else { - throw new Error("simulateMouseEvent(): No event simulation framework present."); - } - }, - - //-------------------------------------------------------------------------- - // Mouse events - //-------------------------------------------------------------------------- - - /** - * Simulates a mouse event on a particular element. - * @param {HTMLElement} target The element to click on. - * @param {String} type The type of event to fire. This can be any one of - * the following: click, dblclick, mousedown, mouseup, mouseout, - * mouseover, and mousemove. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseEvent - * @static - */ - fireMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, - options /*:Object*/) /*:Void*/ - { - options = options || {}; - this.simulateMouseEvent(target, type, options.bubbles, - options.cancelable, options.view, options.detail, options.screenX, - options.screenY, options.clientX, options.clientY, options.ctrlKey, - options.altKey, options.shiftKey, options.metaKey, options.button, - options.relatedTarget); - }, - - /** - * Simulates a click on a particular element. - * @param {HTMLElement} target The element to click on. - * @param {Object} options Additional event options (use DOM standard names). - * @method click - * @static - */ - click : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireMouseEvent(target, "click", options); - }, - - /** - * Simulates a double click on a particular element. - * @param {HTMLElement} target The element to double click on. - * @param {Object} options Additional event options (use DOM standard names). - * @method dblclick - * @static - */ - dblclick : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireMouseEvent( target, "dblclick", options); - }, - - /** - * Simulates a mousedown on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mousedown - * @static - */ - mousedown : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mousedown", options); - }, - - /** - * Simulates a mousemove on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mousemove - * @static - */ - mousemove : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mousemove", options); - }, - - /** - * Simulates a mouseout event on a particular element. Use "relatedTarget" - * on the options object to specify where the mouse moved to. - * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so - * toElement is assigned in its place. IE doesn't allow toElement to be - * be assigned, so relatedTarget is assigned in its place. Both of these - * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly - * in both browsers. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseout - * @static - */ - mouseout : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mouseout", options); - }, - - /** - * Simulates a mouseover event on a particular element. Use "relatedTarget" - * on the options object to specify where the mouse moved from. - * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so - * fromElement is assigned in its place. IE doesn't allow fromElement to be - * be assigned, so relatedTarget is assigned in its place. Both of these - * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly - * in both browsers. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseover - * @static - */ - mouseover : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mouseover", options); - }, - - /** - * Simulates a mouseup on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseup - * @static - */ - mouseup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mouseup", options); - }, - - //-------------------------------------------------------------------------- - // Key events - //-------------------------------------------------------------------------- - - /** - * Fires an event that normally would be fired by the keyboard (keyup, - * keydown, keypress). Make sure to specify either keyCode or charCode as - * an option. - * @private - * @param {String} type The type of event ("keyup", "keydown" or "keypress"). - * @param {HTMLElement} target The target of the event. - * @param {Object} options Options for the event. Either keyCode or charCode - * are required. - * @method fireKeyEvent - * @static - */ - fireKeyEvent : function (type /*:String*/, target /*:HTMLElement*/, - options /*:Object*/) /*:Void*/ - { - options = options || {}; - this.simulateKeyEvent(target, type, options.bubbles, - options.cancelable, options.view, options.ctrlKey, - options.altKey, options.shiftKey, options.metaKey, - options.keyCode, options.charCode); - }, - - /** - * Simulates a keydown event on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method keydown - * @static - */ - keydown : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireKeyEvent("keydown", target, options); - }, - - /** - * Simulates a keypress on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method keypress - * @static - */ - keypress : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireKeyEvent("keypress", target, options); - }, - - /** - * Simulates a keyup event on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method keyup - * @static - */ - keyup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireKeyEvent("keyup", target, options); - } - - -}; -YAHOO.register("event-simulate", YAHOO.util.UserAction, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-min.js deleted file mode 100644 index 02429c8e39..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.util.UserAction={simulateKeyEvent:function(F,J,E,C,L,B,A,K,H,N,M){F=YAHOO.util.Dom.get(F);if(!F){throw new Error("simulateKeyEvent(): Invalid target.");}if(YAHOO.lang.isString(J)){J=J.toLowerCase();switch(J){case"keyup":case"keydown":case"keypress":break;case"textevent":J="keypress";break;default:throw new Error("simulateKeyEvent(): Event type '"+J+"' not supported.");}}else{throw new Error("simulateKeyEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(E)){E=true;}if(!YAHOO.lang.isBoolean(C)){C=true;}if(!YAHOO.lang.isObject(L)){L=window;}if(!YAHOO.lang.isBoolean(B)){B=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(K)){K=false;}if(!YAHOO.lang.isBoolean(H)){H=false;}if(!YAHOO.lang.isNumber(N)){N=0;}if(!YAHOO.lang.isNumber(M)){M=0;}var I=null;if(YAHOO.lang.isFunction(document.createEvent)){try{I=document.createEvent("KeyEvents");I.initKeyEvent(J,E,C,L,B,A,K,H,N,M);}catch(G){try{I=document.createEvent("Events");}catch(D){I=document.createEvent("UIEvents");}finally{I.initEvent(J,E,C);I.view=L;I.altKey=A;I.ctrlKey=B;I.shiftKey=K;I.metaKey=H;I.keyCode=N;I.charCode=M;}}F.dispatchEvent(I);}else{if(YAHOO.lang.isObject(document.createEventObject)){I=document.createEventObject();I.bubbles=E;I.cancelable=C;I.view=L;I.ctrlKey=B;I.altKey=A;I.shiftKey=K;I.metaKey=H;I.keyCode=(M>0)?M:N;F.fireEvent("on"+J,I);}else{throw new Error("simulateKeyEvent(): No event simulation framework present.");}}},simulateMouseEvent:function(K,P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L){K=YAHOO.util.Dom.get(K);if(!K){throw new Error("simulateMouseEvent(): Invalid target.");}if(YAHOO.lang.isString(P)){P=P.toLowerCase();switch(P){case"mouseover":case"mouseout":case"mousedown":case"mouseup":case"click":case"dblclick":case"mousemove":break;default:throw new Error("simulateMouseEvent(): Event type '"+P+"' not supported.");}}else{throw new Error("simulateMouseEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(H)){H=true;}if(!YAHOO.lang.isBoolean(E)){E=(P!="mousemove");}if(!YAHOO.lang.isObject(Q)){Q=window;}if(!YAHOO.lang.isNumber(J)){J=1;}if(!YAHOO.lang.isNumber(G)){G=0;}if(!YAHOO.lang.isNumber(F)){F=0;}if(!YAHOO.lang.isNumber(D)){D=0;}if(!YAHOO.lang.isNumber(B)){B=0;}if(!YAHOO.lang.isBoolean(C)){C=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(O)){O=false;}if(!YAHOO.lang.isBoolean(M)){M=false;}if(!YAHOO.lang.isNumber(I)){I=0;}var N=null;if(YAHOO.lang.isFunction(document.createEvent)){N=document.createEvent("MouseEvents");if(N.initMouseEvent){N.initMouseEvent(P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L);}else{N=document.createEvent("UIEvents");N.initEvent(P,H,E);N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;N.button=I;N.relatedTarget=L;}if(L&&!N.relatedTarget){if(P=="mouseout"){N.toElement=L;}else{if(P=="mouseover"){N.fromElement=L;}}}K.dispatchEvent(N);}else{if(YAHOO.lang.isObject(document.createEventObject)){N=document.createEventObject();N.bubbles=H;N.cancelable=E;N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;switch(I){case 0:N.button=1;break;case 1:N.button=4;break;case 2:break;default:N.button=0;}N.relatedTarget=L;K.fireEvent("on"+P,N);}else{throw new Error("simulateMouseEvent(): No event simulation framework present.");}}},fireMouseEvent:function(C,B,A){A=A||{};this.simulateMouseEvent(C,B,A.bubbles,A.cancelable,A.view,A.detail,A.screenX,A.screenY,A.clientX,A.clientY,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.button,A.relatedTarget);},click:function(B,A){this.fireMouseEvent(B,"click",A);},dblclick:function(B,A){this.fireMouseEvent(B,"dblclick",A);},mousedown:function(B,A){this.fireMouseEvent(B,"mousedown",A);},mousemove:function(B,A){this.fireMouseEvent(B,"mousemove",A);},mouseout:function(B,A){this.fireMouseEvent(B,"mouseout",A);},mouseover:function(B,A){this.fireMouseEvent(B,"mouseover",A);},mouseup:function(B,A){this.fireMouseEvent(B,"mouseup",A);},fireKeyEvent:function(B,C,A){A=A||{};this.simulateKeyEvent(C,B,A.bubbles,A.cancelable,A.view,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.keyCode,A.charCode);},keydown:function(B,A){this.fireKeyEvent("keydown",B,A);},keypress:function(B,A){this.fireKeyEvent("keypress",B,A);},keyup:function(B,A){this.fireKeyEvent("keyup",B,A);}};YAHOO.register("event-simulate",YAHOO.util.UserAction,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate.js deleted file mode 100644 index dd18b0a2bd..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event-simulate/event-simulate.js +++ /dev/null @@ -1,622 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ - -/** - * DOM event simulation utility - * @module event-simulate - * @namespace YAHOO.util - * @requires yahoo,dom,event - */ - -/** - * The UserAction object provides functions that simulate events occurring in - * the browser. Since these are simulated events, they do not behave exactly - * as regular, user-initiated events do, but can be used to test simple - * user interactions safely. - * - * @namespace YAHOO.util - * @class UserAction - * @static - */ -YAHOO.util.UserAction = { - - //-------------------------------------------------------------------------- - // Generic event methods - //-------------------------------------------------------------------------- - - /** - * Simulates a key event using the given event information to populate - * the generated event object. This method does browser-equalizing - * calculations to account for differences in the DOM and IE event models - * as well as different browser quirks. Note: keydown causes Safari 2.x to - * crash. - * @method simulateKeyEvent - * @private - * @static - * @param {HTMLElement} target The target of the given event. - * @param {String} type The type of event to fire. This can be any one of - * the following: keyup, keydown, and keypress. - * @param {Boolean} bubbles (Optional) Indicates if the event can be - * bubbled up. DOM Level 3 specifies that all key events bubble by - * default. The default is true. - * @param {Boolean} cancelable (Optional) Indicates if the event can be - * canceled using preventDefault(). DOM Level 3 specifies that all - * key events can be cancelled. The default - * is true. - * @param {Window} view (Optional) The view containing the target. This is - * typically the window object. The default is window. - * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} metaKey (Optional) Indicates if one of the META keys - * is pressed while the event is firing. The default is false. - * @param {int} keyCode (Optional) The code for the key that is in use. - * The default is 0. - * @param {int} charCode (Optional) The Unicode code for the character - * associated with the key being used. The default is 0. - */ - simulateKeyEvent : function (target /*:HTMLElement*/, type /*:String*/, - bubbles /*:Boolean*/, cancelable /*:Boolean*/, - view /*:Window*/, - ctrlKey /*:Boolean*/, altKey /*:Boolean*/, - shiftKey /*:Boolean*/, metaKey /*:Boolean*/, - keyCode /*:int*/, charCode /*:int*/) /*:Void*/ - { - //check target - target = YAHOO.util.Dom.get(target); - if (!target){ - throw new Error("simulateKeyEvent(): Invalid target."); - } - - //check event type - if (YAHOO.lang.isString(type)){ - type = type.toLowerCase(); - switch(type){ - case "keyup": - case "keydown": - case "keypress": - break; - case "textevent": //DOM Level 3 - type = "keypress"; - break; - // @TODO was the fallthrough intentional, if so throw error - default: - throw new Error("simulateKeyEvent(): Event type '" + type + "' not supported."); - } - } else { - throw new Error("simulateKeyEvent(): Event type must be a string."); - } - - //setup default values - if (!YAHOO.lang.isBoolean(bubbles)){ - bubbles = true; //all key events bubble - } - if (!YAHOO.lang.isBoolean(cancelable)){ - cancelable = true; //all key events can be cancelled - } - if (!YAHOO.lang.isObject(view)){ - view = window; //view is typically window - } - if (!YAHOO.lang.isBoolean(ctrlKey)){ - ctrlKey = false; - } - if (!YAHOO.lang.isBoolean(altKey)){ - altKey = false; - } - if (!YAHOO.lang.isBoolean(shiftKey)){ - shiftKey = false; - } - if (!YAHOO.lang.isBoolean(metaKey)){ - metaKey = false; - } - if (!YAHOO.lang.isNumber(keyCode)){ - keyCode = 0; - } - if (!YAHOO.lang.isNumber(charCode)){ - charCode = 0; - } - - //try to create a mouse event - var customEvent /*:MouseEvent*/ = null; - - //check for DOM-compliant browsers first - if (YAHOO.lang.isFunction(document.createEvent)){ - - try { - - //try to create key event - customEvent = document.createEvent("KeyEvents"); - - /* - * Interesting problem: Firefox implemented a non-standard - * version of initKeyEvent() based on DOM Level 2 specs. - * Key event was removed from DOM Level 2 and re-introduced - * in DOM Level 3 with a different interface. Firefox is the - * only browser with any implementation of Key Events, so for - * now, assume it's Firefox if the above line doesn't error. - */ - //TODO: Decipher between Firefox's implementation and a correct one. - customEvent.initKeyEvent(type, bubbles, cancelable, view, ctrlKey, - altKey, shiftKey, metaKey, keyCode, charCode); - - } catch (ex /*:Error*/){ - - /* - * If it got here, that means key events aren't officially supported. - * Safari/WebKit is a real problem now. WebKit 522 won't let you - * set keyCode, charCode, or other properties if you use a - * UIEvent, so we first must try to create a generic event. The - * fun part is that this will throw an error on Safari 2.x. The - * end result is that we need another try...catch statement just to - * deal with this mess. - */ - try { - - //try to create generic event - will fail in Safari 2.x - customEvent = document.createEvent("Events"); - - } catch (uierror /*:Error*/){ - - //the above failed, so create a UIEvent for Safari 2.x - customEvent = document.createEvent("UIEvents"); - - } finally { - - customEvent.initEvent(type, bubbles, cancelable); - - //initialize - customEvent.view = view; - customEvent.altKey = altKey; - customEvent.ctrlKey = ctrlKey; - customEvent.shiftKey = shiftKey; - customEvent.metaKey = metaKey; - customEvent.keyCode = keyCode; - customEvent.charCode = charCode; - - } - - } - - //fire the event - target.dispatchEvent(customEvent); - - } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE - - //create an IE event object - customEvent = document.createEventObject(); - - //assign available properties - customEvent.bubbles = bubbles; - customEvent.cancelable = cancelable; - customEvent.view = view; - customEvent.ctrlKey = ctrlKey; - customEvent.altKey = altKey; - customEvent.shiftKey = shiftKey; - customEvent.metaKey = metaKey; - - /* - * IE doesn't support charCode explicitly. CharCode should - * take precedence over any keyCode value for accurate - * representation. - */ - customEvent.keyCode = (charCode > 0) ? charCode : keyCode; - - //fire the event - target.fireEvent("on" + type, customEvent); - - } else { - throw new Error("simulateKeyEvent(): No event simulation framework present."); - } - }, - - /** - * Simulates a mouse event using the given event information to populate - * the generated event object. This method does browser-equalizing - * calculations to account for differences in the DOM and IE event models - * as well as different browser quirks. - * @method simulateMouseEvent - * @private - * @static - * @param {HTMLElement} target The target of the given event. - * @param {String} type The type of event to fire. This can be any one of - * the following: click, dblclick, mousedown, mouseup, mouseout, - * mouseover, and mousemove. - * @param {Boolean} bubbles (Optional) Indicates if the event can be - * bubbled up. DOM Level 2 specifies that all mouse events bubble by - * default. The default is true. - * @param {Boolean} cancelable (Optional) Indicates if the event can be - * canceled using preventDefault(). DOM Level 2 specifies that all - * mouse events except mousemove can be cancelled. The default - * is true for all events except mousemove, for which the default - * is false. - * @param {Window} view (Optional) The view containing the target. This is - * typically the window object. The default is window. - * @param {int} detail (Optional) The number of times the mouse button has - * been used. The default value is 1. - * @param {int} screenX (Optional) The x-coordinate on the screen at which - * point the event occured. The default is 0. - * @param {int} screenY (Optional) The y-coordinate on the screen at which - * point the event occured. The default is 0. - * @param {int} clientX (Optional) The x-coordinate on the client at which - * point the event occured. The default is 0. - * @param {int} clientY (Optional) The y-coordinate on the client at which - * point the event occured. The default is 0. - * @param {Boolean} ctrlKey (Optional) Indicates if one of the CTRL keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} altKey (Optional) Indicates if one of the ALT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} shiftKey (Optional) Indicates if one of the SHIFT keys - * is pressed while the event is firing. The default is false. - * @param {Boolean} metaKey (Optional) Indicates if one of the META keys - * is pressed while the event is firing. The default is false. - * @param {int} button (Optional) The button being pressed while the event - * is executing. The value should be 0 for the primary mouse button - * (typically the left button), 1 for the terciary mouse button - * (typically the middle button), and 2 for the secondary mouse button - * (typically the right button). The default is 0. - * @param {HTMLElement} relatedTarget (Optional) For mouseout events, - * this is the element that the mouse has moved to. For mouseover - * events, this is the element that the mouse has moved from. This - * argument is ignored for all other events. The default is null. - */ - simulateMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, - bubbles /*:Boolean*/, cancelable /*:Boolean*/, - view /*:Window*/, detail /*:int*/, - screenX /*:int*/, screenY /*:int*/, - clientX /*:int*/, clientY /*:int*/, - ctrlKey /*:Boolean*/, altKey /*:Boolean*/, - shiftKey /*:Boolean*/, metaKey /*:Boolean*/, - button /*:int*/, relatedTarget /*:HTMLElement*/) /*:Void*/ - { - - //check target - target = YAHOO.util.Dom.get(target); - if (!target){ - throw new Error("simulateMouseEvent(): Invalid target."); - } - - //check event type - if (YAHOO.lang.isString(type)){ - type = type.toLowerCase(); - switch(type){ - case "mouseover": - case "mouseout": - case "mousedown": - case "mouseup": - case "click": - case "dblclick": - case "mousemove": - break; - default: - throw new Error("simulateMouseEvent(): Event type '" + type + "' not supported."); - } - } else { - throw new Error("simulateMouseEvent(): Event type must be a string."); - } - - //setup default values - if (!YAHOO.lang.isBoolean(bubbles)){ - bubbles = true; //all mouse events bubble - } - if (!YAHOO.lang.isBoolean(cancelable)){ - cancelable = (type != "mousemove"); //mousemove is the only one that can't be cancelled - } - if (!YAHOO.lang.isObject(view)){ - view = window; //view is typically window - } - if (!YAHOO.lang.isNumber(detail)){ - detail = 1; //number of mouse clicks must be at least one - } - if (!YAHOO.lang.isNumber(screenX)){ - screenX = 0; - } - if (!YAHOO.lang.isNumber(screenY)){ - screenY = 0; - } - if (!YAHOO.lang.isNumber(clientX)){ - clientX = 0; - } - if (!YAHOO.lang.isNumber(clientY)){ - clientY = 0; - } - if (!YAHOO.lang.isBoolean(ctrlKey)){ - ctrlKey = false; - } - if (!YAHOO.lang.isBoolean(altKey)){ - altKey = false; - } - if (!YAHOO.lang.isBoolean(shiftKey)){ - shiftKey = false; - } - if (!YAHOO.lang.isBoolean(metaKey)){ - metaKey = false; - } - if (!YAHOO.lang.isNumber(button)){ - button = 0; - } - - //try to create a mouse event - var customEvent /*:MouseEvent*/ = null; - - //check for DOM-compliant browsers first - if (YAHOO.lang.isFunction(document.createEvent)){ - - customEvent = document.createEvent("MouseEvents"); - - //Safari 2.x (WebKit 418) still doesn't implement initMouseEvent() - if (customEvent.initMouseEvent){ - customEvent.initMouseEvent(type, bubbles, cancelable, view, detail, - screenX, screenY, clientX, clientY, - ctrlKey, altKey, shiftKey, metaKey, - button, relatedTarget); - } else { //Safari - - //the closest thing available in Safari 2.x is UIEvents - customEvent = document.createEvent("UIEvents"); - customEvent.initEvent(type, bubbles, cancelable); - customEvent.view = view; - customEvent.detail = detail; - customEvent.screenX = screenX; - customEvent.screenY = screenY; - customEvent.clientX = clientX; - customEvent.clientY = clientY; - customEvent.ctrlKey = ctrlKey; - customEvent.altKey = altKey; - customEvent.metaKey = metaKey; - customEvent.shiftKey = shiftKey; - customEvent.button = button; - customEvent.relatedTarget = relatedTarget; - } - - /* - * Check to see if relatedTarget has been assigned. Firefox - * versions less than 2.0 don't allow it to be assigned via - * initMouseEvent() and the property is readonly after event - * creation, so in order to keep YAHOO.util.getRelatedTarget() - * working, assign to the IE proprietary toElement property - * for mouseout event and fromElement property for mouseover - * event. - */ - if (relatedTarget && !customEvent.relatedTarget){ - if (type == "mouseout"){ - customEvent.toElement = relatedTarget; - } else if (type == "mouseover"){ - customEvent.fromElement = relatedTarget; - } - } - - //fire the event - target.dispatchEvent(customEvent); - - } else if (YAHOO.lang.isObject(document.createEventObject)){ //IE - - //create an IE event object - customEvent = document.createEventObject(); - - //assign available properties - customEvent.bubbles = bubbles; - customEvent.cancelable = cancelable; - customEvent.view = view; - customEvent.detail = detail; - customEvent.screenX = screenX; - customEvent.screenY = screenY; - customEvent.clientX = clientX; - customEvent.clientY = clientY; - customEvent.ctrlKey = ctrlKey; - customEvent.altKey = altKey; - customEvent.metaKey = metaKey; - customEvent.shiftKey = shiftKey; - - //fix button property for IE's wacky implementation - switch(button){ - case 0: - customEvent.button = 1; - break; - case 1: - customEvent.button = 4; - break; - case 2: - //leave as is - break; - default: - customEvent.button = 0; - } - - /* - * Have to use relatedTarget because IE won't allow assignment - * to toElement or fromElement on generic events. This keeps - * YAHOO.util.customEvent.getRelatedTarget() functional. - */ - customEvent.relatedTarget = relatedTarget; - - //fire the event - target.fireEvent("on" + type, customEvent); - - } else { - throw new Error("simulateMouseEvent(): No event simulation framework present."); - } - }, - - //-------------------------------------------------------------------------- - // Mouse events - //-------------------------------------------------------------------------- - - /** - * Simulates a mouse event on a particular element. - * @param {HTMLElement} target The element to click on. - * @param {String} type The type of event to fire. This can be any one of - * the following: click, dblclick, mousedown, mouseup, mouseout, - * mouseover, and mousemove. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseEvent - * @static - */ - fireMouseEvent : function (target /*:HTMLElement*/, type /*:String*/, - options /*:Object*/) /*:Void*/ - { - options = options || {}; - this.simulateMouseEvent(target, type, options.bubbles, - options.cancelable, options.view, options.detail, options.screenX, - options.screenY, options.clientX, options.clientY, options.ctrlKey, - options.altKey, options.shiftKey, options.metaKey, options.button, - options.relatedTarget); - }, - - /** - * Simulates a click on a particular element. - * @param {HTMLElement} target The element to click on. - * @param {Object} options Additional event options (use DOM standard names). - * @method click - * @static - */ - click : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireMouseEvent(target, "click", options); - }, - - /** - * Simulates a double click on a particular element. - * @param {HTMLElement} target The element to double click on. - * @param {Object} options Additional event options (use DOM standard names). - * @method dblclick - * @static - */ - dblclick : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireMouseEvent( target, "dblclick", options); - }, - - /** - * Simulates a mousedown on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mousedown - * @static - */ - mousedown : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mousedown", options); - }, - - /** - * Simulates a mousemove on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mousemove - * @static - */ - mousemove : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mousemove", options); - }, - - /** - * Simulates a mouseout event on a particular element. Use "relatedTarget" - * on the options object to specify where the mouse moved to. - * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so - * toElement is assigned in its place. IE doesn't allow toElement to be - * be assigned, so relatedTarget is assigned in its place. Both of these - * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly - * in both browsers. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseout - * @static - */ - mouseout : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mouseout", options); - }, - - /** - * Simulates a mouseover event on a particular element. Use "relatedTarget" - * on the options object to specify where the mouse moved from. - * Quirks: Firefox less than 2.0 doesn't set relatedTarget properly, so - * fromElement is assigned in its place. IE doesn't allow fromElement to be - * be assigned, so relatedTarget is assigned in its place. Both of these - * concessions allow YAHOO.util.Event.getRelatedTarget() to work correctly - * in both browsers. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseover - * @static - */ - mouseover : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mouseover", options); - }, - - /** - * Simulates a mouseup on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method mouseup - * @static - */ - mouseup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireMouseEvent(target, "mouseup", options); - }, - - //-------------------------------------------------------------------------- - // Key events - //-------------------------------------------------------------------------- - - /** - * Fires an event that normally would be fired by the keyboard (keyup, - * keydown, keypress). Make sure to specify either keyCode or charCode as - * an option. - * @private - * @param {String} type The type of event ("keyup", "keydown" or "keypress"). - * @param {HTMLElement} target The target of the event. - * @param {Object} options Options for the event. Either keyCode or charCode - * are required. - * @method fireKeyEvent - * @static - */ - fireKeyEvent : function (type /*:String*/, target /*:HTMLElement*/, - options /*:Object*/) /*:Void*/ - { - options = options || {}; - this.simulateKeyEvent(target, type, options.bubbles, - options.cancelable, options.view, options.ctrlKey, - options.altKey, options.shiftKey, options.metaKey, - options.keyCode, options.charCode); - }, - - /** - * Simulates a keydown event on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method keydown - * @static - */ - keydown : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireKeyEvent("keydown", target, options); - }, - - /** - * Simulates a keypress on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method keypress - * @static - */ - keypress : function (target /*:HTMLElement*/, options /*:Object*/) /*:Void*/ { - this.fireKeyEvent("keypress", target, options); - }, - - /** - * Simulates a keyup event on a particular element. - * @param {HTMLElement} target The element to act on. - * @param {Object} options Additional event options (use DOM standard names). - * @method keyup - * @static - */ - keyup : function (target /*:HTMLElement*/, options /*Object*/) /*:Void*/ { - this.fireKeyEvent("keyup", target, options); - } - - -}; -YAHOO.register("event-simulate", YAHOO.util.UserAction, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event/event-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event/event-debug.js deleted file mode 100644 index 916e0bb0ab..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/event/event-debug.js +++ /dev/null @@ -1,2524 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ - -/** - * The CustomEvent class lets you define events for your application - * that can be subscribed to by one or more independent component. - * - * @param {String} type The type of event, which is passed to the callback - * when the event fires - * @param {Object} context The context the event will fire from. "this" will - * refer to this object in the callback. Default value: - * the window object. The listener can override this. - * @param {boolean} silent pass true to prevent the event from writing to - * the debugsystem - * @param {int} signature the signature that the custom event subscriber - * will receive. YAHOO.util.CustomEvent.LIST or - * YAHOO.util.CustomEvent.FLAT. The default is - * YAHOO.util.CustomEvent.LIST. - * @param fireOnce {boolean} If configured to fire once, the custom event - * will only notify subscribers a single time regardless of how many times - * the event is fired. In addition, new subscribers will be notified - * immediately if the event has already been fired. - * @namespace YAHOO.util - * @class CustomEvent - * @constructor - */ -YAHOO.util.CustomEvent = function(type, context, silent, signature, fireOnce) { - - /** - * The type of event, returned to subscribers when the event fires - * @property type - * @type string - */ - this.type = type; - - /** - * The context the event will fire from by default. Defaults to the window obj. - * @property scope - * @type object - */ - this.scope = context || window; - - /** - * By default all custom events are logged in the debug build. Set silent to true - * to disable debug output for this event. - * @property silent - * @type boolean - */ - this.silent = silent; - - /** - * If configured to fire once, the custom event will only notify subscribers - * a single time regardless of how many times the event is fired. In addition, - * new subscribers will be notified immediately if the event has already been - * fired. - * @property fireOnce - * @type boolean - * @default false - */ - this.fireOnce = fireOnce; - - /** - * Indicates whether or not this event has ever been fired. - * @property fired - * @type boolean - * @default false - */ - this.fired = false; - - /** - * For fireOnce events the arguments the event was fired with are stored - * so that new subscribers get the proper payload. - * @property firedWith - * @type Array - */ - this.firedWith = null; - - /** - * Custom events support two styles of arguments provided to the event - * subscribers. - *
                      - *
                    • YAHOO.util.CustomEvent.LIST: - *
                        - *
                      • param1: event name
                      • - *
                      • param2: array of arguments sent to fire
                      • - *
                      • param3: a custom object supplied by the subscriber
                      • - *
                      - *
                    • - *
                    • YAHOO.util.CustomEvent.FLAT - *
                        - *
                      • param1: the first argument passed to fire. If you need to - * pass multiple parameters, use and array or object literal
                      • - *
                      • param2: a custom object supplied by the subscriber
                      • - *
                      - *
                    • - *
                    - * @property signature - * @type int - */ - this.signature = signature || YAHOO.util.CustomEvent.LIST; - - /** - * The subscribers to this event - * @property subscribers - * @type Subscriber[] - */ - this.subscribers = []; - - if (!this.silent) { - YAHOO.log( "Creating " + this, "info", "Event" ); - } - - var onsubscribeType = "_YUICEOnSubscribe"; - - // Only add subscribe events for events that are not generated by - // CustomEvent - if (type !== onsubscribeType) { - - /** - * Custom events provide a custom event that fires whenever there is - * a new subscriber to the event. This provides an opportunity to - * handle the case where there is a non-repeating event that has - * already fired has a new subscriber. - * - * @event subscribeEvent - * @type YAHOO.util.CustomEvent - * @param fn {Function} The function to execute - * @param obj An object to be passed along when the event fires. - * Defaults to the custom event. - * @param override If true, the obj passed in becomes the - * execution context of the listener. If an object, that object becomes - * the execution context. Defaults to the custom event. - */ - this.subscribeEvent = - new YAHOO.util.CustomEvent(onsubscribeType, this, true); - - } - - - /** - * In order to make it possible to execute the rest of the subscriber - * stack when one thows an exception, the subscribers exceptions are - * caught. The most recent exception is stored in this property - * @property lastError - * @type Error - */ - this.lastError = null; -}; - -/** - * Subscriber listener sigature constant. The LIST type returns three - * parameters: the event type, the array of args passed to fire, and - * the optional custom object - * @property YAHOO.util.CustomEvent.LIST - * @static - * @type int - */ -YAHOO.util.CustomEvent.LIST = 0; - -/** - * Subscriber listener sigature constant. The FLAT type returns two - * parameters: the first argument passed to fire and the optional - * custom object - * @property YAHOO.util.CustomEvent.FLAT - * @static - * @type int - */ -YAHOO.util.CustomEvent.FLAT = 1; - -YAHOO.util.CustomEvent.prototype = { - - /** - * Subscribes the caller to this event - * @method subscribe - * @param {Function} fn The function to execute - * @param {Object} obj An object to be passed along when the event fires. - * overrideContext If true, the obj passed in becomes the execution - * context of the listener. If an object, that object becomes the execution context. - */ - subscribe: function(fn, obj, overrideContext) { - - if (!fn) { -throw new Error("Invalid callback for subscriber to '" + this.type + "'"); - } - - if (this.subscribeEvent) { - this.subscribeEvent.fire(fn, obj, overrideContext); - } - - var s = new YAHOO.util.Subscriber(fn, obj, overrideContext); - - if (this.fireOnce && this.fired) { - this.notify(s, this.firedWith); - } else { - this.subscribers.push(s); - } - }, - - /** - * Unsubscribes subscribers. - * @method unsubscribe - * @param {Function} fn The subscribed function to remove, if not supplied - * all will be removed - * @param {Object} obj The custom object passed to subscribe. This is - * optional, but if supplied will be used to - * disambiguate multiple listeners that are the same - * (e.g., you subscribe many object using a function - * that lives on the prototype) - * @return {boolean} True if the subscriber was found and detached. - */ - unsubscribe: function(fn, obj) { - - if (!fn) { - return this.unsubscribeAll(); - } - - var found = false; - for (var i=0, len=this.subscribers.length; i - *
                  • The type of event
                  • - *
                  • All of the arguments fire() was executed with as an array
                  • - *
                  • The custom object (if any) that was passed into the subscribe() - * method
                  • - * - * @method fire - * @param {Object*} arguments an arbitrary set of parameters to pass to - * the handler. - * @return {boolean} false if one of the subscribers returned false, - * true otherwise - */ - fire: function() { - - this.lastError = null; - - var errors = [], - len=this.subscribers.length; - - - var args=[].slice.call(arguments, 0), ret=true, i, rebuild=false; - - if (this.fireOnce) { - if (this.fired) { - YAHOO.log('fireOnce event has already fired: ' + this.type); - return true; - } else { - this.firedWith = args; - } - } - - this.fired = true; - - if (!len && this.silent) { - //YAHOO.log('DEBUG no subscribers'); - return true; - } - - if (!this.silent) { - YAHOO.log( "Firing " + this + ", " + - "args: " + args + ", " + - "subscribers: " + len, - "info", "Event" ); - } - - // make a copy of the subscribers so that there are - // no index problems if one subscriber removes another. - var subs = this.subscribers.slice(); - - for (i=0; i " + s, "info", "Event" ); - } - - if (this.signature == YAHOO.util.CustomEvent.FLAT) { - - if (args.length > 0) { - param = args[0]; - } - - try { - ret = s.fn.call(scope, param, s.obj); - } catch(e) { - this.lastError = e; - // errors.push(e); - YAHOO.log(this + " subscriber exception: " + e, "error", "Event"); - if (throwErrors) { - throw e; - } - } - } else { - try { - ret = s.fn.call(scope, this.type, args, s.obj); - } catch(ex) { - this.lastError = ex; - YAHOO.log(this + " subscriber exception: " + ex, "error", "Event"); - if (throwErrors) { - throw ex; - } - } - } - - return ret; - }, - - /** - * Removes all listeners - * @method unsubscribeAll - * @return {int} The number of listeners unsubscribed - */ - unsubscribeAll: function() { - var l = this.subscribers.length, i; - for (i=l-1; i>-1; i--) { - this._delete(i); - } - - this.subscribers=[]; - - return l; - }, - - /** - * @method _delete - * @private - */ - _delete: function(index) { - var s = this.subscribers[index]; - if (s) { - delete s.fn; - delete s.obj; - } - - // this.subscribers[index]=null; - this.subscribers.splice(index, 1); - }, - - /** - * @method toString - */ - toString: function() { - return "CustomEvent: " + "'" + this.type + "', " + - "context: " + this.scope; - - } -}; - -///////////////////////////////////////////////////////////////////// - -/** - * Stores the subscriber information to be used when the event fires. - * @param {Function} fn The function to execute - * @param {Object} obj An object to be passed along when the event fires - * @param {boolean} overrideContext If true, the obj passed in becomes the execution - * context of the listener - * @class Subscriber - * @constructor - */ -YAHOO.util.Subscriber = function(fn, obj, overrideContext) { - - /** - * The callback that will be execute when the event fires - * @property fn - * @type function - */ - this.fn = fn; - - /** - * An optional custom object that will passed to the callback when - * the event fires - * @property obj - * @type object - */ - this.obj = YAHOO.lang.isUndefined(obj) ? null : obj; - - /** - * The default execution context for the event listener is defined when the - * event is created (usually the object which contains the event). - * By setting overrideContext to true, the execution context becomes the custom - * object passed in by the subscriber. If overrideContext is an object, that - * object becomes the context. - * @property overrideContext - * @type boolean|object - */ - this.overrideContext = overrideContext; - -}; - -/** - * Returns the execution context for this listener. If overrideContext was set to true - * the custom obj will be the context. If overrideContext is an object, that is the - * context, otherwise the default context will be used. - * @method getScope - * @param {Object} defaultScope the context to use if this listener does not - * override it. - */ -YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) { - if (this.overrideContext) { - if (this.overrideContext === true) { - return this.obj; - } else { - return this.overrideContext; - } - } - return defaultScope; -}; - -/** - * Returns true if the fn and obj match this objects properties. - * Used by the unsubscribe method to match the right subscriber. - * - * @method contains - * @param {Function} fn the function to execute - * @param {Object} obj an object to be passed along when the event fires - * @return {boolean} true if the supplied arguments match this - * subscriber's signature. - */ -YAHOO.util.Subscriber.prototype.contains = function(fn, obj) { - if (obj) { - return (this.fn == fn && this.obj == obj); - } else { - return (this.fn == fn); - } -}; - -/** - * @method toString - */ -YAHOO.util.Subscriber.prototype.toString = function() { - return "Subscriber { obj: " + this.obj + - ", overrideContext: " + (this.overrideContext || "no") + " }"; -}; - -/** - * The Event Utility provides utilities for managing DOM Events and tools - * for building event systems - * - * @module event - * @title Event Utility - * @namespace YAHOO.util - * @requires yahoo - */ - -// The first instance of Event will win if it is loaded more than once. -// @TODO this needs to be changed so that only the state data that needs to -// be preserved is kept, while methods are overwritten/added as needed. -// This means that the module pattern can't be used. -if (!YAHOO.util.Event) { - -/** - * The event utility provides functions to add and remove event listeners, - * event cleansing. It also tries to automatically remove listeners it - * registers during the unload event. - * - * @class Event - * @static - */ - YAHOO.util.Event = function() { - - /** - * True after the onload event has fired - * @property loadComplete - * @type boolean - * @static - * @private - */ - var loadComplete = false, - - /** - * Cache of wrapped listeners - * @property listeners - * @type array - * @static - * @private - */ - listeners = [], - - - /** - * User-defined unload function that will be fired before all events - * are detached - * @property unloadListeners - * @type array - * @static - * @private - */ - unloadListeners = [], - - /** - * The number of times to poll after window.onload. This number is - * increased if additional late-bound handlers are requested after - * the page load. - * @property retryCount - * @static - * @private - */ - retryCount = 0, - - /** - * onAvailable listeners - * @property onAvailStack - * @static - * @private - */ - onAvailStack = [], - - /** - * Counter for auto id generation - * @property counter - * @static - * @private - */ - counter = 0, - - /** - * Normalized keycodes for webkit/safari - * @property webkitKeymap - * @type {int: int} - * @private - * @static - * @final - */ - webkitKeymap = { - 63232: 38, // up - 63233: 40, // down - 63234: 37, // left - 63235: 39, // right - 63276: 33, // page up - 63277: 34, // page down - 25: 9 // SHIFT-TAB (Safari provides a different key code in - // this case, even though the shiftKey modifier is set) - }, - - isIE = YAHOO.env.ua.ie, - - // String constants used by the addFocusListener and removeFocusListener methods - - FOCUSIN = "focusin", - FOCUSOUT = "focusout"; - - return { - - /** - * The number of times we should look for elements that are not - * in the DOM at the time the event is requested after the document - * has been loaded. The default is 500@amp;40 ms, so it will poll - * for 20 seconds or until all outstanding handlers are bound - * (whichever comes first). - * @property POLL_RETRYS - * @type int - * @static - * @final - */ - POLL_RETRYS: 500, - - /** - * The poll interval in milliseconds - * @property POLL_INTERVAL - * @type int - * @static - * @final - */ - POLL_INTERVAL: 40, - - /** - * Element to bind, int constant - * @property EL - * @type int - * @static - * @final - */ - EL: 0, - - /** - * Type of event, int constant - * @property TYPE - * @type int - * @static - * @final - */ - TYPE: 1, - - /** - * Function to execute, int constant - * @property FN - * @type int - * @static - * @final - */ - FN: 2, - - /** - * Function wrapped for context correction and cleanup, int constant - * @property WFN - * @type int - * @static - * @final - */ - WFN: 3, - - /** - * Object passed in by the user that will be returned as a - * parameter to the callback, int constant. Specific to - * unload listeners - * @property OBJ - * @type int - * @static - * @final - */ - UNLOAD_OBJ: 3, - - /** - * Adjusted context, either the element we are registering the event - * on or the custom object passed in by the listener, int constant - * @property ADJ_SCOPE - * @type int - * @static - * @final - */ - ADJ_SCOPE: 4, - - /** - * The original obj passed into addListener - * @property OBJ - * @type int - * @static - * @final - */ - OBJ: 5, - - /** - * The original context parameter passed into addListener - * @property OVERRIDE - * @type int - * @static - * @final - */ - OVERRIDE: 6, - - /** - * The original capture parameter passed into addListener - * @property CAPTURE - * @type int - * @static - * @final - */ - CAPTURE: 7, - - /** - * addListener/removeListener can throw errors in unexpected scenarios. - * These errors are suppressed, the method returns false, and this property - * is set - * @property lastError - * @static - * @type Error - */ - lastError: null, - - /** - * Safari detection - * @property isSafari - * @private - * @static - * @deprecated use YAHOO.env.ua.webkit - */ - isSafari: YAHOO.env.ua.webkit, - - /** - * webkit version - * @property webkit - * @type string - * @private - * @static - * @deprecated use YAHOO.env.ua.webkit - */ - webkit: YAHOO.env.ua.webkit, - - /** - * IE detection - * @property isIE - * @private - * @static - * @deprecated use YAHOO.env.ua.ie - */ - isIE: isIE, - - /** - * poll handle - * @property _interval - * @static - * @private - */ - _interval: null, - - /** - * document readystate poll handle - * @property _dri - * @static - * @private - */ - _dri: null, - - - /** - * Map of special event types - * @property _specialTypes - * @static - * @private - */ - _specialTypes: { - focusin: (isIE ? "focusin" : "focus"), - focusout: (isIE ? "focusout" : "blur") - }, - - - /** - * True when the document is initially usable - * @property DOMReady - * @type boolean - * @static - */ - DOMReady: false, - - /** - * Errors thrown by subscribers of custom events are caught - * and the error message is written to the debug console. If - * this property is set to true, it will also re-throw the - * error. - * @property throwErrors - * @type boolean - * @default false - */ - throwErrors: false, - - - /** - * @method startInterval - * @static - * @private - */ - startInterval: function() { - if (!this._interval) { - // var self = this; - // var callback = function() { self._tryPreloadAttach(); }; - // this._interval = setInterval(callback, this.POLL_INTERVAL); - this._interval = YAHOO.lang.later(this.POLL_INTERVAL, this, this._tryPreloadAttach, null, true); - } - }, - - /** - * Executes the supplied callback when the item with the supplied - * id is found. This is meant to be used to execute behavior as - * soon as possible as the page loads. If you use this after the - * initial page load it will poll for a fixed time for the element. - * The number of times it will poll and the frequency are - * configurable. By default it will poll for 10 seconds. - * - *

                    The callback is executed with a single parameter: - * the custom object parameter, if provided.

                    - * - * @method onAvailable - * - * @param {string||string[]} id the id of the element, or an array - * of ids to look for. - * @param {function} fn what to execute when the element is found. - * @param {object} obj an optional object to be passed back as - * a parameter to fn. - * @param {boolean|object} overrideContext If set to true, fn will execute - * in the context of obj, if set to an object it - * will execute in the context of that object - * @param checkContent {boolean} check child node readiness (onContentReady) - * @static - */ - onAvailable: function(id, fn, obj, overrideContext, checkContent) { - - var a = (YAHOO.lang.isString(id)) ? [id] : id; - - for (var i=0; iThe callback is executed with a single parameter: - * the custom object parameter, if provided.

                    - * - * @method onContentReady - * - * @param {string} id the id of the element to look for. - * @param {function} fn what to execute when the element is ready. - * @param {object} obj an optional object to be passed back as - * a parameter to fn. - * @param {boolean|object} overrideContext If set to true, fn will execute - * in the context of obj. If an object, fn will - * exectute in the context of that object - * - * @static - */ - onContentReady: function(id, fn, obj, overrideContext) { - this.onAvailable(id, fn, obj, overrideContext, true); - }, - - /** - * Executes the supplied callback when the DOM is first usable. This - * will execute immediately if called after the DOMReady event has - * fired. @todo the DOMContentReady event does not fire when the - * script is dynamically injected into the page. This means the - * DOMReady custom event will never fire in FireFox or Opera when the - * library is injected. It _will_ fire in Safari, and the IE - * implementation would allow for us to fire it if the defered script - * is not available. We want this to behave the same in all browsers. - * Is there a way to identify when the script has been injected - * instead of included inline? Is there a way to know whether the - * window onload event has fired without having had a listener attached - * to it when it did so? - * - *

                    The callback is a CustomEvent, so the signature is:

                    - *

                    type <string>, args <array>, customobject <object>

                    - *

                    For DOMReady events, there are no fire argments, so the - * signature is:

                    - *

                    "DOMReady", [], obj

                    - * - * - * @method onDOMReady - * - * @param {function} fn what to execute when the element is found. - * @param {object} obj an optional object to be passed back as - * a parameter to fn. - * @param {boolean|object} overrideContext If set to true, fn will execute - * in the context of obj, if set to an object it - * will execute in the context of that object - * - * @static - */ - // onDOMReady: function(fn, obj, overrideContext) { - onDOMReady: function() { - this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent, arguments); - }, - - - /** - * Appends an event handler - * - * @method _addListener - * - * @param {String|HTMLElement|Array|NodeList} el An id, an element - * reference, or a collection of ids and/or elements to assign the - * listener to. - * @param {String} sType The type of event to append - * @param {Function} fn The method the event invokes - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the handler - * @param {Boolean|object} overrideContext If true, the obj passed in becomes - * the execution context of the listener. If an - * object, this object becomes the execution - * context. - * @param {boolen} capture capture or bubble phase - * @return {Boolean} True if the action was successful or defered, - * false if one or more of the elements - * could not have the listener attached, - * or if the operation throws an exception. - * @private - * @static - */ - _addListener: function(el, sType, fn, obj, overrideContext, bCapture) { - - if (!fn || !fn.call) { - YAHOO.log(sType + " addListener failed, invalid callback", "error", "Event"); - return false; - } - - // The el argument can be an array of elements or element ids. - if ( this._isValidCollection(el)) { - var ok = true; - for (var i=0,len=el.length; i-1; i--) { - ok = ( this.removeListener(el[i], sType, fn) && ok ); - } - return ok; - } - - if (!fn || !fn.call) { - // this.logger.debug("Error, function is not valid " + fn); - //return false; - return this.purgeElement(el, false, sType); - } - - if ("unload" == sType) { - - for (i=unloadListeners.length-1; i>-1; i--) { - li = unloadListeners[i]; - if (li && - li[0] == el && - li[1] == sType && - li[2] == fn) { - unloadListeners.splice(i, 1); - // unloadListeners[i]=null; - return true; - } - } - - return false; - } - - var cacheItem = null; - - // The index is a hidden parameter; needed to remove it from - // the method signature because it was tempting users to - // try and take advantage of it, which is not possible. - var index = arguments[3]; - - if ("undefined" === typeof index) { - index = this._getCacheIndex(listeners, el, sType, fn); - } - - if (index >= 0) { - cacheItem = listeners[index]; - } - - if (!el || !cacheItem) { - // this.logger.debug("cached listener not found"); - return false; - } - - // this.logger.debug("Removing handler: " + el + ", " + sType); - - var bCapture = cacheItem[this.CAPTURE] === true ? true : false; - - try { - this._simpleRemove(el, sType, cacheItem[this.WFN], bCapture); - } catch(ex) { - this.lastError = ex; - return false; - } - - // removed the wrapped handler - delete listeners[index][this.WFN]; - delete listeners[index][this.FN]; - listeners.splice(index, 1); - // listeners[index]=null; - - return true; - - }, - - /** - * Returns the event's target element. Safari sometimes provides - * a text node, and this is automatically resolved to the text - * node's parent so that it behaves like other browsers. - * @method getTarget - * @param {Event} ev the event - * @param {boolean} resolveTextNode when set to true the target's - * parent will be returned if the target is a - * text node. @deprecated, the text node is - * now resolved automatically - * @return {HTMLElement} the event's target - * @static - */ - getTarget: function(ev, resolveTextNode) { - var t = ev.target || ev.srcElement; - return this.resolveTextNode(t); - }, - - /** - * In some cases, some browsers will return a text node inside - * the actual element that was targeted. This normalizes the - * return value for getTarget and getRelatedTarget. - * @method resolveTextNode - * @param {HTMLElement} node node to resolve - * @return {HTMLElement} the normized node - * @static - */ - resolveTextNode: function(n) { - try { - if (n && 3 == n.nodeType) { - return n.parentNode; - } - } catch(e) { } - - return n; - }, - - /** - * Returns the event's pageX - * @method getPageX - * @param {Event} ev the event - * @return {int} the event's pageX - * @static - */ - getPageX: function(ev) { - var x = ev.pageX; - if (!x && 0 !== x) { - x = ev.clientX || 0; - - if ( this.isIE ) { - x += this._getScrollLeft(); - } - } - - return x; - }, - - /** - * Returns the event's pageY - * @method getPageY - * @param {Event} ev the event - * @return {int} the event's pageY - * @static - */ - getPageY: function(ev) { - var y = ev.pageY; - if (!y && 0 !== y) { - y = ev.clientY || 0; - - if ( this.isIE ) { - y += this._getScrollTop(); - } - } - - - return y; - }, - - /** - * Returns the pageX and pageY properties as an indexed array. - * @method getXY - * @param {Event} ev the event - * @return {[x, y]} the pageX and pageY properties of the event - * @static - */ - getXY: function(ev) { - return [this.getPageX(ev), this.getPageY(ev)]; - }, - - /** - * Returns the event's related target - * @method getRelatedTarget - * @param {Event} ev the event - * @return {HTMLElement} the event's relatedTarget - * @static - */ - getRelatedTarget: function(ev) { - var t = ev.relatedTarget; - if (!t) { - if (ev.type == "mouseout") { - t = ev.toElement; - } else if (ev.type == "mouseover") { - t = ev.fromElement; - } - } - - return this.resolveTextNode(t); - }, - - /** - * Returns the time of the event. If the time is not included, the - * event is modified using the current time. - * @method getTime - * @param {Event} ev the event - * @return {Date} the time of the event - * @static - */ - getTime: function(ev) { - if (!ev.time) { - var t = new Date().getTime(); - try { - ev.time = t; - } catch(ex) { - this.lastError = ex; - return t; - } - } - - return ev.time; - }, - - /** - * Convenience method for stopPropagation + preventDefault - * @method stopEvent - * @param {Event} ev the event - * @static - */ - stopEvent: function(ev) { - this.stopPropagation(ev); - this.preventDefault(ev); - }, - - /** - * Stops event propagation - * @method stopPropagation - * @param {Event} ev the event - * @static - */ - stopPropagation: function(ev) { - if (ev.stopPropagation) { - ev.stopPropagation(); - } else { - ev.cancelBubble = true; - } - }, - - /** - * Prevents the default behavior of the event - * @method preventDefault - * @param {Event} ev the event - * @static - */ - preventDefault: function(ev) { - if (ev.preventDefault) { - ev.preventDefault(); - } else { - ev.returnValue = false; - } - }, - - /** - * Finds the event in the window object, the caller's arguments, or - * in the arguments of another method in the callstack. This is - * executed automatically for events registered through the event - * manager, so the implementer should not normally need to execute - * this function at all. - * @method getEvent - * @param {Event} e the event parameter from the handler - * @param {HTMLElement} boundEl the element the listener is attached to - * @return {Event} the event - * @static - */ - getEvent: function(e, boundEl) { - var ev = e || window.event; - - if (!ev) { - var c = this.getEvent.caller; - while (c) { - ev = c.arguments[0]; - if (ev && Event == ev.constructor) { - break; - } - c = c.caller; - } - } - - return ev; - }, - - /** - * Returns the charcode for an event - * @method getCharCode - * @param {Event} ev the event - * @return {int} the event's charCode - * @static - */ - getCharCode: function(ev) { - var code = ev.keyCode || ev.charCode || 0; - - // webkit key normalization - if (YAHOO.env.ua.webkit && (code in webkitKeymap)) { - code = webkitKeymap[code]; - } - return code; - }, - - /** - * Locating the saved event handler data by function ref - * - * @method _getCacheIndex - * @static - * @private - */ - _getCacheIndex: function(a, el, sType, fn) { - for (var i=0, l=a.length; i 0 && onAvailStack.length > 0); - } - - // onAvailable - var notAvail = []; - - var executeItem = function (el, item) { - var context = el; - if (item.overrideContext) { - if (item.overrideContext === true) { - context = item.obj; - } else { - context = item.overrideContext; - } - } - item.fn.call(context, item.obj); - }; - - var i, len, item, el, ready=[]; - - // onAvailable onContentReady - for (i=0, len=onAvailStack.length; i-1; i--) { - item = onAvailStack[i]; - if (!item || !item.id) { - onAvailStack.splice(i, 1); - } - } - - this.startInterval(); - } else { - if (this._interval) { - // clearInterval(this._interval); - this._interval.cancel(); - this._interval = null; - } - } - - this.locked = false; - - }, - - /** - * Removes all listeners attached to the given element via addListener. - * Optionally, the node's children can also be purged. - * Optionally, you can specify a specific type of event to remove. - * @method purgeElement - * @param {HTMLElement} el the element to purge - * @param {boolean} recurse recursively purge this element's children - * as well. Use with caution. - * @param {string} sType optional type of listener to purge. If - * left out, all listeners will be removed - * @static - */ - purgeElement: function(el, recurse, sType) { - var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el; - var elListeners = this.getListeners(oEl, sType), i, len; - if (elListeners) { - for (i=elListeners.length-1; i>-1; i--) { - var l = elListeners[i]; - this.removeListener(oEl, l.type, l.fn); - } - } - - if (recurse && oEl && oEl.childNodes) { - for (i=0,len=oEl.childNodes.length; i-1; j--) { - l = listeners[j]; - if (l) { - EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], j); - } - } - l=null; - } - - EU._simpleRemove(window, "unload", EU._unload); - - }, - - /** - * Returns scrollLeft - * @method _getScrollLeft - * @static - * @private - */ - _getScrollLeft: function() { - return this._getScroll()[1]; - }, - - /** - * Returns scrollTop - * @method _getScrollTop - * @static - * @private - */ - _getScrollTop: function() { - return this._getScroll()[0]; - }, - - /** - * Returns the scrollTop and scrollLeft. Used to calculate the - * pageX and pageY in Internet Explorer - * @method _getScroll - * @static - * @private - */ - _getScroll: function() { - var dd = document.documentElement, db = document.body; - if (dd && (dd.scrollTop || dd.scrollLeft)) { - return [dd.scrollTop, dd.scrollLeft]; - } else if (db) { - return [db.scrollTop, db.scrollLeft]; - } else { - return [0, 0]; - } - }, - - /** - * Used by old versions of CustomEvent, restored for backwards - * compatibility - * @method regCE - * @private - * @static - * @deprecated still here for backwards compatibility - */ - regCE: function() {}, - - /** - * Adds a DOM event directly without the caching, cleanup, context adj, etc - * - * @method _simpleAdd - * @param {HTMLElement} el the element to bind the handler to - * @param {string} sType the type of event handler - * @param {function} fn the callback to invoke - * @param {boolen} capture capture or bubble phase - * @static - * @private - */ - _simpleAdd: function () { - if (window.addEventListener) { - return function(el, sType, fn, capture) { - el.addEventListener(sType, fn, (capture)); - }; - } else if (window.attachEvent) { - return function(el, sType, fn, capture) { - el.attachEvent("on" + sType, fn); - }; - } else { - return function(){}; - } - }(), - - /** - * Basic remove listener - * - * @method _simpleRemove - * @param {HTMLElement} el the element to bind the handler to - * @param {string} sType the type of event handler - * @param {function} fn the callback to invoke - * @param {boolen} capture capture or bubble phase - * @static - * @private - */ - _simpleRemove: function() { - if (window.removeEventListener) { - return function (el, sType, fn, capture) { - el.removeEventListener(sType, fn, (capture)); - }; - } else if (window.detachEvent) { - return function (el, sType, fn) { - el.detachEvent("on" + sType, fn); - }; - } else { - return function(){}; - } - }() - }; - - }(); - - (function() { - var EU = YAHOO.util.Event; - - /** - * YAHOO.util.Event.on is an alias for addListener - * @method on - * @see addListener - * @static - */ - EU.on = EU.addListener; - - /** - * YAHOO.util.Event.onFocus is an alias for addFocusListener - * @method onFocus - * @see addFocusListener - * @static - * @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type. - */ - EU.onFocus = EU.addFocusListener; - - /** - * YAHOO.util.Event.onBlur is an alias for addBlurListener - * @method onBlur - * @see addBlurListener - * @static - * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type. - */ - EU.onBlur = EU.addBlurListener; - -/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ - - // Internet Explorer: use the readyState of a defered script. - // This isolates what appears to be a safe moment to manipulate - // the DOM prior to when the document's readyState suggests - // it is safe to do so. - if (EU.isIE) { - if (self !== self.top) { - document.onreadystatechange = function() { - if (document.readyState == 'complete') { - document.onreadystatechange = null; - EU._ready(); - } - }; - } else { - - // Process onAvailable/onContentReady items when the - // DOM is ready. - YAHOO.util.Event.onDOMReady( - YAHOO.util.Event._tryPreloadAttach, - YAHOO.util.Event, true); - - var n = document.createElement('p'); - - EU._dri = setInterval(function() { - try { - // throws an error if doc is not ready - n.doScroll('left'); - clearInterval(EU._dri); - EU._dri = null; - EU._ready(); - n = null; - } catch (ex) { - } - }, EU.POLL_INTERVAL); - } - - // The document's readyState in Safari currently will - // change to loaded/complete before images are loaded. - } else if (EU.webkit && EU.webkit < 525) { - - EU._dri = setInterval(function() { - var rs=document.readyState; - if ("loaded" == rs || "complete" == rs) { - clearInterval(EU._dri); - EU._dri = null; - EU._ready(); - } - }, EU.POLL_INTERVAL); - - // FireFox and Opera: These browsers provide a event for this - // moment. The latest WebKit releases now support this event. - } else { - - EU._simpleAdd(document, "DOMContentLoaded", EU._ready); - - } - ///////////////////////////////////////////////////////////// - - - EU._simpleAdd(window, "load", EU._load); - EU._simpleAdd(window, "unload", EU._unload); - EU._tryPreloadAttach(); - })(); - -} -/** - * EventProvider is designed to be used with YAHOO.augment to wrap - * CustomEvents in an interface that allows events to be subscribed to - * and fired by name. This makes it possible for implementing code to - * subscribe to an event that either has not been created yet, or will - * not be created at all. - * - * @Class EventProvider - */ -YAHOO.util.EventProvider = function() { }; - -YAHOO.util.EventProvider.prototype = { - - /** - * Private storage of custom events - * @property __yui_events - * @type Object[] - * @private - */ - __yui_events: null, - - /** - * Private storage of custom event subscribers - * @property __yui_subscribers - * @type Object[] - * @private - */ - __yui_subscribers: null, - - /** - * Subscribe to a CustomEvent by event type - * - * @method subscribe - * @param p_type {string} the type, or name of the event - * @param p_fn {function} the function to exectute when the event fires - * @param p_obj {Object} An object to be passed along when the event - * fires - * @param overrideContext {boolean} If true, the obj passed in becomes the - * execution scope of the listener - */ - subscribe: function(p_type, p_fn, p_obj, overrideContext) { - - this.__yui_events = this.__yui_events || {}; - var ce = this.__yui_events[p_type]; - - if (ce) { - ce.subscribe(p_fn, p_obj, overrideContext); - } else { - this.__yui_subscribers = this.__yui_subscribers || {}; - var subs = this.__yui_subscribers; - if (!subs[p_type]) { - subs[p_type] = []; - } - subs[p_type].push( - { fn: p_fn, obj: p_obj, overrideContext: overrideContext } ); - } - }, - - /** - * Unsubscribes one or more listeners the from the specified event - * @method unsubscribe - * @param p_type {string} The type, or name of the event. If the type - * is not specified, it will attempt to remove - * the listener from all hosted events. - * @param p_fn {Function} The subscribed function to unsubscribe, if not - * supplied, all subscribers will be removed. - * @param p_obj {Object} The custom object passed to subscribe. This is - * optional, but if supplied will be used to - * disambiguate multiple listeners that are the same - * (e.g., you subscribe many object using a function - * that lives on the prototype) - * @return {boolean} true if the subscriber was found and detached. - */ - unsubscribe: function(p_type, p_fn, p_obj) { - this.__yui_events = this.__yui_events || {}; - var evts = this.__yui_events; - if (p_type) { - var ce = evts[p_type]; - if (ce) { - return ce.unsubscribe(p_fn, p_obj); - } - } else { - var ret = true; - for (var i in evts) { - if (YAHOO.lang.hasOwnProperty(evts, i)) { - ret = ret && evts[i].unsubscribe(p_fn, p_obj); - } - } - return ret; - } - - return false; - }, - - /** - * Removes all listeners from the specified event. If the event type - * is not specified, all listeners from all hosted custom events will - * be removed. - * @method unsubscribeAll - * @param p_type {string} The type, or name of the event - */ - unsubscribeAll: function(p_type) { - return this.unsubscribe(p_type); - }, - - /** - * Creates a new custom event of the specified type. If a custom event - * by that name already exists, it will not be re-created. In either - * case the custom event is returned. - * - * @method createEvent - * - * @param p_type {string} the type, or name of the event - * @param p_config {object} optional config params. Valid properties are: - * - *
                      - *
                    • - * scope: defines the default execution scope. If not defined - * the default scope will be this instance. - *
                    • - *
                    • - * silent: if true, the custom event will not generate log messages. - * This is false by default. - *
                    • - *
                    • - * fireOnce: if true, the custom event will only notify subscribers - * once regardless of the number of times the event is fired. In - * addition, new subscribers will be executed immediately if the - * event has already fired. - * This is false by default. - *
                    • - *
                    • - * onSubscribeCallback: specifies a callback to execute when the - * event has a new subscriber. This will fire immediately for - * each queued subscriber if any exist prior to the creation of - * the event. - *
                    • - *
                    - * - * @return {CustomEvent} the custom event - * - */ - createEvent: function(p_type, p_config) { - - this.__yui_events = this.__yui_events || {}; - var opts = p_config || {}, - events = this.__yui_events, ce; - - if (events[p_type]) { -YAHOO.log("EventProvider createEvent skipped: '"+p_type+"' already exists"); - } else { - - ce = new YAHOO.util.CustomEvent(p_type, opts.scope || this, opts.silent, - YAHOO.util.CustomEvent.FLAT, opts.fireOnce); - - events[p_type] = ce; - - if (opts.onSubscribeCallback) { - ce.subscribeEvent.subscribe(opts.onSubscribeCallback); - } - - this.__yui_subscribers = this.__yui_subscribers || {}; - var qs = this.__yui_subscribers[p_type]; - - if (qs) { - for (var i=0; i - *
                  • The first argument fire() was executed with
                  • - *
                  • The custom object (if any) that was passed into the subscribe() - * method
                  • - * - * @method fireEvent - * @param p_type {string} the type, or name of the event - * @param arguments {Object*} an arbitrary set of parameters to pass to - * the handler. - * @return {boolean} the return value from CustomEvent.fire - * - */ - fireEvent: function(p_type) { - - this.__yui_events = this.__yui_events || {}; - var ce = this.__yui_events[p_type]; - - if (!ce) { -YAHOO.log(p_type + "event fired before it was created."); - return null; - } - - var args = []; - for (var i=1; i0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.obj);}catch(D){this.lastError=D;if(A){throw D;}}}return B;},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var G=false,H=[],J=[],A=0,E=[],B=0,C={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},D=YAHOO.env.ua.ie,F="focusin",I="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:D,_interval:null,_dri:null,_specialTypes:{focusin:(D?"focusin":"focus"),focusout:(D?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(Q,M,O,P,N){var K=(YAHOO.lang.isString(Q))?[Q]:Q;for(var L=0;L-1;M--){S=(this.removeListener(L[M],K,R)&&S);}return S;}}if(!R||!R.call){return this.purgeElement(L,false,K);}if("unload"==K){for(M=J.length-1;M>-1;M--){U=J[M];if(U&&U[0]==L&&U[1]==K&&U[2]==R){J.splice(M,1);return true;}}return false;}var N=null;var O=arguments[3];if("undefined"===typeof O){O=this._getCacheIndex(H,L,K,R);}if(O>=0){N=H[O];}if(!L||!N){return false;}var T=N[this.CAPTURE]===true?true:false;try{this._simpleRemove(L,K,N[this.WFN],T);}catch(Q){this.lastError=Q;return false;}delete H[O][this.WFN];delete H[O][this.FN];H.splice(O,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement; -}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in C)){K=C[K];}return K;},_getCacheIndex:function(M,P,Q,O){for(var N=0,L=M.length;N0&&E.length>0);}var P=[];var R=function(T,U){var S=T;if(U.overrideContext){if(U.overrideContext===true){S=U.obj;}else{S=U.overrideContext;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=E.length;L-1;L--){O=E[L];if(!O||!O.id){E.splice(L,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; -/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ -if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A); -},createEvent:function(B,G){this.__yui_events=this.__yui_events||{};var E=G||{},D=this.__yui_events,F;if(D[B]){}else{F=new YAHOO.util.CustomEvent(B,E.scope||this,E.silent,YAHOO.util.CustomEvent.FLAT,E.fireOnce);D[B]=F;if(E.onSubscribeCallback){F.subscribeEvent.subscribe(E.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var A=this.__yui_subscribers[B];if(A){for(var C=0;C - *
                  • YAHOO.util.CustomEvent.LIST: - *
                      - *
                    • param1: event name
                    • - *
                    • param2: array of arguments sent to fire
                    • - *
                    • param3: a custom object supplied by the subscriber
                    • - *
                    - *
                  • - *
                  • YAHOO.util.CustomEvent.FLAT - *
                      - *
                    • param1: the first argument passed to fire. If you need to - * pass multiple parameters, use and array or object literal
                    • - *
                    • param2: a custom object supplied by the subscriber
                    • - *
                    - *
                  • - * - * @property signature - * @type int - */ - this.signature = signature || YAHOO.util.CustomEvent.LIST; - - /** - * The subscribers to this event - * @property subscribers - * @type Subscriber[] - */ - this.subscribers = []; - - if (!this.silent) { - } - - var onsubscribeType = "_YUICEOnSubscribe"; - - // Only add subscribe events for events that are not generated by - // CustomEvent - if (type !== onsubscribeType) { - - /** - * Custom events provide a custom event that fires whenever there is - * a new subscriber to the event. This provides an opportunity to - * handle the case where there is a non-repeating event that has - * already fired has a new subscriber. - * - * @event subscribeEvent - * @type YAHOO.util.CustomEvent - * @param fn {Function} The function to execute - * @param obj An object to be passed along when the event fires. - * Defaults to the custom event. - * @param override If true, the obj passed in becomes the - * execution context of the listener. If an object, that object becomes - * the execution context. Defaults to the custom event. - */ - this.subscribeEvent = - new YAHOO.util.CustomEvent(onsubscribeType, this, true); - - } - - - /** - * In order to make it possible to execute the rest of the subscriber - * stack when one thows an exception, the subscribers exceptions are - * caught. The most recent exception is stored in this property - * @property lastError - * @type Error - */ - this.lastError = null; -}; - -/** - * Subscriber listener sigature constant. The LIST type returns three - * parameters: the event type, the array of args passed to fire, and - * the optional custom object - * @property YAHOO.util.CustomEvent.LIST - * @static - * @type int - */ -YAHOO.util.CustomEvent.LIST = 0; - -/** - * Subscriber listener sigature constant. The FLAT type returns two - * parameters: the first argument passed to fire and the optional - * custom object - * @property YAHOO.util.CustomEvent.FLAT - * @static - * @type int - */ -YAHOO.util.CustomEvent.FLAT = 1; - -YAHOO.util.CustomEvent.prototype = { - - /** - * Subscribes the caller to this event - * @method subscribe - * @param {Function} fn The function to execute - * @param {Object} obj An object to be passed along when the event fires. - * overrideContext If true, the obj passed in becomes the execution - * context of the listener. If an object, that object becomes the execution context. - */ - subscribe: function(fn, obj, overrideContext) { - - if (!fn) { -throw new Error("Invalid callback for subscriber to '" + this.type + "'"); - } - - if (this.subscribeEvent) { - this.subscribeEvent.fire(fn, obj, overrideContext); - } - - var s = new YAHOO.util.Subscriber(fn, obj, overrideContext); - - if (this.fireOnce && this.fired) { - this.notify(s, this.firedWith); - } else { - this.subscribers.push(s); - } - }, - - /** - * Unsubscribes subscribers. - * @method unsubscribe - * @param {Function} fn The subscribed function to remove, if not supplied - * all will be removed - * @param {Object} obj The custom object passed to subscribe. This is - * optional, but if supplied will be used to - * disambiguate multiple listeners that are the same - * (e.g., you subscribe many object using a function - * that lives on the prototype) - * @return {boolean} True if the subscriber was found and detached. - */ - unsubscribe: function(fn, obj) { - - if (!fn) { - return this.unsubscribeAll(); - } - - var found = false; - for (var i=0, len=this.subscribers.length; i - *
                  • The type of event
                  • - *
                  • All of the arguments fire() was executed with as an array
                  • - *
                  • The custom object (if any) that was passed into the subscribe() - * method
                  • - * - * @method fire - * @param {Object*} arguments an arbitrary set of parameters to pass to - * the handler. - * @return {boolean} false if one of the subscribers returned false, - * true otherwise - */ - fire: function() { - - this.lastError = null; - - var errors = [], - len=this.subscribers.length; - - - var args=[].slice.call(arguments, 0), ret=true, i, rebuild=false; - - if (this.fireOnce) { - if (this.fired) { - return true; - } else { - this.firedWith = args; - } - } - - this.fired = true; - - if (!len && this.silent) { - return true; - } - - if (!this.silent) { - } - - // make a copy of the subscribers so that there are - // no index problems if one subscriber removes another. - var subs = this.subscribers.slice(); - - for (i=0; i 0) { - param = args[0]; - } - - try { - ret = s.fn.call(scope, param, s.obj); - } catch(e) { - this.lastError = e; - // errors.push(e); - if (throwErrors) { - throw e; - } - } - } else { - try { - ret = s.fn.call(scope, this.type, args, s.obj); - } catch(ex) { - this.lastError = ex; - if (throwErrors) { - throw ex; - } - } - } - - return ret; - }, - - /** - * Removes all listeners - * @method unsubscribeAll - * @return {int} The number of listeners unsubscribed - */ - unsubscribeAll: function() { - var l = this.subscribers.length, i; - for (i=l-1; i>-1; i--) { - this._delete(i); - } - - this.subscribers=[]; - - return l; - }, - - /** - * @method _delete - * @private - */ - _delete: function(index) { - var s = this.subscribers[index]; - if (s) { - delete s.fn; - delete s.obj; - } - - // this.subscribers[index]=null; - this.subscribers.splice(index, 1); - }, - - /** - * @method toString - */ - toString: function() { - return "CustomEvent: " + "'" + this.type + "', " + - "context: " + this.scope; - - } -}; - -///////////////////////////////////////////////////////////////////// - -/** - * Stores the subscriber information to be used when the event fires. - * @param {Function} fn The function to execute - * @param {Object} obj An object to be passed along when the event fires - * @param {boolean} overrideContext If true, the obj passed in becomes the execution - * context of the listener - * @class Subscriber - * @constructor - */ -YAHOO.util.Subscriber = function(fn, obj, overrideContext) { - - /** - * The callback that will be execute when the event fires - * @property fn - * @type function - */ - this.fn = fn; - - /** - * An optional custom object that will passed to the callback when - * the event fires - * @property obj - * @type object - */ - this.obj = YAHOO.lang.isUndefined(obj) ? null : obj; - - /** - * The default execution context for the event listener is defined when the - * event is created (usually the object which contains the event). - * By setting overrideContext to true, the execution context becomes the custom - * object passed in by the subscriber. If overrideContext is an object, that - * object becomes the context. - * @property overrideContext - * @type boolean|object - */ - this.overrideContext = overrideContext; - -}; - -/** - * Returns the execution context for this listener. If overrideContext was set to true - * the custom obj will be the context. If overrideContext is an object, that is the - * context, otherwise the default context will be used. - * @method getScope - * @param {Object} defaultScope the context to use if this listener does not - * override it. - */ -YAHOO.util.Subscriber.prototype.getScope = function(defaultScope) { - if (this.overrideContext) { - if (this.overrideContext === true) { - return this.obj; - } else { - return this.overrideContext; - } - } - return defaultScope; -}; - -/** - * Returns true if the fn and obj match this objects properties. - * Used by the unsubscribe method to match the right subscriber. - * - * @method contains - * @param {Function} fn the function to execute - * @param {Object} obj an object to be passed along when the event fires - * @return {boolean} true if the supplied arguments match this - * subscriber's signature. - */ -YAHOO.util.Subscriber.prototype.contains = function(fn, obj) { - if (obj) { - return (this.fn == fn && this.obj == obj); - } else { - return (this.fn == fn); - } -}; - -/** - * @method toString - */ -YAHOO.util.Subscriber.prototype.toString = function() { - return "Subscriber { obj: " + this.obj + - ", overrideContext: " + (this.overrideContext || "no") + " }"; -}; - -/** - * The Event Utility provides utilities for managing DOM Events and tools - * for building event systems - * - * @module event - * @title Event Utility - * @namespace YAHOO.util - * @requires yahoo - */ - -// The first instance of Event will win if it is loaded more than once. -// @TODO this needs to be changed so that only the state data that needs to -// be preserved is kept, while methods are overwritten/added as needed. -// This means that the module pattern can't be used. -if (!YAHOO.util.Event) { - -/** - * The event utility provides functions to add and remove event listeners, - * event cleansing. It also tries to automatically remove listeners it - * registers during the unload event. - * - * @class Event - * @static - */ - YAHOO.util.Event = function() { - - /** - * True after the onload event has fired - * @property loadComplete - * @type boolean - * @static - * @private - */ - var loadComplete = false, - - /** - * Cache of wrapped listeners - * @property listeners - * @type array - * @static - * @private - */ - listeners = [], - - - /** - * User-defined unload function that will be fired before all events - * are detached - * @property unloadListeners - * @type array - * @static - * @private - */ - unloadListeners = [], - - /** - * The number of times to poll after window.onload. This number is - * increased if additional late-bound handlers are requested after - * the page load. - * @property retryCount - * @static - * @private - */ - retryCount = 0, - - /** - * onAvailable listeners - * @property onAvailStack - * @static - * @private - */ - onAvailStack = [], - - /** - * Counter for auto id generation - * @property counter - * @static - * @private - */ - counter = 0, - - /** - * Normalized keycodes for webkit/safari - * @property webkitKeymap - * @type {int: int} - * @private - * @static - * @final - */ - webkitKeymap = { - 63232: 38, // up - 63233: 40, // down - 63234: 37, // left - 63235: 39, // right - 63276: 33, // page up - 63277: 34, // page down - 25: 9 // SHIFT-TAB (Safari provides a different key code in - // this case, even though the shiftKey modifier is set) - }, - - isIE = YAHOO.env.ua.ie, - - // String constants used by the addFocusListener and removeFocusListener methods - - FOCUSIN = "focusin", - FOCUSOUT = "focusout"; - - return { - - /** - * The number of times we should look for elements that are not - * in the DOM at the time the event is requested after the document - * has been loaded. The default is 500@amp;40 ms, so it will poll - * for 20 seconds or until all outstanding handlers are bound - * (whichever comes first). - * @property POLL_RETRYS - * @type int - * @static - * @final - */ - POLL_RETRYS: 500, - - /** - * The poll interval in milliseconds - * @property POLL_INTERVAL - * @type int - * @static - * @final - */ - POLL_INTERVAL: 40, - - /** - * Element to bind, int constant - * @property EL - * @type int - * @static - * @final - */ - EL: 0, - - /** - * Type of event, int constant - * @property TYPE - * @type int - * @static - * @final - */ - TYPE: 1, - - /** - * Function to execute, int constant - * @property FN - * @type int - * @static - * @final - */ - FN: 2, - - /** - * Function wrapped for context correction and cleanup, int constant - * @property WFN - * @type int - * @static - * @final - */ - WFN: 3, - - /** - * Object passed in by the user that will be returned as a - * parameter to the callback, int constant. Specific to - * unload listeners - * @property OBJ - * @type int - * @static - * @final - */ - UNLOAD_OBJ: 3, - - /** - * Adjusted context, either the element we are registering the event - * on or the custom object passed in by the listener, int constant - * @property ADJ_SCOPE - * @type int - * @static - * @final - */ - ADJ_SCOPE: 4, - - /** - * The original obj passed into addListener - * @property OBJ - * @type int - * @static - * @final - */ - OBJ: 5, - - /** - * The original context parameter passed into addListener - * @property OVERRIDE - * @type int - * @static - * @final - */ - OVERRIDE: 6, - - /** - * The original capture parameter passed into addListener - * @property CAPTURE - * @type int - * @static - * @final - */ - CAPTURE: 7, - - /** - * addListener/removeListener can throw errors in unexpected scenarios. - * These errors are suppressed, the method returns false, and this property - * is set - * @property lastError - * @static - * @type Error - */ - lastError: null, - - /** - * Safari detection - * @property isSafari - * @private - * @static - * @deprecated use YAHOO.env.ua.webkit - */ - isSafari: YAHOO.env.ua.webkit, - - /** - * webkit version - * @property webkit - * @type string - * @private - * @static - * @deprecated use YAHOO.env.ua.webkit - */ - webkit: YAHOO.env.ua.webkit, - - /** - * IE detection - * @property isIE - * @private - * @static - * @deprecated use YAHOO.env.ua.ie - */ - isIE: isIE, - - /** - * poll handle - * @property _interval - * @static - * @private - */ - _interval: null, - - /** - * document readystate poll handle - * @property _dri - * @static - * @private - */ - _dri: null, - - - /** - * Map of special event types - * @property _specialTypes - * @static - * @private - */ - _specialTypes: { - focusin: (isIE ? "focusin" : "focus"), - focusout: (isIE ? "focusout" : "blur") - }, - - - /** - * True when the document is initially usable - * @property DOMReady - * @type boolean - * @static - */ - DOMReady: false, - - /** - * Errors thrown by subscribers of custom events are caught - * and the error message is written to the debug console. If - * this property is set to true, it will also re-throw the - * error. - * @property throwErrors - * @type boolean - * @default false - */ - throwErrors: false, - - - /** - * @method startInterval - * @static - * @private - */ - startInterval: function() { - if (!this._interval) { - // var self = this; - // var callback = function() { self._tryPreloadAttach(); }; - // this._interval = setInterval(callback, this.POLL_INTERVAL); - this._interval = YAHOO.lang.later(this.POLL_INTERVAL, this, this._tryPreloadAttach, null, true); - } - }, - - /** - * Executes the supplied callback when the item with the supplied - * id is found. This is meant to be used to execute behavior as - * soon as possible as the page loads. If you use this after the - * initial page load it will poll for a fixed time for the element. - * The number of times it will poll and the frequency are - * configurable. By default it will poll for 10 seconds. - * - *

                    The callback is executed with a single parameter: - * the custom object parameter, if provided.

                    - * - * @method onAvailable - * - * @param {string||string[]} id the id of the element, or an array - * of ids to look for. - * @param {function} fn what to execute when the element is found. - * @param {object} obj an optional object to be passed back as - * a parameter to fn. - * @param {boolean|object} overrideContext If set to true, fn will execute - * in the context of obj, if set to an object it - * will execute in the context of that object - * @param checkContent {boolean} check child node readiness (onContentReady) - * @static - */ - onAvailable: function(id, fn, obj, overrideContext, checkContent) { - - var a = (YAHOO.lang.isString(id)) ? [id] : id; - - for (var i=0; iThe callback is executed with a single parameter: - * the custom object parameter, if provided.

                    - * - * @method onContentReady - * - * @param {string} id the id of the element to look for. - * @param {function} fn what to execute when the element is ready. - * @param {object} obj an optional object to be passed back as - * a parameter to fn. - * @param {boolean|object} overrideContext If set to true, fn will execute - * in the context of obj. If an object, fn will - * exectute in the context of that object - * - * @static - */ - onContentReady: function(id, fn, obj, overrideContext) { - this.onAvailable(id, fn, obj, overrideContext, true); - }, - - /** - * Executes the supplied callback when the DOM is first usable. This - * will execute immediately if called after the DOMReady event has - * fired. @todo the DOMContentReady event does not fire when the - * script is dynamically injected into the page. This means the - * DOMReady custom event will never fire in FireFox or Opera when the - * library is injected. It _will_ fire in Safari, and the IE - * implementation would allow for us to fire it if the defered script - * is not available. We want this to behave the same in all browsers. - * Is there a way to identify when the script has been injected - * instead of included inline? Is there a way to know whether the - * window onload event has fired without having had a listener attached - * to it when it did so? - * - *

                    The callback is a CustomEvent, so the signature is:

                    - *

                    type <string>, args <array>, customobject <object>

                    - *

                    For DOMReady events, there are no fire argments, so the - * signature is:

                    - *

                    "DOMReady", [], obj

                    - * - * - * @method onDOMReady - * - * @param {function} fn what to execute when the element is found. - * @param {object} obj an optional object to be passed back as - * a parameter to fn. - * @param {boolean|object} overrideContext If set to true, fn will execute - * in the context of obj, if set to an object it - * will execute in the context of that object - * - * @static - */ - // onDOMReady: function(fn, obj, overrideContext) { - onDOMReady: function() { - this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent, arguments); - }, - - - /** - * Appends an event handler - * - * @method _addListener - * - * @param {String|HTMLElement|Array|NodeList} el An id, an element - * reference, or a collection of ids and/or elements to assign the - * listener to. - * @param {String} sType The type of event to append - * @param {Function} fn The method the event invokes - * @param {Object} obj An arbitrary object that will be - * passed as a parameter to the handler - * @param {Boolean|object} overrideContext If true, the obj passed in becomes - * the execution context of the listener. If an - * object, this object becomes the execution - * context. - * @param {boolen} capture capture or bubble phase - * @return {Boolean} True if the action was successful or defered, - * false if one or more of the elements - * could not have the listener attached, - * or if the operation throws an exception. - * @private - * @static - */ - _addListener: function(el, sType, fn, obj, overrideContext, bCapture) { - - if (!fn || !fn.call) { - return false; - } - - // The el argument can be an array of elements or element ids. - if ( this._isValidCollection(el)) { - var ok = true; - for (var i=0,len=el.length; i-1; i--) { - ok = ( this.removeListener(el[i], sType, fn) && ok ); - } - return ok; - } - - if (!fn || !fn.call) { - //return false; - return this.purgeElement(el, false, sType); - } - - if ("unload" == sType) { - - for (i=unloadListeners.length-1; i>-1; i--) { - li = unloadListeners[i]; - if (li && - li[0] == el && - li[1] == sType && - li[2] == fn) { - unloadListeners.splice(i, 1); - // unloadListeners[i]=null; - return true; - } - } - - return false; - } - - var cacheItem = null; - - // The index is a hidden parameter; needed to remove it from - // the method signature because it was tempting users to - // try and take advantage of it, which is not possible. - var index = arguments[3]; - - if ("undefined" === typeof index) { - index = this._getCacheIndex(listeners, el, sType, fn); - } - - if (index >= 0) { - cacheItem = listeners[index]; - } - - if (!el || !cacheItem) { - return false; - } - - - var bCapture = cacheItem[this.CAPTURE] === true ? true : false; - - try { - this._simpleRemove(el, sType, cacheItem[this.WFN], bCapture); - } catch(ex) { - this.lastError = ex; - return false; - } - - // removed the wrapped handler - delete listeners[index][this.WFN]; - delete listeners[index][this.FN]; - listeners.splice(index, 1); - // listeners[index]=null; - - return true; - - }, - - /** - * Returns the event's target element. Safari sometimes provides - * a text node, and this is automatically resolved to the text - * node's parent so that it behaves like other browsers. - * @method getTarget - * @param {Event} ev the event - * @param {boolean} resolveTextNode when set to true the target's - * parent will be returned if the target is a - * text node. @deprecated, the text node is - * now resolved automatically - * @return {HTMLElement} the event's target - * @static - */ - getTarget: function(ev, resolveTextNode) { - var t = ev.target || ev.srcElement; - return this.resolveTextNode(t); - }, - - /** - * In some cases, some browsers will return a text node inside - * the actual element that was targeted. This normalizes the - * return value for getTarget and getRelatedTarget. - * @method resolveTextNode - * @param {HTMLElement} node node to resolve - * @return {HTMLElement} the normized node - * @static - */ - resolveTextNode: function(n) { - try { - if (n && 3 == n.nodeType) { - return n.parentNode; - } - } catch(e) { } - - return n; - }, - - /** - * Returns the event's pageX - * @method getPageX - * @param {Event} ev the event - * @return {int} the event's pageX - * @static - */ - getPageX: function(ev) { - var x = ev.pageX; - if (!x && 0 !== x) { - x = ev.clientX || 0; - - if ( this.isIE ) { - x += this._getScrollLeft(); - } - } - - return x; - }, - - /** - * Returns the event's pageY - * @method getPageY - * @param {Event} ev the event - * @return {int} the event's pageY - * @static - */ - getPageY: function(ev) { - var y = ev.pageY; - if (!y && 0 !== y) { - y = ev.clientY || 0; - - if ( this.isIE ) { - y += this._getScrollTop(); - } - } - - - return y; - }, - - /** - * Returns the pageX and pageY properties as an indexed array. - * @method getXY - * @param {Event} ev the event - * @return {[x, y]} the pageX and pageY properties of the event - * @static - */ - getXY: function(ev) { - return [this.getPageX(ev), this.getPageY(ev)]; - }, - - /** - * Returns the event's related target - * @method getRelatedTarget - * @param {Event} ev the event - * @return {HTMLElement} the event's relatedTarget - * @static - */ - getRelatedTarget: function(ev) { - var t = ev.relatedTarget; - if (!t) { - if (ev.type == "mouseout") { - t = ev.toElement; - } else if (ev.type == "mouseover") { - t = ev.fromElement; - } - } - - return this.resolveTextNode(t); - }, - - /** - * Returns the time of the event. If the time is not included, the - * event is modified using the current time. - * @method getTime - * @param {Event} ev the event - * @return {Date} the time of the event - * @static - */ - getTime: function(ev) { - if (!ev.time) { - var t = new Date().getTime(); - try { - ev.time = t; - } catch(ex) { - this.lastError = ex; - return t; - } - } - - return ev.time; - }, - - /** - * Convenience method for stopPropagation + preventDefault - * @method stopEvent - * @param {Event} ev the event - * @static - */ - stopEvent: function(ev) { - this.stopPropagation(ev); - this.preventDefault(ev); - }, - - /** - * Stops event propagation - * @method stopPropagation - * @param {Event} ev the event - * @static - */ - stopPropagation: function(ev) { - if (ev.stopPropagation) { - ev.stopPropagation(); - } else { - ev.cancelBubble = true; - } - }, - - /** - * Prevents the default behavior of the event - * @method preventDefault - * @param {Event} ev the event - * @static - */ - preventDefault: function(ev) { - if (ev.preventDefault) { - ev.preventDefault(); - } else { - ev.returnValue = false; - } - }, - - /** - * Finds the event in the window object, the caller's arguments, or - * in the arguments of another method in the callstack. This is - * executed automatically for events registered through the event - * manager, so the implementer should not normally need to execute - * this function at all. - * @method getEvent - * @param {Event} e the event parameter from the handler - * @param {HTMLElement} boundEl the element the listener is attached to - * @return {Event} the event - * @static - */ - getEvent: function(e, boundEl) { - var ev = e || window.event; - - if (!ev) { - var c = this.getEvent.caller; - while (c) { - ev = c.arguments[0]; - if (ev && Event == ev.constructor) { - break; - } - c = c.caller; - } - } - - return ev; - }, - - /** - * Returns the charcode for an event - * @method getCharCode - * @param {Event} ev the event - * @return {int} the event's charCode - * @static - */ - getCharCode: function(ev) { - var code = ev.keyCode || ev.charCode || 0; - - // webkit key normalization - if (YAHOO.env.ua.webkit && (code in webkitKeymap)) { - code = webkitKeymap[code]; - } - return code; - }, - - /** - * Locating the saved event handler data by function ref - * - * @method _getCacheIndex - * @static - * @private - */ - _getCacheIndex: function(a, el, sType, fn) { - for (var i=0, l=a.length; i 0 && onAvailStack.length > 0); - } - - // onAvailable - var notAvail = []; - - var executeItem = function (el, item) { - var context = el; - if (item.overrideContext) { - if (item.overrideContext === true) { - context = item.obj; - } else { - context = item.overrideContext; - } - } - item.fn.call(context, item.obj); - }; - - var i, len, item, el, ready=[]; - - // onAvailable onContentReady - for (i=0, len=onAvailStack.length; i-1; i--) { - item = onAvailStack[i]; - if (!item || !item.id) { - onAvailStack.splice(i, 1); - } - } - - this.startInterval(); - } else { - if (this._interval) { - // clearInterval(this._interval); - this._interval.cancel(); - this._interval = null; - } - } - - this.locked = false; - - }, - - /** - * Removes all listeners attached to the given element via addListener. - * Optionally, the node's children can also be purged. - * Optionally, you can specify a specific type of event to remove. - * @method purgeElement - * @param {HTMLElement} el the element to purge - * @param {boolean} recurse recursively purge this element's children - * as well. Use with caution. - * @param {string} sType optional type of listener to purge. If - * left out, all listeners will be removed - * @static - */ - purgeElement: function(el, recurse, sType) { - var oEl = (YAHOO.lang.isString(el)) ? this.getEl(el) : el; - var elListeners = this.getListeners(oEl, sType), i, len; - if (elListeners) { - for (i=elListeners.length-1; i>-1; i--) { - var l = elListeners[i]; - this.removeListener(oEl, l.type, l.fn); - } - } - - if (recurse && oEl && oEl.childNodes) { - for (i=0,len=oEl.childNodes.length; i-1; j--) { - l = listeners[j]; - if (l) { - EU.removeListener(l[EU.EL], l[EU.TYPE], l[EU.FN], j); - } - } - l=null; - } - - EU._simpleRemove(window, "unload", EU._unload); - - }, - - /** - * Returns scrollLeft - * @method _getScrollLeft - * @static - * @private - */ - _getScrollLeft: function() { - return this._getScroll()[1]; - }, - - /** - * Returns scrollTop - * @method _getScrollTop - * @static - * @private - */ - _getScrollTop: function() { - return this._getScroll()[0]; - }, - - /** - * Returns the scrollTop and scrollLeft. Used to calculate the - * pageX and pageY in Internet Explorer - * @method _getScroll - * @static - * @private - */ - _getScroll: function() { - var dd = document.documentElement, db = document.body; - if (dd && (dd.scrollTop || dd.scrollLeft)) { - return [dd.scrollTop, dd.scrollLeft]; - } else if (db) { - return [db.scrollTop, db.scrollLeft]; - } else { - return [0, 0]; - } - }, - - /** - * Used by old versions of CustomEvent, restored for backwards - * compatibility - * @method regCE - * @private - * @static - * @deprecated still here for backwards compatibility - */ - regCE: function() {}, - - /** - * Adds a DOM event directly without the caching, cleanup, context adj, etc - * - * @method _simpleAdd - * @param {HTMLElement} el the element to bind the handler to - * @param {string} sType the type of event handler - * @param {function} fn the callback to invoke - * @param {boolen} capture capture or bubble phase - * @static - * @private - */ - _simpleAdd: function () { - if (window.addEventListener) { - return function(el, sType, fn, capture) { - el.addEventListener(sType, fn, (capture)); - }; - } else if (window.attachEvent) { - return function(el, sType, fn, capture) { - el.attachEvent("on" + sType, fn); - }; - } else { - return function(){}; - } - }(), - - /** - * Basic remove listener - * - * @method _simpleRemove - * @param {HTMLElement} el the element to bind the handler to - * @param {string} sType the type of event handler - * @param {function} fn the callback to invoke - * @param {boolen} capture capture or bubble phase - * @static - * @private - */ - _simpleRemove: function() { - if (window.removeEventListener) { - return function (el, sType, fn, capture) { - el.removeEventListener(sType, fn, (capture)); - }; - } else if (window.detachEvent) { - return function (el, sType, fn) { - el.detachEvent("on" + sType, fn); - }; - } else { - return function(){}; - } - }() - }; - - }(); - - (function() { - var EU = YAHOO.util.Event; - - /** - * YAHOO.util.Event.on is an alias for addListener - * @method on - * @see addListener - * @static - */ - EU.on = EU.addListener; - - /** - * YAHOO.util.Event.onFocus is an alias for addFocusListener - * @method onFocus - * @see addFocusListener - * @static - * @deprecated use YAHOO.util.Event.on and specify "focusin" as the event type. - */ - EU.onFocus = EU.addFocusListener; - - /** - * YAHOO.util.Event.onBlur is an alias for addBlurListener - * @method onBlur - * @see addBlurListener - * @static - * @deprecated use YAHOO.util.Event.on and specify "focusout" as the event type. - */ - EU.onBlur = EU.addBlurListener; - -/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */ - - // Internet Explorer: use the readyState of a defered script. - // This isolates what appears to be a safe moment to manipulate - // the DOM prior to when the document's readyState suggests - // it is safe to do so. - if (EU.isIE) { - if (self !== self.top) { - document.onreadystatechange = function() { - if (document.readyState == 'complete') { - document.onreadystatechange = null; - EU._ready(); - } - }; - } else { - - // Process onAvailable/onContentReady items when the - // DOM is ready. - YAHOO.util.Event.onDOMReady( - YAHOO.util.Event._tryPreloadAttach, - YAHOO.util.Event, true); - - var n = document.createElement('p'); - - EU._dri = setInterval(function() { - try { - // throws an error if doc is not ready - n.doScroll('left'); - clearInterval(EU._dri); - EU._dri = null; - EU._ready(); - n = null; - } catch (ex) { - } - }, EU.POLL_INTERVAL); - } - - // The document's readyState in Safari currently will - // change to loaded/complete before images are loaded. - } else if (EU.webkit && EU.webkit < 525) { - - EU._dri = setInterval(function() { - var rs=document.readyState; - if ("loaded" == rs || "complete" == rs) { - clearInterval(EU._dri); - EU._dri = null; - EU._ready(); - } - }, EU.POLL_INTERVAL); - - // FireFox and Opera: These browsers provide a event for this - // moment. The latest WebKit releases now support this event. - } else { - - EU._simpleAdd(document, "DOMContentLoaded", EU._ready); - - } - ///////////////////////////////////////////////////////////// - - - EU._simpleAdd(window, "load", EU._load); - EU._simpleAdd(window, "unload", EU._unload); - EU._tryPreloadAttach(); - })(); - -} -/** - * EventProvider is designed to be used with YAHOO.augment to wrap - * CustomEvents in an interface that allows events to be subscribed to - * and fired by name. This makes it possible for implementing code to - * subscribe to an event that either has not been created yet, or will - * not be created at all. - * - * @Class EventProvider - */ -YAHOO.util.EventProvider = function() { }; - -YAHOO.util.EventProvider.prototype = { - - /** - * Private storage of custom events - * @property __yui_events - * @type Object[] - * @private - */ - __yui_events: null, - - /** - * Private storage of custom event subscribers - * @property __yui_subscribers - * @type Object[] - * @private - */ - __yui_subscribers: null, - - /** - * Subscribe to a CustomEvent by event type - * - * @method subscribe - * @param p_type {string} the type, or name of the event - * @param p_fn {function} the function to exectute when the event fires - * @param p_obj {Object} An object to be passed along when the event - * fires - * @param overrideContext {boolean} If true, the obj passed in becomes the - * execution scope of the listener - */ - subscribe: function(p_type, p_fn, p_obj, overrideContext) { - - this.__yui_events = this.__yui_events || {}; - var ce = this.__yui_events[p_type]; - - if (ce) { - ce.subscribe(p_fn, p_obj, overrideContext); - } else { - this.__yui_subscribers = this.__yui_subscribers || {}; - var subs = this.__yui_subscribers; - if (!subs[p_type]) { - subs[p_type] = []; - } - subs[p_type].push( - { fn: p_fn, obj: p_obj, overrideContext: overrideContext } ); - } - }, - - /** - * Unsubscribes one or more listeners the from the specified event - * @method unsubscribe - * @param p_type {string} The type, or name of the event. If the type - * is not specified, it will attempt to remove - * the listener from all hosted events. - * @param p_fn {Function} The subscribed function to unsubscribe, if not - * supplied, all subscribers will be removed. - * @param p_obj {Object} The custom object passed to subscribe. This is - * optional, but if supplied will be used to - * disambiguate multiple listeners that are the same - * (e.g., you subscribe many object using a function - * that lives on the prototype) - * @return {boolean} true if the subscriber was found and detached. - */ - unsubscribe: function(p_type, p_fn, p_obj) { - this.__yui_events = this.__yui_events || {}; - var evts = this.__yui_events; - if (p_type) { - var ce = evts[p_type]; - if (ce) { - return ce.unsubscribe(p_fn, p_obj); - } - } else { - var ret = true; - for (var i in evts) { - if (YAHOO.lang.hasOwnProperty(evts, i)) { - ret = ret && evts[i].unsubscribe(p_fn, p_obj); - } - } - return ret; - } - - return false; - }, - - /** - * Removes all listeners from the specified event. If the event type - * is not specified, all listeners from all hosted custom events will - * be removed. - * @method unsubscribeAll - * @param p_type {string} The type, or name of the event - */ - unsubscribeAll: function(p_type) { - return this.unsubscribe(p_type); - }, - - /** - * Creates a new custom event of the specified type. If a custom event - * by that name already exists, it will not be re-created. In either - * case the custom event is returned. - * - * @method createEvent - * - * @param p_type {string} the type, or name of the event - * @param p_config {object} optional config params. Valid properties are: - * - *
                      - *
                    • - * scope: defines the default execution scope. If not defined - * the default scope will be this instance. - *
                    • - *
                    • - * silent: if true, the custom event will not generate log messages. - * This is false by default. - *
                    • - *
                    • - * fireOnce: if true, the custom event will only notify subscribers - * once regardless of the number of times the event is fired. In - * addition, new subscribers will be executed immediately if the - * event has already fired. - * This is false by default. - *
                    • - *
                    • - * onSubscribeCallback: specifies a callback to execute when the - * event has a new subscriber. This will fire immediately for - * each queued subscriber if any exist prior to the creation of - * the event. - *
                    • - *
                    - * - * @return {CustomEvent} the custom event - * - */ - createEvent: function(p_type, p_config) { - - this.__yui_events = this.__yui_events || {}; - var opts = p_config || {}, - events = this.__yui_events, ce; - - if (events[p_type]) { - } else { - - ce = new YAHOO.util.CustomEvent(p_type, opts.scope || this, opts.silent, - YAHOO.util.CustomEvent.FLAT, opts.fireOnce); - - events[p_type] = ce; - - if (opts.onSubscribeCallback) { - ce.subscribeEvent.subscribe(opts.onSubscribeCallback); - } - - this.__yui_subscribers = this.__yui_subscribers || {}; - var qs = this.__yui_subscribers[p_type]; - - if (qs) { - for (var i=0; i - *
                  • The first argument fire() was executed with
                  • - *
                  • The custom object (if any) that was passed into the subscribe() - * method
                  • - * - * @method fireEvent - * @param p_type {string} the type, or name of the event - * @param arguments {Object*} an arbitrary set of parameters to pass to - * the handler. - * @return {boolean} the return value from CustomEvent.fire - * - */ - fireEvent: function(p_type) { - - this.__yui_events = this.__yui_events || {}; - var ce = this.__yui_events[p_type]; - - if (!ce) { - return null; - } - - var args = []; - for (var i=1; i= 420) { - - n.addEventListener("load", function() { - YAHOO.log(id + " DOM2 onload " + url, "info", "Get"); - f(id, url); - }); - - // Nothing can be done with Safari < 3.x except to pause and hope - // for the best, particularly after last script is inserted. The - // scripts will always execute in the order they arrive, not - // necessarily the order in which they were inserted. To support - // script nodes with complete reliability in these browsers, script - // nodes either need to invoke a function in the window once they - // are loaded or the implementer needs to provide a well-known - // property that the utility can poll for. - } else { - // Poll for the existence of the named variable, if it - // was supplied. - var q = queues[id]; - if (q.varName) { - var freq=YAHOO.util.Get.POLL_FREQ; - YAHOO.log("Polling for " + q.varName[0]); - q.maxattempts = YAHOO.util.Get.TIMEOUT/freq; - q.attempts = 0; - q._cache = q.varName[0].split("."); - q.timer = lang.later(freq, q, function(o) { - var a=this._cache, l=a.length, w=this.win, i; - for (i=0; i this.maxattempts) { - var msg = "Over retry limit, giving up"; - q.timer.cancel(); - _fail(id, msg); - } else { - YAHOO.log(a[i] + " failed, retrying"); - } - return; - } - } - - YAHOO.log("Safari poll complete"); - - q.timer.cancel(); - f(id, url); - - }, null, true); - } else { - lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]); - } - } - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - YAHOO.log(id + " onload " + url, "info", "Get"); - f(id, url); - }; - } - }; - - return { - - /** - * The default poll freqency in ms, when needed - * @property POLL_FREQ - * @static - * @type int - * @default 10 - */ - POLL_FREQ: 10, - - /** - * The number of request required before an automatic purge. - * property PURGE_THRESH - * @static - * @type int - * @default 20 - */ - PURGE_THRESH: 20, - - /** - * The length time to poll for varName when loading a script in - * Safari 2.x before the transaction fails. - * property TIMEOUT - * @static - * @type int - * @default 2000 - */ - TIMEOUT: 2000, - - /** - * Called by the helper for detecting script load in Safari - * @method _finalize - * @param id {string} the transaction id - * @private - */ - _finalize: function(id) { - YAHOO.log(id + " finalized ", "info", "Get"); - lang.later(0, null, _finish, id); - }, - - /** - * Abort a transaction - * @method abort - * @param {string|object} either the tId or the object returned from - * script() or css() - */ - abort: function(o) { - var id = (lang.isString(o)) ? o : o.tId; - var q = queues[id]; - if (q) { - YAHOO.log("Aborting " + id, "info", "Get"); - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param url {string|string[]} the url or urls to the script(s) - * @param opts {object} Options: - *
                    - *
                    onSuccess
                    - *
                    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
                    - *
                    win
                    - *
                    the window the script(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted
                    - *
                    purge
                    - *
                    A function that, when executed, will remove the nodes - * that were inserted
                    - *
                    - *
                    - *
                    - *
                    onFailure
                    - *
                    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
                    - *
                    win
                    - *
                    the window the script(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted successfully
                    - *
                    purge
                    - *
                    A function that, when executed, will remove any nodes - * that were inserted
                    - *
                    - *
                    - *
                    - *
                    onTimeout
                    - *
                    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
                    - *
                    win
                    - *
                    the window the script(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted
                    - *
                    purge
                    - *
                    A function that, when executed, will remove the nodes - * that were inserted
                    - *
                    - *
                    - *
                    - *
                    scope
                    - *
                    the execution context for the callbacks
                    - *
                    win
                    - *
                    a window other than the one the utility occupies
                    - *
                    autopurge
                    - *
                    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
                    - *
                    data
                    - *
                    - * data that is supplied to the callback when the script(s) are - * loaded. - *
                    - *
                    varName
                    - *
                    - * variable that should be available when a script is finished - * loading. Used to help Safari 2.x and below with script load - * detection. The type of this property should match what was - * passed into the url parameter: if loading a single url, a - * string can be supplied. If loading multiple scripts, you - * must supply an array that contains the variable name for - * each script. - *
                    - *
                    insertBefore
                    - *
                    node or node id that will become the new node's nextSibling
                    - *
                    - *
                    charset
                    - *
                    Node charset, deprecated, use 'attributes'
                    - *
                    attributes
                    - *
                    A hash of attributes to apply to dynamic nodes.
                    - *
                    timeout
                    - *
                    Number of milliseconds to wait before aborting and firing the timeout event
                    - *
                    -         * // assumes yahoo, dom, and event are already on the page
                    -         *   YAHOO.util.Get.script(
                    -         *   ["http://yui.yahooapis.com/2.7.0/build/dragdrop/dragdrop-min.js",
                    -         *    "http://yui.yahooapis.com/2.7.0/build/animation/animation-min.js"], {
                    -         *     onSuccess: function(o) {
                    -         *       YAHOO.log(o.data); // foo
                    -         *       new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
                    -         *       this.log("won't cause error because YAHOO is the scope");
                    -         *       this.log(o.nodes.length === 2) // true
                    -         *       // o.purge(); // optionally remove the script nodes immediately
                    -         *     },
                    -         *     onFailure: function(o) {
                    -         *       YAHOO.log("transaction failed");
                    -         *     },
                    -         *     data: "foo",
                    -         *     timeout: 10000, // 10 second timeout
                    -         *     scope: YAHOO,
                    -         *     // win: otherframe // target another window/frame
                    -         *     autopurge: true // allow the utility to choose when to remove the nodes
                    -         *   });
                    -         * 
                    - * @return {tId: string} an object containing info about the transaction - */ - script: function(url, opts) { return _queue("script", url, opts); }, - - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param url {string} the url or urls to the css file(s) - * @param opts Options: - *
                    - *
                    onSuccess
                    - *
                    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
                    win
                    - *
                    the window the link nodes(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted
                    - *
                    purge
                    - *
                    A function that, when executed, will remove the nodes - * that were inserted
                    - *
                    - *
                    - * - *
                    scope
                    - *
                    the execution context for the callbacks
                    - *
                    win
                    - *
                    a window other than the one the utility occupies
                    - *
                    data
                    - *
                    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
                    - *
                    insertBefore
                    - *
                    node or node id that will become the new node's nextSibling
                    - *
                    charset
                    - *
                    Node charset, deprecated, use 'attributes'
                    - *
                    attributes
                    - *
                    A hash of attributes to apply to dynamic nodes.
                    - * - *
                    -         *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css");
                    -         * 
                    - *
                    -         *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css",
                    -         *                          "http://yui.yahooapis.com/2.7.0/build/logger/assets/skins/sam/logger.css"]);
                    -         * 
                    - * @return {tId: string} an object containing info about the transaction - */ - css: function(url, opts) { - return _queue("css", url, opts); - } - }; -}(); - -YAHOO.register("get", YAHOO.util.Get, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get-min.js deleted file mode 100644 index 51a4fbaba9..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.util.Get=function(){var M={},L=0,R=0,E=false,N=YAHOO.env.ua,S=YAHOO.lang;var J=function(W,T,X){var U=X||window,Y=U.document,Z=Y.createElement(W);for(var V in T){if(T[V]&&YAHOO.lang.hasOwnProperty(T,V)){Z.setAttribute(V,T[V]);}}return Z;};var I=function(U,V,T){var W={id:"yui__dyn_"+(R++),type:"text/css",rel:"stylesheet",href:U};if(T){S.augmentObject(W,T);}return J("link",W,V);};var P=function(U,V,T){var W={id:"yui__dyn_"+(R++),type:"text/javascript",src:U};if(T){S.augmentObject(W,T);}return J("script",W,V);};var A=function(T,U){return{tId:T.tId,win:T.win,data:T.data,nodes:T.nodes,msg:U,purge:function(){D(this.tId);}};};var B=function(T,W){var U=M[W],V=(S.isString(T))?U.win.document.getElementById(T):T;if(!V){Q(W,"target node not found: "+T);}return V;};var Q=function(W,V){var T=M[W];if(T.onFailure){var U=T.scope||T.win;T.onFailure.call(U,A(T,V));}};var C=function(W){var T=M[W];T.finished=true;if(T.aborted){var V="transaction "+W+" was aborted";Q(W,V);return;}if(T.onSuccess){var U=T.scope||T.win;T.onSuccess.call(U,A(T));}};var O=function(V){var T=M[V];if(T.onTimeout){var U=T.scope||T;T.onTimeout.call(U,A(T));}};var G=function(V,Z){var U=M[V];if(U.timer){U.timer.cancel();}if(U.aborted){var X="transaction "+V+" was aborted";Q(V,X);return;}if(Z){U.url.shift();if(U.varName){U.varName.shift();}}else{U.url=(S.isString(U.url))?[U.url]:U.url;if(U.varName){U.varName=(S.isString(U.varName))?[U.varName]:U.varName;}}var c=U.win,b=c.document,a=b.getElementsByTagName("head")[0],W;if(U.url.length===0){if(U.type==="script"&&N.webkit&&N.webkit<420&&!U.finalpass&&!U.varName){var Y=P(null,U.win,U.attributes);Y.innerHTML='YAHOO.util.Get._finalize("'+V+'");';U.nodes.push(Y);a.appendChild(Y);}else{C(V);}return;}var T=U.url[0];if(!T){U.url.shift();return G(V);}if(U.timeout){U.timer=S.later(U.timeout,U,O,V);}if(U.type==="script"){W=P(T,c,U.attributes);}else{W=I(T,c,U.attributes);}F(U.type,W,V,T,c,U.url.length);U.nodes.push(W);if(U.insertBefore){var e=B(U.insertBefore,V);if(e){e.parentNode.insertBefore(W,e);}}else{a.appendChild(W);}if((N.webkit||N.gecko)&&U.type==="css"){G(V,T);}};var K=function(){if(E){return;}E=true;for(var T in M){var U=M[T];if(U.autopurge&&U.finished){D(U.tId);delete M[T];}}E=false;};var D=function(Z){if(M[Z]){var T=M[Z],U=T.nodes,X=U.length,c=T.win.document,a=c.getElementsByTagName("head")[0],V,Y,W,b;if(T.insertBefore){V=B(T.insertBefore,Z);if(V){a=V.parentNode;}}for(Y=0;Y=420){X.addEventListener("load",function(){a(W,U);});}else{var T=M[W];if(T.varName){var V=YAHOO.util.Get.POLL_FREQ;T.maxattempts=YAHOO.util.Get.TIMEOUT/V;T.attempts=0;T._cache=T.varName[0].split(".");T.timer=S.later(V,T,function(j){var f=this._cache,e=f.length,d=this.win,g;for(g=0;gthis.maxattempts){var h="Over retry limit, giving up";T.timer.cancel();Q(W,h);}else{}return;}}T.timer.cancel();a(W,U);},null,true);}else{S.later(YAHOO.util.Get.POLL_FREQ,null,a,[W,U]);}}}}else{X.onload=function(){a(W,U);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(T){S.later(0,null,C,T);},abort:function(U){var V=(S.isString(U))?U:U.tId;var T=M[V];if(T){T.aborted=true;}},script:function(T,U){return H("script",T,U);},css:function(T,U){return H("css",T,U);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get.js deleted file mode 100644 index 3693baf4b7..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/get/get.js +++ /dev/null @@ -1,755 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Provides a mechanism to fetch remote resources and - * insert them into a document - * @module get - * @requires yahoo - */ - -/** - * Fetches and inserts one or more script or link nodes into the document - * @namespace YAHOO.util - * @class YAHOO.util.Get - */ -YAHOO.util.Get = function() { - - /** - * hash of queues to manage multiple requests - * @property queues - * @private - */ - var queues={}, - - /** - * queue index used to generate transaction ids - * @property qidx - * @type int - * @private - */ - qidx=0, - - /** - * node index used to generate unique node ids - * @property nidx - * @type int - * @private - */ - nidx=0, - - // ridx=0, - - // sandboxFrame=null, - - /** - * interal property used to prevent multiple simultaneous purge - * processes - * @property purging - * @type boolean - * @private - */ - purging=false, - - ua=YAHOO.env.ua, - - lang=YAHOO.lang; - - /** - * Generates an HTML element, this is not appended to a document - * @method _node - * @param type {string} the type of element - * @param attr {string} the attributes - * @param win {Window} optional window to create the element in - * @return {HTMLElement} the generated node - * @private - */ - var _node = function(type, attr, win) { - var w = win || window, d=w.document, n=d.createElement(type); - - for (var i in attr) { - if (attr[i] && YAHOO.lang.hasOwnProperty(attr, i)) { - n.setAttribute(i, attr[i]); - } - } - - return n; - }; - - /** - * Generates a link node - * @method _linkNode - * @param url {string} the url for the css file - * @param win {Window} optional window to create the node in - * @return {HTMLElement} the generated node - * @private - */ - var _linkNode = function(url, win, attributes) { - - var o = { - id: "yui__dyn_" + (nidx++), - type: "text/css", - rel: "stylesheet", - href: url - }; - - if (attributes) { - lang.augmentObject(o, attributes); - } - - return _node("link", o, win); - }; - - /** - * Generates a script node - * @method _scriptNode - * @param url {string} the url for the script file - * @param win {Window} optional window to create the node in - * @return {HTMLElement} the generated node - * @private - */ - var _scriptNode = function(url, win, attributes) { - var o = { - id: "yui__dyn_" + (nidx++), - type: "text/javascript", - src: url - }; - - if (attributes) { - lang.augmentObject(o, attributes); - } - - return _node("script", o, win); - }; - - /** - * Returns the data payload for callback functions - * @method _returnData - * @private - */ - var _returnData = function(q, msg) { - return { - tId: q.tId, - win: q.win, - data: q.data, - nodes: q.nodes, - msg: msg, - purge: function() { - _purge(this.tId); - } - }; - }; - - var _get = function(nId, tId) { - var q = queues[tId], - n = (lang.isString(nId)) ? q.win.document.getElementById(nId) : nId; - if (!n) { - _fail(tId, "target node not found: " + nId); - } - - return n; - }; - - /* - * The request failed, execute fail handler with whatever - * was accomplished. There isn't a failure case at the - * moment unless you count aborted transactions - * @method _fail - * @param id {string} the id of the request - * @private - */ - var _fail = function(id, msg) { - var q = queues[id]; - // execute failure callback - if (q.onFailure) { - var sc=q.scope || q.win; - q.onFailure.call(sc, _returnData(q, msg)); - } - }; - - /** - * The request is complete, so executing the requester's callback - * @method _finish - * @param id {string} the id of the request - * @private - */ - var _finish = function(id) { - var q = queues[id]; - q.finished = true; - - if (q.aborted) { - var msg = "transaction " + id + " was aborted"; - _fail(id, msg); - return; - } - - // execute success callback - if (q.onSuccess) { - var sc=q.scope || q.win; - q.onSuccess.call(sc, _returnData(q)); - } - }; - - /** - * Timeout detected - * @method _timeout - * @param id {string} the id of the request - * @private - */ - var _timeout = function(id) { - var q = queues[id]; - if (q.onTimeout) { - var sc=q.scope || q; - q.onTimeout.call(sc, _returnData(q)); - } - }; - - /** - * Loads the next item for a given request - * @method _next - * @param id {string} the id of the request - * @param loaded {string} the url that was just loaded, if any - * @private - */ - var _next = function(id, loaded) { - var q = queues[id]; - - if (q.timer) { - // Y.log('cancel timer'); - q.timer.cancel(); - } - - if (q.aborted) { - var msg = "transaction " + id + " was aborted"; - _fail(id, msg); - return; - } - - if (loaded) { - q.url.shift(); - if (q.varName) { - q.varName.shift(); - } - } else { - // This is the first pass: make sure the url is an array - q.url = (lang.isString(q.url)) ? [q.url] : q.url; - if (q.varName) { - q.varName = (lang.isString(q.varName)) ? [q.varName] : q.varName; - } - } - - var w=q.win, d=w.document, h=d.getElementsByTagName("head")[0], n; - - if (q.url.length === 0) { - // Safari 2.x workaround - There is no way to know when - // a script is ready in versions of Safari prior to 3.x. - // Adding an extra node reduces the problem, but doesn't - // eliminate it completely because the browser executes - // them asynchronously. - if (q.type === "script" && ua.webkit && ua.webkit < 420 && - !q.finalpass && !q.varName) { - // Add another script node. This does not guarantee that the - // scripts will execute in order, but it does appear to fix the - // problem on fast connections more effectively than using an - // arbitrary timeout. It is possible that the browser does - // block subsequent script execution in this case for a limited - // time. - var extra = _scriptNode(null, q.win, q.attributes); - extra.innerHTML='YAHOO.util.Get._finalize("' + id + '");'; - q.nodes.push(extra); h.appendChild(extra); - - } else { - _finish(id); - } - - return; - } - - - var url = q.url[0]; - - // if the url is undefined, this is probably a trailing comma problem in IE - if (!url) { - q.url.shift(); - return _next(id); - } - - - if (q.timeout) { - // Y.log('create timer'); - q.timer = lang.later(q.timeout, q, _timeout, id); - } - - if (q.type === "script") { - n = _scriptNode(url, w, q.attributes); - } else { - n = _linkNode(url, w, q.attributes); - } - - // track this node's load progress - _track(q.type, n, id, url, w, q.url.length); - - // add the node to the queue so we can return it to the user supplied callback - q.nodes.push(n); - - // add it to the head or insert it before 'insertBefore' - if (q.insertBefore) { - var s = _get(q.insertBefore, id); - if (s) { - s.parentNode.insertBefore(n, s); - } - } else { - h.appendChild(n); - } - - - // FireFox does not support the onload event for link nodes, so there is - // no way to make the css requests synchronous. This means that the css - // rules in multiple files could be applied out of order in this browser - // if a later request returns before an earlier one. Safari too. - if ((ua.webkit || ua.gecko) && q.type === "css") { - _next(id, url); - } - }; - - /** - * Removes processed queues and corresponding nodes - * @method _autoPurge - * @private - */ - var _autoPurge = function() { - - if (purging) { - return; - } - - purging = true; - for (var i in queues) { - var q = queues[i]; - if (q.autopurge && q.finished) { - _purge(q.tId); - delete queues[i]; - } - } - - purging = false; - }; - - /** - * Removes the nodes for the specified queue - * @method _purge - * @private - */ - var _purge = function(tId) { - if (queues[tId]) { - - var q = queues[tId], - nodes = q.nodes, - l = nodes.length, - d = q.win.document, - h = d.getElementsByTagName("head")[0], - sib, i, node, attr; - - if (q.insertBefore) { - sib = _get(q.insertBefore, tId); - if (sib) { - h = sib.parentNode; - } - } - - for (i=0; i= 420) { - - n.addEventListener("load", function() { - f(id, url); - }); - - // Nothing can be done with Safari < 3.x except to pause and hope - // for the best, particularly after last script is inserted. The - // scripts will always execute in the order they arrive, not - // necessarily the order in which they were inserted. To support - // script nodes with complete reliability in these browsers, script - // nodes either need to invoke a function in the window once they - // are loaded or the implementer needs to provide a well-known - // property that the utility can poll for. - } else { - // Poll for the existence of the named variable, if it - // was supplied. - var q = queues[id]; - if (q.varName) { - var freq=YAHOO.util.Get.POLL_FREQ; - q.maxattempts = YAHOO.util.Get.TIMEOUT/freq; - q.attempts = 0; - q._cache = q.varName[0].split("."); - q.timer = lang.later(freq, q, function(o) { - var a=this._cache, l=a.length, w=this.win, i; - for (i=0; i this.maxattempts) { - var msg = "Over retry limit, giving up"; - q.timer.cancel(); - _fail(id, msg); - } else { - } - return; - } - } - - - q.timer.cancel(); - f(id, url); - - }, null, true); - } else { - lang.later(YAHOO.util.Get.POLL_FREQ, null, f, [id, url]); - } - } - } - - // FireFox and Opera support onload (but not DOM2 in FF) handlers for - // script nodes. Opera, but not FF, supports the onload event for link - // nodes. - } else { - n.onload = function() { - f(id, url); - }; - } - }; - - return { - - /** - * The default poll freqency in ms, when needed - * @property POLL_FREQ - * @static - * @type int - * @default 10 - */ - POLL_FREQ: 10, - - /** - * The number of request required before an automatic purge. - * property PURGE_THRESH - * @static - * @type int - * @default 20 - */ - PURGE_THRESH: 20, - - /** - * The length time to poll for varName when loading a script in - * Safari 2.x before the transaction fails. - * property TIMEOUT - * @static - * @type int - * @default 2000 - */ - TIMEOUT: 2000, - - /** - * Called by the helper for detecting script load in Safari - * @method _finalize - * @param id {string} the transaction id - * @private - */ - _finalize: function(id) { - lang.later(0, null, _finish, id); - }, - - /** - * Abort a transaction - * @method abort - * @param {string|object} either the tId or the object returned from - * script() or css() - */ - abort: function(o) { - var id = (lang.isString(o)) ? o : o.tId; - var q = queues[id]; - if (q) { - q.aborted = true; - } - }, - - /** - * Fetches and inserts one or more script nodes into the head - * of the current document or the document in a specified window. - * - * @method script - * @static - * @param url {string|string[]} the url or urls to the script(s) - * @param opts {object} Options: - *
                    - *
                    onSuccess
                    - *
                    - * callback to execute when the script(s) are finished loading - * The callback receives an object back with the following - * data: - *
                    - *
                    win
                    - *
                    the window the script(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted
                    - *
                    purge
                    - *
                    A function that, when executed, will remove the nodes - * that were inserted
                    - *
                    - *
                    - *
                    - *
                    onFailure
                    - *
                    - * callback to execute when the script load operation fails - * The callback receives an object back with the following - * data: - *
                    - *
                    win
                    - *
                    the window the script(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted successfully
                    - *
                    purge
                    - *
                    A function that, when executed, will remove any nodes - * that were inserted
                    - *
                    - *
                    - *
                    - *
                    onTimeout
                    - *
                    - * callback to execute when a timeout occurs. - * The callback receives an object back with the following - * data: - *
                    - *
                    win
                    - *
                    the window the script(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted
                    - *
                    purge
                    - *
                    A function that, when executed, will remove the nodes - * that were inserted
                    - *
                    - *
                    - *
                    - *
                    scope
                    - *
                    the execution context for the callbacks
                    - *
                    win
                    - *
                    a window other than the one the utility occupies
                    - *
                    autopurge
                    - *
                    - * setting to true will let the utilities cleanup routine purge - * the script once loaded - *
                    - *
                    data
                    - *
                    - * data that is supplied to the callback when the script(s) are - * loaded. - *
                    - *
                    varName
                    - *
                    - * variable that should be available when a script is finished - * loading. Used to help Safari 2.x and below with script load - * detection. The type of this property should match what was - * passed into the url parameter: if loading a single url, a - * string can be supplied. If loading multiple scripts, you - * must supply an array that contains the variable name for - * each script. - *
                    - *
                    insertBefore
                    - *
                    node or node id that will become the new node's nextSibling
                    - *
                    - *
                    charset
                    - *
                    Node charset, deprecated, use 'attributes'
                    - *
                    attributes
                    - *
                    A hash of attributes to apply to dynamic nodes.
                    - *
                    timeout
                    - *
                    Number of milliseconds to wait before aborting and firing the timeout event
                    - *
                    -         * // assumes yahoo, dom, and event are already on the page
                    -         *   YAHOO.util.Get.script(
                    -         *   ["http://yui.yahooapis.com/2.7.0/build/dragdrop/dragdrop-min.js",
                    -         *    "http://yui.yahooapis.com/2.7.0/build/animation/animation-min.js"], {
                    -         *     onSuccess: function(o) {
                    -         *       new YAHOO.util.DDProxy("dd1"); // also new o.reference("dd1"); would work
                    -         *       this.log("won't cause error because YAHOO is the scope");
                    -         *       this.log(o.nodes.length === 2) // true
                    -         *       // o.purge(); // optionally remove the script nodes immediately
                    -         *     },
                    -         *     onFailure: function(o) {
                    -         *     },
                    -         *     data: "foo",
                    -         *     timeout: 10000, // 10 second timeout
                    -         *     scope: YAHOO,
                    -         *     // win: otherframe // target another window/frame
                    -         *     autopurge: true // allow the utility to choose when to remove the nodes
                    -         *   });
                    -         * 
                    - * @return {tId: string} an object containing info about the transaction - */ - script: function(url, opts) { return _queue("script", url, opts); }, - - /** - * Fetches and inserts one or more css link nodes into the - * head of the current document or the document in a specified - * window. - * @method css - * @static - * @param url {string} the url or urls to the css file(s) - * @param opts Options: - *
                    - *
                    onSuccess
                    - *
                    - * callback to execute when the css file(s) are finished loading - * The callback receives an object back with the following - * data: - *
                    win
                    - *
                    the window the link nodes(s) were inserted into
                    - *
                    data
                    - *
                    the data object passed in when the request was made
                    - *
                    nodes
                    - *
                    An array containing references to the nodes that were - * inserted
                    - *
                    purge
                    - *
                    A function that, when executed, will remove the nodes - * that were inserted
                    - *
                    - *
                    - * - *
                    scope
                    - *
                    the execution context for the callbacks
                    - *
                    win
                    - *
                    a window other than the one the utility occupies
                    - *
                    data
                    - *
                    - * data that is supplied to the callbacks when the nodes(s) are - * loaded. - *
                    - *
                    insertBefore
                    - *
                    node or node id that will become the new node's nextSibling
                    - *
                    charset
                    - *
                    Node charset, deprecated, use 'attributes'
                    - *
                    attributes
                    - *
                    A hash of attributes to apply to dynamic nodes.
                    - * - *
                    -         *      YAHOO.util.Get.css("http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css");
                    -         * 
                    - *
                    -         *      YAHOO.util.Get.css(["http://yui.yahooapis.com/2.7.0/build/menu/assets/skins/sam/menu.css",
                    -         * 
                    - * @return {tId: string} an object containing info about the transaction - */ - css: function(url, opts) { - return _queue("css", url, opts); - } - }; -}(); - -YAHOO.register("get", YAHOO.util.Get, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids-min.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids-min.css deleted file mode 100644 index 3163c18cf6..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids-min.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -body{text-align:center;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main,.yui-g .yui-u .yui-g{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.first div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-g .yui-u{width:48.1%;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}.yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#hd:after,#bd:after,#ft:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#hd,#bd,#ft,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids.css deleted file mode 100644 index 31e2b3b738..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/grids/grids.css +++ /dev/null @@ -1,467 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * YUI Grids - * @module grids - * @namespace yui- - * @requires reset, fonts - */ - -/** - * Note: Throughout this file, the *property (star-property) filter is used - * to give a value to IE that other browsers do not see. _property is only seen - * by IE7, so the combo of *prop and _prop can target between IE6 and IE7. - * - * More information on these filters and related validation errors: - * http://tech.groups.yahoo.com/group/ydn-javascript/message/40059 - */ - -/** - * Section: General Rules - */ - -body { - text-align: center; -} - -/** - * Section: Page Width Rules (#doc, #doc2, #doc3, #doc4) - */ - -#doc,#doc2,#doc3,#doc4, -.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 { - margin: auto; - text-align: left; - width: 57.69em; - *width: 56.25em; -} - -/* 950 Centered (doc2) */ -#doc2 { - width: 73.076em; - *width: 71.25em; -} - -/* 100% (doc3) */ -#doc3 { -/** - * Left and Right margins are not a structural part of Grids. Without them - * Grids works fine, but content bleeds to the very edge of the document, which - * often impairs readability and usability. They are provided because they - * prevent the content from "bleeding" into the browser's chrome. - */ - margin: auto 10px; - width: auto; -} - -/* 974 Centered (doc4) */ -#doc4 { - width: 74.923em; - *width: 73.05em; -} - -/** - * Section: Preset Template Rules (.yui-t[1-6]) - */ - - -.yui-b { - /* to preserve source-order independence for Gecko */ - position: relative; -} - -.yui-b { - /* to preserve source-order independence for IE */ - _position: static; -} - -#yui-main .yui-b { - /* to preserve source-order independence for Gecko */ - position: static; -} - -#yui-main, -.yui-g .yui-u .yui-g { - width: 100%; -} - -.yui-t1 #yui-main, -.yui-t2 #yui-main, -.yui-t3 #yui-main { - float: right; - /* IE: preserve layout at narrow widths */ - margin-left: -25em; -} - -.yui-t4 #yui-main, -.yui-t5 #yui-main, -.yui-t6 #yui-main { - float: left; - /* IE: preserve layout at narrow widths */ - margin-right: -25em; -} - -/** - * For Specific Template Presets - */ - -.yui-t1 .yui-b { - float: left; - width: 12.30769em; - *width: 12.00em; -} - -.yui-t1 #yui-main .yui-b { - margin-left: 13.30769em; - *margin-left: 13.05em; -} - -.yui-t2 .yui-b { - float: left; - width: 13.8461em; - *width: 13.50em; -} - -.yui-t2 #yui-main .yui-b { - margin-left: 14.8461em; - *margin-left: 14.55em; -} - -.yui-t3 .yui-b { - float: left; - width: 23.0769em; - *width: 22.50em; -} - -.yui-t3 #yui-main .yui-b { - margin-left: 24.0769em; - *margin-left: 23.62em; -} - -.yui-t4 .yui-b { - float: right; - width: 13.8456em; - *width: 13.50em; -} - -.yui-t4 #yui-main .yui-b { - margin-right: 14.8456em; - *margin-right: 14.55em; -} - -.yui-t5 .yui-b { - float: right; - width: 18.4615em; - *width: 18.00em; -} - -.yui-t5 #yui-main .yui-b { - margin-right: 19.4615em; - *margin-right: 19.125em; -} - -.yui-t6 .yui-b { - float: right; - width: 23.0769em; - *width: 22.50em; -} - -.yui-t6 #yui-main .yui-b { - margin-right: 24.0769em; - *margin-right: 23.62em; -} - -.yui-t7 #yui-main .yui-b { - display: block; - margin: 0 0 1em 0; -} - -#yui-main .yui-b { - float: none; - width: auto; -} - -/** - * Section: Grids and Nesting Grids - */ - -/* Children generally take half the available space */ -.yui-gb .yui-u, -.yui-g .yui-gb .yui-u, -.yui-gb .yui-g, -.yui-gb .yui-gb, -.yui-gb .yui-gc, -.yui-gb .yui-gd, -.yui-gb .yui-ge, -.yui-gb .yui-gf, -.yui-gc .yui-u, -.yui-gc .yui-g, -.yui-gd .yui-u { - float: left; -} - -/* Float units (and sub grids) to the right */ -.yui-g .yui-u, -.yui-g .yui-g, -.yui-g .yui-gb, -.yui-g .yui-gc, -.yui-g .yui-gd, -.yui-g .yui-ge, -.yui-g .yui-gf, -.yui-gc .yui-u, -.yui-gd .yui-g, -.yui-g .yui-gc .yui-u, -.yui-ge .yui-u, -.yui-ge .yui-g, -.yui-gf .yui-g, -.yui-gf .yui-u { - float: right; -} - -/*Float units (and sub grids) to the left */ -.yui-g div.first, -.yui-gb div.first, -.yui-gc div.first, -.yui-gd div.first, -.yui-ge div.first, -.yui-gf div.first, -.yui-g .yui-gc div.first, -.yui-g .yui-ge div.first, -.yui-gc div.first div.first { - float: left; -} - -.yui-g .yui-u, -.yui-g .yui-g, -.yui-g .yui-gb, -.yui-g .yui-gc, -.yui-g .yui-gd, -.yui-g .yui-ge, -.yui-g .yui-gf { - width: 49.1%; -} - -.yui-gb .yui-u, -.yui-g .yui-gb .yui-u, -.yui-gb .yui-g, -.yui-gb .yui-gb, -.yui-gb .yui-gc, -.yui-gb .yui-gd, -.yui-gb .yui-ge, -.yui-gb .yui-gf, -.yui-gc .yui-u, -.yui-gc .yui-g, -.yui-gd .yui-u { - width: 32%; - margin-left: 1.99%; -} - -/* Give IE some extra breathing room for 1/3-based rounding issues */ -.yui-gb .yui-u { - *margin-left: 1.9%; - *width: 31.9%; -} - -.yui-gc div.first, - .yui-gd .yui-u { - width: 66%; -} - -.yui-gd div.first { - width: 32%; -} - -.yui-ge div.first, - .yui-gf .yui-u { - width: 74.2%; -} - -.yui-ge .yui-u, - .yui-gf div.first { - width: 24%; -} - -.yui-g .yui-gb div.first, -.yui-gb div.first, -.yui-gc div.first, -.yui-gd div.first { - margin-left: 0; -} - -/** - * Section: Deep Nesting - */ - -.yui-g .yui-g .yui-u, -.yui-gb .yui-g .yui-u, -.yui-gc .yui-g .yui-u, -.yui-gd .yui-g .yui-u, -.yui-ge .yui-g .yui-u, -.yui-gf .yui-g .yui-u { - width: 49%; - *width: 48.1%; - *margin-left: 0; -} - -.yui-g .yui-g .yui-u { - width: 48.1%; -} - -/*YUILibrary bug #1927599 from 1.14 to 2.6.0*/ -.yui-g .yui-gb div.first, - .yui-gb .yui-gb div.first { - *margin-right: 0; - *width: 32%; - _width: 31.7%; -} - -.yui-g .yui-gc div.first, - .yui-gd .yui-g { - width: 66%; -} - -.yui-gb .yui-g div.first { - *margin-right: 4%; - _margin-right: 1.3%; -} - -.yui-gb .yui-gc div.first, - .yui-gb .yui-gd div.first { - *margin-right: 0; -} - -.yui-gb .yui-gb .yui-u, - .yui-gb .yui-gc .yui-u { - *margin-left: 1.8%; - _margin-left: 4%; -} - -.yui-g .yui-gb .yui-u { - _margin-left: 1.0%; -} - -.yui-gb .yui-gd .yui-u { - *width: 66%; - _width: 61.2%; -} - -.yui-gb .yui-gd div.first { - *width: 31%; - _width: 29.5%; -} - -.yui-g .yui-gc .yui-u, - .yui-gb .yui-gc .yui-u { - width: 32%; - _float: right; - margin-right: 0; - _margin-left: 0; -} - -.yui-gb .yui-gc div.first { - width: 66%; - *float: left; - *margin-left: 0; -} - -.yui-gb .yui-ge .yui-u, - .yui-gb .yui-gf .yui-u { - margin: 0; -} - -.yui-gb .yui-gb .yui-u { - _margin-left: .7%; -} - -.yui-gb .yui-g div.first, - .yui-gb .yui-gb div.first { - *margin-left: 0; -} - -.yui-gc .yui-g .yui-u, - .yui-gd .yui-g .yui-u { - *width: 48.1%; - *margin-left: 0; -} - -.yui-gb .yui-gd div.first { - width: 32%; -} - -.yui-g .yui-gd div.first { - _width: 29.9%; -} - -.yui-ge .yui-g { - width: 24%; -} - -.yui-gf .yui-g { - width: 74.2%; -} - -.yui-gb .yui-ge div.yui-u, - .yui-gb .yui-gf div.yui-u { - float: right; -} - -.yui-gb .yui-ge div.first, - .yui-gb .yui-gf div.first { - float: left; -} - -/* Width Accommodation for Nested Contexts */ -.yui-gb .yui-ge .yui-u, - .yui-gb .yui-gf div.first { - *width: 24%; - _width: 20%; -} - -/* Width Accommodation for Nested Contexts */ -.yui-gb .yui-ge div.first, - .yui-gb .yui-gf .yui-u { - *width: 73.5%; - _width: 65.5%; -} - -/* Patch for GD within GE */ -.yui-ge div.first .yui-gd .yui-u { - width: 65%; -} - -.yui-ge div.first .yui-gd div.first { - width: 32%; -} - -/* @group Clearing */ -#hd:after, -#bd:after, -#ft:after, -.yui-g:after, -.yui-gb:after, -.yui-gc:after, -.yui-gd:after, -.yui-ge:after, -.yui-gf:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; -} - -#hd, -#bd, -#ft, -.yui-g, -.yui-gb, -.yui-gc, -.yui-gd, -.yui-ge, -.yui-gf { - zoom: 1; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/assets/blank.html b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/assets/blank.html deleted file mode 100644 index c63060fd81..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/assets/blank.html +++ /dev/null @@ -1 +0,0 @@ -bhm  \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-debug.js deleted file mode 100644 index 983279ebc1..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-debug.js +++ /dev/null @@ -1,803 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The Browser History Manager provides the ability to use the back/forward - * navigation buttons in a DHTML application. It also allows a DHTML - * application to be bookmarked in a specific state. - * - * This library requires the following static markup: - * - * <iframe id="yui-history-iframe" src="path-to-real-asset-in-same-domain"></iframe> - * <input id="yui-history-field" type="hidden"> - * - * @module history - * @requires yahoo,event - * @namespace YAHOO.util - * @title Browser History Manager - */ - -/** - * The History class provides the ability to use the back/forward navigation - * buttons in a DHTML application. It also allows a DHTML application to - * be bookmarked in a specific state. - * - * @class History - * @constructor - */ -YAHOO.util.History = (function () { - - /** - * Our hidden IFrame used to store the browsing history. - * - * @property _histFrame - * @type HTMLIFrameElement - * @default null - * @private - */ - var _histFrame = null; - - /** - * INPUT field (with type="hidden" or type="text") or TEXTAREA. - * This field keeps the value of the initial state, current state - * the list of all states across pages within a single browser session. - * - * @property _stateField - * @type HTMLInputElement|HTMLTextAreaElement - * @default null - * @private - */ - var _stateField = null; - - /** - * Flag used to tell whether YAHOO.util.History.initialize has been called. - * - * @property _initialized - * @type boolean - * @default false - * @private - */ - var _initialized = false; - - /** - * List of registered modules. - * - * @property _modules - * @type array - * @default [] - * @private - */ - var _modules = []; - - /** - * List of fully qualified states. This is used only by Safari. - * - * @property _fqstates - * @type array - * @default [] - * @private - */ - var _fqstates = []; - - /** - * location.hash is a bit buggy on Opera. I have seen instances where - * navigating the history using the back/forward buttons, and hence - * changing the URL, would not change location.hash. That's ok, the - * implementation of an equivalent is trivial. - * - * @method _getHash - * @return {string} The hash portion of the document's location - * @private - */ - function _getHash() { - var i, href; - href = top.location.href; - i = href.indexOf("#"); - return i >= 0 ? href.substr(i + 1) : null; - } - - /** - * Stores all the registered modules' initial state and current state. - * On Safari, we also store all the fully qualified states visited by - * the application within a single browser session. The storage takes - * place in the form field specified during initialization. - * - * @method _storeStates - * @private - */ - function _storeStates() { - - var moduleName, moduleObj, initialStates = [], currentStates = []; - - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - initialStates.push(moduleName + "=" + moduleObj.initialState); - currentStates.push(moduleName + "=" + moduleObj.currentState); - } - } - - _stateField.value = initialStates.join("&") + "|" + currentStates.join("&"); - - if (YAHOO.env.ua.webkit) { - _stateField.value += "|" + _fqstates.join(","); - } - } - - /** - * Sets the new currentState attribute of all modules depending on the new - * fully qualified state. Also notifies the modules which current state has - * changed. - * - * @method _handleFQStateChange - * @param {string} fqstate Fully qualified state - * @private - */ - function _handleFQStateChange(fqstate) { - - var i, len, moduleName, moduleObj, modules, states, tokens, currentState; - - if (!fqstate) { - // Notifies all modules - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - moduleObj.currentState = moduleObj.initialState; - moduleObj.onStateChange(unescape(moduleObj.currentState)); - } - } - return; - } - - modules = []; - states = fqstate.split("&"); - for (i = 0, len = states.length; i < len; i++) { - tokens = states[i].split("="); - if (tokens.length === 2) { - moduleName = tokens[0]; - currentState = tokens[1]; - modules[moduleName] = currentState; - } - } - - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - currentState = modules[moduleName]; - if (!currentState || moduleObj.currentState !== currentState) { - moduleObj.currentState = currentState || moduleObj.initialState; - moduleObj.onStateChange(unescape(moduleObj.currentState)); - } - } - } - } - - /** - * Update the IFrame with our new state. - * - * @method _updateIFrame - * @private - * @return {boolean} true if successful. false otherwise. - */ - function _updateIFrame (fqstate) { - - var html, doc; - - html = '
                    ' + fqstate + '
                    '; - - try { - doc = _histFrame.contentWindow.document; - doc.open(); - doc.write(html); - doc.close(); - return true; - } catch (e) { - return false; - } - } - - /** - * Periodically checks whether our internal IFrame is ready to be used. - * - * @method _checkIframeLoaded - * @private - */ - function _checkIframeLoaded() { - - var doc, elem, fqstate, hash; - - if (!_histFrame.contentWindow || !_histFrame.contentWindow.document) { - // Check again in 10 msec... - setTimeout(_checkIframeLoaded, 10); - return; - } - - // Start the thread that will have the responsibility to - // periodically check whether a navigate operation has been - // requested on the main window. This will happen when - // YAHOO.util.History.navigate has been called or after - // the user has hit the back/forward button. - - doc = _histFrame.contentWindow.document; - elem = doc.getElementById("state"); - // We must use innerText, and not innerHTML because our string contains - // the "&" character (which would end up being escaped as "&") and - // the string comparison would fail... - fqstate = elem ? elem.innerText : null; - - hash = _getHash(); - - setInterval(function () { - - var newfqstate, states, moduleName, moduleObj, newHash, historyLength; - - doc = _histFrame.contentWindow.document; - elem = doc.getElementById("state"); - // See my comment above about using innerText instead of innerHTML... - newfqstate = elem ? elem.innerText : null; - - newHash = _getHash(); - - if (newfqstate !== fqstate) { - - fqstate = newfqstate; - _handleFQStateChange(fqstate); - - if (!fqstate) { - states = []; - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - states.push(moduleName + "=" + moduleObj.initialState); - } - } - newHash = states.join("&"); - } else { - newHash = fqstate; - } - - // Allow the state to be bookmarked by setting the top window's - // URL fragment identifier. Note that here, we are on IE, and - // IE does not touch the browser history when setting the hash - // (unlike all the other browsers). I used to write: - // top.location.replace( "#" + hash ); - // but this had a side effect when the page was not the top frame. - top.location.hash = newHash; - hash = newHash; - - _storeStates(); - - } else if (newHash !== hash) { - - // The hash has changed. The user might have clicked on a link, - // or modified the URL directly, or opened the same application - // bookmarked in a specific state using a bookmark. However, we - // know the hash change was not caused by a hit on the back or - // forward buttons, or by a call to navigate() (because it would - // have been handled above) We must handle these cases, which is - // why we also need to keep track of hash changes on IE! - - // Note that IE6 has some major issues with this kind of user - // interaction (the history stack gets completely messed up) - // but it seems to work fine on IE7. - - hash = newHash; - - // Now, store a new history entry. The following will cause the - // code above to execute, doing all the dirty work for us... - _updateIFrame(newHash); - } - - }, 50); - - _initialized = true; - YAHOO.util.History.onLoadEvent.fire(); - } - - /** - * Finish up the initialization of the Browser History Manager. - * - * @method _initialize - * @private - */ - function _initialize() { - - var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash; - - // Decode the content of our storage field... - parts = _stateField.value.split("|"); - - if (parts.length > 1) { - - initialStates = parts[0].split("&"); - for (i = 0, len = initialStates.length; i < len; i++) { - tokens = initialStates[i].split("="); - if (tokens.length === 2) { - moduleName = tokens[0]; - initialState = tokens[1]; - moduleObj = _modules[moduleName]; - if (moduleObj) { - moduleObj.initialState = initialState; - } - } - } - - currentStates = parts[1].split("&"); - for (i = 0, len = currentStates.length; i < len; i++) { - tokens = currentStates[i].split("="); - if (tokens.length >= 2) { - moduleName = tokens[0]; - currentState = tokens[1]; - moduleObj = _modules[moduleName]; - if (moduleObj) { - moduleObj.currentState = currentState; - } - } - } - } - - if (parts.length > 2) { - _fqstates = parts[2].split(","); - } - - if (YAHOO.env.ua.ie) { - - if (typeof document.documentMode === "undefined" || document.documentMode < 8) { - - // IE < 8 or IE8 in quirks mode or IE7 standards mode - _checkIframeLoaded(); - - } else { - - // IE8 in IE8 standards mode - YAHOO.util.Event.on(top, "hashchange", - function () { - var hash = _getHash(); - _handleFQStateChange(hash); - _storeStates(); - }); - - _initialized = true; - YAHOO.util.History.onLoadEvent.fire(); - - } - - } else { - - // Start the thread that will have the responsibility to - // periodically check whether a navigate operation has been - // requested on the main window. This will happen when - // YAHOO.util.History.navigate has been called or after - // the user has hit the back/forward button. - - // On Safari 1.x and 2.0, the only way to catch a back/forward - // operation is to watch history.length... We basically exploit - // what I consider to be a bug (history.length is not supposed - // to change when going back/forward in the history...) This is - // why, in the following thread, we first compare the hash, - // because the hash thing will be fixed in the next major - // version of Safari. So even if they fix the history.length - // bug, all this will still work! - counter = history.length; - - // On Gecko and Opera, we just need to watch the hash... - hash = _getHash(); - - setInterval(function () { - - var state, newHash, newCounter; - - newHash = _getHash(); - newCounter = history.length; - if (newHash !== hash) { - hash = newHash; - counter = newCounter; - _handleFQStateChange(hash); - _storeStates(); - } else if (newCounter !== counter && YAHOO.env.ua.webkit) { - hash = newHash; - counter = newCounter; - state = _fqstates[counter - 1]; - _handleFQStateChange(state); - _storeStates(); - } - - }, 50); - - _initialized = true; - YAHOO.util.History.onLoadEvent.fire(); - } - } - - return { - - /** - * Fired when the Browser History Manager is ready. If you subscribe to - * this event after the Browser History Manager has been initialized, - * it will not fire. Therefore, it is recommended to use the onReady - * method instead. - * - * @event onLoadEvent - * @see onReady - */ - onLoadEvent: new YAHOO.util.CustomEvent("onLoad"), - - /** - * Executes the supplied callback when the Browser History Manager is - * ready. This will execute immediately if called after the Browser - * History Manager onLoad event has fired. - * - * @method onReady - * @param {function} fn what to execute when the Browser History Manager is ready. - * @param {object} obj an optional object to be passed back as a parameter to fn. - * @param {boolean|object} overrideContext If true, the obj passed in becomes fn's execution scope. - * @see onLoadEvent - */ - onReady: function (fn, obj, overrideContext) { - - if (_initialized) { - - setTimeout(function () { - var ctx = window; - if (overrideContext) { - if (overrideContext === true) { - ctx = obj; - } else { - ctx = overrideContext; - } - } - fn.call(ctx, "onLoad", [], obj); - }, 0); - - } else { - - YAHOO.util.History.onLoadEvent.subscribe(fn, obj, overrideContext); - - } - }, - - /** - * Registers a new module. - * - * @method register - * @param {string} module Non-empty string uniquely identifying the - * module you wish to register. - * @param {string} initialState The initial state of the specified - * module corresponding to its earliest history entry. - * @param {function} onStateChange Callback called when the - * state of the specified module has changed. - * @param {object} obj An arbitrary object that will be passed as a - * parameter to the handler. - * @param {boolean} overrideContext If true, the obj passed in becomes the - * execution scope of the listener. - */ - register: function (module, initialState, onStateChange, obj, overrideContext) { - - var scope, wrappedFn; - - if (typeof module !== "string" || YAHOO.lang.trim(module) === "" || - typeof initialState !== "string" || - typeof onStateChange !== "function") { - throw new Error("Missing or invalid argument"); - } - - if (_modules[module]) { - // Here, we used to throw an exception. However, users have - // complained about this behavior, so we now just return. - return; - } - - // Note: A module CANNOT be registered after calling - // YAHOO.util.History.initialize. Indeed, we set the initial state - // of each registered module in YAHOO.util.History.initialize. - // If you could register a module after initializing the Browser - // History Manager, you would not read the correct state using - // YAHOO.util.History.getCurrentState when coming back to the - // page using the back button. - if (_initialized) { - throw new Error("All modules must be registered before calling YAHOO.util.History.initialize"); - } - - // Make sure the strings passed in do not contain our separators "," and "|" - module = escape(module); - initialState = escape(initialState); - - // If the user chooses to override the scope, we use the - // custom object passed in as the execution scope. - scope = null; - if (overrideContext === true) { - scope = obj; - } else { - scope = overrideContext; - } - - wrappedFn = function (state) { - return onStateChange.call(scope, state, obj); - }; - - _modules[module] = { - name: module, - initialState: initialState, - currentState: initialState, - onStateChange: wrappedFn - }; - }, - - /** - * Initializes the Browser History Manager. Call this method - * from a script block located right after the opening body tag. - * - * @method initialize - * @param {string|HTML Element} stateField used - * to store application states. Must be in the static markup. - * @param {string|HTML Element} histFrame IFrame used to store - * the history (only required on Internet Explorer) - * @public - */ - initialize: function (stateField, histFrame) { - - if (_initialized) { - // The browser history manager has already been initialized. - return; - } - - if (YAHOO.env.ua.opera && typeof history.navigationMode !== "undefined") { - // Disable Opera's fast back/forward navigation mode and puts - // it in compatible mode. This makes anchor-based history - // navigation work after the page has been navigated away - // from and re-activated, at the cost of slowing down - // back/forward navigation to and from that page. - history.navigationMode = "compatible"; - } - - if (typeof stateField === "string") { - stateField = document.getElementById(stateField); - } - - if (!stateField || - stateField.tagName.toUpperCase() !== "TEXTAREA" && - (stateField.tagName.toUpperCase() !== "INPUT" || - stateField.type !== "hidden" && - stateField.type !== "text")) { - throw new Error("Missing or invalid argument"); - } - - _stateField = stateField; - - // IE < 8 or IE8 in quirks mode or IE7 standards mode - if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) { - - if (typeof histFrame === "string") { - histFrame = document.getElementById(histFrame); - } - - if (!histFrame || histFrame.tagName.toUpperCase() !== "IFRAME") { - throw new Error("Missing or invalid argument"); - } - - _histFrame = histFrame; - } - - // Note that the event utility MUST be included inline in the page. - // If it gets loaded later (which you may want to do to improve the - // loading speed of your site), the onDOMReady event never fires, - // and the history library never gets fully initialized. - YAHOO.util.Event.onDOMReady(_initialize); - }, - - /** - * Call this method when you want to store a new entry in the browser's history. - * - * @method navigate - * @param {string} module Non-empty string representing your module. - * @param {string} state String representing the new state of the specified module. - * @return {boolean} Indicates whether the new state was successfully added to the history. - * @public - */ - navigate: function (module, state) { - - var states; - - if (typeof module !== "string" || typeof state !== "string") { - throw new Error("Missing or invalid argument"); - } - - states = {}; - states[module] = state; - - return YAHOO.util.History.multiNavigate(states); - }, - - /** - * Call this method when you want to store a new entry in the browser's history. - * - * @method multiNavigate - * @param {object} states Associative array of module-state pairs to set simultaneously. - * @return {boolean} Indicates whether the new state was successfully added to the history. - * @public - */ - multiNavigate: function (states) { - - var currentStates, moduleName, moduleObj, currentState, fqstate; - - if (typeof states !== "object") { - throw new Error("Missing or invalid argument"); - } - - if (!_initialized) { - throw new Error("The Browser History Manager is not initialized"); - } - - for (moduleName in states) { - if (!_modules[moduleName]) { - throw new Error("The following module has not been registered: " + moduleName); - } - } - - // Generate our new full state string mod1=xxx&mod2=yyy - currentStates = []; - - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - if (YAHOO.lang.hasOwnProperty(states, moduleName)) { - currentState = states[unescape(moduleName)]; - } else { - currentState = unescape(moduleObj.currentState); - } - - // Make sure the strings passed in do not contain our separators "," and "|" - moduleName = escape(moduleName); - currentState = escape(currentState); - - currentStates.push(moduleName + "=" + currentState); - } - } - - fqstate = currentStates.join("&"); - - if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) { - - return _updateIFrame(fqstate); - - } else { - - // Known bug: On Safari 1.x and 2.0, if you have tab browsing - // enabled, Safari will show an endless loading icon in the - // tab. This has apparently been fixed in recent WebKit builds. - // One work around found by Dav Glass is to submit a form that - // points to the same document. This indeed works on Safari 1.x - // and 2.0 but creates bigger problems on WebKit. So for now, - // we'll consider this an acceptable bug, and hope that Apple - // comes out with their next version of Safari very soon. - top.location.hash = fqstate; - if (YAHOO.env.ua.webkit) { - // The following two lines are only useful for Safari 1.x - // and 2.0. Recent nightly builds of WebKit do not require - // that, but unfortunately, it is not easy to differentiate - // between the two. Once Safari 2.0 departs the A-grade - // list, we can remove the following two lines... - _fqstates[history.length] = fqstate; - _storeStates(); - } - - return true; - - } - }, - - /** - * Returns the current state of the specified module. - * - * @method getCurrentState - * @param {string} module Non-empty string representing your module. - * @return {string} The current state of the specified module. - * @public - */ - getCurrentState: function (module) { - - var moduleObj; - - if (typeof module !== "string") { - throw new Error("Missing or invalid argument"); - } - - if (!_initialized) { - throw new Error("The Browser History Manager is not initialized"); - } - - moduleObj = _modules[module]; - if (!moduleObj) { - throw new Error("No such registered module: " + module); - } - - return unescape(moduleObj.currentState); - }, - - /** - * Returns the state of a module according to the URL fragment - * identifier. This method is useful to initialize your modules - * if your application was bookmarked from a particular state. - * - * @method getBookmarkedState - * @param {string} module Non-empty string representing your module. - * @return {string} The bookmarked state of the specified module. - * @public - */ - getBookmarkedState: function (module) { - - var i, len, idx, hash, states, tokens, moduleName; - - if (typeof module !== "string") { - throw new Error("Missing or invalid argument"); - } - - // Use location.href instead of location.hash which is already - // URL-decoded, which creates problems if the state value - // contained special characters... - idx = top.location.href.indexOf("#"); - if (idx >= 0) { - hash = top.location.href.substr(idx + 1); - states = hash.split("&"); - for (i = 0, len = states.length; i < len; i++) { - tokens = states[i].split("="); - if (tokens.length === 2) { - moduleName = tokens[0]; - if (moduleName === module) { - return unescape(tokens[1]); - } - } - } - } - - return null; - }, - - /** - * Returns the value of the specified query string parameter. - * This method is not used internally by the Browser History Manager. - * However, it is provided here as a helper since many applications - * using the Browser History Manager will want to read the value of - * url parameters to initialize themselves. - * - * @method getQueryStringParameter - * @param {string} paramName Name of the parameter we want to look up. - * @param {string} queryString Optional URL to look at. If not specified, - * this method uses the URL in the address bar. - * @return {string} The value of the specified parameter, or null. - * @public - */ - getQueryStringParameter: function (paramName, url) { - - var i, len, idx, queryString, params, tokens; - - url = url || top.location.href; - - idx = url.indexOf("?"); - queryString = idx >= 0 ? url.substr(idx + 1) : url; - - // Remove the hash if any - idx = queryString.lastIndexOf("#"); - queryString = idx >= 0 ? queryString.substr(0, idx) : queryString; - - params = queryString.split("&"); - - for (i = 0, len = params.length; i < len; i++) { - tokens = params[i].split("="); - if (tokens.length >= 2) { - if (tokens[0] === paramName) { - return unescape(tokens[1]); - } - } - } - - return null; - } - - }; - -})(); -YAHOO.register("history", YAHOO.util.History, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-min.js deleted file mode 100644 index 3f9a002eff..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.util.History=(function(){var C=null;var K=null;var F=false;var D=[];var B=[];function I(){var M,L;L=top.location.href;M=L.indexOf("#");return M>=0?L.substr(M+1):null;}function A(){var M,N,O=[],L=[];for(M in D){if(YAHOO.lang.hasOwnProperty(D,M)){N=D[M];O.push(M+"="+N.initialState);L.push(M+"="+N.currentState);}}K.value=O.join("&")+"|"+L.join("&");if(YAHOO.env.ua.webkit){K.value+="|"+B.join(",");}}function H(L){var Q,R,M,O,P,T,S,N;if(!L){for(M in D){if(YAHOO.lang.hasOwnProperty(D,M)){O=D[M];O.currentState=O.initialState;O.onStateChange(unescape(O.currentState));}}return;}P=[];T=L.split("&");for(Q=0,R=T.length;Q";try{N=C.contentWindow.document;N.open();N.write(L);N.close();return true;}catch(M){return false;}}function G(){var O,L,N,M;if(!C.contentWindow||!C.contentWindow.document){setTimeout(G,10);return;}O=C.contentWindow.document;L=O.getElementById("state");N=L?L.innerText:null;M=I();setInterval(function(){var U,Q,R,S,T,P;O=C.contentWindow.document;L=O.getElementById("state");U=L?L.innerText:null;T=I();if(U!==N){N=U;H(N);if(!N){Q=[];for(R in D){if(YAHOO.lang.hasOwnProperty(D,R)){S=D[R];Q.push(R+"="+S.initialState);}}T=Q.join("&");}else{T=N;}top.location.hash=T;M=T;A();}else{if(T!==M){M=T;J(T);}}},50);F=true;YAHOO.util.History.onLoadEvent.fire();}function E(){var S,U,Q,W,M,O,V,P,T,N,L,R;Q=K.value.split("|");if(Q.length>1){V=Q[0].split("&");for(S=0,U=V.length;S=2){M=W[0];N=W[1];O=D[M];if(O){O.currentState=N;}}}}if(Q.length>2){B=Q[2].split(",");}if(YAHOO.env.ua.ie){if(typeof document.documentMode==="undefined"||document.documentMode<8){G();}else{YAHOO.util.Event.on(top,"hashchange",function(){var X=I();H(X);A();});F=true;YAHOO.util.History.onLoadEvent.fire();}}else{L=history.length;R=I();setInterval(function(){var Z,X,Y;X=I();Y=history.length;if(X!==R){R=X;L=Y;H(R);A();}else{if(Y!==L&&YAHOO.env.ua.webkit){R=X;L=Y;Z=B[L-1];H(Z);A();}}},50);F=true;YAHOO.util.History.onLoadEvent.fire();}}return{onLoadEvent:new YAHOO.util.CustomEvent("onLoad"),onReady:function(L,M,N){if(F){setTimeout(function(){var O=window;if(N){if(N===true){O=M;}else{O=N;}}L.call(O,"onLoad",[],M);},0);}else{YAHOO.util.History.onLoadEvent.subscribe(L,M,N);}},register:function(N,L,P,Q,R){var O,M;if(typeof N!=="string"||YAHOO.lang.trim(N)===""||typeof L!=="string"||typeof P!=="function"){throw new Error("Missing or invalid argument");}if(D[N]){return;}if(F){throw new Error("All modules must be registered before calling YAHOO.util.History.initialize");}N=escape(N);L=escape(L);O=null;if(R===true){O=Q;}else{O=R;}M=function(S){return P.call(O,S,Q);};D[N]={name:N,initialState:L,currentState:L,onStateChange:M};},initialize:function(L,M){if(F){return;}if(YAHOO.env.ua.opera&&typeof history.navigationMode!=="undefined"){history.navigationMode="compatible";}if(typeof L==="string"){L=document.getElementById(L);}if(!L||L.tagName.toUpperCase()!=="TEXTAREA"&&(L.tagName.toUpperCase()!=="INPUT"||L.type!=="hidden"&&L.type!=="text")){throw new Error("Missing or invalid argument");}K=L;if(YAHOO.env.ua.ie&&(typeof document.documentMode==="undefined"||document.documentMode<8)){if(typeof M==="string"){M=document.getElementById(M);}if(!M||M.tagName.toUpperCase()!=="IFRAME"){throw new Error("Missing or invalid argument");}C=M;}YAHOO.util.Event.onDOMReady(E);},navigate:function(M,N){var L;if(typeof M!=="string"||typeof N!=="string"){throw new Error("Missing or invalid argument");}L={};L[M]=N;return YAHOO.util.History.multiNavigate(L);},multiNavigate:function(M){var L,N,P,O,Q;if(typeof M!=="object"){throw new Error("Missing or invalid argument");}if(!F){throw new Error("The Browser History Manager is not initialized");}for(N in M){if(!D[N]){throw new Error("The following module has not been registered: "+N);}}L=[];for(N in D){if(YAHOO.lang.hasOwnProperty(D,N)){P=D[N];if(YAHOO.lang.hasOwnProperty(M,N)){O=M[unescape(N)];}else{O=unescape(P.currentState);}N=escape(N);O=escape(O);L.push(N+"="+O);}}Q=L.join("&");if(YAHOO.env.ua.ie&&(typeof document.documentMode==="undefined"||document.documentMode<8)){return J(Q);}else{top.location.hash=Q;if(YAHOO.env.ua.webkit){B[history.length]=Q;A();}return true;}},getCurrentState:function(L){var M;if(typeof L!=="string"){throw new Error("Missing or invalid argument");}if(!F){throw new Error("The Browser History Manager is not initialized");}M=D[L];if(!M){throw new Error("No such registered module: "+L);}return unescape(M.currentState);},getBookmarkedState:function(Q){var P,M,L,S,N,R,O;if(typeof Q!=="string"){throw new Error("Missing or invalid argument");}L=top.location.href.indexOf("#");if(L>=0){S=top.location.href.substr(L+1);N=S.split("&");for(P=0,M=N.length;P=0?N.substr(L+1):N;L=S.lastIndexOf("#");S=L>=0?S.substr(0,L):S;R=S.split("&");for(O=0,M=R.length;O=2){if(P[0]===Q){return unescape(P[1]);}}}return null;}};})();YAHOO.register("history",YAHOO.util.History,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history.js deleted file mode 100644 index 983279ebc1..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/history/history.js +++ /dev/null @@ -1,803 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The Browser History Manager provides the ability to use the back/forward - * navigation buttons in a DHTML application. It also allows a DHTML - * application to be bookmarked in a specific state. - * - * This library requires the following static markup: - * - * <iframe id="yui-history-iframe" src="path-to-real-asset-in-same-domain"></iframe> - * <input id="yui-history-field" type="hidden"> - * - * @module history - * @requires yahoo,event - * @namespace YAHOO.util - * @title Browser History Manager - */ - -/** - * The History class provides the ability to use the back/forward navigation - * buttons in a DHTML application. It also allows a DHTML application to - * be bookmarked in a specific state. - * - * @class History - * @constructor - */ -YAHOO.util.History = (function () { - - /** - * Our hidden IFrame used to store the browsing history. - * - * @property _histFrame - * @type HTMLIFrameElement - * @default null - * @private - */ - var _histFrame = null; - - /** - * INPUT field (with type="hidden" or type="text") or TEXTAREA. - * This field keeps the value of the initial state, current state - * the list of all states across pages within a single browser session. - * - * @property _stateField - * @type HTMLInputElement|HTMLTextAreaElement - * @default null - * @private - */ - var _stateField = null; - - /** - * Flag used to tell whether YAHOO.util.History.initialize has been called. - * - * @property _initialized - * @type boolean - * @default false - * @private - */ - var _initialized = false; - - /** - * List of registered modules. - * - * @property _modules - * @type array - * @default [] - * @private - */ - var _modules = []; - - /** - * List of fully qualified states. This is used only by Safari. - * - * @property _fqstates - * @type array - * @default [] - * @private - */ - var _fqstates = []; - - /** - * location.hash is a bit buggy on Opera. I have seen instances where - * navigating the history using the back/forward buttons, and hence - * changing the URL, would not change location.hash. That's ok, the - * implementation of an equivalent is trivial. - * - * @method _getHash - * @return {string} The hash portion of the document's location - * @private - */ - function _getHash() { - var i, href; - href = top.location.href; - i = href.indexOf("#"); - return i >= 0 ? href.substr(i + 1) : null; - } - - /** - * Stores all the registered modules' initial state and current state. - * On Safari, we also store all the fully qualified states visited by - * the application within a single browser session. The storage takes - * place in the form field specified during initialization. - * - * @method _storeStates - * @private - */ - function _storeStates() { - - var moduleName, moduleObj, initialStates = [], currentStates = []; - - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - initialStates.push(moduleName + "=" + moduleObj.initialState); - currentStates.push(moduleName + "=" + moduleObj.currentState); - } - } - - _stateField.value = initialStates.join("&") + "|" + currentStates.join("&"); - - if (YAHOO.env.ua.webkit) { - _stateField.value += "|" + _fqstates.join(","); - } - } - - /** - * Sets the new currentState attribute of all modules depending on the new - * fully qualified state. Also notifies the modules which current state has - * changed. - * - * @method _handleFQStateChange - * @param {string} fqstate Fully qualified state - * @private - */ - function _handleFQStateChange(fqstate) { - - var i, len, moduleName, moduleObj, modules, states, tokens, currentState; - - if (!fqstate) { - // Notifies all modules - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - moduleObj.currentState = moduleObj.initialState; - moduleObj.onStateChange(unescape(moduleObj.currentState)); - } - } - return; - } - - modules = []; - states = fqstate.split("&"); - for (i = 0, len = states.length; i < len; i++) { - tokens = states[i].split("="); - if (tokens.length === 2) { - moduleName = tokens[0]; - currentState = tokens[1]; - modules[moduleName] = currentState; - } - } - - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - currentState = modules[moduleName]; - if (!currentState || moduleObj.currentState !== currentState) { - moduleObj.currentState = currentState || moduleObj.initialState; - moduleObj.onStateChange(unescape(moduleObj.currentState)); - } - } - } - } - - /** - * Update the IFrame with our new state. - * - * @method _updateIFrame - * @private - * @return {boolean} true if successful. false otherwise. - */ - function _updateIFrame (fqstate) { - - var html, doc; - - html = '
                    ' + fqstate + '
                    '; - - try { - doc = _histFrame.contentWindow.document; - doc.open(); - doc.write(html); - doc.close(); - return true; - } catch (e) { - return false; - } - } - - /** - * Periodically checks whether our internal IFrame is ready to be used. - * - * @method _checkIframeLoaded - * @private - */ - function _checkIframeLoaded() { - - var doc, elem, fqstate, hash; - - if (!_histFrame.contentWindow || !_histFrame.contentWindow.document) { - // Check again in 10 msec... - setTimeout(_checkIframeLoaded, 10); - return; - } - - // Start the thread that will have the responsibility to - // periodically check whether a navigate operation has been - // requested on the main window. This will happen when - // YAHOO.util.History.navigate has been called or after - // the user has hit the back/forward button. - - doc = _histFrame.contentWindow.document; - elem = doc.getElementById("state"); - // We must use innerText, and not innerHTML because our string contains - // the "&" character (which would end up being escaped as "&") and - // the string comparison would fail... - fqstate = elem ? elem.innerText : null; - - hash = _getHash(); - - setInterval(function () { - - var newfqstate, states, moduleName, moduleObj, newHash, historyLength; - - doc = _histFrame.contentWindow.document; - elem = doc.getElementById("state"); - // See my comment above about using innerText instead of innerHTML... - newfqstate = elem ? elem.innerText : null; - - newHash = _getHash(); - - if (newfqstate !== fqstate) { - - fqstate = newfqstate; - _handleFQStateChange(fqstate); - - if (!fqstate) { - states = []; - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - states.push(moduleName + "=" + moduleObj.initialState); - } - } - newHash = states.join("&"); - } else { - newHash = fqstate; - } - - // Allow the state to be bookmarked by setting the top window's - // URL fragment identifier. Note that here, we are on IE, and - // IE does not touch the browser history when setting the hash - // (unlike all the other browsers). I used to write: - // top.location.replace( "#" + hash ); - // but this had a side effect when the page was not the top frame. - top.location.hash = newHash; - hash = newHash; - - _storeStates(); - - } else if (newHash !== hash) { - - // The hash has changed. The user might have clicked on a link, - // or modified the URL directly, or opened the same application - // bookmarked in a specific state using a bookmark. However, we - // know the hash change was not caused by a hit on the back or - // forward buttons, or by a call to navigate() (because it would - // have been handled above) We must handle these cases, which is - // why we also need to keep track of hash changes on IE! - - // Note that IE6 has some major issues with this kind of user - // interaction (the history stack gets completely messed up) - // but it seems to work fine on IE7. - - hash = newHash; - - // Now, store a new history entry. The following will cause the - // code above to execute, doing all the dirty work for us... - _updateIFrame(newHash); - } - - }, 50); - - _initialized = true; - YAHOO.util.History.onLoadEvent.fire(); - } - - /** - * Finish up the initialization of the Browser History Manager. - * - * @method _initialize - * @private - */ - function _initialize() { - - var i, len, parts, tokens, moduleName, moduleObj, initialStates, initialState, currentStates, currentState, counter, hash; - - // Decode the content of our storage field... - parts = _stateField.value.split("|"); - - if (parts.length > 1) { - - initialStates = parts[0].split("&"); - for (i = 0, len = initialStates.length; i < len; i++) { - tokens = initialStates[i].split("="); - if (tokens.length === 2) { - moduleName = tokens[0]; - initialState = tokens[1]; - moduleObj = _modules[moduleName]; - if (moduleObj) { - moduleObj.initialState = initialState; - } - } - } - - currentStates = parts[1].split("&"); - for (i = 0, len = currentStates.length; i < len; i++) { - tokens = currentStates[i].split("="); - if (tokens.length >= 2) { - moduleName = tokens[0]; - currentState = tokens[1]; - moduleObj = _modules[moduleName]; - if (moduleObj) { - moduleObj.currentState = currentState; - } - } - } - } - - if (parts.length > 2) { - _fqstates = parts[2].split(","); - } - - if (YAHOO.env.ua.ie) { - - if (typeof document.documentMode === "undefined" || document.documentMode < 8) { - - // IE < 8 or IE8 in quirks mode or IE7 standards mode - _checkIframeLoaded(); - - } else { - - // IE8 in IE8 standards mode - YAHOO.util.Event.on(top, "hashchange", - function () { - var hash = _getHash(); - _handleFQStateChange(hash); - _storeStates(); - }); - - _initialized = true; - YAHOO.util.History.onLoadEvent.fire(); - - } - - } else { - - // Start the thread that will have the responsibility to - // periodically check whether a navigate operation has been - // requested on the main window. This will happen when - // YAHOO.util.History.navigate has been called or after - // the user has hit the back/forward button. - - // On Safari 1.x and 2.0, the only way to catch a back/forward - // operation is to watch history.length... We basically exploit - // what I consider to be a bug (history.length is not supposed - // to change when going back/forward in the history...) This is - // why, in the following thread, we first compare the hash, - // because the hash thing will be fixed in the next major - // version of Safari. So even if they fix the history.length - // bug, all this will still work! - counter = history.length; - - // On Gecko and Opera, we just need to watch the hash... - hash = _getHash(); - - setInterval(function () { - - var state, newHash, newCounter; - - newHash = _getHash(); - newCounter = history.length; - if (newHash !== hash) { - hash = newHash; - counter = newCounter; - _handleFQStateChange(hash); - _storeStates(); - } else if (newCounter !== counter && YAHOO.env.ua.webkit) { - hash = newHash; - counter = newCounter; - state = _fqstates[counter - 1]; - _handleFQStateChange(state); - _storeStates(); - } - - }, 50); - - _initialized = true; - YAHOO.util.History.onLoadEvent.fire(); - } - } - - return { - - /** - * Fired when the Browser History Manager is ready. If you subscribe to - * this event after the Browser History Manager has been initialized, - * it will not fire. Therefore, it is recommended to use the onReady - * method instead. - * - * @event onLoadEvent - * @see onReady - */ - onLoadEvent: new YAHOO.util.CustomEvent("onLoad"), - - /** - * Executes the supplied callback when the Browser History Manager is - * ready. This will execute immediately if called after the Browser - * History Manager onLoad event has fired. - * - * @method onReady - * @param {function} fn what to execute when the Browser History Manager is ready. - * @param {object} obj an optional object to be passed back as a parameter to fn. - * @param {boolean|object} overrideContext If true, the obj passed in becomes fn's execution scope. - * @see onLoadEvent - */ - onReady: function (fn, obj, overrideContext) { - - if (_initialized) { - - setTimeout(function () { - var ctx = window; - if (overrideContext) { - if (overrideContext === true) { - ctx = obj; - } else { - ctx = overrideContext; - } - } - fn.call(ctx, "onLoad", [], obj); - }, 0); - - } else { - - YAHOO.util.History.onLoadEvent.subscribe(fn, obj, overrideContext); - - } - }, - - /** - * Registers a new module. - * - * @method register - * @param {string} module Non-empty string uniquely identifying the - * module you wish to register. - * @param {string} initialState The initial state of the specified - * module corresponding to its earliest history entry. - * @param {function} onStateChange Callback called when the - * state of the specified module has changed. - * @param {object} obj An arbitrary object that will be passed as a - * parameter to the handler. - * @param {boolean} overrideContext If true, the obj passed in becomes the - * execution scope of the listener. - */ - register: function (module, initialState, onStateChange, obj, overrideContext) { - - var scope, wrappedFn; - - if (typeof module !== "string" || YAHOO.lang.trim(module) === "" || - typeof initialState !== "string" || - typeof onStateChange !== "function") { - throw new Error("Missing or invalid argument"); - } - - if (_modules[module]) { - // Here, we used to throw an exception. However, users have - // complained about this behavior, so we now just return. - return; - } - - // Note: A module CANNOT be registered after calling - // YAHOO.util.History.initialize. Indeed, we set the initial state - // of each registered module in YAHOO.util.History.initialize. - // If you could register a module after initializing the Browser - // History Manager, you would not read the correct state using - // YAHOO.util.History.getCurrentState when coming back to the - // page using the back button. - if (_initialized) { - throw new Error("All modules must be registered before calling YAHOO.util.History.initialize"); - } - - // Make sure the strings passed in do not contain our separators "," and "|" - module = escape(module); - initialState = escape(initialState); - - // If the user chooses to override the scope, we use the - // custom object passed in as the execution scope. - scope = null; - if (overrideContext === true) { - scope = obj; - } else { - scope = overrideContext; - } - - wrappedFn = function (state) { - return onStateChange.call(scope, state, obj); - }; - - _modules[module] = { - name: module, - initialState: initialState, - currentState: initialState, - onStateChange: wrappedFn - }; - }, - - /** - * Initializes the Browser History Manager. Call this method - * from a script block located right after the opening body tag. - * - * @method initialize - * @param {string|HTML Element} stateField used - * to store application states. Must be in the static markup. - * @param {string|HTML Element} histFrame IFrame used to store - * the history (only required on Internet Explorer) - * @public - */ - initialize: function (stateField, histFrame) { - - if (_initialized) { - // The browser history manager has already been initialized. - return; - } - - if (YAHOO.env.ua.opera && typeof history.navigationMode !== "undefined") { - // Disable Opera's fast back/forward navigation mode and puts - // it in compatible mode. This makes anchor-based history - // navigation work after the page has been navigated away - // from and re-activated, at the cost of slowing down - // back/forward navigation to and from that page. - history.navigationMode = "compatible"; - } - - if (typeof stateField === "string") { - stateField = document.getElementById(stateField); - } - - if (!stateField || - stateField.tagName.toUpperCase() !== "TEXTAREA" && - (stateField.tagName.toUpperCase() !== "INPUT" || - stateField.type !== "hidden" && - stateField.type !== "text")) { - throw new Error("Missing or invalid argument"); - } - - _stateField = stateField; - - // IE < 8 or IE8 in quirks mode or IE7 standards mode - if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) { - - if (typeof histFrame === "string") { - histFrame = document.getElementById(histFrame); - } - - if (!histFrame || histFrame.tagName.toUpperCase() !== "IFRAME") { - throw new Error("Missing or invalid argument"); - } - - _histFrame = histFrame; - } - - // Note that the event utility MUST be included inline in the page. - // If it gets loaded later (which you may want to do to improve the - // loading speed of your site), the onDOMReady event never fires, - // and the history library never gets fully initialized. - YAHOO.util.Event.onDOMReady(_initialize); - }, - - /** - * Call this method when you want to store a new entry in the browser's history. - * - * @method navigate - * @param {string} module Non-empty string representing your module. - * @param {string} state String representing the new state of the specified module. - * @return {boolean} Indicates whether the new state was successfully added to the history. - * @public - */ - navigate: function (module, state) { - - var states; - - if (typeof module !== "string" || typeof state !== "string") { - throw new Error("Missing or invalid argument"); - } - - states = {}; - states[module] = state; - - return YAHOO.util.History.multiNavigate(states); - }, - - /** - * Call this method when you want to store a new entry in the browser's history. - * - * @method multiNavigate - * @param {object} states Associative array of module-state pairs to set simultaneously. - * @return {boolean} Indicates whether the new state was successfully added to the history. - * @public - */ - multiNavigate: function (states) { - - var currentStates, moduleName, moduleObj, currentState, fqstate; - - if (typeof states !== "object") { - throw new Error("Missing or invalid argument"); - } - - if (!_initialized) { - throw new Error("The Browser History Manager is not initialized"); - } - - for (moduleName in states) { - if (!_modules[moduleName]) { - throw new Error("The following module has not been registered: " + moduleName); - } - } - - // Generate our new full state string mod1=xxx&mod2=yyy - currentStates = []; - - for (moduleName in _modules) { - if (YAHOO.lang.hasOwnProperty(_modules, moduleName)) { - moduleObj = _modules[moduleName]; - if (YAHOO.lang.hasOwnProperty(states, moduleName)) { - currentState = states[unescape(moduleName)]; - } else { - currentState = unescape(moduleObj.currentState); - } - - // Make sure the strings passed in do not contain our separators "," and "|" - moduleName = escape(moduleName); - currentState = escape(currentState); - - currentStates.push(moduleName + "=" + currentState); - } - } - - fqstate = currentStates.join("&"); - - if (YAHOO.env.ua.ie && (typeof document.documentMode === "undefined" || document.documentMode < 8)) { - - return _updateIFrame(fqstate); - - } else { - - // Known bug: On Safari 1.x and 2.0, if you have tab browsing - // enabled, Safari will show an endless loading icon in the - // tab. This has apparently been fixed in recent WebKit builds. - // One work around found by Dav Glass is to submit a form that - // points to the same document. This indeed works on Safari 1.x - // and 2.0 but creates bigger problems on WebKit. So for now, - // we'll consider this an acceptable bug, and hope that Apple - // comes out with their next version of Safari very soon. - top.location.hash = fqstate; - if (YAHOO.env.ua.webkit) { - // The following two lines are only useful for Safari 1.x - // and 2.0. Recent nightly builds of WebKit do not require - // that, but unfortunately, it is not easy to differentiate - // between the two. Once Safari 2.0 departs the A-grade - // list, we can remove the following two lines... - _fqstates[history.length] = fqstate; - _storeStates(); - } - - return true; - - } - }, - - /** - * Returns the current state of the specified module. - * - * @method getCurrentState - * @param {string} module Non-empty string representing your module. - * @return {string} The current state of the specified module. - * @public - */ - getCurrentState: function (module) { - - var moduleObj; - - if (typeof module !== "string") { - throw new Error("Missing or invalid argument"); - } - - if (!_initialized) { - throw new Error("The Browser History Manager is not initialized"); - } - - moduleObj = _modules[module]; - if (!moduleObj) { - throw new Error("No such registered module: " + module); - } - - return unescape(moduleObj.currentState); - }, - - /** - * Returns the state of a module according to the URL fragment - * identifier. This method is useful to initialize your modules - * if your application was bookmarked from a particular state. - * - * @method getBookmarkedState - * @param {string} module Non-empty string representing your module. - * @return {string} The bookmarked state of the specified module. - * @public - */ - getBookmarkedState: function (module) { - - var i, len, idx, hash, states, tokens, moduleName; - - if (typeof module !== "string") { - throw new Error("Missing or invalid argument"); - } - - // Use location.href instead of location.hash which is already - // URL-decoded, which creates problems if the state value - // contained special characters... - idx = top.location.href.indexOf("#"); - if (idx >= 0) { - hash = top.location.href.substr(idx + 1); - states = hash.split("&"); - for (i = 0, len = states.length; i < len; i++) { - tokens = states[i].split("="); - if (tokens.length === 2) { - moduleName = tokens[0]; - if (moduleName === module) { - return unescape(tokens[1]); - } - } - } - } - - return null; - }, - - /** - * Returns the value of the specified query string parameter. - * This method is not used internally by the Browser History Manager. - * However, it is provided here as a helper since many applications - * using the Browser History Manager will want to read the value of - * url parameters to initialize themselves. - * - * @method getQueryStringParameter - * @param {string} paramName Name of the parameter we want to look up. - * @param {string} queryString Optional URL to look at. If not specified, - * this method uses the URL in the address bar. - * @return {string} The value of the specified parameter, or null. - * @public - */ - getQueryStringParameter: function (paramName, url) { - - var i, len, idx, queryString, params, tokens; - - url = url || top.location.href; - - idx = url.indexOf("?"); - queryString = idx >= 0 ? url.substr(idx + 1) : url; - - // Remove the hash if any - idx = queryString.lastIndexOf("#"); - queryString = idx >= 0 ? queryString.substr(0, idx) : queryString; - - params = queryString.split("&"); - - for (i = 0, len = params.length; i < len; i++) { - tokens = params[i].split("="); - if (tokens.length >= 2) { - if (tokens[0] === paramName) { - return unescape(tokens[1]); - } - } - } - - return null; - } - - }; - -})(); -YAHOO.register("history", YAHOO.util.History, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/imagecropper-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/imagecropper-core.css deleted file mode 100644 index 366300ff44..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/imagecropper-core.css +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css deleted file mode 100644 index e33ac8752b..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper-skin.css +++ /dev/null @@ -1,16 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper.css deleted file mode 100644 index 0e8d36f62c..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/assets/skins/sam/imagecropper.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-debug.js deleted file mode 100644 index b72d58e438..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-debug.js +++ /dev/null @@ -1,907 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * @description

                    Creates a Image Cropper control.

                    - * @namespace YAHOO.widget - * @requires yahoo, dom, dragdrop, element, event, resize - * @module imagecropper - * @beta - */ -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class ImageCropper - * @description

                    Creates a Image Cropper control.

                    - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The image element to make croppable. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - var Crop = function(el, config) { - YAHOO.log('Initializing', 'log', 'ImageCropper'); - var oConfig = { - element: el, - attributes: config || {} - }; - - Crop.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all ImageCropper instances - * @type Object - */ - Crop._instances = {}; - /** - * @static - * @method getCropperById - * @description Get's an ImageCropper object by the HTML id of the image associated with the ImageCropper object. - * @return {Object} The ImageCropper Object - */ - Crop.getCropperById = function(id) { - if (Crop._instances[id]) { - return Crop._instances[id]; - } - return false; - }; - - YAHOO.extend(Crop, YAHOO.util.Element, { - /** - * @private - * @property CSS_MAIN - * @description The CSS class used to wrap the element - * @type String - */ - CSS_MAIN: 'yui-crop', - /** - * @private - * @property CSS_MASK - * @description The CSS class for the mask element - * @type String - */ - CSS_MASK: 'yui-crop-mask', - /** - * @private - * @property CSS_RESIZE_MASK - * @description The CSS class for the mask inside the resize element - * @type String - */ - CSS_RESIZE_MASK: 'yui-crop-resize-mask', - - /** - * @private - * @property _image - * @description The url of the image we are cropping - * @type String - */ - _image: null, - /** - * @private - * @property _active - * @description Flag to determine if the crop region is active - * @type Boolean - */ - _active: null, - /** - * @private - * @property _resize - * @description A reference to the Resize Utility used in this Cropper Instance - * @type Object - */ - _resize: null, - /** - * @private - * @property _resizeEl - * @description The HTML Element used to create the Resize Oject - * @type HTMLElement - */ - _resizeEl: null, - /** - * @private - * @property _resizeMaskEl - * @description The HTML Element used to create the Resize mask - * @type HTMLElement - */ - _resizeMaskEl: null, - /** - * @private - * @property _wrap - * @description The HTML Element created to wrap the image - * @type HTMLElement - */ - _wrap: null, - /** - * @private - * @property _mask - * @description The HTML Element created to "mask" the image being cropped - * @type HTMLElement - */ - _mask: null, - /** - * @private - * @method _createWrap - * @description Creates the wrapper element used to wrap the image - */ - _createWrap: function() { - YAHOO.log('Creating the wrap element', 'log', 'ImageCropper'); - this._wrap = document.createElement('div'); - this._wrap.id = this.get('element').id + '_wrap'; - this._wrap.className = this.CSS_MAIN; - var el = this.get('element'); - this._wrap.style.width = el.width ? el.width + 'px' : Dom.getStyle(el, 'width'); - this._wrap.style.height = el.height ? el.height + 'px' : Dom.getStyle(el, 'height'); - - var par = this.get('element').parentNode; - par.replaceChild(this._wrap, this.get('element')); - this._wrap.appendChild(this.get('element')); - - Event.on(this._wrap, 'mouseover', this._handleMouseOver, this, true); - Event.on(this._wrap, 'mouseout', this._handleMouseOut, this, true); - - Event.on(this._wrap, 'click', function(ev) { Event.stopEvent(ev); }, this, true); - }, - - /** - * @private - * @method _createMask - * @description Creates the mask element used to mask the image - */ - _createMask: function() { - YAHOO.log('Creating the Mask', 'log', 'ImageCropper'); - this._mask = document.createElement('div'); - this._mask.className = this.CSS_MASK; - this._wrap.appendChild(this._mask); - }, - - /** - * @private - * @method _createResize - * @description Creates the resize element and the instance of the Resize Utility - */ - _createResize: function() { - YAHOO.log('Creating the Resize element', 'log', 'ImageCropper'); - this._resizeEl = document.createElement('div'); - this._resizeEl.className = YAHOO.util.Resize.prototype.CSS_RESIZE; - this._resizeEl.style.position = 'absolute'; - - this._resizeEl.innerHTML = '
                    '; - this._resizeMaskEl = this._resizeEl.firstChild; - this._wrap.appendChild(this._resizeEl); - this._resizeEl.style.top = this.get('initialXY')[1] + 'px'; - this._resizeEl.style.left = this.get('initialXY')[0] + 'px'; - this._resizeMaskEl.style.height = Math.floor(this.get('initHeight')) + 'px'; - this._resizeMaskEl.style.width = Math.floor(this.get('initWidth')) + 'px'; - - this._resize = new YAHOO.util.Resize(this._resizeEl, { - knobHandles: true, - handles: 'all', - draggable: true, - status: this.get('status'), - minWidth: this.get('minWidth'), - minHeight: this.get('minHeight'), - ratio: this.get('ratio'), - autoRatio: this.get('autoRatio'), - height: this.get('initHeight'), - width: this.get('initWidth') - }); - - this._setBackgroundImage(this.get('element').getAttribute('src', 2)); - this._setBackgroundPosition(-(this.get('initialXY')[0]), -(this.get('initialXY')[1])); - - this._resize.on('startResize', this._handleStartResizeEvent, this, true); - this._resize.on('endResize', this._handleEndResizeEvent, this, true); - this._resize.on('dragEvent', this._handleDragEvent, this, true); - this._resize.on('beforeResize', this._handleBeforeResizeEvent, this, true); - this._resize.on('resize', this._handleResizeEvent, this, true); - this._resize.dd.on('b4StartDragEvent', this._handleB4DragEvent, this, true); - }, - - /** - * @private - * @method _handleMouseOver - * @description Handles the mouseover event - */ - _handleMouseOver: function(ev) { - var evType = 'keydown'; - if (YAHOO.env.ua.gecko || YAHOO.env.ua.opera) { - evType = 'keypress'; - } - if (!this._active) { - this._active = true; - if (this.get('useKeys')) { - Event.on(document, evType, this._handleKeyPress, this, true); - } - } - }, - /** - * @private - * @method _handleMouseOut - * @description Handles the mouseout event - */ - _handleMouseOut: function(ev) { - var evType = 'keydown'; - if (YAHOO.env.ua.gecko || YAHOO.env.ua.opera) { - evType = 'keypress'; - } - this._active = false; - if (this.get('useKeys')) { - Event.removeListener(document, evType, this._handleKeyPress); - } - }, - - /** - * @private - * @method _moveEl - * @description Moves the resize element based on the arrow keys - */ - _moveEl: function(dir, inc) { - YAHOO.log('Moving the element', 'log', 'ImageCropper'); - var t = 0, l = 0, - region = this._setConstraints(), - resize = true; - - switch (dir) { - case 'down': - t = -(inc); - if ((region.bottom - inc) < 0) { - resize = false; - this._resizeEl.style.top = (region.top + region.bottom) + 'px'; - } - break; - case 'up': - t = (inc); - if ((region.top - inc) < 0) { - resize = false; - this._resizeEl.style.top = '0px'; - } - break; - case 'right': - l = -(inc); - if ((region.right - inc) < 0) { - resize = false; - this._resizeEl.style.left = (region.left + region.right) + 'px'; - } - break; - case 'left': - l = inc; - if ((region.left - inc) < 0) { - resize = false; - this._resizeEl.style.left = '0px'; - } - break; - } - - if (resize) { - YAHOO.log('Moving via Key Listener: ' + dir, 'log', 'ImageCropper'); - this._resizeEl.style.left = (parseInt(this._resizeEl.style.left, 10) - l) + 'px'; - this._resizeEl.style.top = (parseInt(this._resizeEl.style.top, 10) - t) + 'px'; - this.fireEvent('moveEvent', { target: 'keypress' }); - } else { - this._setConstraints(); - } - this._syncBackgroundPosition(); - }, - - /** - * @private - * @method _handleKeyPress - * @description Handles the keypress event - */ - _handleKeyPress: function(ev) { - var kc = Event.getCharCode(ev), - stopEvent = false, - inc = ((ev.shiftKey) ? this.get('shiftKeyTick') : this.get('keyTick')); - - switch (kc) { - case 0x25: // left - this._moveEl('left', inc); - stopEvent = true; - break; - case 0x26: // up - this._moveEl('up', inc); - stopEvent = true; - break; - case 0x27: // right - this._moveEl('right', inc); - stopEvent = true; - break; - case 0x28: // down - this._moveEl('down', inc); - stopEvent = true; - break; - default: - } - if (stopEvent) { - Event.preventDefault(ev); - } - }, - - /** - * @private - * @method _handleB4DragEvent - * @description Handles the DragDrop b4DragEvent event - */ - _handleB4DragEvent: function() { - this._setConstraints(); - }, - - /** - * @private - * @method _handleDragEvent - * @description Handles the DragDrop DragEvent event - */ - _handleDragEvent: function() { - this._syncBackgroundPosition(); - this.fireEvent('dragEvent', arguments); - this.fireEvent('moveEvent', { target: 'dragevent' }); - }, - - /** - * @private - * @method _handleBeforeResizeEvent - * @description Handles the Resize Utilitys beforeResize event - */ - _handleBeforeResizeEvent: function(args) { - var region = Dom.getRegion(this.get('element')), - c = this._resize._cache, - ch = this._resize._currentHandle, h = 0, w = 0; - - if (args.top && (args.top < region.top)) { - h = (c.height + c.top) - region.top; - Dom.setY(this._resize.getWrapEl(), region.top); - this._resize.getWrapEl().style.height = h + 'px'; - this._resize._cache.height = h; - this._resize._cache.top = region.top; - this._syncBackgroundPosition(); - return false; - } - if (args.left && (args.left < region.left)) { - w = (c.width + c.left) - region.left; - Dom.setX(this._resize.getWrapEl(), region.left); - this._resize._cache.left = region.left; - this._resize.getWrapEl().style.width = w + 'px'; - this._resize._cache.width = w; - this._syncBackgroundPosition(); - return false; - } - if (ch != 'tl' && ch != 'l' && ch != 'bl') { - if (c.left && args.width && ((c.left + args.width) > region.right)) { - w = (region.right - c.left); - Dom.setX(this._resize.getWrapEl(), (region.right - w)); - this._resize.getWrapEl().style.width = w + 'px'; - this._resize._cache.left = (region.right - w); - this._resize._cache.width = w; - this._syncBackgroundPosition(); - return false; - } - } - if (ch != 't' && ch != 'tr' && ch != 'tl') { - if (c.top && args.height && ((c.top + args.height) > region.bottom)) { - h = (region.bottom - c.top); - Dom.setY(this._resize.getWrapEl(), (region.bottom - h)); - this._resize.getWrapEl().style.height = h + 'px'; - this._resize._cache.height = h; - this._resize._cache.top = (region.bottom - h); - this._syncBackgroundPosition(); - return false; - } - } - }, - /** - * @private - * @method _handleResizeMaskEl - * @description Resizes the inner mask element - */ - _handleResizeMaskEl: function() { - var a = this._resize._cache; - this._resizeMaskEl.style.height = Math.floor(a.height) + 'px'; - this._resizeMaskEl.style.width = Math.floor(a.width) + 'px'; - }, - /** - * @private - * @method _handleResizeEvent - * @param Event ev The Resize Utilitys resize event. - * @description Handles the Resize Utilitys Resize event - */ - _handleResizeEvent: function(ev) { - this._setConstraints(true); - this._syncBackgroundPosition(); - this.fireEvent('resizeEvent', arguments); - this.fireEvent('moveEvent', { target: 'resizeevent' }); - }, - - /** - * @private - * @method _syncBackgroundPosition - * @description Syncs the packground position of the resize element with the resize elements top and left style position - */ - _syncBackgroundPosition: function() { - this._handleResizeMaskEl(); - this._setBackgroundPosition(-(parseInt(this._resizeEl.style.left, 10)), -(parseInt(this._resizeEl.style.top, 10))); - }, - - /** - * @private - * @method _setBackgroundPosition - * @param Number l The left position - * @param Number t The top position - * @description Sets the background image position to the top and left position - */ - _setBackgroundPosition: function(l, t) { - //YAHOO.log('Setting the image background position of the mask to: (' + l + ', ' + t + ')', 'log', 'ImageCropper'); - var bl = parseInt(Dom.getStyle(this._resize.get('element'), 'borderLeftWidth'), 10); - var bt = parseInt(Dom.getStyle(this._resize.get('element'), 'borderTopWidth'), 10); - if (isNaN(bl)) { - bl = 0; - } - if (isNaN(bt)) { - bt = 0; - } - var mask = this._resize.getWrapEl().firstChild; - var pos = (l - bl) + 'px ' + (t - bt) + 'px'; - this._resizeMaskEl.style.backgroundPosition = pos; - }, - - /** - * @private - * @method _setBackgroundImage - * @param String url The url of the image - * @description Sets the background image of the resize element - */ - _setBackgroundImage: function(url) { - YAHOO.log('Setting the background image', 'log', 'ImageCropper'); - var mask = this._resize.getWrapEl().firstChild; - this._image = url; - mask.style.backgroundImage = 'url(' + url + '#)'; - }, - - /** - * @private - * @method _handleEndResizeEvent - * @description Handles the Resize Utilitys endResize event - */ - _handleEndResizeEvent: function() { - this._setConstraints(true); - }, - /** - * @private - * @method _handleStartResizeEvent - * @description Handles the Resize Utilitys startResize event - */ - _handleStartResizeEvent: function() { - this._setConstraints(true); - - var h = this._resize._cache.height, - w = this._resize._cache.width, - t = parseInt(this._resize.getWrapEl().style.top, 10), - l = parseInt(this._resize.getWrapEl().style.left, 10), - maxH = 0, maxW = 0; - - switch (this._resize._currentHandle) { - case 'b': - maxH = (h + this._resize.dd.bottomConstraint); - break; - case 'l': - maxW = (w + this._resize.dd.leftConstraint); - break; - case 'r': - maxH = (h + t); - maxW = (w + this._resize.dd.rightConstraint); - break; - case 'br': - maxH = (h + this._resize.dd.bottomConstraint); - maxW = (w + this._resize.dd.rightConstraint); - break; - case 'tr': - maxH = (h + t); - maxW = (w + this._resize.dd.rightConstraint); - break; - - } - - if (maxH) { - YAHOO.log('Setting the maxHeight on the resize object to: ' + maxH, 'log', 'ImageCropper'); - //this._resize.set('maxHeight', maxH); - } - if (maxW) { - YAHOO.log('Setting the maxWidth on the resize object to: ' + maxW, 'log', 'ImageCropper'); - //this._resize.set('maxWidth', maxW); - } - - this.fireEvent('startResizeEvent', arguments); - }, - - /** - * @private - * @method _setConstraints - * @param Boolean inside Used when called from inside a resize event, false by default (dragging) - * @description Set the DragDrop constraints to keep the element inside the crop area. - * @return {Object} Object containing Top, Right, Bottom and Left constraints - */ - _setConstraints: function(inside) { - YAHOO.log('Setting Contraints', 'log', 'ImageCropper'); - var resize = this._resize; - resize.dd.resetConstraints(); - var height = parseInt(resize.get('height'), 10), - width = parseInt(resize.get('width'), 10); - if (inside) { - //Called from inside the resize callback - height = resize._cache.height; - width = resize._cache.width; - } - - //Get the top, right, bottom and left positions - var region = Dom.getRegion(this.get('element')); - //Get the element we are working on - var el = resize.getWrapEl(); - - //Get the xy position of it - var xy = Dom.getXY(el); - - //Set left to x minus left - var left = xy[0] - region.left; - - //Set right to right minus x minus width - var right = region.right - xy[0] - width; - - //Set top to y minus top - var top = xy[1] - region.top; - - //Set bottom to bottom minus y minus height - var bottom = region.bottom - xy[1] - height; - - if (top < 0) { - top = 0; - } - - resize.dd.setXConstraint(left, right); - resize.dd.setYConstraint(top, bottom); - YAHOO.log('Constraints: ' + top + ',' + right + ',' + bottom + ',' + left, 'log', 'ImageCropper'); - - return { - top: top, - right: right, - bottom: bottom, - left: left - }; - - - - }, - /** - * @method getCropCoords - * @description Returns the coordinates needed to crop the image - * @return {Object} The top, left, height, width and image url of the image being cropped - */ - getCropCoords: function() { - var coords = { - top: parseInt(this._resize.getWrapEl().style.top, 10), - left: parseInt(this._resize.getWrapEl().style.left, 10), - height: this._resize._cache.height, - width: this._resize._cache.width, - image: this._image - }; - YAHOO.log('Getting the crop coordinates: ' + Lang.dump(coords), 'log', 'ImageCropper'); - return coords; - }, - /** - * @method reset - * @description Resets the crop element back to it's original position - * @return {YAHOO.widget.ImageCropper} The ImageCropper instance - */ - reset: function() { - YAHOO.log('Resetting the control', 'log', 'ImageCropper'); - this._resize.resize(null, this.get('initHeight'), this.get('initWidth'), 0, 0, true); - this._resizeEl.style.top = this.get('initialXY')[1] + 'px'; - this._resizeEl.style.left = this.get('initialXY')[0] + 'px'; - this._syncBackgroundPosition(); - return this; - }, - - /** - * @method getEl - * @description Get the HTML reference for the image element. - * @return {HTMLElement} The image element - */ - getEl: function() { - return this.get('element'); - }, - /** - * @method getResizeEl - * @description Get the HTML reference for the resize element. - * @return {HTMLElement} The resize element - */ - getResizeEl: function() { - return this._resizeEl; - }, - /** - * @method getWrapEl - * @description Get the HTML reference for the wrap element. - * @return {HTMLElement} The wrap element - */ - getWrapEl: function() { - return this._wrap; - }, - - /** - * @method getMaskEl - * @description Get the HTML reference for the mask element. - * @return {HTMLElement} The mask element - */ - getMaskEl: function() { - return this._mask; - }, - - /** - * @method getResizeMaskEl - * @description Get the HTML reference for the resizable object's mask element. - * @return {HTMLElement} The resize objects mask element. - */ - getResizeMaskEl: function() { - return this._resizeMaskEl; - }, - - /** - * @method getResizeObject - * @description Get the Resize Utility object. - * @return {YAHOO.util.Resize} The Resize instance - */ - getResizeObject: function() { - return this._resize; - }, - - /** - * @private - * @method init - * @description The ImageCropper class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.log('init', 'info', 'ImageCropper'); - Crop.superclass.init.call(this, p_oElement, p_oAttributes); - - var id = p_oElement; - - if (!Lang.isString(id)) { - if (id.tagName && (id.tagName.toLowerCase() == 'img')) { - id = Dom.generateId(id); - } else { - YAHOO.log('Element is not an image.', 'error', 'ImageCropper'); - return false; - } - } else { - var el = Dom.get(id); - if (el.tagName && el.tagName.toLowerCase() == 'img') { - //All good - } else { - YAHOO.log('Element is not an image.', 'error', 'ImageCropper'); - return false; - } - } - - - - Crop._instances[id] = this; - this._createWrap(); - this._createMask(); - this._createResize(); - this._setConstraints(); - - }, - /** - * @private - * @method initAttributes - * @description Initializes all of the configuration attributes used to create a croppable element. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the widget. - */ - - initAttributes: function(attr) { - Crop.superclass.initAttributes.call(this, attr); - - /** - * @attribute initialXY - * @description Array of the XY position that we need to set the crop element to when we build it. Defaults to [10, 10] - * @type Array - */ - this.setAttributeConfig('initialXY', { - writeOnce: true, - validator: YAHOO.lang.isArray, - value: attr.initialXY || [10, 10] - }); - /** - * @attribute keyTick - * @description The pixel tick for the arrow keys, defaults to 1 - * @type Number - */ - this.setAttributeConfig('keyTick', { - validator: YAHOO.lang.isNumber, - value: attr.keyTick || 1 - }); - - /** - * @attribute shiftKeyTick - * @description The pixel tick for shift + the arrow keys, defaults to 10 - * @type Number - */ - this.setAttributeConfig('shiftKeyTick', { - validator: YAHOO.lang.isNumber, - value: attr.shiftKeyTick || 10 - }); - - /** - * @attribute useKeys - * @description Should we use the Arrow keys to position the crop element, defaults to true - * @type Boolean - */ - this.setAttributeConfig('useKeys', { - validator: YAHOO.lang.isBoolean, - value: ((attr.useKeys === false) ? false : true) - }); - - /** - * @attribute status - * @description Show the Resize Utility status, defaults to true - * @type Boolean - */ - this.setAttributeConfig('status', { - validator: YAHOO.lang.isBoolean, - value: ((attr.status === false) ? false : true), - method: function(status) { - if (this._resize) { - this._resize.set('status', status); - } - } - }); - - /** - * @attribute minHeight - * @description MinHeight of the crop area, default 50 - * @type Number - */ - this.setAttributeConfig('minHeight', { - validator: YAHOO.lang.isNumber, - value: attr.minHeight || 50, - method: function(h) { - if (this._resize) { - this._resize.set('minHeight', h); - } - } - }); - - /** - * @attribute minWidth - * @description MinWidth of the crop area, default 50. - * @type Number - */ - this.setAttributeConfig('minWidth', { - validator: YAHOO.lang.isNumber, - value: attr.minWidth || 50, - method: function(w) { - if (this._resize) { - this._resize.set('minWidth', w); - } - } - }); - - /** - * @attribute ratio - * @description Set the ratio config option of the Resize Utlility, default false - * @type Boolean - */ - this.setAttributeConfig('ratio', { - validator: YAHOO.lang.isBoolean, - value: attr.ratio || false, - method: function(r) { - if (this._resize) { - this._resize.set('ratio', r); - } - } - }); - - /** - * @attribute ratio - * @description Set the autoRatio config option of the Resize Utlility, default true - * @type Boolean - */ - this.setAttributeConfig('autoRatio', { - validator: YAHOO.lang.isBoolean, - value: ((attr.autoRatio === false) ? false : true), - method: function(a) { - if (this._resize) { - this._resize.set('autoRatio', a); - } - } - }); - - /** - * @attribute initHeight - * @description Set the initlal height of the crop area, defaults to 1/4 of the image height - * @type Number - */ - this.setAttributeConfig('initHeight', { - writeOnce: true, - validator: YAHOO.lang.isNumber, - value: attr.initHeight || (this.get('element').height / 4) - }); - - /** - * @attribute initWidth - * @description Set the initlal width of the crop area, defaults to 1/4 of the image width - * @type Number - */ - this.setAttributeConfig('initWidth', { - validator: YAHOO.lang.isNumber, - writeOnce: true, - value: attr.initWidth || (this.get('element').width / 4) - }); - - }, - /** - * @method destroy - * @description Destroys the ImageCropper object and all of it's elements & listeners. - */ - destroy: function() { - YAHOO.log('Destroying the ImageCropper', 'info', 'ImageCropper'); - this._resize.destroy(); - this._resizeEl.parentNode.removeChild(this._resizeEl); - this._mask.parentNode.removeChild(this._mask); - Event.purgeElement(this._wrap); - this._wrap.parentNode.replaceChild(this.get('element'), this._wrap); - - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - - }, - /** - * @method toString - * @description Returns a string representing the ImageCropper Object. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'ImageCropper (#' + this.get('id') + ')'; - } - return 'Image Cropper'; - } - }); - - YAHOO.widget.ImageCropper = Crop; - -/** -* @event dragEvent -* @description Fires when the DragDrop dragEvent -* @type YAHOO.util.CustomEvent -*/ -/** -* @event startResizeEvent -* @description Fires when when a resize action is started. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event resizeEvent -* @description Fires on every element resize. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event moveEvent -* @description Fires on every element move. Inside these methods: _handleKeyPress, _handleDragEvent, _handleResizeEvent -* @type YAHOO.util.CustomEvent -*/ - -})(); - -YAHOO.register("imagecropper", YAHOO.widget.ImageCropper, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-min.js deleted file mode 100644 index fb99289e05..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper-min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang;var B=function(F,E){var G={element:F,attributes:E||{}};B.superclass.constructor.call(this,G.element,G.attributes);};B._instances={};B.getCropperById=function(E){if(B._instances[E]){return B._instances[E];}return false;};YAHOO.extend(B,YAHOO.util.Element,{CSS_MAIN:"yui-crop",CSS_MASK:"yui-crop-mask",CSS_RESIZE_MASK:"yui-crop-resize-mask",_image:null,_active:null,_resize:null,_resizeEl:null,_resizeMaskEl:null,_wrap:null,_mask:null,_createWrap:function(){this._wrap=document.createElement("div");this._wrap.id=this.get("element").id+"_wrap";this._wrap.className=this.CSS_MAIN;var F=this.get("element");this._wrap.style.width=F.width?F.width+"px":C.getStyle(F,"width");this._wrap.style.height=F.height?F.height+"px":C.getStyle(F,"height");var E=this.get("element").parentNode;E.replaceChild(this._wrap,this.get("element"));this._wrap.appendChild(this.get("element"));A.on(this._wrap,"mouseover",this._handleMouseOver,this,true);A.on(this._wrap,"mouseout",this._handleMouseOut,this,true);A.on(this._wrap,"click",function(G){A.stopEvent(G);},this,true);},_createMask:function(){this._mask=document.createElement("div");this._mask.className=this.CSS_MASK;this._wrap.appendChild(this._mask);},_createResize:function(){this._resizeEl=document.createElement("div");this._resizeEl.className=YAHOO.util.Resize.prototype.CSS_RESIZE;this._resizeEl.style.position="absolute";this._resizeEl.innerHTML='
                    ';this._resizeMaskEl=this._resizeEl.firstChild;this._wrap.appendChild(this._resizeEl);this._resizeEl.style.top=this.get("initialXY")[1]+"px";this._resizeEl.style.left=this.get("initialXY")[0]+"px";this._resizeMaskEl.style.height=Math.floor(this.get("initHeight"))+"px";this._resizeMaskEl.style.width=Math.floor(this.get("initWidth"))+"px";this._resize=new YAHOO.util.Resize(this._resizeEl,{knobHandles:true,handles:"all",draggable:true,status:this.get("status"),minWidth:this.get("minWidth"),minHeight:this.get("minHeight"),ratio:this.get("ratio"),autoRatio:this.get("autoRatio"),height:this.get("initHeight"),width:this.get("initWidth")});this._setBackgroundImage(this.get("element").getAttribute("src",2));this._setBackgroundPosition(-(this.get("initialXY")[0]),-(this.get("initialXY")[1]));this._resize.on("startResize",this._handleStartResizeEvent,this,true);this._resize.on("endResize",this._handleEndResizeEvent,this,true);this._resize.on("dragEvent",this._handleDragEvent,this,true);this._resize.on("beforeResize",this._handleBeforeResizeEvent,this,true);this._resize.on("resize",this._handleResizeEvent,this,true);this._resize.dd.on("b4StartDragEvent",this._handleB4DragEvent,this,true);},_handleMouseOver:function(F){var E="keydown";if(YAHOO.env.ua.gecko||YAHOO.env.ua.opera){E="keypress";}if(!this._active){this._active=true;if(this.get("useKeys")){A.on(document,E,this._handleKeyPress,this,true);}}},_handleMouseOut:function(F){var E="keydown";if(YAHOO.env.ua.gecko||YAHOO.env.ua.opera){E="keypress";}this._active=false;if(this.get("useKeys")){A.removeListener(document,E,this._handleKeyPress);}},_moveEl:function(G,J){var H=0,E=0,I=this._setConstraints(),F=true;switch(G){case"down":H=-(J);if((I.bottom-J)<0){F=false;this._resizeEl.style.top=(I.top+I.bottom)+"px";}break;case"up":H=(J);if((I.top-J)<0){F=false;this._resizeEl.style.top="0px";}break;case"right":E=-(J);if((I.right-J)<0){F=false;this._resizeEl.style.left=(I.left+I.right)+"px";}break;case"left":E=J;if((I.left-J)<0){F=false;this._resizeEl.style.left="0px";}break;}if(F){this._resizeEl.style.left=(parseInt(this._resizeEl.style.left,10)-E)+"px";this._resizeEl.style.top=(parseInt(this._resizeEl.style.top,10)-H)+"px";this.fireEvent("moveEvent",{target:"keypress"});}else{this._setConstraints();}this._syncBackgroundPosition();},_handleKeyPress:function(G){var E=A.getCharCode(G),F=false,H=((G.shiftKey)?this.get("shiftKeyTick"):this.get("keyTick"));switch(E){case 37:this._moveEl("left",H);F=true;break;case 38:this._moveEl("up",H);F=true;break;case 39:this._moveEl("right",H);F=true;break;case 40:this._moveEl("down",H);F=true;break;default:}if(F){A.preventDefault(G);}},_handleB4DragEvent:function(){this._setConstraints();},_handleDragEvent:function(){this._syncBackgroundPosition();this.fireEvent("dragEvent",arguments);this.fireEvent("moveEvent",{target:"dragevent"});},_handleBeforeResizeEvent:function(F){var I=C.getRegion(this.get("element")),J=this._resize._cache,H=this._resize._currentHandle,G=0,E=0;if(F.top&&(F.topI.right)){E=(I.right-J.left);C.setX(this._resize.getWrapEl(),(I.right-E));this._resize.getWrapEl().style.width=E+"px";this._resize._cache.left=(I.right-E);this._resize._cache.width=E;this._syncBackgroundPosition();return false;}}if(H!="t"&&H!="tr"&&H!="tl"){if(J.top&&F.height&&((J.top+F.height)>I.bottom)){G=(I.bottom-J.top);C.setY(this._resize.getWrapEl(),(I.bottom-G));this._resize.getWrapEl().style.height=G+"px";this._resize._cache.height=G;this._resize._cache.top=(I.bottom-G);this._syncBackgroundPosition();return false;}}},_handleResizeMaskEl:function(){var E=this._resize._cache;this._resizeMaskEl.style.height=Math.floor(E.height)+"px";this._resizeMaskEl.style.width=Math.floor(E.width)+"px";},_handleResizeEvent:function(E){this._setConstraints(true);this._syncBackgroundPosition();this.fireEvent("resizeEvent",arguments);this.fireEvent("moveEvent",{target:"resizeevent"});},_syncBackgroundPosition:function(){this._handleResizeMaskEl();this._setBackgroundPosition(-(parseInt(this._resizeEl.style.left,10)),-(parseInt(this._resizeEl.style.top,10))); -},_setBackgroundPosition:function(F,H){var J=parseInt(C.getStyle(this._resize.get("element"),"borderLeftWidth"),10);var G=parseInt(C.getStyle(this._resize.get("element"),"borderTopWidth"),10);if(isNaN(J)){J=0;}if(isNaN(G)){G=0;}var E=this._resize.getWrapEl().firstChild;var I=(F-J)+"px "+(H-G)+"px";this._resizeMaskEl.style.backgroundPosition=I;},_setBackgroundImage:function(F){var E=this._resize.getWrapEl().firstChild;this._image=F;E.style.backgroundImage="url("+F+"#)";},_handleEndResizeEvent:function(){this._setConstraints(true);},_handleStartResizeEvent:function(){this._setConstraints(true);var I=this._resize._cache.height,F=this._resize._cache.width,H=parseInt(this._resize.getWrapEl().style.top,10),E=parseInt(this._resize.getWrapEl().style.left,10),G=0,J=0;switch(this._resize._currentHandle){case"b":G=(I+this._resize.dd.bottomConstraint);break;case"l":J=(F+this._resize.dd.leftConstraint);break;case"r":G=(I+H);J=(F+this._resize.dd.rightConstraint);break;case"br":G=(I+this._resize.dd.bottomConstraint);J=(F+this._resize.dd.rightConstraint);break;case"tr":G=(I+H);J=(F+this._resize.dd.rightConstraint);break;}if(G){}if(J){}this.fireEvent("startResizeEvent",arguments);},_setConstraints:function(J){var H=this._resize;H.dd.resetConstraints();var N=parseInt(H.get("height"),10),F=parseInt(H.get("width"),10);if(J){N=H._cache.height;F=H._cache.width;}var L=C.getRegion(this.get("element"));var G=H.getWrapEl();var O=C.getXY(G);var I=O[0]-L.left;var M=L.right-O[0]-F;var K=O[1]-L.top;var E=L.bottom-O[1]-N;if(K<0){K=0;}H.dd.setXConstraint(I,M);H.dd.setYConstraint(K,E);return{top:K,right:M,bottom:E,left:I};},getCropCoords:function(){var E={top:parseInt(this._resize.getWrapEl().style.top,10),left:parseInt(this._resize.getWrapEl().style.left,10),height:this._resize._cache.height,width:this._resize._cache.width,image:this._image};return E;},reset:function(){this._resize.resize(null,this.get("initHeight"),this.get("initWidth"),0,0,true);this._resizeEl.style.top=this.get("initialXY")[1]+"px";this._resizeEl.style.left=this.get("initialXY")[0]+"px";this._syncBackgroundPosition();return this;},getEl:function(){return this.get("element");},getResizeEl:function(){return this._resizeEl;},getWrapEl:function(){return this._wrap;},getMaskEl:function(){return this._mask;},getResizeMaskEl:function(){return this._resizeMaskEl;},getResizeObject:function(){return this._resize;},init:function(G,E){B.superclass.init.call(this,G,E);var H=G;if(!D.isString(H)){if(H.tagName&&(H.tagName.toLowerCase()=="img")){H=C.generateId(H);}else{return false;}}else{var F=C.get(H);if(F.tagName&&F.tagName.toLowerCase()=="img"){}else{return false;}}B._instances[H]=this;this._createWrap();this._createMask();this._createResize();this._setConstraints();},initAttributes:function(E){B.superclass.initAttributes.call(this,E);this.setAttributeConfig("initialXY",{writeOnce:true,validator:YAHOO.lang.isArray,value:E.initialXY||[10,10]});this.setAttributeConfig("keyTick",{validator:YAHOO.lang.isNumber,value:E.keyTick||1});this.setAttributeConfig("shiftKeyTick",{validator:YAHOO.lang.isNumber,value:E.shiftKeyTick||10});this.setAttributeConfig("useKeys",{validator:YAHOO.lang.isBoolean,value:((E.useKeys===false)?false:true)});this.setAttributeConfig("status",{validator:YAHOO.lang.isBoolean,value:((E.status===false)?false:true),method:function(F){if(this._resize){this._resize.set("status",F);}}});this.setAttributeConfig("minHeight",{validator:YAHOO.lang.isNumber,value:E.minHeight||50,method:function(F){if(this._resize){this._resize.set("minHeight",F);}}});this.setAttributeConfig("minWidth",{validator:YAHOO.lang.isNumber,value:E.minWidth||50,method:function(F){if(this._resize){this._resize.set("minWidth",F);}}});this.setAttributeConfig("ratio",{validator:YAHOO.lang.isBoolean,value:E.ratio||false,method:function(F){if(this._resize){this._resize.set("ratio",F);}}});this.setAttributeConfig("autoRatio",{validator:YAHOO.lang.isBoolean,value:((E.autoRatio===false)?false:true),method:function(F){if(this._resize){this._resize.set("autoRatio",F);}}});this.setAttributeConfig("initHeight",{writeOnce:true,validator:YAHOO.lang.isNumber,value:E.initHeight||(this.get("element").height/4)});this.setAttributeConfig("initWidth",{validator:YAHOO.lang.isNumber,writeOnce:true,value:E.initWidth||(this.get("element").width/4)});},destroy:function(){this._resize.destroy();this._resizeEl.parentNode.removeChild(this._resizeEl);this._mask.parentNode.removeChild(this._mask);A.purgeElement(this._wrap);this._wrap.parentNode.replaceChild(this.get("element"),this._wrap);for(var E in this){if(D.hasOwnProperty(this,E)){this[E]=null;}}},toString:function(){if(this.get){return"ImageCropper (#"+this.get("id")+")";}return"Image Cropper";}});YAHOO.widget.ImageCropper=B;})();YAHOO.register("imagecropper",YAHOO.widget.ImageCropper,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper.js deleted file mode 100644 index f194b96883..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imagecropper/imagecropper.js +++ /dev/null @@ -1,889 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * @description

                    Creates a Image Cropper control.

                    - * @namespace YAHOO.widget - * @requires yahoo, dom, dragdrop, element, event, resize - * @module imagecropper - * @beta - */ -(function() { -var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class ImageCropper - * @description

                    Creates a Image Cropper control.

                    - * @extends YAHOO.util.Element - * @param {String/HTMLElement} el The image element to make croppable. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - var Crop = function(el, config) { - var oConfig = { - element: el, - attributes: config || {} - }; - - Crop.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all ImageCropper instances - * @type Object - */ - Crop._instances = {}; - /** - * @static - * @method getCropperById - * @description Get's an ImageCropper object by the HTML id of the image associated with the ImageCropper object. - * @return {Object} The ImageCropper Object - */ - Crop.getCropperById = function(id) { - if (Crop._instances[id]) { - return Crop._instances[id]; - } - return false; - }; - - YAHOO.extend(Crop, YAHOO.util.Element, { - /** - * @private - * @property CSS_MAIN - * @description The CSS class used to wrap the element - * @type String - */ - CSS_MAIN: 'yui-crop', - /** - * @private - * @property CSS_MASK - * @description The CSS class for the mask element - * @type String - */ - CSS_MASK: 'yui-crop-mask', - /** - * @private - * @property CSS_RESIZE_MASK - * @description The CSS class for the mask inside the resize element - * @type String - */ - CSS_RESIZE_MASK: 'yui-crop-resize-mask', - - /** - * @private - * @property _image - * @description The url of the image we are cropping - * @type String - */ - _image: null, - /** - * @private - * @property _active - * @description Flag to determine if the crop region is active - * @type Boolean - */ - _active: null, - /** - * @private - * @property _resize - * @description A reference to the Resize Utility used in this Cropper Instance - * @type Object - */ - _resize: null, - /** - * @private - * @property _resizeEl - * @description The HTML Element used to create the Resize Oject - * @type HTMLElement - */ - _resizeEl: null, - /** - * @private - * @property _resizeMaskEl - * @description The HTML Element used to create the Resize mask - * @type HTMLElement - */ - _resizeMaskEl: null, - /** - * @private - * @property _wrap - * @description The HTML Element created to wrap the image - * @type HTMLElement - */ - _wrap: null, - /** - * @private - * @property _mask - * @description The HTML Element created to "mask" the image being cropped - * @type HTMLElement - */ - _mask: null, - /** - * @private - * @method _createWrap - * @description Creates the wrapper element used to wrap the image - */ - _createWrap: function() { - this._wrap = document.createElement('div'); - this._wrap.id = this.get('element').id + '_wrap'; - this._wrap.className = this.CSS_MAIN; - var el = this.get('element'); - this._wrap.style.width = el.width ? el.width + 'px' : Dom.getStyle(el, 'width'); - this._wrap.style.height = el.height ? el.height + 'px' : Dom.getStyle(el, 'height'); - - var par = this.get('element').parentNode; - par.replaceChild(this._wrap, this.get('element')); - this._wrap.appendChild(this.get('element')); - - Event.on(this._wrap, 'mouseover', this._handleMouseOver, this, true); - Event.on(this._wrap, 'mouseout', this._handleMouseOut, this, true); - - Event.on(this._wrap, 'click', function(ev) { Event.stopEvent(ev); }, this, true); - }, - - /** - * @private - * @method _createMask - * @description Creates the mask element used to mask the image - */ - _createMask: function() { - this._mask = document.createElement('div'); - this._mask.className = this.CSS_MASK; - this._wrap.appendChild(this._mask); - }, - - /** - * @private - * @method _createResize - * @description Creates the resize element and the instance of the Resize Utility - */ - _createResize: function() { - this._resizeEl = document.createElement('div'); - this._resizeEl.className = YAHOO.util.Resize.prototype.CSS_RESIZE; - this._resizeEl.style.position = 'absolute'; - - this._resizeEl.innerHTML = '
                    '; - this._resizeMaskEl = this._resizeEl.firstChild; - this._wrap.appendChild(this._resizeEl); - this._resizeEl.style.top = this.get('initialXY')[1] + 'px'; - this._resizeEl.style.left = this.get('initialXY')[0] + 'px'; - this._resizeMaskEl.style.height = Math.floor(this.get('initHeight')) + 'px'; - this._resizeMaskEl.style.width = Math.floor(this.get('initWidth')) + 'px'; - - this._resize = new YAHOO.util.Resize(this._resizeEl, { - knobHandles: true, - handles: 'all', - draggable: true, - status: this.get('status'), - minWidth: this.get('minWidth'), - minHeight: this.get('minHeight'), - ratio: this.get('ratio'), - autoRatio: this.get('autoRatio'), - height: this.get('initHeight'), - width: this.get('initWidth') - }); - - this._setBackgroundImage(this.get('element').getAttribute('src', 2)); - this._setBackgroundPosition(-(this.get('initialXY')[0]), -(this.get('initialXY')[1])); - - this._resize.on('startResize', this._handleStartResizeEvent, this, true); - this._resize.on('endResize', this._handleEndResizeEvent, this, true); - this._resize.on('dragEvent', this._handleDragEvent, this, true); - this._resize.on('beforeResize', this._handleBeforeResizeEvent, this, true); - this._resize.on('resize', this._handleResizeEvent, this, true); - this._resize.dd.on('b4StartDragEvent', this._handleB4DragEvent, this, true); - }, - - /** - * @private - * @method _handleMouseOver - * @description Handles the mouseover event - */ - _handleMouseOver: function(ev) { - var evType = 'keydown'; - if (YAHOO.env.ua.gecko || YAHOO.env.ua.opera) { - evType = 'keypress'; - } - if (!this._active) { - this._active = true; - if (this.get('useKeys')) { - Event.on(document, evType, this._handleKeyPress, this, true); - } - } - }, - /** - * @private - * @method _handleMouseOut - * @description Handles the mouseout event - */ - _handleMouseOut: function(ev) { - var evType = 'keydown'; - if (YAHOO.env.ua.gecko || YAHOO.env.ua.opera) { - evType = 'keypress'; - } - this._active = false; - if (this.get('useKeys')) { - Event.removeListener(document, evType, this._handleKeyPress); - } - }, - - /** - * @private - * @method _moveEl - * @description Moves the resize element based on the arrow keys - */ - _moveEl: function(dir, inc) { - var t = 0, l = 0, - region = this._setConstraints(), - resize = true; - - switch (dir) { - case 'down': - t = -(inc); - if ((region.bottom - inc) < 0) { - resize = false; - this._resizeEl.style.top = (region.top + region.bottom) + 'px'; - } - break; - case 'up': - t = (inc); - if ((region.top - inc) < 0) { - resize = false; - this._resizeEl.style.top = '0px'; - } - break; - case 'right': - l = -(inc); - if ((region.right - inc) < 0) { - resize = false; - this._resizeEl.style.left = (region.left + region.right) + 'px'; - } - break; - case 'left': - l = inc; - if ((region.left - inc) < 0) { - resize = false; - this._resizeEl.style.left = '0px'; - } - break; - } - - if (resize) { - this._resizeEl.style.left = (parseInt(this._resizeEl.style.left, 10) - l) + 'px'; - this._resizeEl.style.top = (parseInt(this._resizeEl.style.top, 10) - t) + 'px'; - this.fireEvent('moveEvent', { target: 'keypress' }); - } else { - this._setConstraints(); - } - this._syncBackgroundPosition(); - }, - - /** - * @private - * @method _handleKeyPress - * @description Handles the keypress event - */ - _handleKeyPress: function(ev) { - var kc = Event.getCharCode(ev), - stopEvent = false, - inc = ((ev.shiftKey) ? this.get('shiftKeyTick') : this.get('keyTick')); - - switch (kc) { - case 0x25: // left - this._moveEl('left', inc); - stopEvent = true; - break; - case 0x26: // up - this._moveEl('up', inc); - stopEvent = true; - break; - case 0x27: // right - this._moveEl('right', inc); - stopEvent = true; - break; - case 0x28: // down - this._moveEl('down', inc); - stopEvent = true; - break; - default: - } - if (stopEvent) { - Event.preventDefault(ev); - } - }, - - /** - * @private - * @method _handleB4DragEvent - * @description Handles the DragDrop b4DragEvent event - */ - _handleB4DragEvent: function() { - this._setConstraints(); - }, - - /** - * @private - * @method _handleDragEvent - * @description Handles the DragDrop DragEvent event - */ - _handleDragEvent: function() { - this._syncBackgroundPosition(); - this.fireEvent('dragEvent', arguments); - this.fireEvent('moveEvent', { target: 'dragevent' }); - }, - - /** - * @private - * @method _handleBeforeResizeEvent - * @description Handles the Resize Utilitys beforeResize event - */ - _handleBeforeResizeEvent: function(args) { - var region = Dom.getRegion(this.get('element')), - c = this._resize._cache, - ch = this._resize._currentHandle, h = 0, w = 0; - - if (args.top && (args.top < region.top)) { - h = (c.height + c.top) - region.top; - Dom.setY(this._resize.getWrapEl(), region.top); - this._resize.getWrapEl().style.height = h + 'px'; - this._resize._cache.height = h; - this._resize._cache.top = region.top; - this._syncBackgroundPosition(); - return false; - } - if (args.left && (args.left < region.left)) { - w = (c.width + c.left) - region.left; - Dom.setX(this._resize.getWrapEl(), region.left); - this._resize._cache.left = region.left; - this._resize.getWrapEl().style.width = w + 'px'; - this._resize._cache.width = w; - this._syncBackgroundPosition(); - return false; - } - if (ch != 'tl' && ch != 'l' && ch != 'bl') { - if (c.left && args.width && ((c.left + args.width) > region.right)) { - w = (region.right - c.left); - Dom.setX(this._resize.getWrapEl(), (region.right - w)); - this._resize.getWrapEl().style.width = w + 'px'; - this._resize._cache.left = (region.right - w); - this._resize._cache.width = w; - this._syncBackgroundPosition(); - return false; - } - } - if (ch != 't' && ch != 'tr' && ch != 'tl') { - if (c.top && args.height && ((c.top + args.height) > region.bottom)) { - h = (region.bottom - c.top); - Dom.setY(this._resize.getWrapEl(), (region.bottom - h)); - this._resize.getWrapEl().style.height = h + 'px'; - this._resize._cache.height = h; - this._resize._cache.top = (region.bottom - h); - this._syncBackgroundPosition(); - return false; - } - } - }, - /** - * @private - * @method _handleResizeMaskEl - * @description Resizes the inner mask element - */ - _handleResizeMaskEl: function() { - var a = this._resize._cache; - this._resizeMaskEl.style.height = Math.floor(a.height) + 'px'; - this._resizeMaskEl.style.width = Math.floor(a.width) + 'px'; - }, - /** - * @private - * @method _handleResizeEvent - * @param Event ev The Resize Utilitys resize event. - * @description Handles the Resize Utilitys Resize event - */ - _handleResizeEvent: function(ev) { - this._setConstraints(true); - this._syncBackgroundPosition(); - this.fireEvent('resizeEvent', arguments); - this.fireEvent('moveEvent', { target: 'resizeevent' }); - }, - - /** - * @private - * @method _syncBackgroundPosition - * @description Syncs the packground position of the resize element with the resize elements top and left style position - */ - _syncBackgroundPosition: function() { - this._handleResizeMaskEl(); - this._setBackgroundPosition(-(parseInt(this._resizeEl.style.left, 10)), -(parseInt(this._resizeEl.style.top, 10))); - }, - - /** - * @private - * @method _setBackgroundPosition - * @param Number l The left position - * @param Number t The top position - * @description Sets the background image position to the top and left position - */ - _setBackgroundPosition: function(l, t) { - var bl = parseInt(Dom.getStyle(this._resize.get('element'), 'borderLeftWidth'), 10); - var bt = parseInt(Dom.getStyle(this._resize.get('element'), 'borderTopWidth'), 10); - if (isNaN(bl)) { - bl = 0; - } - if (isNaN(bt)) { - bt = 0; - } - var mask = this._resize.getWrapEl().firstChild; - var pos = (l - bl) + 'px ' + (t - bt) + 'px'; - this._resizeMaskEl.style.backgroundPosition = pos; - }, - - /** - * @private - * @method _setBackgroundImage - * @param String url The url of the image - * @description Sets the background image of the resize element - */ - _setBackgroundImage: function(url) { - var mask = this._resize.getWrapEl().firstChild; - this._image = url; - mask.style.backgroundImage = 'url(' + url + '#)'; - }, - - /** - * @private - * @method _handleEndResizeEvent - * @description Handles the Resize Utilitys endResize event - */ - _handleEndResizeEvent: function() { - this._setConstraints(true); - }, - /** - * @private - * @method _handleStartResizeEvent - * @description Handles the Resize Utilitys startResize event - */ - _handleStartResizeEvent: function() { - this._setConstraints(true); - - var h = this._resize._cache.height, - w = this._resize._cache.width, - t = parseInt(this._resize.getWrapEl().style.top, 10), - l = parseInt(this._resize.getWrapEl().style.left, 10), - maxH = 0, maxW = 0; - - switch (this._resize._currentHandle) { - case 'b': - maxH = (h + this._resize.dd.bottomConstraint); - break; - case 'l': - maxW = (w + this._resize.dd.leftConstraint); - break; - case 'r': - maxH = (h + t); - maxW = (w + this._resize.dd.rightConstraint); - break; - case 'br': - maxH = (h + this._resize.dd.bottomConstraint); - maxW = (w + this._resize.dd.rightConstraint); - break; - case 'tr': - maxH = (h + t); - maxW = (w + this._resize.dd.rightConstraint); - break; - - } - - if (maxH) { - //this._resize.set('maxHeight', maxH); - } - if (maxW) { - //this._resize.set('maxWidth', maxW); - } - - this.fireEvent('startResizeEvent', arguments); - }, - - /** - * @private - * @method _setConstraints - * @param Boolean inside Used when called from inside a resize event, false by default (dragging) - * @description Set the DragDrop constraints to keep the element inside the crop area. - * @return {Object} Object containing Top, Right, Bottom and Left constraints - */ - _setConstraints: function(inside) { - var resize = this._resize; - resize.dd.resetConstraints(); - var height = parseInt(resize.get('height'), 10), - width = parseInt(resize.get('width'), 10); - if (inside) { - //Called from inside the resize callback - height = resize._cache.height; - width = resize._cache.width; - } - - //Get the top, right, bottom and left positions - var region = Dom.getRegion(this.get('element')); - //Get the element we are working on - var el = resize.getWrapEl(); - - //Get the xy position of it - var xy = Dom.getXY(el); - - //Set left to x minus left - var left = xy[0] - region.left; - - //Set right to right minus x minus width - var right = region.right - xy[0] - width; - - //Set top to y minus top - var top = xy[1] - region.top; - - //Set bottom to bottom minus y minus height - var bottom = region.bottom - xy[1] - height; - - if (top < 0) { - top = 0; - } - - resize.dd.setXConstraint(left, right); - resize.dd.setYConstraint(top, bottom); - - return { - top: top, - right: right, - bottom: bottom, - left: left - }; - - - - }, - /** - * @method getCropCoords - * @description Returns the coordinates needed to crop the image - * @return {Object} The top, left, height, width and image url of the image being cropped - */ - getCropCoords: function() { - var coords = { - top: parseInt(this._resize.getWrapEl().style.top, 10), - left: parseInt(this._resize.getWrapEl().style.left, 10), - height: this._resize._cache.height, - width: this._resize._cache.width, - image: this._image - }; - return coords; - }, - /** - * @method reset - * @description Resets the crop element back to it's original position - * @return {YAHOO.widget.ImageCropper} The ImageCropper instance - */ - reset: function() { - this._resize.resize(null, this.get('initHeight'), this.get('initWidth'), 0, 0, true); - this._resizeEl.style.top = this.get('initialXY')[1] + 'px'; - this._resizeEl.style.left = this.get('initialXY')[0] + 'px'; - this._syncBackgroundPosition(); - return this; - }, - - /** - * @method getEl - * @description Get the HTML reference for the image element. - * @return {HTMLElement} The image element - */ - getEl: function() { - return this.get('element'); - }, - /** - * @method getResizeEl - * @description Get the HTML reference for the resize element. - * @return {HTMLElement} The resize element - */ - getResizeEl: function() { - return this._resizeEl; - }, - /** - * @method getWrapEl - * @description Get the HTML reference for the wrap element. - * @return {HTMLElement} The wrap element - */ - getWrapEl: function() { - return this._wrap; - }, - - /** - * @method getMaskEl - * @description Get the HTML reference for the mask element. - * @return {HTMLElement} The mask element - */ - getMaskEl: function() { - return this._mask; - }, - - /** - * @method getResizeMaskEl - * @description Get the HTML reference for the resizable object's mask element. - * @return {HTMLElement} The resize objects mask element. - */ - getResizeMaskEl: function() { - return this._resizeMaskEl; - }, - - /** - * @method getResizeObject - * @description Get the Resize Utility object. - * @return {YAHOO.util.Resize} The Resize instance - */ - getResizeObject: function() { - return this._resize; - }, - - /** - * @private - * @method init - * @description The ImageCropper class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - Crop.superclass.init.call(this, p_oElement, p_oAttributes); - - var id = p_oElement; - - if (!Lang.isString(id)) { - if (id.tagName && (id.tagName.toLowerCase() == 'img')) { - id = Dom.generateId(id); - } else { - return false; - } - } else { - var el = Dom.get(id); - if (el.tagName && el.tagName.toLowerCase() == 'img') { - //All good - } else { - return false; - } - } - - - - Crop._instances[id] = this; - this._createWrap(); - this._createMask(); - this._createResize(); - this._setConstraints(); - - }, - /** - * @private - * @method initAttributes - * @description Initializes all of the configuration attributes used to create a croppable element. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the widget. - */ - - initAttributes: function(attr) { - Crop.superclass.initAttributes.call(this, attr); - - /** - * @attribute initialXY - * @description Array of the XY position that we need to set the crop element to when we build it. Defaults to [10, 10] - * @type Array - */ - this.setAttributeConfig('initialXY', { - writeOnce: true, - validator: YAHOO.lang.isArray, - value: attr.initialXY || [10, 10] - }); - /** - * @attribute keyTick - * @description The pixel tick for the arrow keys, defaults to 1 - * @type Number - */ - this.setAttributeConfig('keyTick', { - validator: YAHOO.lang.isNumber, - value: attr.keyTick || 1 - }); - - /** - * @attribute shiftKeyTick - * @description The pixel tick for shift + the arrow keys, defaults to 10 - * @type Number - */ - this.setAttributeConfig('shiftKeyTick', { - validator: YAHOO.lang.isNumber, - value: attr.shiftKeyTick || 10 - }); - - /** - * @attribute useKeys - * @description Should we use the Arrow keys to position the crop element, defaults to true - * @type Boolean - */ - this.setAttributeConfig('useKeys', { - validator: YAHOO.lang.isBoolean, - value: ((attr.useKeys === false) ? false : true) - }); - - /** - * @attribute status - * @description Show the Resize Utility status, defaults to true - * @type Boolean - */ - this.setAttributeConfig('status', { - validator: YAHOO.lang.isBoolean, - value: ((attr.status === false) ? false : true), - method: function(status) { - if (this._resize) { - this._resize.set('status', status); - } - } - }); - - /** - * @attribute minHeight - * @description MinHeight of the crop area, default 50 - * @type Number - */ - this.setAttributeConfig('minHeight', { - validator: YAHOO.lang.isNumber, - value: attr.minHeight || 50, - method: function(h) { - if (this._resize) { - this._resize.set('minHeight', h); - } - } - }); - - /** - * @attribute minWidth - * @description MinWidth of the crop area, default 50. - * @type Number - */ - this.setAttributeConfig('minWidth', { - validator: YAHOO.lang.isNumber, - value: attr.minWidth || 50, - method: function(w) { - if (this._resize) { - this._resize.set('minWidth', w); - } - } - }); - - /** - * @attribute ratio - * @description Set the ratio config option of the Resize Utlility, default false - * @type Boolean - */ - this.setAttributeConfig('ratio', { - validator: YAHOO.lang.isBoolean, - value: attr.ratio || false, - method: function(r) { - if (this._resize) { - this._resize.set('ratio', r); - } - } - }); - - /** - * @attribute ratio - * @description Set the autoRatio config option of the Resize Utlility, default true - * @type Boolean - */ - this.setAttributeConfig('autoRatio', { - validator: YAHOO.lang.isBoolean, - value: ((attr.autoRatio === false) ? false : true), - method: function(a) { - if (this._resize) { - this._resize.set('autoRatio', a); - } - } - }); - - /** - * @attribute initHeight - * @description Set the initlal height of the crop area, defaults to 1/4 of the image height - * @type Number - */ - this.setAttributeConfig('initHeight', { - writeOnce: true, - validator: YAHOO.lang.isNumber, - value: attr.initHeight || (this.get('element').height / 4) - }); - - /** - * @attribute initWidth - * @description Set the initlal width of the crop area, defaults to 1/4 of the image width - * @type Number - */ - this.setAttributeConfig('initWidth', { - validator: YAHOO.lang.isNumber, - writeOnce: true, - value: attr.initWidth || (this.get('element').width / 4) - }); - - }, - /** - * @method destroy - * @description Destroys the ImageCropper object and all of it's elements & listeners. - */ - destroy: function() { - this._resize.destroy(); - this._resizeEl.parentNode.removeChild(this._resizeEl); - this._mask.parentNode.removeChild(this._mask); - Event.purgeElement(this._wrap); - this._wrap.parentNode.replaceChild(this.get('element'), this._wrap); - - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - } - } - - }, - /** - * @method toString - * @description Returns a string representing the ImageCropper Object. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'ImageCropper (#' + this.get('id') + ')'; - } - return 'Image Cropper'; - } - }); - - YAHOO.widget.ImageCropper = Crop; - -/** -* @event dragEvent -* @description Fires when the DragDrop dragEvent -* @type YAHOO.util.CustomEvent -*/ -/** -* @event startResizeEvent -* @description Fires when when a resize action is started. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event resizeEvent -* @description Fires on every element resize. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event moveEvent -* @description Fires on every element move. Inside these methods: _handleKeyPress, _handleDragEvent, _handleResizeEvent -* @type YAHOO.util.CustomEvent -*/ - -})(); - -YAHOO.register("imagecropper", YAHOO.widget.ImageCropper, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-debug.js deleted file mode 100644 index 28bb682564..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-debug.js +++ /dev/null @@ -1,487 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The ImageLoader Utility is a framework to dynamically load images according to certain triggers, - * enabling faster load times and a more responsive UI. - * - * @module imageloader - * @namespace YAHOO.util - * @requires yahoo, dom, event - */ - -if (typeof(YAHOO.util.ImageLoader) == 'undefined') { - YAHOO.util.ImageLoader = {}; -} - -/** - * A group for images. A group can have one time limit and a series of triggers. Thus the images belonging to this group must share these constraints. - * @class YAHOO.util.ImageLoader.group - * @requires YAHOO.util.Dom - * @requires YAHOO.util.Event - * @constructor - * @param {String|HTMLElement} trigEl The HTML element id or reference to assign the trigger event to. Can be null for no trigger - * @param {String} trigAct The type of event to assign to trigEl. Can be null for no trigger - * @param {Number} timeout Timeout (time limit) length, in seconds. Can be undefined, or <= 0, for no time limit - */ -YAHOO.util.ImageLoader.group = function(trigEl, trigAct, timeout) { - /** - * Name for the group. Only used to identify the group in logging statements - * @property name - * @type String - */ - this.name = 'unnamed'; - - /** - * Collection of images registered with this group - * @property _imgObjs - * @private - * @type Object - */ - this._imgObjs = {}; - - /** - * Timeout (time limit) length, in seconds - * @property timeoutLen - * @type Number - */ - this.timeoutLen = timeout; - - /** - * Timeout object to keep a handle on the time limit - * @property _timeout - * @private - * @type Object - */ - this._timeout = null; - - /** - * Collection of triggers for this group. - * Keeps track of each trigger's element, event, and event-listener-callback "fetch" function - * @property _triggers - * @private - * @type Array - */ - this._triggers = []; - - /** - * Collection of custom-event triggers for this group. - * Keeps track of each trigger's event object and event-listener-callback "fetch" function - * @property _customTriggers - * @private - * @type Array - */ - this._customTriggers = []; - - /** - * Flag to check if images are above the fold. If foldConditional is true, the group will check each of its image locations at page load. If any part of the image is within the client viewport, the image is displayed immediately - * @property foldConditional - * @type Boolean - */ - this.foldConditional = false; - - /** - * Class name that will identify images belonging to the group. This class name will be removed from each element in order to fetch images. - * This class should have, in its CSS style definition, "background:none !important;" - * @property className - * @type String - */ - this.className = null; - - /** - * HTML elements having the class name that is associated with this group - * Elements are stored during the _foldCheck function and reused later during the fetch function. Gives a slight performance improvement when className and foldConditional are both used - * @property _classImageEls - * @private - * @type Array - */ - this._classImageEls = null; - - // add a listener to set the time limit in the onload - YAHOO.util.Event.addListener(window, 'load', this._onloadTasks, this, true); - // add the trigger - this.addTrigger(trigEl, trigAct); - -}; - -/** - * Adds a trigger to the group. Call this with the same style as YAHOO.util.Event.addListener - * @method addTrigger - * @param {String|HTMLElement} trigEl The HTML element id or reference to assign the trigger event to - * @param {String} trigAct The type of event to assign to trigEl - */ -YAHOO.util.ImageLoader.group.prototype.addTrigger = function(trigEl, trigAct) { - if (! trigEl || ! trigAct) { - return; - } - /* Need to wrap the fetch function. Event Util can't distinguish prototyped functions of different instantiations - * Leads to this scenario: groupA and groupZ both have window-scroll triggers. groupZ also has a 2-sec timeout (groupA has no timeout). - * groupZ's timeout fires; we remove the triggers. The removeListener call finds the first window-scroll event with Y.u.IL.p.fetch, which is groupA's. - * groupA's trigger is removed and never fires, leaving images unfetched - */ - var wrappedFetch = function() { - this.fetch(); - }; - this._triggers.push([trigEl, trigAct, wrappedFetch]); - YAHOO.util.Event.addListener(trigEl, trigAct, wrappedFetch, this, true); -}; - -/** - * Adds a custom event trigger to the group. - * @method addCustomTrigger - * @param {Object} event A YAHOO.util.CustomEvent object - */ -YAHOO.util.ImageLoader.group.prototype.addCustomTrigger = function(event) { - // make sure we're dealing with a CustomEvent object - if (! event || ! event instanceof YAHOO.util.CustomEvent) { - return; - } - - // see comment in addTrigger() - var wrappedFetch = function() { - this.fetch(); - }; - this._customTriggers.push([event, wrappedFetch]); - event.subscribe(wrappedFetch, this, true); -}; - -/** - * Setup to do in the window's onload - * Initiates time limit for group; executes the fold check for the images - * @method _onloadTasks - * @private - */ -YAHOO.util.ImageLoader.group.prototype._onloadTasks = function() { - if (this.timeoutLen && typeof(this.timeoutLen) == 'number' && this.timeoutLen > 0) { - this._timeout = setTimeout(this._getFetchTimeout(), this.timeoutLen * 1000); - } - - if (this.foldConditional) { - this._foldCheck(); - } -}; - -/** - * Returns the group's fetch method, with the proper closure, for use with setTimeout - * @method _getFetchTimeout - * @return {Function} group's fetch method - * @private - */ -YAHOO.util.ImageLoader.group.prototype._getFetchTimeout = function() { - var self = this; - return function() { self.fetch(); }; -}; - -/** - * Registers a background image with the group - * @method registerBgImage - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @return {Object} bgImgObj that was registered, for modifying any attributes in the object - */ -YAHOO.util.ImageLoader.group.prototype.registerBgImage = function(domId, url) { - this._imgObjs[domId] = new YAHOO.util.ImageLoader.bgImgObj(domId, url); - return this._imgObjs[domId]; -}; -/** - * Registers a src image with the group - * @method registerSrcImage - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Int} width pixel width of the image - defaults to image's natural size - * @param {Int} height pixel height of the image - defaults to image's natural size - * @return {Object} srcImgObj that was registered, for modifying any attributes in the object - */ -YAHOO.util.ImageLoader.group.prototype.registerSrcImage = function(domId, url, width, height) { - this._imgObjs[domId] = new YAHOO.util.ImageLoader.srcImgObj(domId, url, width, height); - return this._imgObjs[domId]; -}; -/** - * Registers an alpha-channel-type png background image with the group - * @method registerPngBgImage - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Object} ailProps The AlphaImageLoader properties to be set for the image - * Valid properties are 'sizingMethod' and 'enabled' - * @return {Object} pngBgImgObj that was registered, for modifying any attributes in the object - */ -YAHOO.util.ImageLoader.group.prototype.registerPngBgImage = function(domId, url, ailProps) { - this._imgObjs[domId] = new YAHOO.util.ImageLoader.pngBgImgObj(domId, url, ailProps); - return this._imgObjs[domId]; -}; - -/** - * Displays the images in the group - * @method fetch - */ -YAHOO.util.ImageLoader.group.prototype.fetch = function() { - YAHOO.log('Fetching images in group: "' + this.name + '".', 'info', 'imageloader'); - - clearTimeout(this._timeout); - // remove all listeners - for (var i=0, len = this._triggers.length; i < len; i++) { - YAHOO.util.Event.removeListener(this._triggers[i][0], this._triggers[i][1], this._triggers[i][2]); - } - // remove custom event subscriptions - for (var i=0, len = this._customTriggers.length; i < len; i++) { - this._customTriggers[i][0].unsubscribe(this._customTriggers[i][1], this); - } - - // fetch whatever we need to by className - this._fetchByClass(); - - // fetch registered images - for (var id in this._imgObjs) { - if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) { - this._imgObjs[id].fetch(); - } - } -}; - -/** - * Checks the position of each image in the group. If any part of the image is within the client viewport, shows the image immediately. - * @method _foldCheck - * @private - */ -YAHOO.util.ImageLoader.group.prototype._foldCheck = function() { - YAHOO.log('Checking for images above the fold in group: "' + this.name + '"', 'info', 'imageloader'); - var scrollTop = (document.compatMode != 'CSS1Compat') ? document.body.scrollTop : document.documentElement.scrollTop; - var viewHeight = YAHOO.util.Dom.getViewportHeight(); - var hLimit = scrollTop + viewHeight; - var scrollLeft = (document.compatMode != 'CSS1Compat') ? document.body.scrollLeft : document.documentElement.scrollLeft; - var viewWidth = YAHOO.util.Dom.getViewportWidth(); - var wLimit = scrollLeft + viewWidth; - for (var id in this._imgObjs) { - if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) { - var elPos = YAHOO.util.Dom.getXY(this._imgObjs[id].domId); - if (elPos[1] < hLimit && elPos[0] < wLimit) { - YAHOO.log('Image with id "' + this._imgObjs[id].domId + '" is above the fold. Fetching image.', 'info', 'imageloader'); - this._imgObjs[id].fetch(); - } - } - } - // and by class - if (this.className) { - this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className); - for (var i=0, len = this._classImageEls.length; i < len; i++) { - var elPos = YAHOO.util.Dom.getXY(this._classImageEls[i]); - if (elPos[1] < hLimit && elPos[0] < wLimit) { - YAHOO.log('Image with id "' + this._classImageEls[i].id + '" is above the fold. Fetching image. (Image registered by class name with the group - may not have an id.)', 'info', 'imageloader'); - YAHOO.util.Dom.removeClass(this._classImageEls[i], this.className); - } - } - } -}; - -/** - * Finds all elements in the Dom with the class name specified in the group. Removes the class from the element in order to let the style definitions trigger the image fetching - * @method _fetchByClass - * @private - */ -YAHOO.util.ImageLoader.group.prototype._fetchByClass = function() { - if (! this.className) { - return; - } - - YAHOO.log('Fetching all images with class "' + this.className + '" in group "' + this.name + '".', 'info', 'imageloader'); - // this._classImageEls may have been set during _foldCheck - if (this._classImageEls === null) { - this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className); - } - YAHOO.util.Dom.removeClass(this._classImageEls, this.className); -}; - - -/** - * Base class for image objects to be registered with the groups - * @class YAHOO.util.ImageLoader.imgObj - * @constructor - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - */ -YAHOO.util.ImageLoader.imgObj = function(domId, url) { - /** - * HTML DOM id of the image element - * @property domId - * @type String - */ - this.domId = domId; - - /** - * URL for the image - * @property url - * @type String - */ - this.url = url; - - /** - * Pixel width of the image. Will be set as a "width" attribute after the image is fetched. - * Detaults to the natural width of the image. - * Only appropriate with src images - * @property width - * @type Int - */ - this.width = null; - - /** - * Pixel height of the image. Will be set as a "height" attribute after the image is fetched. - * Detaults to the natural height of the image. - * Only appropriate with src images - * @property height - * @type Int - */ - this.height = null; - - /** - * Whether the style.visibility should be set to "visible" after the image is fetched. - * Used when setting src images as visibility:hidden prior to image fetching - * @property setVisible - * @type Boolean - */ - this.setVisible = false; - - /** - * Whether the image has already been fetched. In the case of a foldCondional group, keeps track for when the trigger is fired so images aren't fetched twice - * @property _fetched - * @type Boolean - * @private - */ - this._fetched = false; -}; - -/** - * Displays the image; puts the URL into the DOM - * @method fetch - */ -YAHOO.util.ImageLoader.imgObj.prototype.fetch = function() { - if (this._fetched) { - return; - } - var el = document.getElementById(this.domId); - if (! el) { - return; - } - YAHOO.log('Fetching image with id "' + this.domId + '".', 'info', 'imageloader'); - this._applyUrl(el); - - if (this.setVisible) { - el.style.visibility = 'visible'; - } - if (this.width) { - el.width = this.width; - } - if (this.height) { - el.height = this.height; - } - this._fetched = true; -}; - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Must be overridden by child class - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.imgObj.prototype._applyUrl = function(el) { -}; - -/** - * Background image object. A background image is one whose URL is specified by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.bgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - */ -YAHOO.util.ImageLoader.bgImgObj = function(domId, url) { - YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url); -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) { - el.style.backgroundImage = "url('" + this.url + "')"; -}; - -/** - * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element - * @class YAHOO.util.ImageLoader.srcImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Int} width pixel width of the image - defaults to image's natural size - * @param {Int} height pixel height of the image - defaults to image's natural size - */ -YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) { - YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url); - this.width = width; - this.height = height; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets src - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) { - el.src = this.url; -}; - -/** - * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.pngBgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Object} ailProps The AlphaImageLoader properties to be set for the image - * Valid properties are 'sizingMethod' and 'enabled' - */ -YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) { - YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url); - - /** - * AlphaImageLoader properties to be set for the image. - * Valid properties are "sizingMethod" and "enabled". - * @property props - * @type Object - */ - this.props = ailProps || {}; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) { - if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) { - var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod; - var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled; - el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")'; - } - else { - el.style.backgroundImage = "url('" + this.url + "')"; - } -}; -YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-min.js deleted file mode 100644 index 5166b074fc..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/imageloader/imageloader-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -if(typeof(YAHOO.util.ImageLoader)=="undefined"){YAHOO.util.ImageLoader={};}YAHOO.util.ImageLoader.group=function(A,B,C){this.name="unnamed";this._imgObjs={};this.timeoutLen=C;this._timeout=null;this._triggers=[];this._customTriggers=[];this.foldConditional=false;this.className=null;this._classImageEls=null;YAHOO.util.Event.addListener(window,"load",this._onloadTasks,this,true);this.addTrigger(A,B);};YAHOO.util.ImageLoader.group.prototype.addTrigger=function(B,C){if(!B||!C){return;}var A=function(){this.fetch();};this._triggers.push([B,C,A]);YAHOO.util.Event.addListener(B,C,A,this,true);};YAHOO.util.ImageLoader.group.prototype.addCustomTrigger=function(B){if(!B||!B instanceof YAHOO.util.CustomEvent){return;}var A=function(){this.fetch();};this._customTriggers.push([B,A]);B.subscribe(A,this,true);};YAHOO.util.ImageLoader.group.prototype._onloadTasks=function(){if(this.timeoutLen&&typeof(this.timeoutLen)=="number"&&this.timeoutLen>0){this._timeout=setTimeout(this._getFetchTimeout(),this.timeoutLen*1000);}if(this.foldConditional){this._foldCheck();}};YAHOO.util.ImageLoader.group.prototype._getFetchTimeout=function(){var A=this;return function(){A.fetch();};};YAHOO.util.ImageLoader.group.prototype.registerBgImage=function(B,A){this._imgObjs[B]=new YAHOO.util.ImageLoader.bgImgObj(B,A);return this._imgObjs[B];};YAHOO.util.ImageLoader.group.prototype.registerSrcImage=function(D,B,C,A){this._imgObjs[D]=new YAHOO.util.ImageLoader.srcImgObj(D,B,C,A);return this._imgObjs[D];};YAHOO.util.ImageLoader.group.prototype.registerPngBgImage=function(C,B,A){this._imgObjs[C]=new YAHOO.util.ImageLoader.pngBgImgObj(C,B,A);return this._imgObjs[C];};YAHOO.util.ImageLoader.group.prototype.fetch=function(){clearTimeout(this._timeout);for(var B=0,A=this._triggers.length;B 0) { - this._timeout = setTimeout(this._getFetchTimeout(), this.timeoutLen * 1000); - } - - if (this.foldConditional) { - this._foldCheck(); - } -}; - -/** - * Returns the group's fetch method, with the proper closure, for use with setTimeout - * @method _getFetchTimeout - * @return {Function} group's fetch method - * @private - */ -YAHOO.util.ImageLoader.group.prototype._getFetchTimeout = function() { - var self = this; - return function() { self.fetch(); }; -}; - -/** - * Registers a background image with the group - * @method registerBgImage - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @return {Object} bgImgObj that was registered, for modifying any attributes in the object - */ -YAHOO.util.ImageLoader.group.prototype.registerBgImage = function(domId, url) { - this._imgObjs[domId] = new YAHOO.util.ImageLoader.bgImgObj(domId, url); - return this._imgObjs[domId]; -}; -/** - * Registers a src image with the group - * @method registerSrcImage - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Int} width pixel width of the image - defaults to image's natural size - * @param {Int} height pixel height of the image - defaults to image's natural size - * @return {Object} srcImgObj that was registered, for modifying any attributes in the object - */ -YAHOO.util.ImageLoader.group.prototype.registerSrcImage = function(domId, url, width, height) { - this._imgObjs[domId] = new YAHOO.util.ImageLoader.srcImgObj(domId, url, width, height); - return this._imgObjs[domId]; -}; -/** - * Registers an alpha-channel-type png background image with the group - * @method registerPngBgImage - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Object} ailProps The AlphaImageLoader properties to be set for the image - * Valid properties are 'sizingMethod' and 'enabled' - * @return {Object} pngBgImgObj that was registered, for modifying any attributes in the object - */ -YAHOO.util.ImageLoader.group.prototype.registerPngBgImage = function(domId, url, ailProps) { - this._imgObjs[domId] = new YAHOO.util.ImageLoader.pngBgImgObj(domId, url, ailProps); - return this._imgObjs[domId]; -}; - -/** - * Displays the images in the group - * @method fetch - */ -YAHOO.util.ImageLoader.group.prototype.fetch = function() { - - clearTimeout(this._timeout); - // remove all listeners - for (var i=0, len = this._triggers.length; i < len; i++) { - YAHOO.util.Event.removeListener(this._triggers[i][0], this._triggers[i][1], this._triggers[i][2]); - } - // remove custom event subscriptions - for (var i=0, len = this._customTriggers.length; i < len; i++) { - this._customTriggers[i][0].unsubscribe(this._customTriggers[i][1], this); - } - - // fetch whatever we need to by className - this._fetchByClass(); - - // fetch registered images - for (var id in this._imgObjs) { - if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) { - this._imgObjs[id].fetch(); - } - } -}; - -/** - * Checks the position of each image in the group. If any part of the image is within the client viewport, shows the image immediately. - * @method _foldCheck - * @private - */ -YAHOO.util.ImageLoader.group.prototype._foldCheck = function() { - var scrollTop = (document.compatMode != 'CSS1Compat') ? document.body.scrollTop : document.documentElement.scrollTop; - var viewHeight = YAHOO.util.Dom.getViewportHeight(); - var hLimit = scrollTop + viewHeight; - var scrollLeft = (document.compatMode != 'CSS1Compat') ? document.body.scrollLeft : document.documentElement.scrollLeft; - var viewWidth = YAHOO.util.Dom.getViewportWidth(); - var wLimit = scrollLeft + viewWidth; - for (var id in this._imgObjs) { - if (YAHOO.lang.hasOwnProperty(this._imgObjs, id)) { - var elPos = YAHOO.util.Dom.getXY(this._imgObjs[id].domId); - if (elPos[1] < hLimit && elPos[0] < wLimit) { - this._imgObjs[id].fetch(); - } - } - } - // and by class - if (this.className) { - this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className); - for (var i=0, len = this._classImageEls.length; i < len; i++) { - var elPos = YAHOO.util.Dom.getXY(this._classImageEls[i]); - if (elPos[1] < hLimit && elPos[0] < wLimit) { - YAHOO.util.Dom.removeClass(this._classImageEls[i], this.className); - } - } - } -}; - -/** - * Finds all elements in the Dom with the class name specified in the group. Removes the class from the element in order to let the style definitions trigger the image fetching - * @method _fetchByClass - * @private - */ -YAHOO.util.ImageLoader.group.prototype._fetchByClass = function() { - if (! this.className) { - return; - } - - // this._classImageEls may have been set during _foldCheck - if (this._classImageEls === null) { - this._classImageEls = YAHOO.util.Dom.getElementsByClassName(this.className); - } - YAHOO.util.Dom.removeClass(this._classImageEls, this.className); -}; - - -/** - * Base class for image objects to be registered with the groups - * @class YAHOO.util.ImageLoader.imgObj - * @constructor - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - */ -YAHOO.util.ImageLoader.imgObj = function(domId, url) { - /** - * HTML DOM id of the image element - * @property domId - * @type String - */ - this.domId = domId; - - /** - * URL for the image - * @property url - * @type String - */ - this.url = url; - - /** - * Pixel width of the image. Will be set as a "width" attribute after the image is fetched. - * Detaults to the natural width of the image. - * Only appropriate with src images - * @property width - * @type Int - */ - this.width = null; - - /** - * Pixel height of the image. Will be set as a "height" attribute after the image is fetched. - * Detaults to the natural height of the image. - * Only appropriate with src images - * @property height - * @type Int - */ - this.height = null; - - /** - * Whether the style.visibility should be set to "visible" after the image is fetched. - * Used when setting src images as visibility:hidden prior to image fetching - * @property setVisible - * @type Boolean - */ - this.setVisible = false; - - /** - * Whether the image has already been fetched. In the case of a foldCondional group, keeps track for when the trigger is fired so images aren't fetched twice - * @property _fetched - * @type Boolean - * @private - */ - this._fetched = false; -}; - -/** - * Displays the image; puts the URL into the DOM - * @method fetch - */ -YAHOO.util.ImageLoader.imgObj.prototype.fetch = function() { - if (this._fetched) { - return; - } - var el = document.getElementById(this.domId); - if (! el) { - return; - } - this._applyUrl(el); - - if (this.setVisible) { - el.style.visibility = 'visible'; - } - if (this.width) { - el.width = this.width; - } - if (this.height) { - el.height = this.height; - } - this._fetched = true; -}; - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Must be overridden by child class - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.imgObj.prototype._applyUrl = function(el) { -}; - -/** - * Background image object. A background image is one whose URL is specified by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.bgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - */ -YAHOO.util.ImageLoader.bgImgObj = function(domId, url) { - YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url); -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) { - el.style.backgroundImage = "url('" + this.url + "')"; -}; - -/** - * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element - * @class YAHOO.util.ImageLoader.srcImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Int} width pixel width of the image - defaults to image's natural size - * @param {Int} height pixel height of the image - defaults to image's natural size - */ -YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) { - YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url); - this.width = width; - this.height = height; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets src - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) { - el.src = this.url; -}; - -/** - * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.pngBgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Object} ailProps The AlphaImageLoader properties to be set for the image - * Valid properties are 'sizingMethod' and 'enabled' - */ -YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) { - YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url); - - /** - * AlphaImageLoader properties to be set for the image. - * Valid properties are "sizingMethod" and "enabled". - * @property props - * @type Object - */ - this.props = ailProps || {}; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) { - if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) { - var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod; - var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled; - el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")'; - } - else { - el.style.backgroundImage = "url('" + this.url + "')"; - } -}; -YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); -Œ¾@,V"Ţѭ¡Á´¡ƒtion(el) { -}; - -/** - * Background image object. A background image is one whose URL is specified by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.bgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - */ -YAHOO.util.ImageLoader.bgImgObj = function(domId, url) { - YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url); -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) { - el.style.backgroundImage = "url('" + this.url + "')"; -}; - -/** - * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element - * @class YAHOO.util.ImageLoader.srcImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Int} width pixel width of the image - defaults to image's natural size - * @param {Int} height pixel height of the image - defaults to image's natural size - */ -YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) { - YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url); - this.width = width; - this.height = height; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets src - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) { - el.src = this.url; -}; - -/** - * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.pngBgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Object} ailProps The AlphaImageLoader properties to be set for the image - * Valid properties are 'sizingMethod' and 'enabled' - */ -YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) { - YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url); - - /** - * AlphaImageLoader properties to be set for the image. - * Valid properties are "sizingMethod" and "enabled". - * @property props - * @type Object - */ - this.props = ailProps || {}; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) { - if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) { - var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod; - var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled; - el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")'; - } - else { - el.style.backgroundImage = "url('" + this.url + "')"; - } -}; -YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); -7»Rê,drԕ’*îƒÐtion(el) { -}; - -/** - * Background image object. A background image is one whose URL is specified by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.bgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - */ -YAHOO.util.ImageLoader.bgImgObj = function(domId, url) { - YAHOO.util.ImageLoader.bgImgObj.superclass.constructor.call(this, domId, url); -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.bgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.bgImgObj.prototype._applyUrl = function(el) { - el.style.backgroundImage = "url('" + this.url + "')"; -}; - -/** - * Source image object. A source image is one whose URL is specified by a src attribute in the DOM element - * @class YAHOO.util.ImageLoader.srcImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Int} width pixel width of the image - defaults to image's natural size - * @param {Int} height pixel height of the image - defaults to image's natural size - */ -YAHOO.util.ImageLoader.srcImgObj = function(domId, url, width, height) { - YAHOO.util.ImageLoader.srcImgObj.superclass.constructor.call(this, domId, url); - this.width = width; - this.height = height; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.srcImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * Sets src - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.srcImgObj.prototype._applyUrl = function(el) { - el.src = this.url; -}; - -/** - * PNG background image object. A PNG background image is one whose URL is specified through AlphaImageLoader or by "background-image" in the element's style - * @class YAHOO.util.ImageLoader.pngBgImgObj - * @constructor - * @extends YAHOO.util.ImageLoader.imgObj - * @param {String} domId HTML DOM id of the image element - * @param {String} url URL for the image - * @param {Object} ailProps The AlphaImageLoader properties to be set for the image - * Valid properties are 'sizingMethod' and 'enabled' - */ -YAHOO.util.ImageLoader.pngBgImgObj = function(domId, url, ailProps) { - YAHOO.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this, domId, url); - - /** - * AlphaImageLoader properties to be set for the image. - * Valid properties are "sizingMethod" and "enabled". - * @property props - * @type Object - */ - this.props = ailProps || {}; -}; - -YAHOO.lang.extend(YAHOO.util.ImageLoader.pngBgImgObj, YAHOO.util.ImageLoader.imgObj); - -/** - * Inserts the image URL into the DOM so that the image is displayed. - * If the browser is determined to be IE6 (or older), sets the AlphaImageLoader src; otherwise sets style.backgroundImage - * @method _applyUrl - * @param {Object} el HTML DOM element - * @private - */ -YAHOO.util.ImageLoader.pngBgImgObj.prototype._applyUrl = function(el) { - if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) { - var sizingMethod = (YAHOO.lang.isUndefined(this.props.sizingMethod)) ? 'scale' : this.props.sizingMethod; - var enabled = (YAHOO.lang.isUndefined(this.props.enabled)) ? 'true' : this.props.enabled; - el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.url + '", sizingMethod="' + sizingMethod + '", enabled="' + enabled + '")'; - } - else { - el.style.backgroundImage = "url('" + this.url + "')"; - } -}; -YAHOO.register("imageloader", YAHOO.util.ImageLoader, {version: "2.8.0r4", build: "2449"}); - \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/layout-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/layout-core.css deleted file mode 100644 index 399303f967..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/layout-core.css +++ /dev/null @@ -1,158 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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; - /*overflow: hidden;*/ -} - -.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%; - /*overflow: hidden;*/ -} -.yui-layout div.yui-layout-bd { - position: absolute; - top: 0; - left: 0; - zoom: 1; - width: 100%; - /*overflow: hidden;*/ -} -.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; - /*overflow: hidden;*/ -} - -.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-layout .yui-layout-unit .yui-content { - overflow: hidden; -} -.yui-layout .yui-layout-unit .yui-layout-scroll { - overflow: auto; -} -*/ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout-skin.css deleted file mode 100644 index 696bfd9a2a..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout-skin.css +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* Remove the dotted border on the resize proxy */ -.yui-skin-sam .yui-layout .yui-resize-proxy { - border: none; - font-size: 0; - margin: 0; - padding: 0; -} -/* During resize, hide the handles */ -.yui-skin-sam .yui-layout .yui-resize-resizing .yui-resize-handle { - /*visibility: hidden;*/ - display: none; - zoom: 1; -} -/* Style the div inside the resize proxy */ -.yui-skin-sam .yui-layout .yui-resize-proxy div { - position: absolute; - border: 1px solid #808080; - background-color: #EDF5FF; -} -/* Set the color of the Active resize handle */ -.yui-skin-sam .yui-layout .yui-resize .yui-resize-handle-active { - zoom: 1; -} -/* Styles for the left handle */ -.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l { - width: 5px; - height: 100%; - top: 0; - left: 0; - zoom: 1; -} -/* Styles for the right handle */ -.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-r { - width: 5px; - top: 0; - right: 0; - height: 100%; - position: absolute; - zoom: 1; -} -/* Styles for the bottom handle */ -.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-b { - width: 100%; - bottom: 0; - left: 0; - height: 5px; -} -/* Styles for the top handle */ -.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-t { - width: 100%; - top: 0; - left: 0; - height: 5px; -} - -/* Left Collapse button */ -.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; -} -/* Left Collapsed Expand Button */ -.yui-skin-sam .yui-layout .yui-layout-clip-left .collapse { - background: transparent url(layout_sprite.png) no-repeat -20px -140px; - border: 1px solid #808080; -} -/* Right Collapse Button */ -.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; -} -/* Right Collapsed Expand Button */ -.yui-skin-sam .yui-layout .yui-layout-clip-right .collapse { - background: transparent url(layout_sprite.png) no-repeat -20px -120px; - border: 1px solid #808080; -} -/* Top Collapse Button */ -.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; -} -/* Top Collapsed Expand Button */ -.yui-skin-sam .yui-layout .yui-layout-clip-top .collapse { - background: transparent url(layout_sprite.png) no-repeat -20px -240px; - border: 1px solid #808080; -} -/* Bottom Collapse Button */ -.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; -} -/* Bottom Collapsed Expand Button */ -.yui-skin-sam .yui-layout .yui-layout-clip-bottom .collapse { - background: transparent url(layout_sprite.png) no-repeat -20px -180px; - border: 1px solid #808080; -} -/* Close Button */ -.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; -} - -/* Give the header a blue backgorund */ -.yui-skin-sam .yui-layout .yui-layout-hd { - background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1400px; - border: 1px solid #808080; -} -/* Set the background color */ -.yui-skin-sam .yui-layout { - background-color: #EDF5FF; -} -/* Style the text in the header */ -.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-hd h2 { - font-weight: bold; - color: #fff; - padding: 3px; - margin: 0; -} -/* Style the body */ -.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; -} -/* Add a border to the bottom of the body because there is no footer */ -.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-noft { - border-bottom: 1px solid #808080; -} -/* Add a border to the top of the body because there is no header */ -.yui-skin-sam .yui-layout .yui-layout-unit div.yui-layout-bd-nohd { - border-top: 1px solid #808080; -} - -/* Style the Clip */ -.yui-skin-sam .yui-layout .yui-layout-clip { - position: absolute; - height: 20px; - background-color: #EDF5FF; - display: none; - border: 1px solid #808080; -} -/* Style the footer */ -.yui-skin-sam .yui-layout div.yui-layout-ft { - border: 1px solid #808080; - border-top: none; - *border-top-width: 0; - background-color: #f2f2f2; -} - -/* Remove the color from the resize handle */ -.yui-skin-sam .yui-layout-unit .yui-resize-handle { - background-color: transparent; - zoom: 1; -} -/* Reposition the handles */ -.yui-skin-sam .yui-layout-unit .yui-resize-handle-r { - right: 0; - top: 0; - background-image: none; - zoom: 1; -} -.yui-skin-sam .yui-layout-unit .yui-resize-handle-l { - left: 0; - top: 0; - background-image: none; - zoom: 1; -} -.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; -} -/* Add the gripper */ -.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; - display: block; - background: transparent url(layout_sprite.png) no-repeat 0 -5px; -} -/* Add the gripper */ -.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; - zoom: 1; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout.css deleted file mode 100644 index e4d7143546..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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:0;}.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{display:none;zoom:1;}.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{zoom:1;}.yui-skin-sam .yui-layout .yui-resize-proxy .yui-layout-handle-l{width:5px;height:100%;top:0;left:0;zoom:1;}.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(../../../../assets/skins/sam/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;margin:0;}.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;zoom:1;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-r{right:0;top:0;background-image:none;zoom:1;}.yui-skin-sam .yui-layout-unit .yui-resize-handle-l{left:0;top:0;background-image:none;zoom:1;}.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:0;display:block;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;zoom:1;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout_sprite.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/assets/skins/sam/layout_sprite.png deleted file mode 100644 index d6fce3c7a5bec2e266531e2b921f6a3bc3572bcb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-debug.js deleted file mode 100644 index f916ee36fe..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-debug.js +++ /dev/null @@ -1,2305 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * @description

                    Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.

                    - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event - * @module layout - */ -(function() { - var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class Layout - * @extends YAHOO.util.Element - * @description

                    Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.

                    - * @param {String/HTMLElement} el The element to make contain a layout. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - var Layout = function(el, config) { - YAHOO.log('Creating the Layout Object', 'info', 'Layout'); - if (Lang.isObject(el) && !el.tagName) { - config = el; - el = null; - } - if (Lang.isString(el)) { - if (Dom.get(el)) { - el = Dom.get(el); - } - } - if (!el) { - el = document.body; - } - - var oConfig = { - element: el, - attributes: config || {} - }; - - Layout.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all layout instances - * @type Object - */ - Layout._instances = {}; - /** - * @static - * @method getLayoutById - * @description Get's a layout object by the HTML id of the element associated with the Layout object. - * @return {Object} The Layout Object - */ - Layout.getLayoutById = function(id) { - if (Layout._instances[id]) { - return Layout._instances[id]; - } - return false; - }; - - YAHOO.extend(Layout, YAHOO.util.Element, { - /** - * @property browser - * @description A modified version of the YAHOO.env.ua object - * @type Object - */ - browser: function() { - var b = YAHOO.env.ua; - b.standardsMode = false; - b.secure = false; - return b; - }(), - /** - * @private - * @property _units - * @description An object literal that contains a list of units in the layout - * @type Object - */ - _units: null, - /** - * @private - * @property _rendered - * @description Set to true when the layout is rendered - * @type Boolean - */ - _rendered: null, - /** - * @private - * @property _zIndex - * @description The zIndex to set all LayoutUnits to - * @type Number - */ - _zIndex: null, - /** - * @private - * @property _sizes - * @description A collection of the current sizes of all usable LayoutUnits to be used for calculations - * @type Object - */ - _sizes: null, - /** - * @private - * @method _setBodySize - * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units) - * @description Used to set the body size of the layout, sets the height and width of the parent container - */ - _setBodySize: function(set) { - var h = 0, w = 0; - set = ((set === false) ? false : true); - - if (this._isBody) { - h = Dom.getClientHeight(); - w = Dom.getClientWidth(); - } else { - h = parseInt(this.getStyle('height'), 10); - w = parseInt(this.getStyle('width'), 10); - if (isNaN(w)) { - w = this.get('element').clientWidth; - } - if (isNaN(h)) { - h = this.get('element').clientHeight; - } - } - if (this.get('minWidth')) { - if (w < this.get('minWidth')) { - w = this.get('minWidth'); - } - } - if (this.get('minHeight')) { - if (h < this.get('minHeight')) { - h = this.get('minHeight'); - } - } - if (set) { - if (h < 0) { - h = 0; - } - if (w < 0) { - w = 0; - } - Dom.setStyle(this._doc, 'height', h + 'px'); - Dom.setStyle(this._doc, 'width', w + 'px'); - } - this._sizes.doc = { h: h, w: w }; - YAHOO.log('Setting Body height and width: (' + h + ',' + w + ')', 'info', 'Layout'); - this._setSides(set); - }, - /** - * @private - * @method _setSides - * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units) - * @description Used to set the size and position of the left, right, top and bottom units - */ - _setSides: function(set) { - YAHOO.log('Setting side units', 'info', 'Layout'); - var h1 = ((this._units.top) ? this._units.top.get('height') : 0), - h2 = ((this._units.bottom) ? this._units.bottom.get('height') : 0), - h = this._sizes.doc.h, - w = this._sizes.doc.w; - set = ((set === false) ? false : true); - - this._sizes.top = { - h: h1, w: ((this._units.top) ? w : 0), - t: 0 - }; - this._sizes.bottom = { - h: h2, w: ((this._units.bottom) ? w : 0) - }; - - var newH = (h - (h1 + h2)); - - this._sizes.left = { - h: newH, w: ((this._units.left) ? this._units.left.get('width') : 0) - }; - this._sizes.right = { - h: newH, w: ((this._units.right) ? this._units.right.get('width') : 0), - l: ((this._units.right) ? (w - this._units.right.get('width')) : 0), - t: ((this._units.top) ? this._sizes.top.h : 0) - }; - - if (this._units.right && set) { - this._units.right.set('top', this._sizes.right.t); - if (!this._units.right._collapsing) { - this._units.right.set('left', this._sizes.right.l); - } - this._units.right.set('height', this._sizes.right.h, true); - } - if (this._units.left) { - this._sizes.left.l = 0; - if (this._units.top) { - this._sizes.left.t = this._sizes.top.h; - } else { - this._sizes.left.t = 0; - } - if (set) { - this._units.left.set('top', this._sizes.left.t); - this._units.left.set('height', this._sizes.left.h, true); - this._units.left.set('left', 0); - } - } - if (this._units.bottom) { - this._sizes.bottom.t = this._sizes.top.h + this._sizes.left.h; - if (set) { - this._units.bottom.set('top', this._sizes.bottom.t); - this._units.bottom.set('width', this._sizes.bottom.w, true); - } - } - if (this._units.top) { - if (set) { - this._units.top.set('width', this._sizes.top.w, true); - } - } - YAHOO.log('Setting sizes: (' + Lang.dump(this._sizes) + ')', 'info', 'Layout'); - this._setCenter(set); - }, - /** - * @private - * @method _setCenter - * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units) - * @description Used to set the size and position of the center unit - */ - _setCenter: function(set) { - set = ((set === false) ? false : true); - var h = this._sizes.left.h; - var w = (this._sizes.doc.w - (this._sizes.left.w + this._sizes.right.w)); - if (set) { - this._units.center.set('height', h, true); - this._units.center.set('width', w, true); - this._units.center.set('top', this._sizes.top.h); - this._units.center.set('left', this._sizes.left.w); - } - this._sizes.center = { h: h, w: w, t: this._sizes.top.h, l: this._sizes.left.w }; - YAHOO.log('Setting Center size to: (' + h + ', ' + w + ')', 'info', 'Layout'); - }, - /** - * @method getSizes - * @description Get a reference to the internal Layout Unit sizes object used to build the layout wireframe - * @return {Object} An object of the layout unit sizes - */ - getSizes: function() { - return this._sizes; - }, - /** - * @method getUnitById - * @param {String} id The HTML element id of the unit - * @description Get the LayoutUnit by it's HTML id - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - getUnitById: function(id) { - return YAHOO.widget.LayoutUnit.getLayoutUnitById(id); - }, - /** - * @method getUnitByPosition - * @param {String} pos The position of the unit in this layout - * @description Get the LayoutUnit by it's position in this layout - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - getUnitByPosition: function(pos) { - if (pos) { - pos = pos.toLowerCase(); - if (this._units[pos]) { - return this._units[pos]; - } - return false; - } - return false; - }, - /** - * @method removeUnit - * @param {Object} unit The LayoutUnit that you want to remove - * @description Remove the unit from this layout and resize the layout. - */ - removeUnit: function(unit) { - delete this._units[unit.get('position')]; - this.resize(); - }, - /** - * @method addUnit - * @param {Object} cfg The config for the LayoutUnit that you want to add - * @description Add a unit to this layout and if the layout is rendered, resize the layout. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - addUnit: function(cfg) { - if (!cfg.position) { - YAHOO.log('No position property passed', 'error', 'Layout'); - return false; - } - if (this._units[cfg.position]) { - YAHOO.log('Position already exists', 'error', 'Layout'); - return false; - } - YAHOO.log('Adding Unit at position: ' + cfg.position, 'info', 'Layout'); - var element = null, - el = null; - - if (cfg.id) { - if (Dom.get(cfg.id)) { - element = Dom.get(cfg.id); - delete cfg.id; - - } - } - if (cfg.element) { - element = cfg.element; - } - - if (!el) { - el = document.createElement('div'); - var id = Dom.generateId(); - el.id = id; - } - - if (!element) { - element = document.createElement('div'); - } - Dom.addClass(element, 'yui-layout-wrap'); - if (this.browser.ie && !this.browser.standardsMode) { - el.style.zoom = 1; - element.style.zoom = 1; - } - - if (el.firstChild) { - el.insertBefore(element, el.firstChild); - } else { - el.appendChild(element); - } - this._doc.appendChild(el); - - var h = false, w = false; - - if (cfg.height) { - h = parseInt(cfg.height, 10); - } - if (cfg.width) { - w = parseInt(cfg.width, 10); - } - var unitConfig = {}; - YAHOO.lang.augmentObject(unitConfig, cfg); // break obj ref - - unitConfig.parent = this; - unitConfig.wrap = element; - unitConfig.height = h; - unitConfig.width = w; - - var unit = new YAHOO.widget.LayoutUnit(el, unitConfig); - - unit.on('heightChange', this.resize, { unit: unit }, this); - unit.on('widthChange', this.resize, { unit: unit }, this); - unit.on('gutterChange', this.resize, { unit: unit }, this); - this._units[cfg.position] = unit; - - if (this._rendered) { - this.resize(); - } - - return unit; - }, - /** - * @private - * @method _createUnits - * @description Private method to create units from the config that was passed in. - */ - _createUnits: function() { - var units = this.get('units'); - for (var i in units) { - if (Lang.hasOwnProperty(units, i)) { - this.addUnit(units[i]); - } - } - }, - /** - * @method resize - * @param Boolean/Event set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units). This can also have an attribute event passed to it. - * @description Starts the chain of resize routines that will resize all the units. - * @return {YAHOO.widget.Layout} The Layout instance - */ - resize: function(set, info) { - /* - * Fixes bug #2528175 - * If the event comes from an attribute and the value hasn't changed, don't process it. - */ - var ev = set; - if (ev && ev.prevValue && ev.newValue) { - if (ev.prevValue == ev.newValue) { - if (info) { - if (info.unit) { - if (!info.unit.get('animate')) { - set = false; - } - } - } - } - } - set = ((set === false) ? false : true); - if (set) { - var retVal = this.fireEvent('beforeResize'); - if (retVal === false) { - set = false; - } - if (this.browser.ie) { - if (this._isBody) { - Dom.removeClass(document.documentElement, 'yui-layout'); - Dom.addClass(document.documentElement, 'yui-layout'); - } else { - this.removeClass('yui-layout'); - this.addClass('yui-layout'); - } - } - } - this._setBodySize(set); - if (set) { - this.fireEvent('resize', { target: this, sizes: this._sizes, event: ev }); - } - return this; - }, - /** - * @private - * @method _setupBodyElements - * @description Sets up the main doc element when using the body as the main element. - */ - _setupBodyElements: function() { - this._doc = Dom.get('layout-doc'); - if (!this._doc) { - this._doc = document.createElement('div'); - this._doc.id = 'layout-doc'; - if (document.body.firstChild) { - document.body.insertBefore(this._doc, document.body.firstChild); - } else { - document.body.appendChild(this._doc); - } - } - this._createUnits(); - this._setBodySize(); - Event.on(window, 'resize', this.resize, this, true); - Dom.addClass(this._doc, 'yui-layout-doc'); - }, - /** - * @private - * @method _setupElements - * @description Sets up the main doc element when not using the body as the main element. - */ - _setupElements: function() { - this._doc = this.getElementsByClassName('yui-layout-doc')[0]; - if (!this._doc) { - this._doc = document.createElement('div'); - this.get('element').appendChild(this._doc); - } - this._createUnits(); - this._setBodySize(); - Dom.addClass(this._doc, 'yui-layout-doc'); - }, - /** - * @private - * @property _isBody - * @description Flag to determine if we are using the body as the root element. - * @type Boolean - */ - _isBody: null, - /** - * @private - * @property _doc - * @description Reference to the root element - * @type HTMLElement - */ - _doc: null, - /** - * @private - * @method init - * @description The Layout class' initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.log('init', 'info', 'Layout'); - - this._zIndex = 0; - - Layout.superclass.init.call(this, p_oElement, p_oAttributes); - - if (this.get('parent')) { - this._zIndex = this.get('parent')._zIndex + 10; - } - - this._sizes = {}; - this._units = {}; - - var id = p_oElement; - if (!Lang.isString(id)) { - id = Dom.generateId(id); - } - Layout._instances[id] = this; - }, - /** - * @method render - * @description This method starts the render process, applying classnames and creating elements - * @return {YAHOO.widget.Layout} The Layout instance - */ - render: function() { - YAHOO.log('Render', 'info', 'Layout'); - this._stamp(); - var el = this.get('element'); - if (el && el.tagName && (el.tagName.toLowerCase() == 'body')) { - this._isBody = true; - Dom.addClass(document.body, 'yui-layout'); - if (Dom.hasClass(document.body, 'yui-skin-sam')) { - //Move the class up so we can have a css chain - Dom.addClass(document.documentElement, 'yui-skin-sam'); - Dom.removeClass(document.body, 'yui-skin-sam'); - } - this._setupBodyElements(); - } else { - this._isBody = false; - this.addClass('yui-layout'); - this._setupElements(); - } - this.resize(); - this._rendered = true; - this.fireEvent('render'); - - return this; - }, - /** - * @private - * @method _stamp - * @description Stamps the root node with a secure classname for ease of use. Also sets the this.browser.standardsMode variable. - */ - _stamp: function() { - if (document.compatMode == 'CSS1Compat') { - this.browser.standardsMode = true; - } - if (window.location.href.toLowerCase().indexOf("https") === 0) { - Dom.addClass(document.documentElement, 'secure'); - this.browser.secure = true; - } - }, - /** - * @private - * @method initAttributes - * @description Processes the config - */ - initAttributes: function(attr) { - Layout.superclass.initAttributes.call(this, attr); - /** - * @attribute units - * @description An array of config definitions for the LayoutUnits to add to this layout - * @type Array - */ - this.setAttributeConfig('units', { - writeOnce: true, - validator: YAHOO.lang.isArray, - value: attr.units || [] - }); - - /** - * @attribute minHeight - * @description The minimum height in pixels - * @type Number - */ - this.setAttributeConfig('minHeight', { - value: attr.minHeight || false, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minWidth - * @description The minimum width in pixels - * @type Number - */ - this.setAttributeConfig('minWidth', { - value: attr.minWidth || false, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute height - * @description The height in pixels - * @type Number - */ - this.setAttributeConfig('height', { - value: attr.height || false, - validator: YAHOO.lang.isNumber, - method: function(h) { - if (h < 0) { - h = 0; - } - this.setStyle('height', h + 'px'); - } - }); - - /** - * @attribute width - * @description The width in pixels - * @type Number - */ - this.setAttributeConfig('width', { - value: attr.width || false, - validator: YAHOO.lang.isNumber, - method: function(w) { - if (w < 0) { - w = 0; - } - this.setStyle('width', w + 'px'); - } - }); - - /** - * @attribute parent - * @description If this layout is to be used as a child of another Layout instance, this config will bind the resize events together. - * @type Object YAHOO.widget.Layout - */ - this.setAttributeConfig('parent', { - writeOnce: true, - value: attr.parent || false, - method: function(p) { - if (p) { - p.on('resize', this.resize, this, true); - } - } - }); - }, - /** - * @method destroy - * @description Removes this layout from the page and destroys all units that it contains. This will destroy all data inside the layout and it's children. - */ - destroy: function() { - var par = this.get('parent'); - if (par) { - par.removeListener('resize', this.resize, this, true); - } - Event.removeListener(window, 'resize', this.resize, this, true); - - this.unsubscribeAll(); - for (var u in this._units) { - if (Lang.hasOwnProperty(this._units, u)) { - if (this._units[u]) { - this._units[u].destroy(true); - } - } - } - - Event.purgeElement(this.get('element')); - this.get('parentNode').removeChild(this.get('element')); - - delete YAHOO.widget.Layout._instances[this.get('id')]; - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - delete this[i]; - } - } - - if (par) { - par.resize(); - } - }, - /** - * @method toString - * @description Returns a string representing the Layout. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'Layout #' + this.get('id'); - } - return 'Layout'; - } - }); - /** - * @event resize - * @description Fired when this.resize is called - * @type YAHOO.util.CustomEvent - */ - /** - * @event startResize - * @description Fired when the Resize Utility for a Unit fires it's startResize Event. - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeResize - * @description Fires at the beginning of the resize method. If you return false, the resize is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event render - * @description Fired after the render method completes. - * @type YAHOO.util.CustomEvent - */ - - YAHOO.widget.Layout = Layout; -})(); -/** - * @description

                    Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.

                    - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, layout - * @optional animation, dragdrop, selector - */ -(function() { - var Dom = YAHOO.util.Dom, - Sel = YAHOO.util.Selector, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class LayoutUnit - * @extends YAHOO.util.Element - * @description

                    Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.

                    - * @param {String/HTMLElement} el The element to make a unit. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - var LayoutUnit = function(el, config) { - - var oConfig = { - element: el, - attributes: config || {} - }; - - LayoutUnit.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all layout unit instances - * @type Object - */ - LayoutUnit._instances = {}; - /** - * @static - * @method getLayoutUnitById - * @description Get's a layout unit object by the HTML id of the element associated with the Layout Unit object. - * @return {Object} The Layout Object - */ - LayoutUnit.getLayoutUnitById = function(id) { - if (LayoutUnit._instances[id]) { - return LayoutUnit._instances[id]; - } - return false; - }; - - YAHOO.extend(LayoutUnit, YAHOO.util.Element, { - /** - * @property STR_CLOSE - * @description String used for close button title - * @type {String} - */ - STR_CLOSE: 'Click to close this pane.', - /** - * @property STR_COLLAPSE - * @description String used for collapse button title - * @type {String} - */ - STR_COLLAPSE: 'Click to collapse this pane.', - /** - * @property STR_EXPAND - * @description String used for expand button title - * @type {String} - */ - STR_EXPAND: 'Click to expand this pane.', - /** - * The class name applied to dynamic tabs while loading. - * @property LOADING_CLASSNAME - * @type String - * @default "disabled" - */ - LOADING_CLASSNAME: 'loading', - /** - * @property browser - * @description A modified version of the YAHOO.env.ua object - * @type Object - */ - browser: null, - /** - * @private - * @property _sizes - * @description A collection of the current sizes of the contents of this Layout Unit - * @type Object - */ - _sizes: null, - /** - * @private - * @property _anim - * @description A reference to the Animation instance used by this LayouUnit - * @type YAHOO.util.Anim - */ - _anim: null, - /** - * @private - * @property _resize - * @description A reference to the Resize instance used by this LayoutUnit - * @type YAHOO.util.Resize - */ - _resize: null, - /** - * @private - * @property _clip - * @description A reference to the clip element used when collapsing the unit - * @type HTMLElement - */ - _clip: null, - /** - * @private - * @property _gutter - * @description A simple hash table used to store the gutter to apply to the Unit - * @type Object - */ - _gutter: null, - /** - * @property header - * @description A reference to the HTML element used for the Header - * @type HTMLELement - */ - header: null, - /** - * @property body - * @description A reference to the HTML element used for the body - * @type HTMLElement - */ - body: null, - /** - * @property footer - * @description A reference to the HTML element used for the footer - * @type HTMLElement - */ - footer: null, - /** - * @private - * @property _collapsed - * @description Flag to determine if the unit is collapsed or not. - * @type Boolean - */ - _collapsed: null, - /** - * @private - * @property _collapsing - * @description A flag set while the unit is being collapsed, used so we don't fire events while animating the size - * @type Boolean - */ - _collapsing: null, - /** - * @private - * @property _lastWidth - * @description A holder for the last known width of the unit - * @type Number - */ - _lastWidth: null, - /** - * @private - * @property _lastHeight - * @description A holder for the last known height of the unit - * @type Number - */ - _lastHeight: null, - /** - * @private - * @property _lastTop - * @description A holder for the last known top of the unit - * @type Number - */ - _lastTop: null, - /** - * @private - * @property _lastLeft - * @description A holder for the last known left of the unit - * @type Number - */ - _lastLeft: null, - /** - * @private - * @property _lastScroll - * @description A holder for the last known scroll state of the unit - * @type Boolean - */ - _lastScroll: null, - /** - * @private - * @property _lastCenetrScroll - * @description A holder for the last known scroll state of the center unit - * @type Boolean - */ - _lastCenterScroll: null, - /** - * @private - * @property _lastScrollTop - * @description A holder for the last known scrollTop state of the unit - * @type Number - */ - _lastScrollTop: null, - /** - * @method resize - * @description Resize either the unit or it's clipped state, also updating the box inside - * @param {Boolean} force This will force full calculations even when the unit is collapsed - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - resize: function(force) { - YAHOO.log('Resize', 'info', 'LayoutUnit'); - var retVal = this.fireEvent('beforeResize'); - if (retVal === false) { - return this; - } - if (!this._collapsing || (force === true)) { - var scroll = this.get('scroll'); - this.set('scroll', false); - - - var hd = this._getBoxSize(this.header), - ft = this._getBoxSize(this.footer), - box = [this.get('height'), this.get('width')]; - - var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom), - nw = box[1] - (this._gutter.left + this._gutter.right); - - var wrapH = (nh + (hd[0] + ft[0])), - wrapW = nw; - - if (this._collapsed && !this._collapsing) { - this._setHeight(this._clip, wrapH); - this._setWidth(this._clip, wrapW); - Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px'); - Dom.setStyle(this._clip, 'left', this.get('left') + this._gutter.left + 'px'); - } else if (!this._collapsed || (this._collapsed && this._collapsing)) { - wrapH = this._setHeight(this.get('wrap'), wrapH); - wrapW = this._setWidth(this.get('wrap'), wrapW); - this._sizes.wrap.h = wrapH; - this._sizes.wrap.w = wrapW; - - Dom.setStyle(this.get('wrap'), 'top', this._gutter.top + 'px'); - Dom.setStyle(this.get('wrap'), 'left', this._gutter.left + 'px'); - - this._sizes.header.w = this._setWidth(this.header, wrapW); - this._sizes.header.h = hd[0]; - - this._sizes.footer.w = this._setWidth(this.footer, wrapW); - this._sizes.footer.h = ft[0]; - - Dom.setStyle(this.footer, 'bottom', '0px'); - - this._sizes.body.h = this._setHeight(this.body, (wrapH - (hd[0] + ft[0]))); - this._sizes.body.w =this._setWidth(this.body, wrapW); - Dom.setStyle(this.body, 'top', hd[0] + 'px'); - - this.set('scroll', scroll); - this.fireEvent('resize'); - } - } - return this; - }, - /** - * @private - * @method _setWidth - * @description Sets the width of the element based on the border size of the element. - * @param {HTMLElement} el The HTMLElement to have it's width set - * @param {Number} w The width that you want it the element set to - * @return {Number} The new width, fixed for borders and IE QuirksMode - */ - _setWidth: function(el, w) { - if (el) { - var b = this._getBorderSizes(el); - w = (w - (b[1] + b[3])); - w = this._fixQuirks(el, w, 'w'); - if (w < 0) { - w = 0; - } - Dom.setStyle(el, 'width', w + 'px'); - } - return w; - }, - /** - * @private - * @method _setHeight - * @description Sets the height of the element based on the border size of the element. - * @param {HTMLElement} el The HTMLElement to have it's height set - * @param {Number} h The height that you want it the element set to - * @return {Number} The new height, fixed for borders and IE QuirksMode - */ - _setHeight: function(el, h) { - if (el) { - var b = this._getBorderSizes(el); - h = (h - (b[0] + b[2])); - h = this._fixQuirks(el, h, 'h'); - if (h < 0) { - h = 0; - } - Dom.setStyle(el, 'height', h + 'px'); - } - return h; - }, - /** - * @private - * @method _fixQuirks - * @description Fixes the box calculations for IE in QuirksMode - * @param {HTMLElement} el The HTMLElement to set the dimension on - * @param {Number} dim The number of the dimension to fix - * @param {String} side The dimension (h or w) to fix. Defaults to h - * @return {Number} The fixed dimension - */ - _fixQuirks: function(el, dim, side) { - var i1 = 0, i2 = 2; - if (side == 'w') { - i1 = 1; - i2 = 3; - } - if ((this.browser.ie < 8) && !this.browser.standardsMode) { - //Internet Explorer - Quirks Mode - var b = this._getBorderSizes(el), - bp = this._getBorderSizes(el.parentNode); - if ((b[i1] === 0) && (b[i2] === 0)) { //No Borders, check parent - if ((bp[i1] !== 0) && (bp[i2] !== 0)) { //Parent has Borders - dim = (dim - (bp[i1] + bp[i2])); - } - } else { - if ((bp[i1] === 0) && (bp[i2] === 0)) { - dim = (dim + (b[i1] + b[i2])); - } - } - } - return dim; - }, - /** - * @private - * @method _getBoxSize - * @description Get's the elements clientHeight and clientWidth plus the size of the borders - * @param {HTMLElement} el The HTMLElement to get the size of - * @return {Array} An array of height and width - */ - _getBoxSize: function(el) { - var size = [0, 0]; - if (el) { - if (this.browser.ie && !this.browser.standardsMode) { - el.style.zoom = 1; - } - var b = this._getBorderSizes(el); - size[0] = el.clientHeight + (b[0] + b[2]); - size[1] = el.clientWidth + (b[1] + b[3]); - } - return size; - }, - /** - * @private - * @method _getBorderSizes - * @description Get the CSS border size of the element passed. - * @param {HTMLElement} el The element to get the border size of - * @return {Array} An array of the top, right, bottom, left borders. - */ - _getBorderSizes: function(el) { - var s = []; - el = el || this.get('element'); - if (this.browser.ie && !this.browser.standardsMode) { - el.style.zoom = 1; - } - s[0] = parseInt(Dom.getStyle(el, 'borderTopWidth'), 10); - s[1] = parseInt(Dom.getStyle(el, 'borderRightWidth'), 10); - s[2] = parseInt(Dom.getStyle(el, 'borderBottomWidth'), 10); - s[3] = parseInt(Dom.getStyle(el, 'borderLeftWidth'), 10); - - //IE will return NaN on these if they are set to auto, we'll set them to 0 - for (var i = 0; i < s.length; i++) { - if (isNaN(s[i])) { - s[i] = 0; - } - } - return s; - }, - /** - * @private - * @method _createClip - * @description Create the clip element used when the Unit is collapsed - */ - _createClip: function() { - if (!this._clip) { - this._clip = document.createElement('div'); - this._clip.className = 'yui-layout-clip yui-layout-clip-' + this.get('position'); - this._clip.innerHTML = '
                    '; - var c = this._clip.firstChild; - c.title = this.STR_EXPAND; - Event.on(c, 'click', this.expand, this, true); - this.get('element').parentNode.appendChild(this._clip); - } - }, - /** - * @private - * @method _toggleClip - * @description Toggle th current state of the Clip element and set it's height, width and position - */ - _toggleClip: function() { - if (!this._collapsed) { - //show - var hd = this._getBoxSize(this.header), - ft = this._getBoxSize(this.footer), - box = [this.get('height'), this.get('width')]; - - - var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom), - nw = box[1] - (this._gutter.left + this._gutter.right), - wrapH = (nh + (hd[0] + ft[0])); - - switch (this.get('position')) { - case 'top': - case 'bottom': - this._setWidth(this._clip, nw); - this._setHeight(this._clip, this.get('collapseSize')); - Dom.setStyle(this._clip, 'left', (this._lastLeft + this._gutter.left) + 'px'); - if (this.get('position') == 'bottom') { - Dom.setStyle(this._clip, 'top', ((this._lastTop + this._lastHeight) - (this.get('collapseSize') - this._gutter.top)) + 'px'); - } else { - Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px'); - } - break; - case 'left': - case 'right': - this._setWidth(this._clip, this.get('collapseSize')); - this._setHeight(this._clip, wrapH); - Dom.setStyle(this._clip, 'top', (this.get('top') + this._gutter.top) + 'px'); - if (this.get('position') == 'right') { - Dom.setStyle(this._clip, 'left', (((this._lastLeft + this._lastWidth) - this.get('collapseSize')) - this._gutter.left) + 'px'); - } else { - Dom.setStyle(this._clip, 'left', (this.get('left') + this._gutter.left) + 'px'); - } - break; - } - - Dom.setStyle(this._clip, 'display', 'block'); - this.setStyle('display', 'none'); - } else { - //Hide - Dom.setStyle(this._clip, 'display', 'none'); - } - }, - /** - * @method getSizes - * @description Get a reference to the internal sizes object for this unit - * @return {Object} An object of the sizes used for calculations - */ - getSizes: function() { - return this._sizes; - }, - /** - * @method toggle - * @description Toggles the Unit, replacing it with a clipped version. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - toggle: function() { - if (this._collapsed) { - this.expand(); - } else { - this.collapse(); - } - return this; - }, - /** - * @method expand - * @description Expand the Unit if it is collapsed. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - expand: function() { - if (!this._collapsed) { - return this; - } - var retVal = this.fireEvent('beforeExpand'); - if (retVal === false) { - return this; - } - - this._collapsing = true; - this.setStyle('zIndex', this.get('parent')._zIndex + 1); - - if (this._anim) { - this.setStyle('display', 'none'); - var attr = {}, s; - - switch (this.get('position')) { - case 'left': - case 'right': - this.set('width', this._lastWidth, true); - this.setStyle('width', this._lastWidth + 'px'); - this.get('parent').resize(false); - s = this.get('parent').getSizes()[this.get('position')]; - this.set('height', s.h, true); - var left = s.l; - attr = { - left: { - to: left - } - }; - if (this.get('position') == 'left') { - attr.left.from = (left - s.w); - this.setStyle('left', (left - s.w) + 'px'); - } - break; - case 'top': - case 'bottom': - this.set('height', this._lastHeight, true); - this.setStyle('height', this._lastHeight + 'px'); - this.get('parent').resize(false); - s = this.get('parent').getSizes()[this.get('position')]; - this.set('width', s.w, true); - var top = s.t; - attr = { - top: { - to: top - } - }; - if (this.get('position') == 'top') { - this.setStyle('top', (top - s.h) + 'px'); - attr.top.from = (top - s.h); - } - break; - } - - this._anim.attributes = attr; - var exStart = function() { - this.setStyle('display', 'block'); - this.resize(true); - this._anim.onStart.unsubscribe(exStart, this, true); - }; - var expand = function() { - this._collapsing = false; - this.setStyle('zIndex', this.get('parent')._zIndex); - this.set('width', this._lastWidth); - this.set('height', this._lastHeight); - this._collapsed = false; - this.resize(); - this.set('scroll', this._lastScroll); - if (this._lastScrollTop > 0) { - this.body.scrollTop = this._lastScrollTop; - } - this._anim.onComplete.unsubscribe(expand, this, true); - this.fireEvent('expand'); - }; - this._anim.onStart.subscribe(exStart, this, true); - this._anim.onComplete.subscribe(expand, this, true); - this._anim.animate(); - this._toggleClip(); - } else { - this._collapsing = false; - this._toggleClip(); - this._collapsed = false; - this.setStyle('zIndex', this.get('parent')._zIndex); - this.setStyle('display', 'block'); - this.set('width', this._lastWidth); - this.set('height', this._lastHeight); - this.resize(); - this.set('scroll', this._lastScroll); - if (this._lastScrollTop > 0) { - this.body.scrollTop = this._lastScrollTop; - } - this.fireEvent('expand'); - } - return this; - }, - /** - * @method collapse - * @description Collapse the Unit if it is not collapsed. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - collapse: function() { - if (this._collapsed) { - return this; - } - var retValue = this.fireEvent('beforeCollapse'); - if (retValue === false) { - return this; - } - if (!this._clip) { - this._createClip(); - } - this._collapsing = true; - var w = this.get('width'), - h = this.get('height'), - attr = {}; - this._lastWidth = w; - this._lastHeight = h; - this._lastScroll = this.get('scroll'); - this._lastScrollTop = this.body.scrollTop; - this.set('scroll', false, true); - this._lastLeft = parseInt(this.get('element').style.left, 10); - this._lastTop = parseInt(this.get('element').style.top, 10); - if (isNaN(this._lastTop)) { - this._lastTop = 0; - this.set('top', 0); - } - if (isNaN(this._lastLeft)) { - this._lastLeft = 0; - this.set('left', 0); - } - this.setStyle('zIndex', this.get('parent')._zIndex + 1); - var pos = this.get('position'); - - switch (pos) { - case 'top': - case 'bottom': - this.set('height', (this.get('collapseSize') + (this._gutter.top + this._gutter.bottom))); - attr = { - top: { - to: (this.get('top') - h) - } - }; - if (pos == 'bottom') { - attr.top.to = (this.get('top') + h); - } - break; - case 'left': - case 'right': - this.set('width', (this.get('collapseSize') + (this._gutter.left + this._gutter.right))); - attr = { - left: { - to: -(this._lastWidth) - } - }; - if (pos == 'right') { - attr.left = { - to: (this.get('left') + w) - }; - } - break; - } - if (this._anim) { - this._anim.attributes = attr; - var collapse = function() { - this._collapsing = false; - this._toggleClip(); - this.setStyle('zIndex', this.get('parent')._zIndex); - this._collapsed = true; - this.get('parent').resize(); - this._anim.onComplete.unsubscribe(collapse, this, true); - this.fireEvent('collapse'); - }; - this._anim.onComplete.subscribe(collapse, this, true); - this._anim.animate(); - } else { - this._collapsing = false; - this.setStyle('display', 'none'); - this._toggleClip(); - this.setStyle('zIndex', this.get('parent')._zIndex); - this.get('parent').resize(); - this._collapsed = true; - this.fireEvent('collapse'); - } - return this; - }, - /** - * @method close - * @description Close the unit, removing it from the parent Layout. - * @return {YAHOO.widget.Layout} The parent Layout instance - */ - close: function() { - this.setStyle('display', 'none'); - this.get('parent').removeUnit(this); - this.fireEvent('close'); - if (this._clip) { - this._clip.parentNode.removeChild(this._clip); - this._clip = null; - } - return this.get('parent'); - }, - /** - * @property loadHandler - * @description Callback method for the YUI Connection Manager used for load the body using AJAX - * @type Object - */ - loadHandler: { - success: function(o) { - this.body.innerHTML = o.responseText; - this.resize (true); - }, - failure: function(o) { - } - }, - /** - * @property dataConnection - * @description YUI Connection Manager handler - * @type Object - */ - dataConnection: null, - /** - * @private - * @property _loading - * @description During the loading process this variable will be true - * @type Number - */ - _loading: false, - /** - * @method loadContent - * @description Loading the content of the unit using the connection manager - * @return {object} YUI Connection Manager handler - */ - loadContent: function() { - // load dynamic content unless already loading or loaded and caching - if (YAHOO.util.Connect && this.get('dataSrc') && !this._loading && !this.get('dataLoaded')) { - this._loading = true; - Dom.addClass(this.body, this.LOADING_CLASSNAME); - this.dataConnection = YAHOO.util.Connect.asyncRequest( - this.get('loadMethod'), - this.get('dataSrc'), - { - success: function(o) { - this.loadHandler.success.call(this, o); - this.set('dataLoaded', true); - this.dataConnection = null; - Dom.removeClass(this.body, this.LOADING_CLASSNAME); - this._loading = false; - this.fireEvent('load'); - }, - failure: function(o) { - this.loadHandler.failure.call(this, o); - this.dataConnection = null; - Dom.removeClass(this.body, this.LOADING_CLASSNAME); - this._loading = false; - this.fireEvent('loadError', { error: o }); - }, - scope: this, - timeout: this.get('dataTimeout') - } - ); - return this.dataConnection; - } - return false; - }, - /** - * @private - * @method init - * @description The initalization method inherited from Element. - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.log('init', 'info', 'LayoutUnit'); - this._gutter = { - left: 0, - right: 0, - top: 0, - bottom: 0 - }; - this._sizes = { - wrap: { - h: 0, - w: 0 - }, - header: { - h: 0, - w: 0 - }, - body: { - h: 0, - w: 0 - }, - footer: { - h: 0, - w: 0 - } - }; - - LayoutUnit.superclass.init.call(this, p_oElement, p_oAttributes); - - this.browser = this.get('parent').browser; - - var id = p_oElement; - if (!Lang.isString(id)) { - id = Dom.generateId(id); - } - LayoutUnit._instances[id] = this; - - this.setStyle('position', 'absolute'); - - this.addClass('yui-layout-unit'); - this.addClass('yui-layout-unit-' + this.get('position')); - - - var header = this.getElementsByClassName('yui-layout-hd', 'div')[0]; - if (header) { - this.header = header; - } - var body = this.getElementsByClassName('yui-layout-bd', 'div')[0]; - if (body) { - this.body = body; - } - var footer = this.getElementsByClassName('yui-layout-ft', 'div')[0]; - if (footer) { - this.footer = footer; - } - - this.on('contentChange', this.resize, this, true); - this._lastScrollTop = 0; - - this.set('animate', this.get('animate')); - }, - /** - * @private - * @method initAttributes - * @description Processes the config - */ - initAttributes: function(attr) { - LayoutUnit.superclass.initAttributes.call(this, attr); - - /** - * @private - * @attribute wrap - * @description A reference to the wrap element - * @type HTMLElement - */ - this.setAttributeConfig('wrap', { - value: attr.wrap || null, - method: function(w) { - if (w) { - var id = Dom.generateId(w); - LayoutUnit._instances[id] = this; - } - } - }); - /** - * @attribute grids - * @description Set this option to true if you want the LayoutUnit to fix the first layer of YUI CSS Grids (margins) - * @type Boolean - */ - this.setAttributeConfig('grids', { - value: attr.grids || false - }); - /** - * @private - * @attribute top - * @description The current top positioning of the Unit - * @type Number - */ - this.setAttributeConfig('top', { - value: attr.top || 0, - validator: Lang.isNumber, - method: function(t) { - if (!this._collapsing) { - this.setStyle('top', t + 'px'); - } - } - }); - /** - * @private - * @attribute left - * @description The current left position of the Unit - * @type Number - */ - this.setAttributeConfig('left', { - value: attr.left || 0, - validator: Lang.isNumber, - method: function(l) { - if (!this._collapsing) { - this.setStyle('left', l + 'px'); - } - } - }); - - /** - * @attribute minWidth - * @description The minWidth parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('minWidth', { - value: attr.minWidth || false, - method: function(v) { - if (this._resize) { - this._resize.set('minWidth', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxWidth - * @description The maxWidth parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('maxWidth', { - value: attr.maxWidth || false, - method: function(v) { - if (this._resize) { - this._resize.set('maxWidth', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minHeight - * @description The minHeight parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('minHeight', { - value: attr.minHeight || false, - method: function(v) { - if (this._resize) { - this._resize.set('minHeight', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxHeight - * @description The maxHeight parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('maxHeight', { - value: attr.maxHeight || false, - method: function(v) { - if (this._resize) { - this._resize.set('maxHeight', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute height - * @description The height of the Unit - * @type Number - */ - this.setAttributeConfig('height', { - value: attr.height, - validator: Lang.isNumber, - method: function(h) { - if (!this._collapsing) { - if (h < 0) { - h = 0; - } - this.setStyle('height', h + 'px'); - } - } - }); - - /** - * @attribute width - * @description The width of the Unit - * @type Number - */ - this.setAttributeConfig('width', { - value: attr.width, - validator: Lang.isNumber, - method: function(w) { - if (!this._collapsing) { - if (w < 0) { - w = 0; - } - this.setStyle('width', w + 'px'); - } - } - }); - /** - * @attribute zIndex - * @description The CSS zIndex to give to the unit, so you can have overlapping elements such as menus in a unit. - * @type {Number} - */ - this.setAttributeConfig('zIndex', { - value: attr.zIndex || false, - method: function(z) { - this.setStyle('zIndex', z); - } - }); - /** - * @attribute position - * @description The position (top, right, bottom, left or center) of the Unit in the Layout - * @type {String} - */ - this.setAttributeConfig('position', { - value: attr.position - }); - /** - * @attribute gutter - * @description The gutter that we should apply to the parent Layout around this Unit. Supports standard CSS markup: (2 4 0 5) or (2) or (2 5) - * @type String - */ - this.setAttributeConfig('gutter', { - value: attr.gutter || 0, - validator: YAHOO.lang.isString, - method: function(gutter) { - var p = gutter.split(' '); - if (p.length) { - this._gutter.top = parseInt(p[0], 10); - if (p[1]) { - this._gutter.right = parseInt(p[1], 10); - } else { - this._gutter.right = this._gutter.top; - } - if (p[2]) { - this._gutter.bottom = parseInt(p[2], 10); - } else { - this._gutter.bottom = this._gutter.top; - } - if (p[3]) { - this._gutter.left = parseInt(p[3], 10); - } else if (p[1]) { - this._gutter.left = this._gutter.right; - } else { - this._gutter.left = this._gutter.top; - } - } - } - }); - /** - * @attribute parent - * @description The parent Layout that we are assigned to - * @type {Object} YAHOO.widget.Layout - */ - this.setAttributeConfig('parent', { - writeOnce: true, - value: attr.parent || false, - method: function(p) { - if (p) { - p.on('resize', this.resize, this, true); - } - - } - }); - /** - * @attribute collapseSize - * @description The pixel size of the Clip that we will collapse to - * @type Number - */ - this.setAttributeConfig('collapseSize', { - value: attr.collapseSize || 25, - validator: YAHOO.lang.isNumber - }); - /** - * @attribute duration - * @description The duration to give the Animation Utility when animating the opening and closing of Units - */ - this.setAttributeConfig('duration', { - value: attr.duration || 0.5 - }); - /** - * @attribute easing - * @description The Animation Easing to apply to the Animation instance for this unit. - */ - this.setAttributeConfig('easing', { - value: attr.easing || ((YAHOO.util && YAHOO.util.Easing) ? YAHOO.util.Easing.BounceIn : 'false') - }); - /** - * @attribute animate - * @description Use animation to collapse/expand the unit - * @type Boolean - */ - this.setAttributeConfig('animate', { - value: ((attr.animate === false) ? false : true), - validator: function() { - var anim = false; - if (YAHOO.util.Anim) { - anim = true; - } - return anim; - }, - method: function(anim) { - if (anim) { - this._anim = new YAHOO.util.Anim(this.get('element'), {}, this.get('duration'), this.get('easing')); - } else { - this._anim = false; - } - } - }); - /** - * @attribute header - * @description The text to use as the Header of the Unit - */ - this.setAttributeConfig('header', { - value: attr.header || false, - method: function(txt) { - if (txt === false) { - //Remove the footer - if (this.header) { - Dom.addClass(this.body, 'yui-layout-bd-nohd'); - this.header.parentNode.removeChild(this.header); - this.header = null; - } - } else { - if (!this.header) { - var header = this.getElementsByClassName('yui-layout-hd', 'div')[0]; - if (!header) { - header = this._createHeader(); - } - this.header = header; - } - var h = this.header.getElementsByTagName('h2')[0]; - if (!h) { - h = document.createElement('h2'); - this.header.appendChild(h); - } - h.innerHTML = txt; - if (this.body) { - Dom.removeClass(this.body, 'yui-layout-bd-nohd'); - } - } - this.fireEvent('contentChange', { target: 'header' }); - } - }); - /** - * @attribute proxy - * @description Use the proxy config setting for the Resize Utility - * @type Boolean - */ - this.setAttributeConfig('proxy', { - writeOnce: true, - value: ((attr.proxy === false) ? false : true) - }); - /** - * @attribute body - * @description The content for the body. If we find an element in the page with an id that matches the passed option we will move that element into the body of this unit. - */ - this.setAttributeConfig('body', { - value: attr.body || false, - method: function(content) { - if (!this.body) { - var body = this.getElementsByClassName('yui-layout-bd', 'div')[0]; - if (body) { - this.body = body; - } else { - body = document.createElement('div'); - body.className = 'yui-layout-bd'; - this.body = body; - this.get('wrap').appendChild(body); - } - } - if (!this.header) { - Dom.addClass(this.body, 'yui-layout-bd-nohd'); - } - Dom.addClass(this.body, 'yui-layout-bd-noft'); - - - var el = null; - if (Lang.isString(content)) { - el = Dom.get(content); - } else if (content && content.tagName) { - el = content; - } - if (el) { - var id = Dom.generateId(el); - LayoutUnit._instances[id] = this; - this.body.appendChild(el); - } else { - this.body.innerHTML = content; - } - - this._cleanGrids(); - - this.fireEvent('contentChange', { target: 'body' }); - } - }); - - /** - * @attribute footer - * @description The content for the footer. If we find an element in the page with an id that matches the passed option we will move that element into the footer of this unit. - */ - this.setAttributeConfig('footer', { - value: attr.footer || false, - method: function(content) { - if (content === false) { - //Remove the footer - if (this.footer) { - Dom.addClass(this.body, 'yui-layout-bd-noft'); - this.footer.parentNode.removeChild(this.footer); - this.footer = null; - } - } else { - if (!this.footer) { - var ft = this.getElementsByClassName('yui-layout-ft', 'div')[0]; - if (!ft) { - ft = document.createElement('div'); - ft.className = 'yui-layout-ft'; - this.footer = ft; - this.get('wrap').appendChild(ft); - } else { - this.footer = ft; - } - } - var el = null; - if (Lang.isString(content)) { - el = Dom.get(content); - } else if (content && content.tagName) { - el = content; - } - if (el) { - this.footer.appendChild(el); - } else { - this.footer.innerHTML = content; - } - Dom.removeClass(this.body, 'yui-layout-bd-noft'); - } - this.fireEvent('contentChange', { target: 'footer' }); - } - }); - /** - * @attribute close - * @description Adds a close icon to the unit - */ - this.setAttributeConfig('close', { - value: attr.close || false, - method: function(close) { - //Position Center doesn't get this - if (this.get('position') == 'center') { - YAHOO.log('Position center unit cannot have close', 'error', 'LayoutUnit'); - return false; - } - if (!this.header && close) { - this._createHeader(); - } - var c = Dom.getElementsByClassName('close', 'div', this.header)[0]; - if (close) { - //Force some header text if there isn't any - if (!this.get('header')) { - this.set('header', ' '); - } - if (!c) { - c = document.createElement('div'); - c.className = 'close'; - this.header.appendChild(c); - Event.on(c, 'click', this.close, this, true); - } - c.title = this.STR_CLOSE; - } else if (c && c.parentNode) { - Event.purgeElement(c); - c.parentNode.removeChild(c); - } - this._configs.close.value = close; - this.set('collapse', this.get('collapse')); //Reset so we get the right classnames - } - }); - - /** - * @attribute collapse - * @description Adds a collapse icon to the unit - */ - this.setAttributeConfig('collapse', { - value: attr.collapse || false, - method: function(collapse) { - //Position Center doesn't get this - if (this.get('position') == 'center') { - YAHOO.log('Position center unit cannot have collapse', 'error', 'LayoutUnit'); - return false; - } - if (!this.header && collapse) { - this._createHeader(); - } - var c = Dom.getElementsByClassName('collapse', 'div', this.header)[0]; - if (collapse) { - //Force some header text if there isn't any - if (!this.get('header')) { - this.set('header', ' '); - } - if (!c) { - c = document.createElement('div'); - this.header.appendChild(c); - Event.on(c, 'click', this.collapse, this, true); - } - c.title = this.STR_COLLAPSE; - c.className = 'collapse' + ((this.get('close')) ? ' collapse-close' : ''); - } else if (c && c.parentNode) { - Event.purgeElement(c); - c.parentNode.removeChild(c); - } - } - }); - /** - * @attribute scroll - * @description Adds a class to the unit to allow for overflow: auto (yui-layout-scroll), default is overflow: hidden (yui-layout-noscroll). If true scroll bars will be placed on the element when the content exceeds the given area, false will put overflow hidden to hide the content. Passing null will render the content as usual overflow. - * @type Boolean/Null - */ - - this.setAttributeConfig('scroll', { - value: (((attr.scroll === true) || (attr.scroll === false) || (attr.scroll === null)) ? attr.scroll : false), - method: function(scroll) { - if ((scroll === false) && !this._collapsed) { //Removing scroll bar - if (this.body) { - if (this.body.scrollTop > 0) { - this._lastScrollTop = this.body.scrollTop; - } - } - } - - if (scroll === true) { - this.addClass('yui-layout-scroll'); - this.removeClass('yui-layout-noscroll'); - if (this._lastScrollTop > 0) { - if (this.body) { - this.body.scrollTop = this._lastScrollTop; - } - } - } else if (scroll === false) { - this.removeClass('yui-layout-scroll'); - this.addClass('yui-layout-noscroll'); - } else if (scroll === null) { - this.removeClass('yui-layout-scroll'); - this.removeClass('yui-layout-noscroll'); - } - } - }); - /** - * @attribute hover - * @description Config option to pass to the Resize Utility - */ - this.setAttributeConfig('hover', { - writeOnce: true, - value: attr.hover || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @attribute useShim - * @description Config option to pass to the Resize Utility - */ - this.setAttributeConfig('useShim', { - value: attr.useShim || false, - validator: YAHOO.lang.isBoolean, - method: function(u) { - if (this._resize) { - this._resize.set('useShim', u); - } - } - }); - /** - * @attribute resize - * @description Should a Resize instance be added to this unit - */ - - this.setAttributeConfig('resize', { - value: attr.resize || false, - validator: function(r) { - if (YAHOO.util && YAHOO.util.Resize) { - return true; - } - return false; - }, - method: function(resize) { - if (resize && !this._resize) { - //Position Center doesn't get this - if (this.get('position') == 'center') { - YAHOO.log('Position center unit cannot have resize', 'error', 'LayoutUnit'); - return false; - } - var handle = false; //To catch center - switch (this.get('position')) { - case 'top': - handle = 'b'; - break; - case 'bottom': - handle = 't'; - break; - case 'right': - handle = 'l'; - break; - case 'left': - handle = 'r'; - break; - } - - this.setStyle('position', 'absolute'); //Make sure Resize get's a position - - if (handle) { - this._resize = new YAHOO.util.Resize(this.get('element'), { - proxy: this.get('proxy'), - hover: this.get('hover'), - status: false, - autoRatio: false, - handles: [handle], - minWidth: this.get('minWidth'), - maxWidth: this.get('maxWidth'), - minHeight: this.get('minHeight'), - maxHeight: this.get('maxHeight'), - height: this.get('height'), - width: this.get('width'), - setSize: false, - useShim: this.get('useShim'), - wrap: false - }); - - this._resize._handles[handle].innerHTML = '
                    '; - - if (this.get('proxy')) { - var proxy = this._resize.getProxyEl(); - proxy.innerHTML = '
                    '; - } - this._resize.on('startResize', function(ev) { - this._lastScroll = this.get('scroll'); - this.set('scroll', false); - if (this.get('parent')) { - this.get('parent').fireEvent('startResize'); - var c = this.get('parent').getUnitByPosition('center'); - this._lastCenterScroll = c.get('scroll'); - c.addClass(this._resize.CSS_RESIZING); - c.set('scroll', false); - } - this.fireEvent('startResize'); - }, this, true); - this._resize.on('resize', function(ev) { - this.set('height', ev.height); - this.set('width', ev.width); - }, this, true); - this._resize.on('endResize', function(ev) { - this.set('scroll', this._lastScroll); - if (this.get('parent')) { - var c = this.get('parent').getUnitByPosition('center'); - c.set('scroll', this._lastCenterScroll); - c.removeClass(this._resize.CSS_RESIZING); - } - this.resize(); - this.fireEvent('endResize'); - }, this, true); - } - } else { - if (this._resize) { - this._resize.destroy(); - } - } - } - }); - /** - * The unit data source, used for loading content dynamically. - * @attribute dataSrc - * @type String - */ - this.setAttributeConfig('dataSrc', { - value: attr.dataSrc - }); - /** - * The method to use for the data request. - * @attribute loadMethod - * @type String - * @default "GET" - */ - this.setAttributeConfig('loadMethod', { - value: attr.loadMethod || 'GET', - validator: YAHOO.lang.isString - }); - /** - * Whether or not any data has been loaded from the server. - * @attribute dataLoaded - * @type Boolean - */ - this.setAttributeConfig('dataLoaded', { - value: false, - validator: YAHOO.lang.isBoolean, - writeOnce: true - }); - /** - * Number if milliseconds before aborting and calling failure handler. - * @attribute dataTimeout - * @type Number - * @default null - */ - this.setAttributeConfig('dataTimeout', { - value: attr.dataTimeout || null, - validator: YAHOO.lang.isNumber - }); - }, - /** - * @private - * @method _cleanGrids - * @description This method attempts to clean up the first level of the YUI CSS Grids, YAHOO.util.Selector is required for this operation. - */ - _cleanGrids: function() { - if (this.get('grids')) { - var b = Sel.query('div.yui-b', this.body, true); - if (b) { - Dom.removeClass(b, 'yui-b'); - } - Event.onAvailable('yui-main', function() { - Dom.setStyle(Sel.query('#yui-main'), 'margin-left', '0'); - Dom.setStyle(Sel.query('#yui-main'), 'margin-right', '0'); - }); - } - }, - /** - * @private - * @method _createHeader - * @description Creates the HTMLElement for the header - * @return {HTMLElement} The new HTMLElement - */ - _createHeader: function() { - var header = document.createElement('div'); - header.className = 'yui-layout-hd'; - if (this.get('firstChild')) { - this.get('wrap').insertBefore(header, this.get('wrap').firstChild); - } else { - this.get('wrap').appendChild(header); - } - this.header = header; - return header; - }, - /** - * @method destroy - * @param {Boolean} force Don't report to the parent, because we are being called from the parent. - * @description Removes this unit from the parent and cleans up after itself. - * @return {YAHOO.widget.Layout} The parent Layout instance - */ - destroy: function(force) { - if (this._resize) { - this._resize.destroy(); - } - var par = this.get('parent'); - - this.setStyle('display', 'none'); - if (this._clip) { - this._clip.parentNode.removeChild(this._clip); - this._clip = null; - } - - if (!force) { - par.removeUnit(this); - } - - if (par) { - par.removeListener('resize', this.resize, this, true); - } - this.unsubscribeAll(); - Event.purgeElement(this.get('element')); - this.get('parentNode').removeChild(this.get('element')); - - delete YAHOO.widget.LayoutUnit._instances[this.get('id')]; - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - delete this[i]; - } - } - - return par; - }, - /** - * @method toString - * @description Returns a string representing the LayoutUnit. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'LayoutUnit #' + this.get('id') + ' (' + this.get('position') + ')'; - } - return 'LayoutUnit'; - } - /** - * @event resize - * @description Fired when this.resize is called - * @type YAHOO.util.CustomEvent - */ - /** - * @event startResize - * @description Fired when the Resize Utility fires it's startResize Event. - * @type YAHOO.util.CustomEvent - */ - /** - * @event endResize - * @description Fired when the Resize Utility fires it's endResize Event. - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeResize - * @description Fired at the beginning of the resize method. If you return false, the resize is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event contentChange - * @description Fired when the content in the header, body or footer is changed via the API - * @type YAHOO.util.CustomEvent - */ - /** - * @event close - * @description Fired when the unit is closed - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeCollapse - * @description Fired before the unit is collapsed. If you return false, the collapse is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event collapse - * @description Fired when the unit is collapsed - * @type YAHOO.util.CustomEvent - */ - /** - * @event expand - * @description Fired when the unit is exanded - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeExpand - * @description Fired before the unit is exanded. If you return false, the collapse is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event load - * @description Fired when data is loaded via the dataSrc config. - * @type YAHOO.util.CustomEvent - */ - /** - * @event loadError - * @description Fired when an error occurs loading data via the dataSrc config. Error message is passed as argument to this event. - * @type YAHOO.util.CustomEvent - */ - }); - - YAHOO.widget.LayoutUnit = LayoutUnit; -})(); -YAHOO.register("layout", YAHOO.widget.Layout, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-min.js deleted file mode 100644 index 157d1d9fea..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout-min.js +++ /dev/null @@ -1,11 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var C=YAHOO.util.Dom,A=YAHOO.util.Event,D=YAHOO.lang;var B=function(F,E){if(D.isObject(F)&&!F.tagName){E=F;F=null;}if(D.isString(F)){if(C.get(F)){F=C.get(F);}}if(!F){F=document.body;}var G={element:F,attributes:E||{}};B.superclass.constructor.call(this,G.element,G.attributes);};B._instances={};B.getLayoutById=function(E){if(B._instances[E]){return B._instances[E];}return false;};YAHOO.extend(B,YAHOO.util.Element,{browser:function(){var E=YAHOO.env.ua;E.standardsMode=false;E.secure=false;return E;}(),_units:null,_rendered:null,_zIndex:null,_sizes:null,_setBodySize:function(G){var F=0,E=0;G=((G===false)?false:true);if(this._isBody){F=C.getClientHeight();E=C.getClientWidth();}else{F=parseInt(this.getStyle("height"),10);E=parseInt(this.getStyle("width"),10);if(isNaN(E)){E=this.get("element").clientWidth;}if(isNaN(F)){F=this.get("element").clientHeight;}}if(this.get("minWidth")){if(E0){this.body.scrollTop=this._lastScrollTop;}this._anim.onComplete.unsubscribe(G,this,true);this.fireEvent("expand");};this._anim.onStart.subscribe(I,this,true);this._anim.onComplete.subscribe(G,this,true);this._anim.animate();this._toggleClip();}else{this._collapsing=false;this._toggleClip();this._collapsed=false;this.setStyle("zIndex",this.get("parent")._zIndex);this.setStyle("display","block");this.set("width",this._lastWidth);this.set("height",this._lastHeight);this.resize();this.set("scroll",this._lastScroll);if(this._lastScrollTop>0){this.body.scrollTop=this._lastScrollTop;}this.fireEvent("expand");}return this;},collapse:function(){if(this._collapsed){return this;}var J=this.fireEvent("beforeCollapse");if(J===false){return this;}if(!this._clip){this._createClip();}this._collapsing=true;var G=this.get("width"),H=this.get("height"),F={};this._lastWidth=G;this._lastHeight=H;this._lastScroll=this.get("scroll");this._lastScrollTop=this.body.scrollTop;this.set("scroll",false,true);this._lastLeft=parseInt(this.get("element").style.left,10);this._lastTop=parseInt(this.get("element").style.top,10);if(isNaN(this._lastTop)){this._lastTop=0;this.set("top",0);}if(isNaN(this._lastLeft)){this._lastLeft=0;this.set("left",0);}this.setStyle("zIndex",this.get("parent")._zIndex+1);var K=this.get("position");switch(K){case"top":case"bottom":this.set("height",(this.get("collapseSize")+(this._gutter.top+this._gutter.bottom)));F={top:{to:(this.get("top")-H)}};if(K=="bottom"){F.top.to=(this.get("top")+H);}break;case"left":case"right":this.set("width",(this.get("collapseSize")+(this._gutter.left+this._gutter.right)));F={left:{to:-(this._lastWidth)}};if(K=="right"){F.left={to:(this.get("left")+G)};}break;}if(this._anim){this._anim.attributes=F;var I=function(){this._collapsing=false;this._toggleClip();this.setStyle("zIndex",this.get("parent")._zIndex);this._collapsed=true;this.get("parent").resize();this._anim.onComplete.unsubscribe(I,this,true);this.fireEvent("collapse");};this._anim.onComplete.subscribe(I,this,true);this._anim.animate();}else{this._collapsing=false;this.setStyle("display","none");this._toggleClip();this.setStyle("zIndex",this.get("parent")._zIndex);this.get("parent").resize();this._collapsed=true;this.fireEvent("collapse");}return this;},close:function(){this.setStyle("display","none");this.get("parent").removeUnit(this);this.fireEvent("close");if(this._clip){this._clip.parentNode.removeChild(this._clip);this._clip=null;}return this.get("parent");},loadHandler:{success:function(F){this.body.innerHTML=F.responseText;this.resize(true);},failure:function(F){}},dataConnection:null,_loading:false,loadContent:function(){if(YAHOO.util.Connect&&this.get("dataSrc")&&!this._loading&&!this.get("dataLoaded")){this._loading=true;D.addClass(this.body,this.LOADING_CLASSNAME);this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get("loadMethod"),this.get("dataSrc"),{success:function(F){this.loadHandler.success.call(this,F);this.set("dataLoaded",true);this.dataConnection=null;D.removeClass(this.body,this.LOADING_CLASSNAME);this._loading=false;this.fireEvent("load");},failure:function(F){this.loadHandler.failure.call(this,F);this.dataConnection=null;D.removeClass(this.body,this.LOADING_CLASSNAME);this._loading=false;this.fireEvent("loadError",{error:F});},scope:this,timeout:this.get("dataTimeout")});return this.dataConnection;}return false;},init:function(H,G){this._gutter={left:0,right:0,top:0,bottom:0};this._sizes={wrap:{h:0,w:0},header:{h:0,w:0},body:{h:0,w:0},footer:{h:0,w:0}};B.superclass.init.call(this,H,G);this.browser=this.get("parent").browser;var K=H;if(!E.isString(K)){K=D.generateId(K);}B._instances[K]=this;this.setStyle("position","absolute");this.addClass("yui-layout-unit");this.addClass("yui-layout-unit-"+this.get("position")); -var J=this.getElementsByClassName("yui-layout-hd","div")[0];if(J){this.header=J;}var F=this.getElementsByClassName("yui-layout-bd","div")[0];if(F){this.body=F;}var I=this.getElementsByClassName("yui-layout-ft","div")[0];if(I){this.footer=I;}this.on("contentChange",this.resize,this,true);this._lastScrollTop=0;this.set("animate",this.get("animate"));},initAttributes:function(F){B.superclass.initAttributes.call(this,F);this.setAttributeConfig("wrap",{value:F.wrap||null,method:function(G){if(G){var H=D.generateId(G);B._instances[H]=this;}}});this.setAttributeConfig("grids",{value:F.grids||false});this.setAttributeConfig("top",{value:F.top||0,validator:E.isNumber,method:function(G){if(!this._collapsing){this.setStyle("top",G+"px");}}});this.setAttributeConfig("left",{value:F.left||0,validator:E.isNumber,method:function(G){if(!this._collapsing){this.setStyle("left",G+"px");}}});this.setAttributeConfig("minWidth",{value:F.minWidth||false,method:function(G){if(this._resize){this._resize.set("minWidth",G);}},validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxWidth",{value:F.maxWidth||false,method:function(G){if(this._resize){this._resize.set("maxWidth",G);}},validator:YAHOO.lang.isNumber});this.setAttributeConfig("minHeight",{value:F.minHeight||false,method:function(G){if(this._resize){this._resize.set("minHeight",G);}},validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxHeight",{value:F.maxHeight||false,method:function(G){if(this._resize){this._resize.set("maxHeight",G);}},validator:YAHOO.lang.isNumber});this.setAttributeConfig("height",{value:F.height,validator:E.isNumber,method:function(G){if(!this._collapsing){if(G<0){G=0;}this.setStyle("height",G+"px");}}});this.setAttributeConfig("width",{value:F.width,validator:E.isNumber,method:function(G){if(!this._collapsing){if(G<0){G=0;}this.setStyle("width",G+"px");}}});this.setAttributeConfig("zIndex",{value:F.zIndex||false,method:function(G){this.setStyle("zIndex",G);}});this.setAttributeConfig("position",{value:F.position});this.setAttributeConfig("gutter",{value:F.gutter||0,validator:YAHOO.lang.isString,method:function(H){var G=H.split(" ");if(G.length){this._gutter.top=parseInt(G[0],10);if(G[1]){this._gutter.right=parseInt(G[1],10);}else{this._gutter.right=this._gutter.top;}if(G[2]){this._gutter.bottom=parseInt(G[2],10);}else{this._gutter.bottom=this._gutter.top;}if(G[3]){this._gutter.left=parseInt(G[3],10);}else{if(G[1]){this._gutter.left=this._gutter.right;}else{this._gutter.left=this._gutter.top;}}}}});this.setAttributeConfig("parent",{writeOnce:true,value:F.parent||false,method:function(G){if(G){G.on("resize",this.resize,this,true);}}});this.setAttributeConfig("collapseSize",{value:F.collapseSize||25,validator:YAHOO.lang.isNumber});this.setAttributeConfig("duration",{value:F.duration||0.5});this.setAttributeConfig("easing",{value:F.easing||((YAHOO.util&&YAHOO.util.Easing)?YAHOO.util.Easing.BounceIn:"false")});this.setAttributeConfig("animate",{value:((F.animate===false)?false:true),validator:function(){var G=false;if(YAHOO.util.Anim){G=true;}return G;},method:function(G){if(G){this._anim=new YAHOO.util.Anim(this.get("element"),{},this.get("duration"),this.get("easing"));}else{this._anim=false;}}});this.setAttributeConfig("header",{value:F.header||false,method:function(G){if(G===false){if(this.header){D.addClass(this.body,"yui-layout-bd-nohd");this.header.parentNode.removeChild(this.header);this.header=null;}}else{if(!this.header){var I=this.getElementsByClassName("yui-layout-hd","div")[0];if(!I){I=this._createHeader();}this.header=I;}var H=this.header.getElementsByTagName("h2")[0];if(!H){H=document.createElement("h2");this.header.appendChild(H);}H.innerHTML=G;if(this.body){D.removeClass(this.body,"yui-layout-bd-nohd");}}this.fireEvent("contentChange",{target:"header"});}});this.setAttributeConfig("proxy",{writeOnce:true,value:((F.proxy===false)?false:true)});this.setAttributeConfig("body",{value:F.body||false,method:function(I){if(!this.body){var G=this.getElementsByClassName("yui-layout-bd","div")[0];if(G){this.body=G;}else{G=document.createElement("div");G.className="yui-layout-bd";this.body=G;this.get("wrap").appendChild(G);}}if(!this.header){D.addClass(this.body,"yui-layout-bd-nohd");}D.addClass(this.body,"yui-layout-bd-noft");var H=null;if(E.isString(I)){H=D.get(I);}else{if(I&&I.tagName){H=I;}}if(H){var J=D.generateId(H);B._instances[J]=this;this.body.appendChild(H);}else{this.body.innerHTML=I;}this._cleanGrids();this.fireEvent("contentChange",{target:"body"});}});this.setAttributeConfig("footer",{value:F.footer||false,method:function(H){if(H===false){if(this.footer){D.addClass(this.body,"yui-layout-bd-noft");this.footer.parentNode.removeChild(this.footer);this.footer=null;}}else{if(!this.footer){var I=this.getElementsByClassName("yui-layout-ft","div")[0];if(!I){I=document.createElement("div");I.className="yui-layout-ft";this.footer=I;this.get("wrap").appendChild(I);}else{this.footer=I;}}var G=null;if(E.isString(H)){G=D.get(H);}else{if(H&&H.tagName){G=H;}}if(G){this.footer.appendChild(G);}else{this.footer.innerHTML=H;}D.removeClass(this.body,"yui-layout-bd-noft");}this.fireEvent("contentChange",{target:"footer"});}});this.setAttributeConfig("close",{value:F.close||false,method:function(G){if(this.get("position")=="center"){return false;}if(!this.header&&G){this._createHeader();}var H=D.getElementsByClassName("close","div",this.header)[0];if(G){if(!this.get("header")){this.set("header"," ");}if(!H){H=document.createElement("div");H.className="close";this.header.appendChild(H);A.on(H,"click",this.close,this,true);}H.title=this.STR_CLOSE;}else{if(H&&H.parentNode){A.purgeElement(H);H.parentNode.removeChild(H);}}this._configs.close.value=G;this.set("collapse",this.get("collapse"));}});this.setAttributeConfig("collapse",{value:F.collapse||false,method:function(G){if(this.get("position")=="center"){return false;}if(!this.header&&G){this._createHeader();}var H=D.getElementsByClassName("collapse","div",this.header)[0];if(G){if(!this.get("header")){this.set("header"," "); -}if(!H){H=document.createElement("div");this.header.appendChild(H);A.on(H,"click",this.collapse,this,true);}H.title=this.STR_COLLAPSE;H.className="collapse"+((this.get("close"))?" collapse-close":"");}else{if(H&&H.parentNode){A.purgeElement(H);H.parentNode.removeChild(H);}}}});this.setAttributeConfig("scroll",{value:(((F.scroll===true)||(F.scroll===false)||(F.scroll===null))?F.scroll:false),method:function(G){if((G===false)&&!this._collapsed){if(this.body){if(this.body.scrollTop>0){this._lastScrollTop=this.body.scrollTop;}}}if(G===true){this.addClass("yui-layout-scroll");this.removeClass("yui-layout-noscroll");if(this._lastScrollTop>0){if(this.body){this.body.scrollTop=this._lastScrollTop;}}}else{if(G===false){this.removeClass("yui-layout-scroll");this.addClass("yui-layout-noscroll");}else{if(G===null){this.removeClass("yui-layout-scroll");this.removeClass("yui-layout-noscroll");}}}}});this.setAttributeConfig("hover",{writeOnce:true,value:F.hover||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("useShim",{value:F.useShim||false,validator:YAHOO.lang.isBoolean,method:function(G){if(this._resize){this._resize.set("useShim",G);}}});this.setAttributeConfig("resize",{value:F.resize||false,validator:function(G){if(YAHOO.util&&YAHOO.util.Resize){return true;}return false;},method:function(G){if(G&&!this._resize){if(this.get("position")=="center"){return false;}var I=false;switch(this.get("position")){case"top":I="b";break;case"bottom":I="t";break;case"right":I="l";break;case"left":I="r";break;}this.setStyle("position","absolute");if(I){this._resize=new YAHOO.util.Resize(this.get("element"),{proxy:this.get("proxy"),hover:this.get("hover"),status:false,autoRatio:false,handles:[I],minWidth:this.get("minWidth"),maxWidth:this.get("maxWidth"),minHeight:this.get("minHeight"),maxHeight:this.get("maxHeight"),height:this.get("height"),width:this.get("width"),setSize:false,useShim:this.get("useShim"),wrap:false});this._resize._handles[I].innerHTML='
                    ';if(this.get("proxy")){var H=this._resize.getProxyEl();H.innerHTML='
                    ';}this._resize.on("startResize",function(J){this._lastScroll=this.get("scroll");this.set("scroll",false);if(this.get("parent")){this.get("parent").fireEvent("startResize");var K=this.get("parent").getUnitByPosition("center");this._lastCenterScroll=K.get("scroll");K.addClass(this._resize.CSS_RESIZING);K.set("scroll",false);}this.fireEvent("startResize");},this,true);this._resize.on("resize",function(J){this.set("height",J.height);this.set("width",J.width);},this,true);this._resize.on("endResize",function(J){this.set("scroll",this._lastScroll);if(this.get("parent")){var K=this.get("parent").getUnitByPosition("center");K.set("scroll",this._lastCenterScroll);K.removeClass(this._resize.CSS_RESIZING);}this.resize();this.fireEvent("endResize");},this,true);}}else{if(this._resize){this._resize.destroy();}}}});this.setAttributeConfig("dataSrc",{value:F.dataSrc});this.setAttributeConfig("loadMethod",{value:F.loadMethod||"GET",validator:YAHOO.lang.isString});this.setAttributeConfig("dataLoaded",{value:false,validator:YAHOO.lang.isBoolean,writeOnce:true});this.setAttributeConfig("dataTimeout",{value:F.dataTimeout||null,validator:YAHOO.lang.isNumber});},_cleanGrids:function(){if(this.get("grids")){var F=C.query("div.yui-b",this.body,true);if(F){D.removeClass(F,"yui-b");}A.onAvailable("yui-main",function(){D.setStyle(C.query("#yui-main"),"margin-left","0");D.setStyle(C.query("#yui-main"),"margin-right","0");});}},_createHeader:function(){var F=document.createElement("div");F.className="yui-layout-hd";if(this.get("firstChild")){this.get("wrap").insertBefore(F,this.get("wrap").firstChild);}else{this.get("wrap").appendChild(F);}this.header=F;return F;},destroy:function(H){if(this._resize){this._resize.destroy();}var G=this.get("parent");this.setStyle("display","none");if(this._clip){this._clip.parentNode.removeChild(this._clip);this._clip=null;}if(!H){G.removeUnit(this);}if(G){G.removeListener("resize",this.resize,this,true);}this.unsubscribeAll();A.purgeElement(this.get("element"));this.get("parentNode").removeChild(this.get("element"));delete YAHOO.widget.LayoutUnit._instances[this.get("id")];for(var F in this){if(E.hasOwnProperty(this,F)){this[F]=null;delete this[F];}}return G;},toString:function(){if(this.get){return"LayoutUnit #"+this.get("id")+" ("+this.get("position")+")";}return"LayoutUnit";}});YAHOO.widget.LayoutUnit=B;})();YAHOO.register("layout",YAHOO.widget.Layout,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout.js deleted file mode 100644 index 94fc00f5aa..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/layout/layout.js +++ /dev/null @@ -1,2290 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * @description

                    Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.

                    - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event - * @module layout - */ -(function() { - var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class Layout - * @extends YAHOO.util.Element - * @description

                    Provides a fixed layout containing, top, bottom, left, right and center layout units. It can be applied to either the body or an element.

                    - * @param {String/HTMLElement} el The element to make contain a layout. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - var Layout = function(el, config) { - if (Lang.isObject(el) && !el.tagName) { - config = el; - el = null; - } - if (Lang.isString(el)) { - if (Dom.get(el)) { - el = Dom.get(el); - } - } - if (!el) { - el = document.body; - } - - var oConfig = { - element: el, - attributes: config || {} - }; - - Layout.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all layout instances - * @type Object - */ - Layout._instances = {}; - /** - * @static - * @method getLayoutById - * @description Get's a layout object by the HTML id of the element associated with the Layout object. - * @return {Object} The Layout Object - */ - Layout.getLayoutById = function(id) { - if (Layout._instances[id]) { - return Layout._instances[id]; - } - return false; - }; - - YAHOO.extend(Layout, YAHOO.util.Element, { - /** - * @property browser - * @description A modified version of the YAHOO.env.ua object - * @type Object - */ - browser: function() { - var b = YAHOO.env.ua; - b.standardsMode = false; - b.secure = false; - return b; - }(), - /** - * @private - * @property _units - * @description An object literal that contains a list of units in the layout - * @type Object - */ - _units: null, - /** - * @private - * @property _rendered - * @description Set to true when the layout is rendered - * @type Boolean - */ - _rendered: null, - /** - * @private - * @property _zIndex - * @description The zIndex to set all LayoutUnits to - * @type Number - */ - _zIndex: null, - /** - * @private - * @property _sizes - * @description A collection of the current sizes of all usable LayoutUnits to be used for calculations - * @type Object - */ - _sizes: null, - /** - * @private - * @method _setBodySize - * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units) - * @description Used to set the body size of the layout, sets the height and width of the parent container - */ - _setBodySize: function(set) { - var h = 0, w = 0; - set = ((set === false) ? false : true); - - if (this._isBody) { - h = Dom.getClientHeight(); - w = Dom.getClientWidth(); - } else { - h = parseInt(this.getStyle('height'), 10); - w = parseInt(this.getStyle('width'), 10); - if (isNaN(w)) { - w = this.get('element').clientWidth; - } - if (isNaN(h)) { - h = this.get('element').clientHeight; - } - } - if (this.get('minWidth')) { - if (w < this.get('minWidth')) { - w = this.get('minWidth'); - } - } - if (this.get('minHeight')) { - if (h < this.get('minHeight')) { - h = this.get('minHeight'); - } - } - if (set) { - if (h < 0) { - h = 0; - } - if (w < 0) { - w = 0; - } - Dom.setStyle(this._doc, 'height', h + 'px'); - Dom.setStyle(this._doc, 'width', w + 'px'); - } - this._sizes.doc = { h: h, w: w }; - this._setSides(set); - }, - /** - * @private - * @method _setSides - * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units) - * @description Used to set the size and position of the left, right, top and bottom units - */ - _setSides: function(set) { - var h1 = ((this._units.top) ? this._units.top.get('height') : 0), - h2 = ((this._units.bottom) ? this._units.bottom.get('height') : 0), - h = this._sizes.doc.h, - w = this._sizes.doc.w; - set = ((set === false) ? false : true); - - this._sizes.top = { - h: h1, w: ((this._units.top) ? w : 0), - t: 0 - }; - this._sizes.bottom = { - h: h2, w: ((this._units.bottom) ? w : 0) - }; - - var newH = (h - (h1 + h2)); - - this._sizes.left = { - h: newH, w: ((this._units.left) ? this._units.left.get('width') : 0) - }; - this._sizes.right = { - h: newH, w: ((this._units.right) ? this._units.right.get('width') : 0), - l: ((this._units.right) ? (w - this._units.right.get('width')) : 0), - t: ((this._units.top) ? this._sizes.top.h : 0) - }; - - if (this._units.right && set) { - this._units.right.set('top', this._sizes.right.t); - if (!this._units.right._collapsing) { - this._units.right.set('left', this._sizes.right.l); - } - this._units.right.set('height', this._sizes.right.h, true); - } - if (this._units.left) { - this._sizes.left.l = 0; - if (this._units.top) { - this._sizes.left.t = this._sizes.top.h; - } else { - this._sizes.left.t = 0; - } - if (set) { - this._units.left.set('top', this._sizes.left.t); - this._units.left.set('height', this._sizes.left.h, true); - this._units.left.set('left', 0); - } - } - if (this._units.bottom) { - this._sizes.bottom.t = this._sizes.top.h + this._sizes.left.h; - if (set) { - this._units.bottom.set('top', this._sizes.bottom.t); - this._units.bottom.set('width', this._sizes.bottom.w, true); - } - } - if (this._units.top) { - if (set) { - this._units.top.set('width', this._sizes.top.w, true); - } - } - this._setCenter(set); - }, - /** - * @private - * @method _setCenter - * @param {Boolean} set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units) - * @description Used to set the size and position of the center unit - */ - _setCenter: function(set) { - set = ((set === false) ? false : true); - var h = this._sizes.left.h; - var w = (this._sizes.doc.w - (this._sizes.left.w + this._sizes.right.w)); - if (set) { - this._units.center.set('height', h, true); - this._units.center.set('width', w, true); - this._units.center.set('top', this._sizes.top.h); - this._units.center.set('left', this._sizes.left.w); - } - this._sizes.center = { h: h, w: w, t: this._sizes.top.h, l: this._sizes.left.w }; - }, - /** - * @method getSizes - * @description Get a reference to the internal Layout Unit sizes object used to build the layout wireframe - * @return {Object} An object of the layout unit sizes - */ - getSizes: function() { - return this._sizes; - }, - /** - * @method getUnitById - * @param {String} id The HTML element id of the unit - * @description Get the LayoutUnit by it's HTML id - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - getUnitById: function(id) { - return YAHOO.widget.LayoutUnit.getLayoutUnitById(id); - }, - /** - * @method getUnitByPosition - * @param {String} pos The position of the unit in this layout - * @description Get the LayoutUnit by it's position in this layout - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - getUnitByPosition: function(pos) { - if (pos) { - pos = pos.toLowerCase(); - if (this._units[pos]) { - return this._units[pos]; - } - return false; - } - return false; - }, - /** - * @method removeUnit - * @param {Object} unit The LayoutUnit that you want to remove - * @description Remove the unit from this layout and resize the layout. - */ - removeUnit: function(unit) { - delete this._units[unit.get('position')]; - this.resize(); - }, - /** - * @method addUnit - * @param {Object} cfg The config for the LayoutUnit that you want to add - * @description Add a unit to this layout and if the layout is rendered, resize the layout. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - addUnit: function(cfg) { - if (!cfg.position) { - return false; - } - if (this._units[cfg.position]) { - return false; - } - var element = null, - el = null; - - if (cfg.id) { - if (Dom.get(cfg.id)) { - element = Dom.get(cfg.id); - delete cfg.id; - - } - } - if (cfg.element) { - element = cfg.element; - } - - if (!el) { - el = document.createElement('div'); - var id = Dom.generateId(); - el.id = id; - } - - if (!element) { - element = document.createElement('div'); - } - Dom.addClass(element, 'yui-layout-wrap'); - if (this.browser.ie && !this.browser.standardsMode) { - el.style.zoom = 1; - element.style.zoom = 1; - } - - if (el.firstChild) { - el.insertBefore(element, el.firstChild); - } else { - el.appendChild(element); - } - this._doc.appendChild(el); - - var h = false, w = false; - - if (cfg.height) { - h = parseInt(cfg.height, 10); - } - if (cfg.width) { - w = parseInt(cfg.width, 10); - } - var unitConfig = {}; - YAHOO.lang.augmentObject(unitConfig, cfg); // break obj ref - - unitConfig.parent = this; - unitConfig.wrap = element; - unitConfig.height = h; - unitConfig.width = w; - - var unit = new YAHOO.widget.LayoutUnit(el, unitConfig); - - unit.on('heightChange', this.resize, { unit: unit }, this); - unit.on('widthChange', this.resize, { unit: unit }, this); - unit.on('gutterChange', this.resize, { unit: unit }, this); - this._units[cfg.position] = unit; - - if (this._rendered) { - this.resize(); - } - - return unit; - }, - /** - * @private - * @method _createUnits - * @description Private method to create units from the config that was passed in. - */ - _createUnits: function() { - var units = this.get('units'); - for (var i in units) { - if (Lang.hasOwnProperty(units, i)) { - this.addUnit(units[i]); - } - } - }, - /** - * @method resize - * @param Boolean/Event set If set to false, it will NOT set the size, just perform the calculations (used for collapsing units). This can also have an attribute event passed to it. - * @description Starts the chain of resize routines that will resize all the units. - * @return {YAHOO.widget.Layout} The Layout instance - */ - resize: function(set, info) { - /* - * Fixes bug #2528175 - * If the event comes from an attribute and the value hasn't changed, don't process it. - */ - var ev = set; - if (ev && ev.prevValue && ev.newValue) { - if (ev.prevValue == ev.newValue) { - if (info) { - if (info.unit) { - if (!info.unit.get('animate')) { - set = false; - } - } - } - } - } - set = ((set === false) ? false : true); - if (set) { - var retVal = this.fireEvent('beforeResize'); - if (retVal === false) { - set = false; - } - if (this.browser.ie) { - if (this._isBody) { - Dom.removeClass(document.documentElement, 'yui-layout'); - Dom.addClass(document.documentElement, 'yui-layout'); - } else { - this.removeClass('yui-layout'); - this.addClass('yui-layout'); - } - } - } - this._setBodySize(set); - if (set) { - this.fireEvent('resize', { target: this, sizes: this._sizes, event: ev }); - } - return this; - }, - /** - * @private - * @method _setupBodyElements - * @description Sets up the main doc element when using the body as the main element. - */ - _setupBodyElements: function() { - this._doc = Dom.get('layout-doc'); - if (!this._doc) { - this._doc = document.createElement('div'); - this._doc.id = 'layout-doc'; - if (document.body.firstChild) { - document.body.insertBefore(this._doc, document.body.firstChild); - } else { - document.body.appendChild(this._doc); - } - } - this._createUnits(); - this._setBodySize(); - Event.on(window, 'resize', this.resize, this, true); - Dom.addClass(this._doc, 'yui-layout-doc'); - }, - /** - * @private - * @method _setupElements - * @description Sets up the main doc element when not using the body as the main element. - */ - _setupElements: function() { - this._doc = this.getElementsByClassName('yui-layout-doc')[0]; - if (!this._doc) { - this._doc = document.createElement('div'); - this.get('element').appendChild(this._doc); - } - this._createUnits(); - this._setBodySize(); - Dom.addClass(this._doc, 'yui-layout-doc'); - }, - /** - * @private - * @property _isBody - * @description Flag to determine if we are using the body as the root element. - * @type Boolean - */ - _isBody: null, - /** - * @private - * @property _doc - * @description Reference to the root element - * @type HTMLElement - */ - _doc: null, - /** - * @private - * @method init - * @description The Layout class' initialization method - */ - init: function(p_oElement, p_oAttributes) { - - this._zIndex = 0; - - Layout.superclass.init.call(this, p_oElement, p_oAttributes); - - if (this.get('parent')) { - this._zIndex = this.get('parent')._zIndex + 10; - } - - this._sizes = {}; - this._units = {}; - - var id = p_oElement; - if (!Lang.isString(id)) { - id = Dom.generateId(id); - } - Layout._instances[id] = this; - }, - /** - * @method render - * @description This method starts the render process, applying classnames and creating elements - * @return {YAHOO.widget.Layout} The Layout instance - */ - render: function() { - this._stamp(); - var el = this.get('element'); - if (el && el.tagName && (el.tagName.toLowerCase() == 'body')) { - this._isBody = true; - Dom.addClass(document.body, 'yui-layout'); - if (Dom.hasClass(document.body, 'yui-skin-sam')) { - //Move the class up so we can have a css chain - Dom.addClass(document.documentElement, 'yui-skin-sam'); - Dom.removeClass(document.body, 'yui-skin-sam'); - } - this._setupBodyElements(); - } else { - this._isBody = false; - this.addClass('yui-layout'); - this._setupElements(); - } - this.resize(); - this._rendered = true; - this.fireEvent('render'); - - return this; - }, - /** - * @private - * @method _stamp - * @description Stamps the root node with a secure classname for ease of use. Also sets the this.browser.standardsMode variable. - */ - _stamp: function() { - if (document.compatMode == 'CSS1Compat') { - this.browser.standardsMode = true; - } - if (window.location.href.toLowerCase().indexOf("https") === 0) { - Dom.addClass(document.documentElement, 'secure'); - this.browser.secure = true; - } - }, - /** - * @private - * @method initAttributes - * @description Processes the config - */ - initAttributes: function(attr) { - Layout.superclass.initAttributes.call(this, attr); - /** - * @attribute units - * @description An array of config definitions for the LayoutUnits to add to this layout - * @type Array - */ - this.setAttributeConfig('units', { - writeOnce: true, - validator: YAHOO.lang.isArray, - value: attr.units || [] - }); - - /** - * @attribute minHeight - * @description The minimum height in pixels - * @type Number - */ - this.setAttributeConfig('minHeight', { - value: attr.minHeight || false, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minWidth - * @description The minimum width in pixels - * @type Number - */ - this.setAttributeConfig('minWidth', { - value: attr.minWidth || false, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute height - * @description The height in pixels - * @type Number - */ - this.setAttributeConfig('height', { - value: attr.height || false, - validator: YAHOO.lang.isNumber, - method: function(h) { - if (h < 0) { - h = 0; - } - this.setStyle('height', h + 'px'); - } - }); - - /** - * @attribute width - * @description The width in pixels - * @type Number - */ - this.setAttributeConfig('width', { - value: attr.width || false, - validator: YAHOO.lang.isNumber, - method: function(w) { - if (w < 0) { - w = 0; - } - this.setStyle('width', w + 'px'); - } - }); - - /** - * @attribute parent - * @description If this layout is to be used as a child of another Layout instance, this config will bind the resize events together. - * @type Object YAHOO.widget.Layout - */ - this.setAttributeConfig('parent', { - writeOnce: true, - value: attr.parent || false, - method: function(p) { - if (p) { - p.on('resize', this.resize, this, true); - } - } - }); - }, - /** - * @method destroy - * @description Removes this layout from the page and destroys all units that it contains. This will destroy all data inside the layout and it's children. - */ - destroy: function() { - var par = this.get('parent'); - if (par) { - par.removeListener('resize', this.resize, this, true); - } - Event.removeListener(window, 'resize', this.resize, this, true); - - this.unsubscribeAll(); - for (var u in this._units) { - if (Lang.hasOwnProperty(this._units, u)) { - if (this._units[u]) { - this._units[u].destroy(true); - } - } - } - - Event.purgeElement(this.get('element')); - this.get('parentNode').removeChild(this.get('element')); - - delete YAHOO.widget.Layout._instances[this.get('id')]; - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - delete this[i]; - } - } - - if (par) { - par.resize(); - } - }, - /** - * @method toString - * @description Returns a string representing the Layout. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'Layout #' + this.get('id'); - } - return 'Layout'; - } - }); - /** - * @event resize - * @description Fired when this.resize is called - * @type YAHOO.util.CustomEvent - */ - /** - * @event startResize - * @description Fired when the Resize Utility for a Unit fires it's startResize Event. - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeResize - * @description Fires at the beginning of the resize method. If you return false, the resize is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event render - * @description Fired after the render method completes. - * @type YAHOO.util.CustomEvent - */ - - YAHOO.widget.Layout = Layout; -})(); -/** - * @description

                    Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.

                    - * @namespace YAHOO.widget - * @requires yahoo, dom, element, event, layout - * @optional animation, dragdrop, selector - */ -(function() { - var Dom = YAHOO.util.Dom, - Sel = YAHOO.util.Selector, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class LayoutUnit - * @extends YAHOO.util.Element - * @description

                    Provides a fixed position unit containing a header, body and footer for use with a YAHOO.widget.Layout instance.

                    - * @param {String/HTMLElement} el The element to make a unit. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - var LayoutUnit = function(el, config) { - - var oConfig = { - element: el, - attributes: config || {} - }; - - LayoutUnit.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all layout unit instances - * @type Object - */ - LayoutUnit._instances = {}; - /** - * @static - * @method getLayoutUnitById - * @description Get's a layout unit object by the HTML id of the element associated with the Layout Unit object. - * @return {Object} The Layout Object - */ - LayoutUnit.getLayoutUnitById = function(id) { - if (LayoutUnit._instances[id]) { - return LayoutUnit._instances[id]; - } - return false; - }; - - YAHOO.extend(LayoutUnit, YAHOO.util.Element, { - /** - * @property STR_CLOSE - * @description String used for close button title - * @type {String} - */ - STR_CLOSE: 'Click to close this pane.', - /** - * @property STR_COLLAPSE - * @description String used for collapse button title - * @type {String} - */ - STR_COLLAPSE: 'Click to collapse this pane.', - /** - * @property STR_EXPAND - * @description String used for expand button title - * @type {String} - */ - STR_EXPAND: 'Click to expand this pane.', - /** - * The class name applied to dynamic tabs while loading. - * @property LOADING_CLASSNAME - * @type String - * @default "disabled" - */ - LOADING_CLASSNAME: 'loading', - /** - * @property browser - * @description A modified version of the YAHOO.env.ua object - * @type Object - */ - browser: null, - /** - * @private - * @property _sizes - * @description A collection of the current sizes of the contents of this Layout Unit - * @type Object - */ - _sizes: null, - /** - * @private - * @property _anim - * @description A reference to the Animation instance used by this LayouUnit - * @type YAHOO.util.Anim - */ - _anim: null, - /** - * @private - * @property _resize - * @description A reference to the Resize instance used by this LayoutUnit - * @type YAHOO.util.Resize - */ - _resize: null, - /** - * @private - * @property _clip - * @description A reference to the clip element used when collapsing the unit - * @type HTMLElement - */ - _clip: null, - /** - * @private - * @property _gutter - * @description A simple hash table used to store the gutter to apply to the Unit - * @type Object - */ - _gutter: null, - /** - * @property header - * @description A reference to the HTML element used for the Header - * @type HTMLELement - */ - header: null, - /** - * @property body - * @description A reference to the HTML element used for the body - * @type HTMLElement - */ - body: null, - /** - * @property footer - * @description A reference to the HTML element used for the footer - * @type HTMLElement - */ - footer: null, - /** - * @private - * @property _collapsed - * @description Flag to determine if the unit is collapsed or not. - * @type Boolean - */ - _collapsed: null, - /** - * @private - * @property _collapsing - * @description A flag set while the unit is being collapsed, used so we don't fire events while animating the size - * @type Boolean - */ - _collapsing: null, - /** - * @private - * @property _lastWidth - * @description A holder for the last known width of the unit - * @type Number - */ - _lastWidth: null, - /** - * @private - * @property _lastHeight - * @description A holder for the last known height of the unit - * @type Number - */ - _lastHeight: null, - /** - * @private - * @property _lastTop - * @description A holder for the last known top of the unit - * @type Number - */ - _lastTop: null, - /** - * @private - * @property _lastLeft - * @description A holder for the last known left of the unit - * @type Number - */ - _lastLeft: null, - /** - * @private - * @property _lastScroll - * @description A holder for the last known scroll state of the unit - * @type Boolean - */ - _lastScroll: null, - /** - * @private - * @property _lastCenetrScroll - * @description A holder for the last known scroll state of the center unit - * @type Boolean - */ - _lastCenterScroll: null, - /** - * @private - * @property _lastScrollTop - * @description A holder for the last known scrollTop state of the unit - * @type Number - */ - _lastScrollTop: null, - /** - * @method resize - * @description Resize either the unit or it's clipped state, also updating the box inside - * @param {Boolean} force This will force full calculations even when the unit is collapsed - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - resize: function(force) { - var retVal = this.fireEvent('beforeResize'); - if (retVal === false) { - return this; - } - if (!this._collapsing || (force === true)) { - var scroll = this.get('scroll'); - this.set('scroll', false); - - - var hd = this._getBoxSize(this.header), - ft = this._getBoxSize(this.footer), - box = [this.get('height'), this.get('width')]; - - var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom), - nw = box[1] - (this._gutter.left + this._gutter.right); - - var wrapH = (nh + (hd[0] + ft[0])), - wrapW = nw; - - if (this._collapsed && !this._collapsing) { - this._setHeight(this._clip, wrapH); - this._setWidth(this._clip, wrapW); - Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px'); - Dom.setStyle(this._clip, 'left', this.get('left') + this._gutter.left + 'px'); - } else if (!this._collapsed || (this._collapsed && this._collapsing)) { - wrapH = this._setHeight(this.get('wrap'), wrapH); - wrapW = this._setWidth(this.get('wrap'), wrapW); - this._sizes.wrap.h = wrapH; - this._sizes.wrap.w = wrapW; - - Dom.setStyle(this.get('wrap'), 'top', this._gutter.top + 'px'); - Dom.setStyle(this.get('wrap'), 'left', this._gutter.left + 'px'); - - this._sizes.header.w = this._setWidth(this.header, wrapW); - this._sizes.header.h = hd[0]; - - this._sizes.footer.w = this._setWidth(this.footer, wrapW); - this._sizes.footer.h = ft[0]; - - Dom.setStyle(this.footer, 'bottom', '0px'); - - this._sizes.body.h = this._setHeight(this.body, (wrapH - (hd[0] + ft[0]))); - this._sizes.body.w =this._setWidth(this.body, wrapW); - Dom.setStyle(this.body, 'top', hd[0] + 'px'); - - this.set('scroll', scroll); - this.fireEvent('resize'); - } - } - return this; - }, - /** - * @private - * @method _setWidth - * @description Sets the width of the element based on the border size of the element. - * @param {HTMLElement} el The HTMLElement to have it's width set - * @param {Number} w The width that you want it the element set to - * @return {Number} The new width, fixed for borders and IE QuirksMode - */ - _setWidth: function(el, w) { - if (el) { - var b = this._getBorderSizes(el); - w = (w - (b[1] + b[3])); - w = this._fixQuirks(el, w, 'w'); - if (w < 0) { - w = 0; - } - Dom.setStyle(el, 'width', w + 'px'); - } - return w; - }, - /** - * @private - * @method _setHeight - * @description Sets the height of the element based on the border size of the element. - * @param {HTMLElement} el The HTMLElement to have it's height set - * @param {Number} h The height that you want it the element set to - * @return {Number} The new height, fixed for borders and IE QuirksMode - */ - _setHeight: function(el, h) { - if (el) { - var b = this._getBorderSizes(el); - h = (h - (b[0] + b[2])); - h = this._fixQuirks(el, h, 'h'); - if (h < 0) { - h = 0; - } - Dom.setStyle(el, 'height', h + 'px'); - } - return h; - }, - /** - * @private - * @method _fixQuirks - * @description Fixes the box calculations for IE in QuirksMode - * @param {HTMLElement} el The HTMLElement to set the dimension on - * @param {Number} dim The number of the dimension to fix - * @param {String} side The dimension (h or w) to fix. Defaults to h - * @return {Number} The fixed dimension - */ - _fixQuirks: function(el, dim, side) { - var i1 = 0, i2 = 2; - if (side == 'w') { - i1 = 1; - i2 = 3; - } - if ((this.browser.ie < 8) && !this.browser.standardsMode) { - //Internet Explorer - Quirks Mode - var b = this._getBorderSizes(el), - bp = this._getBorderSizes(el.parentNode); - if ((b[i1] === 0) && (b[i2] === 0)) { //No Borders, check parent - if ((bp[i1] !== 0) && (bp[i2] !== 0)) { //Parent has Borders - dim = (dim - (bp[i1] + bp[i2])); - } - } else { - if ((bp[i1] === 0) && (bp[i2] === 0)) { - dim = (dim + (b[i1] + b[i2])); - } - } - } - return dim; - }, - /** - * @private - * @method _getBoxSize - * @description Get's the elements clientHeight and clientWidth plus the size of the borders - * @param {HTMLElement} el The HTMLElement to get the size of - * @return {Array} An array of height and width - */ - _getBoxSize: function(el) { - var size = [0, 0]; - if (el) { - if (this.browser.ie && !this.browser.standardsMode) { - el.style.zoom = 1; - } - var b = this._getBorderSizes(el); - size[0] = el.clientHeight + (b[0] + b[2]); - size[1] = el.clientWidth + (b[1] + b[3]); - } - return size; - }, - /** - * @private - * @method _getBorderSizes - * @description Get the CSS border size of the element passed. - * @param {HTMLElement} el The element to get the border size of - * @return {Array} An array of the top, right, bottom, left borders. - */ - _getBorderSizes: function(el) { - var s = []; - el = el || this.get('element'); - if (this.browser.ie && !this.browser.standardsMode) { - el.style.zoom = 1; - } - s[0] = parseInt(Dom.getStyle(el, 'borderTopWidth'), 10); - s[1] = parseInt(Dom.getStyle(el, 'borderRightWidth'), 10); - s[2] = parseInt(Dom.getStyle(el, 'borderBottomWidth'), 10); - s[3] = parseInt(Dom.getStyle(el, 'borderLeftWidth'), 10); - - //IE will return NaN on these if they are set to auto, we'll set them to 0 - for (var i = 0; i < s.length; i++) { - if (isNaN(s[i])) { - s[i] = 0; - } - } - return s; - }, - /** - * @private - * @method _createClip - * @description Create the clip element used when the Unit is collapsed - */ - _createClip: function() { - if (!this._clip) { - this._clip = document.createElement('div'); - this._clip.className = 'yui-layout-clip yui-layout-clip-' + this.get('position'); - this._clip.innerHTML = '
                    '; - var c = this._clip.firstChild; - c.title = this.STR_EXPAND; - Event.on(c, 'click', this.expand, this, true); - this.get('element').parentNode.appendChild(this._clip); - } - }, - /** - * @private - * @method _toggleClip - * @description Toggle th current state of the Clip element and set it's height, width and position - */ - _toggleClip: function() { - if (!this._collapsed) { - //show - var hd = this._getBoxSize(this.header), - ft = this._getBoxSize(this.footer), - box = [this.get('height'), this.get('width')]; - - - var nh = (box[0] - hd[0] - ft[0]) - (this._gutter.top + this._gutter.bottom), - nw = box[1] - (this._gutter.left + this._gutter.right), - wrapH = (nh + (hd[0] + ft[0])); - - switch (this.get('position')) { - case 'top': - case 'bottom': - this._setWidth(this._clip, nw); - this._setHeight(this._clip, this.get('collapseSize')); - Dom.setStyle(this._clip, 'left', (this._lastLeft + this._gutter.left) + 'px'); - if (this.get('position') == 'bottom') { - Dom.setStyle(this._clip, 'top', ((this._lastTop + this._lastHeight) - (this.get('collapseSize') - this._gutter.top)) + 'px'); - } else { - Dom.setStyle(this._clip, 'top', this.get('top') + this._gutter.top + 'px'); - } - break; - case 'left': - case 'right': - this._setWidth(this._clip, this.get('collapseSize')); - this._setHeight(this._clip, wrapH); - Dom.setStyle(this._clip, 'top', (this.get('top') + this._gutter.top) + 'px'); - if (this.get('position') == 'right') { - Dom.setStyle(this._clip, 'left', (((this._lastLeft + this._lastWidth) - this.get('collapseSize')) - this._gutter.left) + 'px'); - } else { - Dom.setStyle(this._clip, 'left', (this.get('left') + this._gutter.left) + 'px'); - } - break; - } - - Dom.setStyle(this._clip, 'display', 'block'); - this.setStyle('display', 'none'); - } else { - //Hide - Dom.setStyle(this._clip, 'display', 'none'); - } - }, - /** - * @method getSizes - * @description Get a reference to the internal sizes object for this unit - * @return {Object} An object of the sizes used for calculations - */ - getSizes: function() { - return this._sizes; - }, - /** - * @method toggle - * @description Toggles the Unit, replacing it with a clipped version. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - toggle: function() { - if (this._collapsed) { - this.expand(); - } else { - this.collapse(); - } - return this; - }, - /** - * @method expand - * @description Expand the Unit if it is collapsed. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - expand: function() { - if (!this._collapsed) { - return this; - } - var retVal = this.fireEvent('beforeExpand'); - if (retVal === false) { - return this; - } - - this._collapsing = true; - this.setStyle('zIndex', this.get('parent')._zIndex + 1); - - if (this._anim) { - this.setStyle('display', 'none'); - var attr = {}, s; - - switch (this.get('position')) { - case 'left': - case 'right': - this.set('width', this._lastWidth, true); - this.setStyle('width', this._lastWidth + 'px'); - this.get('parent').resize(false); - s = this.get('parent').getSizes()[this.get('position')]; - this.set('height', s.h, true); - var left = s.l; - attr = { - left: { - to: left - } - }; - if (this.get('position') == 'left') { - attr.left.from = (left - s.w); - this.setStyle('left', (left - s.w) + 'px'); - } - break; - case 'top': - case 'bottom': - this.set('height', this._lastHeight, true); - this.setStyle('height', this._lastHeight + 'px'); - this.get('parent').resize(false); - s = this.get('parent').getSizes()[this.get('position')]; - this.set('width', s.w, true); - var top = s.t; - attr = { - top: { - to: top - } - }; - if (this.get('position') == 'top') { - this.setStyle('top', (top - s.h) + 'px'); - attr.top.from = (top - s.h); - } - break; - } - - this._anim.attributes = attr; - var exStart = function() { - this.setStyle('display', 'block'); - this.resize(true); - this._anim.onStart.unsubscribe(exStart, this, true); - }; - var expand = function() { - this._collapsing = false; - this.setStyle('zIndex', this.get('parent')._zIndex); - this.set('width', this._lastWidth); - this.set('height', this._lastHeight); - this._collapsed = false; - this.resize(); - this.set('scroll', this._lastScroll); - if (this._lastScrollTop > 0) { - this.body.scrollTop = this._lastScrollTop; - } - this._anim.onComplete.unsubscribe(expand, this, true); - this.fireEvent('expand'); - }; - this._anim.onStart.subscribe(exStart, this, true); - this._anim.onComplete.subscribe(expand, this, true); - this._anim.animate(); - this._toggleClip(); - } else { - this._collapsing = false; - this._toggleClip(); - this._collapsed = false; - this.setStyle('zIndex', this.get('parent')._zIndex); - this.setStyle('display', 'block'); - this.set('width', this._lastWidth); - this.set('height', this._lastHeight); - this.resize(); - this.set('scroll', this._lastScroll); - if (this._lastScrollTop > 0) { - this.body.scrollTop = this._lastScrollTop; - } - this.fireEvent('expand'); - } - return this; - }, - /** - * @method collapse - * @description Collapse the Unit if it is not collapsed. - * @return {YAHOO.widget.LayoutUnit} The LayoutUnit instance - */ - collapse: function() { - if (this._collapsed) { - return this; - } - var retValue = this.fireEvent('beforeCollapse'); - if (retValue === false) { - return this; - } - if (!this._clip) { - this._createClip(); - } - this._collapsing = true; - var w = this.get('width'), - h = this.get('height'), - attr = {}; - this._lastWidth = w; - this._lastHeight = h; - this._lastScroll = this.get('scroll'); - this._lastScrollTop = this.body.scrollTop; - this.set('scroll', false, true); - this._lastLeft = parseInt(this.get('element').style.left, 10); - this._lastTop = parseInt(this.get('element').style.top, 10); - if (isNaN(this._lastTop)) { - this._lastTop = 0; - this.set('top', 0); - } - if (isNaN(this._lastLeft)) { - this._lastLeft = 0; - this.set('left', 0); - } - this.setStyle('zIndex', this.get('parent')._zIndex + 1); - var pos = this.get('position'); - - switch (pos) { - case 'top': - case 'bottom': - this.set('height', (this.get('collapseSize') + (this._gutter.top + this._gutter.bottom))); - attr = { - top: { - to: (this.get('top') - h) - } - }; - if (pos == 'bottom') { - attr.top.to = (this.get('top') + h); - } - break; - case 'left': - case 'right': - this.set('width', (this.get('collapseSize') + (this._gutter.left + this._gutter.right))); - attr = { - left: { - to: -(this._lastWidth) - } - }; - if (pos == 'right') { - attr.left = { - to: (this.get('left') + w) - }; - } - break; - } - if (this._anim) { - this._anim.attributes = attr; - var collapse = function() { - this._collapsing = false; - this._toggleClip(); - this.setStyle('zIndex', this.get('parent')._zIndex); - this._collapsed = true; - this.get('parent').resize(); - this._anim.onComplete.unsubscribe(collapse, this, true); - this.fireEvent('collapse'); - }; - this._anim.onComplete.subscribe(collapse, this, true); - this._anim.animate(); - } else { - this._collapsing = false; - this.setStyle('display', 'none'); - this._toggleClip(); - this.setStyle('zIndex', this.get('parent')._zIndex); - this.get('parent').resize(); - this._collapsed = true; - this.fireEvent('collapse'); - } - return this; - }, - /** - * @method close - * @description Close the unit, removing it from the parent Layout. - * @return {YAHOO.widget.Layout} The parent Layout instance - */ - close: function() { - this.setStyle('display', 'none'); - this.get('parent').removeUnit(this); - this.fireEvent('close'); - if (this._clip) { - this._clip.parentNode.removeChild(this._clip); - this._clip = null; - } - return this.get('parent'); - }, - /** - * @property loadHandler - * @description Callback method for the YUI Connection Manager used for load the body using AJAX - * @type Object - */ - loadHandler: { - success: function(o) { - this.body.innerHTML = o.responseText; - this.resize (true); - }, - failure: function(o) { - } - }, - /** - * @property dataConnection - * @description YUI Connection Manager handler - * @type Object - */ - dataConnection: null, - /** - * @private - * @property _loading - * @description During the loading process this variable will be true - * @type Number - */ - _loading: false, - /** - * @method loadContent - * @description Loading the content of the unit using the connection manager - * @return {object} YUI Connection Manager handler - */ - loadContent: function() { - // load dynamic content unless already loading or loaded and caching - if (YAHOO.util.Connect && this.get('dataSrc') && !this._loading && !this.get('dataLoaded')) { - this._loading = true; - Dom.addClass(this.body, this.LOADING_CLASSNAME); - this.dataConnection = YAHOO.util.Connect.asyncRequest( - this.get('loadMethod'), - this.get('dataSrc'), - { - success: function(o) { - this.loadHandler.success.call(this, o); - this.set('dataLoaded', true); - this.dataConnection = null; - Dom.removeClass(this.body, this.LOADING_CLASSNAME); - this._loading = false; - this.fireEvent('load'); - }, - failure: function(o) { - this.loadHandler.failure.call(this, o); - this.dataConnection = null; - Dom.removeClass(this.body, this.LOADING_CLASSNAME); - this._loading = false; - this.fireEvent('loadError', { error: o }); - }, - scope: this, - timeout: this.get('dataTimeout') - } - ); - return this.dataConnection; - } - return false; - }, - /** - * @private - * @method init - * @description The initalization method inherited from Element. - */ - init: function(p_oElement, p_oAttributes) { - this._gutter = { - left: 0, - right: 0, - top: 0, - bottom: 0 - }; - this._sizes = { - wrap: { - h: 0, - w: 0 - }, - header: { - h: 0, - w: 0 - }, - body: { - h: 0, - w: 0 - }, - footer: { - h: 0, - w: 0 - } - }; - - LayoutUnit.superclass.init.call(this, p_oElement, p_oAttributes); - - this.browser = this.get('parent').browser; - - var id = p_oElement; - if (!Lang.isString(id)) { - id = Dom.generateId(id); - } - LayoutUnit._instances[id] = this; - - this.setStyle('position', 'absolute'); - - this.addClass('yui-layout-unit'); - this.addClass('yui-layout-unit-' + this.get('position')); - - - var header = this.getElementsByClassName('yui-layout-hd', 'div')[0]; - if (header) { - this.header = header; - } - var body = this.getElementsByClassName('yui-layout-bd', 'div')[0]; - if (body) { - this.body = body; - } - var footer = this.getElementsByClassName('yui-layout-ft', 'div')[0]; - if (footer) { - this.footer = footer; - } - - this.on('contentChange', this.resize, this, true); - this._lastScrollTop = 0; - - this.set('animate', this.get('animate')); - }, - /** - * @private - * @method initAttributes - * @description Processes the config - */ - initAttributes: function(attr) { - LayoutUnit.superclass.initAttributes.call(this, attr); - - /** - * @private - * @attribute wrap - * @description A reference to the wrap element - * @type HTMLElement - */ - this.setAttributeConfig('wrap', { - value: attr.wrap || null, - method: function(w) { - if (w) { - var id = Dom.generateId(w); - LayoutUnit._instances[id] = this; - } - } - }); - /** - * @attribute grids - * @description Set this option to true if you want the LayoutUnit to fix the first layer of YUI CSS Grids (margins) - * @type Boolean - */ - this.setAttributeConfig('grids', { - value: attr.grids || false - }); - /** - * @private - * @attribute top - * @description The current top positioning of the Unit - * @type Number - */ - this.setAttributeConfig('top', { - value: attr.top || 0, - validator: Lang.isNumber, - method: function(t) { - if (!this._collapsing) { - this.setStyle('top', t + 'px'); - } - } - }); - /** - * @private - * @attribute left - * @description The current left position of the Unit - * @type Number - */ - this.setAttributeConfig('left', { - value: attr.left || 0, - validator: Lang.isNumber, - method: function(l) { - if (!this._collapsing) { - this.setStyle('left', l + 'px'); - } - } - }); - - /** - * @attribute minWidth - * @description The minWidth parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('minWidth', { - value: attr.minWidth || false, - method: function(v) { - if (this._resize) { - this._resize.set('minWidth', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxWidth - * @description The maxWidth parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('maxWidth', { - value: attr.maxWidth || false, - method: function(v) { - if (this._resize) { - this._resize.set('maxWidth', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minHeight - * @description The minHeight parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('minHeight', { - value: attr.minHeight || false, - method: function(v) { - if (this._resize) { - this._resize.set('minHeight', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxHeight - * @description The maxHeight parameter passed to the Resize Utility - * @type Number - */ - this.setAttributeConfig('maxHeight', { - value: attr.maxHeight || false, - method: function(v) { - if (this._resize) { - this._resize.set('maxHeight', v); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute height - * @description The height of the Unit - * @type Number - */ - this.setAttributeConfig('height', { - value: attr.height, - validator: Lang.isNumber, - method: function(h) { - if (!this._collapsing) { - if (h < 0) { - h = 0; - } - this.setStyle('height', h + 'px'); - } - } - }); - - /** - * @attribute width - * @description The width of the Unit - * @type Number - */ - this.setAttributeConfig('width', { - value: attr.width, - validator: Lang.isNumber, - method: function(w) { - if (!this._collapsing) { - if (w < 0) { - w = 0; - } - this.setStyle('width', w + 'px'); - } - } - }); - /** - * @attribute zIndex - * @description The CSS zIndex to give to the unit, so you can have overlapping elements such as menus in a unit. - * @type {Number} - */ - this.setAttributeConfig('zIndex', { - value: attr.zIndex || false, - method: function(z) { - this.setStyle('zIndex', z); - } - }); - /** - * @attribute position - * @description The position (top, right, bottom, left or center) of the Unit in the Layout - * @type {String} - */ - this.setAttributeConfig('position', { - value: attr.position - }); - /** - * @attribute gutter - * @description The gutter that we should apply to the parent Layout around this Unit. Supports standard CSS markup: (2 4 0 5) or (2) or (2 5) - * @type String - */ - this.setAttributeConfig('gutter', { - value: attr.gutter || 0, - validator: YAHOO.lang.isString, - method: function(gutter) { - var p = gutter.split(' '); - if (p.length) { - this._gutter.top = parseInt(p[0], 10); - if (p[1]) { - this._gutter.right = parseInt(p[1], 10); - } else { - this._gutter.right = this._gutter.top; - } - if (p[2]) { - this._gutter.bottom = parseInt(p[2], 10); - } else { - this._gutter.bottom = this._gutter.top; - } - if (p[3]) { - this._gutter.left = parseInt(p[3], 10); - } else if (p[1]) { - this._gutter.left = this._gutter.right; - } else { - this._gutter.left = this._gutter.top; - } - } - } - }); - /** - * @attribute parent - * @description The parent Layout that we are assigned to - * @type {Object} YAHOO.widget.Layout - */ - this.setAttributeConfig('parent', { - writeOnce: true, - value: attr.parent || false, - method: function(p) { - if (p) { - p.on('resize', this.resize, this, true); - } - - } - }); - /** - * @attribute collapseSize - * @description The pixel size of the Clip that we will collapse to - * @type Number - */ - this.setAttributeConfig('collapseSize', { - value: attr.collapseSize || 25, - validator: YAHOO.lang.isNumber - }); - /** - * @attribute duration - * @description The duration to give the Animation Utility when animating the opening and closing of Units - */ - this.setAttributeConfig('duration', { - value: attr.duration || 0.5 - }); - /** - * @attribute easing - * @description The Animation Easing to apply to the Animation instance for this unit. - */ - this.setAttributeConfig('easing', { - value: attr.easing || ((YAHOO.util && YAHOO.util.Easing) ? YAHOO.util.Easing.BounceIn : 'false') - }); - /** - * @attribute animate - * @description Use animation to collapse/expand the unit - * @type Boolean - */ - this.setAttributeConfig('animate', { - value: ((attr.animate === false) ? false : true), - validator: function() { - var anim = false; - if (YAHOO.util.Anim) { - anim = true; - } - return anim; - }, - method: function(anim) { - if (anim) { - this._anim = new YAHOO.util.Anim(this.get('element'), {}, this.get('duration'), this.get('easing')); - } else { - this._anim = false; - } - } - }); - /** - * @attribute header - * @description The text to use as the Header of the Unit - */ - this.setAttributeConfig('header', { - value: attr.header || false, - method: function(txt) { - if (txt === false) { - //Remove the footer - if (this.header) { - Dom.addClass(this.body, 'yui-layout-bd-nohd'); - this.header.parentNode.removeChild(this.header); - this.header = null; - } - } else { - if (!this.header) { - var header = this.getElementsByClassName('yui-layout-hd', 'div')[0]; - if (!header) { - header = this._createHeader(); - } - this.header = header; - } - var h = this.header.getElementsByTagName('h2')[0]; - if (!h) { - h = document.createElement('h2'); - this.header.appendChild(h); - } - h.innerHTML = txt; - if (this.body) { - Dom.removeClass(this.body, 'yui-layout-bd-nohd'); - } - } - this.fireEvent('contentChange', { target: 'header' }); - } - }); - /** - * @attribute proxy - * @description Use the proxy config setting for the Resize Utility - * @type Boolean - */ - this.setAttributeConfig('proxy', { - writeOnce: true, - value: ((attr.proxy === false) ? false : true) - }); - /** - * @attribute body - * @description The content for the body. If we find an element in the page with an id that matches the passed option we will move that element into the body of this unit. - */ - this.setAttributeConfig('body', { - value: attr.body || false, - method: function(content) { - if (!this.body) { - var body = this.getElementsByClassName('yui-layout-bd', 'div')[0]; - if (body) { - this.body = body; - } else { - body = document.createElement('div'); - body.className = 'yui-layout-bd'; - this.body = body; - this.get('wrap').appendChild(body); - } - } - if (!this.header) { - Dom.addClass(this.body, 'yui-layout-bd-nohd'); - } - Dom.addClass(this.body, 'yui-layout-bd-noft'); - - - var el = null; - if (Lang.isString(content)) { - el = Dom.get(content); - } else if (content && content.tagName) { - el = content; - } - if (el) { - var id = Dom.generateId(el); - LayoutUnit._instances[id] = this; - this.body.appendChild(el); - } else { - this.body.innerHTML = content; - } - - this._cleanGrids(); - - this.fireEvent('contentChange', { target: 'body' }); - } - }); - - /** - * @attribute footer - * @description The content for the footer. If we find an element in the page with an id that matches the passed option we will move that element into the footer of this unit. - */ - this.setAttributeConfig('footer', { - value: attr.footer || false, - method: function(content) { - if (content === false) { - //Remove the footer - if (this.footer) { - Dom.addClass(this.body, 'yui-layout-bd-noft'); - this.footer.parentNode.removeChild(this.footer); - this.footer = null; - } - } else { - if (!this.footer) { - var ft = this.getElementsByClassName('yui-layout-ft', 'div')[0]; - if (!ft) { - ft = document.createElement('div'); - ft.className = 'yui-layout-ft'; - this.footer = ft; - this.get('wrap').appendChild(ft); - } else { - this.footer = ft; - } - } - var el = null; - if (Lang.isString(content)) { - el = Dom.get(content); - } else if (content && content.tagName) { - el = content; - } - if (el) { - this.footer.appendChild(el); - } else { - this.footer.innerHTML = content; - } - Dom.removeClass(this.body, 'yui-layout-bd-noft'); - } - this.fireEvent('contentChange', { target: 'footer' }); - } - }); - /** - * @attribute close - * @description Adds a close icon to the unit - */ - this.setAttributeConfig('close', { - value: attr.close || false, - method: function(close) { - //Position Center doesn't get this - if (this.get('position') == 'center') { - return false; - } - if (!this.header && close) { - this._createHeader(); - } - var c = Dom.getElementsByClassName('close', 'div', this.header)[0]; - if (close) { - //Force some header text if there isn't any - if (!this.get('header')) { - this.set('header', ' '); - } - if (!c) { - c = document.createElement('div'); - c.className = 'close'; - this.header.appendChild(c); - Event.on(c, 'click', this.close, this, true); - } - c.title = this.STR_CLOSE; - } else if (c && c.parentNode) { - Event.purgeElement(c); - c.parentNode.removeChild(c); - } - this._configs.close.value = close; - this.set('collapse', this.get('collapse')); //Reset so we get the right classnames - } - }); - - /** - * @attribute collapse - * @description Adds a collapse icon to the unit - */ - this.setAttributeConfig('collapse', { - value: attr.collapse || false, - method: function(collapse) { - //Position Center doesn't get this - if (this.get('position') == 'center') { - return false; - } - if (!this.header && collapse) { - this._createHeader(); - } - var c = Dom.getElementsByClassName('collapse', 'div', this.header)[0]; - if (collapse) { - //Force some header text if there isn't any - if (!this.get('header')) { - this.set('header', ' '); - } - if (!c) { - c = document.createElement('div'); - this.header.appendChild(c); - Event.on(c, 'click', this.collapse, this, true); - } - c.title = this.STR_COLLAPSE; - c.className = 'collapse' + ((this.get('close')) ? ' collapse-close' : ''); - } else if (c && c.parentNode) { - Event.purgeElement(c); - c.parentNode.removeChild(c); - } - } - }); - /** - * @attribute scroll - * @description Adds a class to the unit to allow for overflow: auto (yui-layout-scroll), default is overflow: hidden (yui-layout-noscroll). If true scroll bars will be placed on the element when the content exceeds the given area, false will put overflow hidden to hide the content. Passing null will render the content as usual overflow. - * @type Boolean/Null - */ - - this.setAttributeConfig('scroll', { - value: (((attr.scroll === true) || (attr.scroll === false) || (attr.scroll === null)) ? attr.scroll : false), - method: function(scroll) { - if ((scroll === false) && !this._collapsed) { //Removing scroll bar - if (this.body) { - if (this.body.scrollTop > 0) { - this._lastScrollTop = this.body.scrollTop; - } - } - } - - if (scroll === true) { - this.addClass('yui-layout-scroll'); - this.removeClass('yui-layout-noscroll'); - if (this._lastScrollTop > 0) { - if (this.body) { - this.body.scrollTop = this._lastScrollTop; - } - } - } else if (scroll === false) { - this.removeClass('yui-layout-scroll'); - this.addClass('yui-layout-noscroll'); - } else if (scroll === null) { - this.removeClass('yui-layout-scroll'); - this.removeClass('yui-layout-noscroll'); - } - } - }); - /** - * @attribute hover - * @description Config option to pass to the Resize Utility - */ - this.setAttributeConfig('hover', { - writeOnce: true, - value: attr.hover || false, - validator: YAHOO.lang.isBoolean - }); - /** - * @attribute useShim - * @description Config option to pass to the Resize Utility - */ - this.setAttributeConfig('useShim', { - value: attr.useShim || false, - validator: YAHOO.lang.isBoolean, - method: function(u) { - if (this._resize) { - this._resize.set('useShim', u); - } - } - }); - /** - * @attribute resize - * @description Should a Resize instance be added to this unit - */ - - this.setAttributeConfig('resize', { - value: attr.resize || false, - validator: function(r) { - if (YAHOO.util && YAHOO.util.Resize) { - return true; - } - return false; - }, - method: function(resize) { - if (resize && !this._resize) { - //Position Center doesn't get this - if (this.get('position') == 'center') { - return false; - } - var handle = false; //To catch center - switch (this.get('position')) { - case 'top': - handle = 'b'; - break; - case 'bottom': - handle = 't'; - break; - case 'right': - handle = 'l'; - break; - case 'left': - handle = 'r'; - break; - } - - this.setStyle('position', 'absolute'); //Make sure Resize get's a position - - if (handle) { - this._resize = new YAHOO.util.Resize(this.get('element'), { - proxy: this.get('proxy'), - hover: this.get('hover'), - status: false, - autoRatio: false, - handles: [handle], - minWidth: this.get('minWidth'), - maxWidth: this.get('maxWidth'), - minHeight: this.get('minHeight'), - maxHeight: this.get('maxHeight'), - height: this.get('height'), - width: this.get('width'), - setSize: false, - useShim: this.get('useShim'), - wrap: false - }); - - this._resize._handles[handle].innerHTML = '
                    '; - - if (this.get('proxy')) { - var proxy = this._resize.getProxyEl(); - proxy.innerHTML = '
                    '; - } - this._resize.on('startResize', function(ev) { - this._lastScroll = this.get('scroll'); - this.set('scroll', false); - if (this.get('parent')) { - this.get('parent').fireEvent('startResize'); - var c = this.get('parent').getUnitByPosition('center'); - this._lastCenterScroll = c.get('scroll'); - c.addClass(this._resize.CSS_RESIZING); - c.set('scroll', false); - } - this.fireEvent('startResize'); - }, this, true); - this._resize.on('resize', function(ev) { - this.set('height', ev.height); - this.set('width', ev.width); - }, this, true); - this._resize.on('endResize', function(ev) { - this.set('scroll', this._lastScroll); - if (this.get('parent')) { - var c = this.get('parent').getUnitByPosition('center'); - c.set('scroll', this._lastCenterScroll); - c.removeClass(this._resize.CSS_RESIZING); - } - this.resize(); - this.fireEvent('endResize'); - }, this, true); - } - } else { - if (this._resize) { - this._resize.destroy(); - } - } - } - }); - /** - * The unit data source, used for loading content dynamically. - * @attribute dataSrc - * @type String - */ - this.setAttributeConfig('dataSrc', { - value: attr.dataSrc - }); - /** - * The method to use for the data request. - * @attribute loadMethod - * @type String - * @default "GET" - */ - this.setAttributeConfig('loadMethod', { - value: attr.loadMethod || 'GET', - validator: YAHOO.lang.isString - }); - /** - * Whether or not any data has been loaded from the server. - * @attribute dataLoaded - * @type Boolean - */ - this.setAttributeConfig('dataLoaded', { - value: false, - validator: YAHOO.lang.isBoolean, - writeOnce: true - }); - /** - * Number if milliseconds before aborting and calling failure handler. - * @attribute dataTimeout - * @type Number - * @default null - */ - this.setAttributeConfig('dataTimeout', { - value: attr.dataTimeout || null, - validator: YAHOO.lang.isNumber - }); - }, - /** - * @private - * @method _cleanGrids - * @description This method attempts to clean up the first level of the YUI CSS Grids, YAHOO.util.Selector is required for this operation. - */ - _cleanGrids: function() { - if (this.get('grids')) { - var b = Sel.query('div.yui-b', this.body, true); - if (b) { - Dom.removeClass(b, 'yui-b'); - } - Event.onAvailable('yui-main', function() { - Dom.setStyle(Sel.query('#yui-main'), 'margin-left', '0'); - Dom.setStyle(Sel.query('#yui-main'), 'margin-right', '0'); - }); - } - }, - /** - * @private - * @method _createHeader - * @description Creates the HTMLElement for the header - * @return {HTMLElement} The new HTMLElement - */ - _createHeader: function() { - var header = document.createElement('div'); - header.className = 'yui-layout-hd'; - if (this.get('firstChild')) { - this.get('wrap').insertBefore(header, this.get('wrap').firstChild); - } else { - this.get('wrap').appendChild(header); - } - this.header = header; - return header; - }, - /** - * @method destroy - * @param {Boolean} force Don't report to the parent, because we are being called from the parent. - * @description Removes this unit from the parent and cleans up after itself. - * @return {YAHOO.widget.Layout} The parent Layout instance - */ - destroy: function(force) { - if (this._resize) { - this._resize.destroy(); - } - var par = this.get('parent'); - - this.setStyle('display', 'none'); - if (this._clip) { - this._clip.parentNode.removeChild(this._clip); - this._clip = null; - } - - if (!force) { - par.removeUnit(this); - } - - if (par) { - par.removeListener('resize', this.resize, this, true); - } - this.unsubscribeAll(); - Event.purgeElement(this.get('element')); - this.get('parentNode').removeChild(this.get('element')); - - delete YAHOO.widget.LayoutUnit._instances[this.get('id')]; - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - delete this[i]; - } - } - - return par; - }, - /** - * @method toString - * @description Returns a string representing the LayoutUnit. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'LayoutUnit #' + this.get('id') + ' (' + this.get('position') + ')'; - } - return 'LayoutUnit'; - } - /** - * @event resize - * @description Fired when this.resize is called - * @type YAHOO.util.CustomEvent - */ - /** - * @event startResize - * @description Fired when the Resize Utility fires it's startResize Event. - * @type YAHOO.util.CustomEvent - */ - /** - * @event endResize - * @description Fired when the Resize Utility fires it's endResize Event. - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeResize - * @description Fired at the beginning of the resize method. If you return false, the resize is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event contentChange - * @description Fired when the content in the header, body or footer is changed via the API - * @type YAHOO.util.CustomEvent - */ - /** - * @event close - * @description Fired when the unit is closed - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeCollapse - * @description Fired before the unit is collapsed. If you return false, the collapse is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event collapse - * @description Fired when the unit is collapsed - * @type YAHOO.util.CustomEvent - */ - /** - * @event expand - * @description Fired when the unit is exanded - * @type YAHOO.util.CustomEvent - */ - /** - * @event beforeExpand - * @description Fired before the unit is exanded. If you return false, the collapse is cancelled. - * @type YAHOO.util.CustomEvent - */ - /** - * @event load - * @description Fired when data is loaded via the dataSrc config. - * @type YAHOO.util.CustomEvent - */ - /** - * @event loadError - * @description Fired when an error occurs loading data via the dataSrc config. Error message is passed as argument to this event. - * @type YAHOO.util.CustomEvent - */ - }); - - YAHOO.widget.LayoutUnit = LayoutUnit; -})(); -YAHOO.register("layout", YAHOO.widget.Layout, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger-core.css deleted file mode 100644 index 8143532d27..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger-core.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* This file intentionally left blank */ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger.css deleted file mode 100644 index 75cbec69fc..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/logger.css +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* logger default styles */ -/* default width: 31em */ -/* default font-size 77% */ -.yui-log {padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;} - -/* for containers built from scratch */ -.yui-log-container {position:absolute;top:1em;right:1em;} - -/* buttons */ -.yui-log input { - margin:0;padding:0; - font-family:arial; - font-size:100%; - font-weight:normal; -} -.yui-log .yui-log-btns {position:relative;float:right;bottom:.25em;} - -/* header */ -.yui-log .yui-log-hd {margin-top:1em;padding:.5em;background-color:#575757;} -.yui-log .yui-log-hd h4 {margin:0;padding:0;font-size:107%;font-weight:bold;color:#FFF;} - -/* body */ - -.yui-log .yui-log-bd {width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;} /* height is controlled here: default 20em*/ -.yui-log p {margin:1px;padding:.1em;} -.yui-log pre {margin:0;padding:0;} - -/* for pre to respect newlines yet wrap long lines */ -/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */ -.yui-log pre.yui-log-verbose { - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ -} - -/* footer */ -.yui-log .yui-log-ft {margin-top:.5em;} -.yui-log .yui-log-ft .yui-log-categoryfilters {} -.yui-log .yui-log-ft .yui-log-sourcefilters {width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;} -.yui-log .yui-log-filtergrp {margin-right:.5em;} -/*.yui-log .yui-log-ft ul {margin:0;padding:0;line-height:1.8} -.yui-log .yui-log-ft li {list-style:none;display:inline;white-space:nowrap;}*/ - -/* logs */ -.yui-log .info {background-color:#A7CC25;} /* A7CC25 green */ -.yui-log .warn {background-color:#F58516;} /* F58516 orange */ -.yui-log .error {background-color:#E32F0B;} /* E32F0B red */ -.yui-log .time {background-color:#A6C9D7;} /* A6C9D7 blue */ -.yui-log .window {background-color:#F2E886;} /* F2E886 tan */ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger-skin.css deleted file mode 100644 index 8ff72e2c59..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger-skin.css +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* logger default styles */ -/* default width: 31em */ -/* default font-size 77% */ -.yui-skin-sam .yui-log { padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000; } - -/* for containers built from scratch */ -.yui-skin-sam .yui-log-container { position:absolute;top:1em;right:1em; } - -/* buttons */ -.yui-skin-sam .yui-log input { - margin:0;padding:0; - font-family:arial; - font-size:100%; - font-weight:normal; -} -.yui-skin-sam .yui-log .yui-log-btns { position:relative;float:right;bottom:.25em; } - -/* header */ -.yui-skin-sam .yui-log .yui-log-hd { margin-top:1em;padding:.5em;background-color:#575757; } -.yui-skin-sam .yui-log .yui-log-hd h4 { margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF; } - -/* body */ - -.yui-skin-sam .yui-log .yui-log-bd { width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto; } /* height is controlled here: default 20em*/ -.yui-skin-sam .yui-log p { margin:1px;padding:.1em; } -.yui-skin-sam .yui-log pre { margin:0;padding:0; } - -/* for pre to respect newlines yet wrap long lines */ -/* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */ -.yui-skin-sam .yui-log pre.yui-log-verbose { - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ -} - -/* footer */ -.yui-skin-sam .yui-log .yui-log-ft { margin-top:.5em; } -.yui-skin-sam .yui-log .yui-log-ft .yui-log-categoryfilters { } -.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters { width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em; } -.yui-skin-sam .yui-log .yui-log-filtergrp { margin-right:.5em; } - -/* logs */ -.yui-skin-sam .yui-log .info { background-color:#A7CC25; } /* A7CC25 green */ -.yui-skin-sam .yui-log .warn { background-color:#F58516; } /* F58516 orange */ -.yui-skin-sam .yui-log .error { background-color:#E32F0B; } /* E32F0B red */ -.yui-skin-sam .yui-log .time { background-color:#A6C9D7; } /* A6C9D7 blue */ -.yui-skin-sam .yui-log .window { background-color:#F2E886; } /* F2E886 tan */ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger.css deleted file mode 100644 index 491b9c09fe..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/assets/skins/sam/logger.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-skin-sam .yui-log{padding:1em;width:31em;background-color:#AAA;color:#000;border:1px solid black;font-family:monospace;font-size:77%;text-align:left;z-index:9000;}.yui-skin-sam .yui-log-container{position:absolute;top:1em;right:1em;}.yui-skin-sam .yui-log input{margin:0;padding:0;font-family:arial;font-size:100%;font-weight:normal;}.yui-skin-sam .yui-log .yui-log-btns{position:relative;float:right;bottom:.25em;}.yui-skin-sam .yui-log .yui-log-hd{margin-top:1em;padding:.5em;background-color:#575757;}.yui-skin-sam .yui-log .yui-log-hd h4{margin:0;padding:0;font-size:108%;font-weight:bold;color:#FFF;}.yui-skin-sam .yui-log .yui-log-bd{width:100%;height:20em;background-color:#FFF;border:1px solid gray;overflow:auto;}.yui-skin-sam .yui-log p{margin:1px;padding:.1em;}.yui-skin-sam .yui-log pre{margin:0;padding:0;}.yui-skin-sam .yui-log pre.yui-log-verbose{white-space:pre-wrap;white-space:-moz-pre-wrap!important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.yui-skin-sam .yui-log .yui-log-ft{margin-top:.5em;}.yui-skin-sam .yui-log .yui-log-ft .yui-log-sourcefilters{width:100%;border-top:1px solid #575757;margin-top:.75em;padding-top:.75em;}.yui-skin-sam .yui-log .yui-log-filtergrp{margin-right:.5em;}.yui-skin-sam .yui-log .info{background-color:#A7CC25;}.yui-skin-sam .yui-log .warn{background-color:#F58516;}.yui-skin-sam .yui-log .error{background-color:#E32F0B;}.yui-skin-sam .yui-log .time{background-color:#A6C9D7;}.yui-skin-sam .yui-log .window{background-color:#F2E886;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/logger-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/logger-debug.js deleted file mode 100644 index 8ddd7ff7bf..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/logger/logger-debug.js +++ /dev/null @@ -1,2104 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ - -/** - * The LogMsg class defines a single log message. - * - * @class LogMsg - * @constructor - * @param oConfigs {Object} Object literal of configuration params. - */ -YAHOO.widget.LogMsg = function(oConfigs) { - // Parse configs - /** - * Log message. - * - * @property msg - * @type String - */ - this.msg = - /** - * Log timestamp. - * - * @property time - * @type Date - */ - this.time = - - /** - * Log category. - * - * @property category - * @type String - */ - this.category = - - /** - * Log source. The first word passed in as the source argument. - * - * @property source - * @type String - */ - this.source = - - /** - * Log source detail. The remainder of the string passed in as the source argument, not - * including the first word (if any). - * - * @property sourceDetail - * @type String - */ - this.sourceDetail = null; - - if (oConfigs && (oConfigs.constructor == Object)) { - for(var param in oConfigs) { - if (oConfigs.hasOwnProperty(param)) { - this[param] = oConfigs[param]; - } - } - } -}; -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ - -/** - * The LogWriter class provides a mechanism to log messages through - * YAHOO.widget.Logger from a named source. - * - * @class LogWriter - * @constructor - * @param sSource {String} Source of LogWriter instance. - */ -YAHOO.widget.LogWriter = function(sSource) { - if(!sSource) { - YAHOO.log("Could not instantiate LogWriter due to invalid source.", - "error", "LogWriter"); - return; - } - this._source = sSource; - }; - -///////////////////////////////////////////////////////////////////////////// -// -// Public methods -// -///////////////////////////////////////////////////////////////////////////// - - /** - * Public accessor to the unique name of the LogWriter instance. - * - * @method toString - * @return {String} Unique name of the LogWriter instance. - */ -YAHOO.widget.LogWriter.prototype.toString = function() { - return "LogWriter " + this._sSource; -}; - -/** - * Logs a message attached to the source of the LogWriter. - * - * @method log - * @param sMsg {String} The log message. - * @param sCategory {String} Category name. - */ -YAHOO.widget.LogWriter.prototype.log = function(sMsg, sCategory) { - YAHOO.widget.Logger.log(sMsg, sCategory, this._source); -}; - -/** - * Public accessor to get the source name. - * - * @method getSource - * @return {String} The LogWriter source. - */ -YAHOO.widget.LogWriter.prototype.getSource = function() { - return this._source; -}; - -/** - * Public accessor to set the source name. - * - * @method setSource - * @param sSource {String} Source of LogWriter instance. - */ -YAHOO.widget.LogWriter.prototype.setSource = function(sSource) { - if(!sSource) { - YAHOO.log("Could not set source due to invalid source.", "error", this.toString()); - return; - } - else { - this._source = sSource; - } -}; - -///////////////////////////////////////////////////////////////////////////// -// -// Private member variables -// -///////////////////////////////////////////////////////////////////////////// - -/** - * Source of the LogWriter instance. - * - * @property _source - * @type String - * @private - */ -YAHOO.widget.LogWriter.prototype._source = null; - - - - /** - * The Logger widget provides a simple way to read or write log messages in - * JavaScript code. Integration with the YUI Library's debug builds allow - * implementers to access under-the-hood events, errors, and debugging messages. - * Output may be read through a LogReader console and/or output to a browser - * console. - * - * @module logger - * @requires yahoo, event, dom - * @optional dragdrop - * @namespace YAHOO.widget - * @title Logger Widget - */ - -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ - -// Define once -if(!YAHOO.widget.Logger) { - /** - * The singleton Logger class provides core log management functionality. Saves - * logs written through the global YAHOO.log function or written by a LogWriter - * instance. Provides access to logs for reading by a LogReader instance or - * native browser console such as the Firebug extension to Firefox or Safari's - * JavaScript console through integration with the console.log() method. - * - * @class Logger - * @static - */ - YAHOO.widget.Logger = { - // Initialize properties - loggerEnabled: true, - _browserConsoleEnabled: false, - categories: ["info","warn","error","time","window"], - sources: ["global"], - _stack: [], // holds all log msgs - maxStackEntries: 2500, - _startTime: new Date().getTime(), // static start timestamp - _lastTime: null, // timestamp of last logged message - _windowErrorsHandled: false, - _origOnWindowError: null - }; - - ///////////////////////////////////////////////////////////////////////////// - // - // Public properties - // - ///////////////////////////////////////////////////////////////////////////// - /** - * True if Logger is enabled, false otherwise. - * - * @property loggerEnabled - * @type Boolean - * @static - * @default true - */ - - /** - * Array of categories. - * - * @property categories - * @type String[] - * @static - * @default ["info","warn","error","time","window"] - */ - - /** - * Array of sources. - * - * @property sources - * @type String[] - * @static - * @default ["global"] - */ - - /** - * Upper limit on size of internal stack. - * - * @property maxStackEntries - * @type Number - * @static - * @default 2500 - */ - - ///////////////////////////////////////////////////////////////////////////// - // - // Private properties - // - ///////////////////////////////////////////////////////////////////////////// - /** - * Internal property to track whether output to browser console is enabled. - * - * @property _browserConsoleEnabled - * @type Boolean - * @static - * @default false - * @private - */ - - /** - * Array to hold all log messages. - * - * @property _stack - * @type Array - * @static - * @private - */ - /** - * Static timestamp of Logger initialization. - * - * @property _startTime - * @type Date - * @static - * @private - */ - /** - * Timestamp of last logged message. - * - * @property _lastTime - * @type Date - * @static - * @private - */ - ///////////////////////////////////////////////////////////////////////////// - // - // Public methods - // - ///////////////////////////////////////////////////////////////////////////// - /** - * Saves a log message to the stack and fires newLogEvent. If the log message is - * assigned to an unknown category, creates a new category. If the log message is - * from an unknown source, creates a new source. If browser console is enabled, - * outputs the log message to browser console. - * - * @method log - * @param sMsg {String} The log message. - * @param sCategory {String} Category of log message, or null. - * @param sSource {String} Source of LogWriter, or null if global. - */ - YAHOO.widget.Logger.log = function(sMsg, sCategory, sSource) { - if(this.loggerEnabled) { - if(!sCategory) { - sCategory = "info"; // default category - } - else { - sCategory = sCategory.toLocaleLowerCase(); - if(this._isNewCategory(sCategory)) { - this._createNewCategory(sCategory); - } - } - var sClass = "global"; // default source - var sDetail = null; - if(sSource) { - var spaceIndex = sSource.indexOf(" "); - if(spaceIndex > 0) { - // Substring until first space - sClass = sSource.substring(0,spaceIndex); - // The rest of the source - sDetail = sSource.substring(spaceIndex,sSource.length); - } - else { - sClass = sSource; - } - if(this._isNewSource(sClass)) { - this._createNewSource(sClass); - } - } - - var timestamp = new Date(); - var logEntry = new YAHOO.widget.LogMsg({ - msg: sMsg, - time: timestamp, - category: sCategory, - source: sClass, - sourceDetail: sDetail - }); - - var stack = this._stack; - var maxStackEntries = this.maxStackEntries; - if(maxStackEntries && !isNaN(maxStackEntries) && - (stack.length >= maxStackEntries)) { - stack.shift(); - } - stack.push(logEntry); - this.newLogEvent.fire(logEntry); - - if(this._browserConsoleEnabled) { - this._printToBrowserConsole(logEntry); - } - return true; - } - else { - return false; - } - }; - - /** - * Resets internal stack and startTime, enables Logger, and fires logResetEvent. - * - * @method reset - */ - YAHOO.widget.Logger.reset = function() { - this._stack = []; - this._startTime = new Date().getTime(); - this.loggerEnabled = true; - this.log("Logger reset"); - this.logResetEvent.fire(); - }; - - /** - * Public accessor to internal stack of log message objects. - * - * @method getStack - * @return {Object[]} Array of log message objects. - */ - YAHOO.widget.Logger.getStack = function() { - return this._stack; - }; - - /** - * Public accessor to internal start time. - * - * @method getStartTime - * @return {Date} Internal date of when Logger singleton was initialized. - */ - YAHOO.widget.Logger.getStartTime = function() { - return this._startTime; - }; - - /** - * Disables output to the browser's global console.log() function, which is used - * by the Firebug extension to Firefox as well as Safari. - * - * @method disableBrowserConsole - */ - YAHOO.widget.Logger.disableBrowserConsole = function() { - YAHOO.log("Logger output to the function console.log() has been disabled."); - this._browserConsoleEnabled = false; - }; - - /** - * Enables output to the browser's global console.log() function, which is used - * by the Firebug extension to Firefox as well as Safari. - * - * @method enableBrowserConsole - */ - YAHOO.widget.Logger.enableBrowserConsole = function() { - this._browserConsoleEnabled = true; - YAHOO.log("Logger output to the function console.log() has been enabled."); - }; - - /** - * Surpresses native JavaScript errors and outputs to console. By default, - * Logger does not handle JavaScript window error events. - * NB: Not all browsers support the window.onerror event. - * - * @method handleWindowErrors - */ - YAHOO.widget.Logger.handleWindowErrors = function() { - if(!YAHOO.widget.Logger._windowErrorsHandled) { - // Save any previously defined handler to call - if(window.error) { - YAHOO.widget.Logger._origOnWindowError = window.onerror; - } - window.onerror = YAHOO.widget.Logger._onWindowError; - YAHOO.widget.Logger._windowErrorsHandled = true; - YAHOO.log("Logger handling of window.onerror has been enabled."); - } - else { - YAHOO.log("Logger handling of window.onerror had already been enabled."); - } - }; - - /** - * Unsurpresses native JavaScript errors. By default, - * Logger does not handle JavaScript window error events. - * NB: Not all browsers support the window.onerror event. - * - * @method unhandleWindowErrors - */ - YAHOO.widget.Logger.unhandleWindowErrors = function() { - if(YAHOO.widget.Logger._windowErrorsHandled) { - // Revert to any previously defined handler to call - if(YAHOO.widget.Logger._origOnWindowError) { - window.onerror = YAHOO.widget.Logger._origOnWindowError; - YAHOO.widget.Logger._origOnWindowError = null; - } - else { - window.onerror = null; - } - YAHOO.widget.Logger._windowErrorsHandled = false; - YAHOO.log("Logger handling of window.onerror has been disabled."); - } - else { - YAHOO.log("Logger handling of window.onerror had already been disabled."); - } - }; - - ///////////////////////////////////////////////////////////////////////////// - // - // Public events - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Fired when a new category has been created. - * - * @event categoryCreateEvent - * @param sCategory {String} Category name. - */ - YAHOO.widget.Logger.categoryCreateEvent = - new YAHOO.util.CustomEvent("categoryCreate", this, true); - - /** - * Fired when a new source has been named. - * - * @event sourceCreateEvent - * @param sSource {String} Source name. - */ - YAHOO.widget.Logger.sourceCreateEvent = - new YAHOO.util.CustomEvent("sourceCreate", this, true); - - /** - * Fired when a new log message has been created. - * - * @event newLogEvent - * @param sMsg {String} Log message. - */ - YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true); - - /** - * Fired when the Logger has been reset has been created. - * - * @event logResetEvent - */ - YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true); - - ///////////////////////////////////////////////////////////////////////////// - // - // Private methods - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Creates a new category of log messages and fires categoryCreateEvent. - * - * @method _createNewCategory - * @param sCategory {String} Category name. - * @private - */ - YAHOO.widget.Logger._createNewCategory = function(sCategory) { - this.categories.push(sCategory); - this.categoryCreateEvent.fire(sCategory); - }; - - /** - * Checks to see if a category has already been created. - * - * @method _isNewCategory - * @param sCategory {String} Category name. - * @return {Boolean} Returns true if category is unknown, else returns false. - * @private - */ - YAHOO.widget.Logger._isNewCategory = function(sCategory) { - for(var i=0; i < this.categories.length; i++) { - if(sCategory == this.categories[i]) { - return false; - } - } - return true; - }; - - /** - * Creates a new source of log messages and fires sourceCreateEvent. - * - * @method _createNewSource - * @param sSource {String} Source name. - * @private - */ - YAHOO.widget.Logger._createNewSource = function(sSource) { - this.sources.push(sSource); - this.sourceCreateEvent.fire(sSource); - }; - - /** - * Checks to see if a source already exists. - * - * @method _isNewSource - * @param sSource {String} Source name. - * @return {Boolean} Returns true if source is unknown, else returns false. - * @private - */ - YAHOO.widget.Logger._isNewSource = function(sSource) { - if(sSource) { - for(var i=0; i < this.sources.length; i++) { - if(sSource == this.sources[i]) { - return false; - } - } - return true; - } - }; - - /** - * Outputs a log message to global console.log() function. - * - * @method _printToBrowserConsole - * @param oEntry {Object} Log entry object. - * @private - */ - YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) { - if(window.console && console.log) { - var category = oEntry.category; - var label = oEntry.category.substring(0,4).toUpperCase(); - - var time = oEntry.time; - var localTime; - if (time.toLocaleTimeString) { - localTime = time.toLocaleTimeString(); - } - else { - localTime = time.toString(); - } - - var msecs = time.getTime(); - var elapsedTime = (YAHOO.widget.Logger._lastTime) ? - (msecs - YAHOO.widget.Logger._lastTime) : 0; - YAHOO.widget.Logger._lastTime = msecs; - - var output = - localTime + " (" + - elapsedTime + "ms): " + - oEntry.source + ": "; - - // for bug 1987607 - if (YAHOO.env.ua.webkit) { - output += oEntry.msg; - } - - console.log(output, oEntry.msg); - } - }; - - ///////////////////////////////////////////////////////////////////////////// - // - // Private event handlers - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Handles logging of messages due to window error events. - * - * @method _onWindowError - * @param sMsg {String} The error message. - * @param sUrl {String} URL of the error. - * @param sLine {String} Line number of the error. - * @private - */ - YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) { - // Logger is not in scope of this event handler - try { - YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window"); - if(YAHOO.widget.Logger._origOnWindowError) { - YAHOO.widget.Logger._origOnWindowError(); - } - } - catch(e) { - return false; - } - }; - - ///////////////////////////////////////////////////////////////////////////// - // - // First log - // - ///////////////////////////////////////////////////////////////////////////// - - YAHOO.widget.Logger.log("Logger initialized"); -} - -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -(function () { -var Logger = YAHOO.widget.Logger, - u = YAHOO.util, - Dom = u.Dom, - Event = u.Event, - d = document; - -function make(el,props) { - el = d.createElement(el); - if (props) { - for (var p in props) { - if (props.hasOwnProperty(p)) { - el[p] = props[p]; - } - } - } - return el; -} - -/** - * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger. - * - * @class LogReader - * @constructor - * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV. - * @param elContainer {String} (optional) String ID of an existing DIV. - * @param oConfigs {Object} (optional) Object literal of configuration params. - */ -function LogReader(elContainer, oConfigs) { - this._sName = LogReader._index; - LogReader._index++; - - this._init.apply(this,arguments); - - /** - * Render the LogReader immediately upon instantiation. If set to false, - * you must call myLogReader.render() to generate the UI. - * - * @property autoRender - * @type {Boolean} - * @default true - */ - if (this.autoRender !== false) { - this.render(); - } -} - -///////////////////////////////////////////////////////////////////////////// -// -// Static member variables -// -///////////////////////////////////////////////////////////////////////////// -YAHOO.lang.augmentObject(LogReader, { - /** - * Internal class member to index multiple LogReader instances. - * - * @property _memberName - * @static - * @type Number - * @default 0 - * @private - */ - _index : 0, - - /** - * Node template for the log entries - * @property ENTRY_TEMPLATE - * @static - * @type {HTMLElement} - * @default pre element with class yui-log-entry - */ - ENTRY_TEMPLATE : (function () { - return make('pre',{ className: 'yui-log-entry' }); - })(), - - /** - * Template used for innerHTML of verbose entry output. - * @property VERBOSE_TEMPLATE - * @static - * @default "<p><span class='{category}'>{label}</span>{totalTime}ms (+{elapsedTime}) {localTime}:</p><p>{sourceAndDetail}</p><p>{message}</p>" - */ - VERBOSE_TEMPLATE : "

                    {label} {totalTime}ms (+{elapsedTime}) {localTime}:

                    {sourceAndDetail}

                    {message}

                    ", - - /** - * Template used for innerHTML of compact entry output. - * @property BASIC_TEMPLATE - * @static - * @default "<p><span class='{category}'>{label}</span>{totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}</p>" - */ - BASIC_TEMPLATE : "

                    {label} {totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}

                    " -}); - -///////////////////////////////////////////////////////////////////////////// -// -// Public member variables -// -///////////////////////////////////////////////////////////////////////////// - -LogReader.prototype = { - /** - * Whether or not LogReader is enabled to output log messages. - * - * @property logReaderEnabled - * @type Boolean - * @default true - */ - logReaderEnabled : true, - - /** - * Public member to access CSS width of the LogReader container. - * - * @property width - * @type String - */ - width : null, - - /** - * Public member to access CSS height of the LogReader container. - * - * @property height - * @type String - */ - height : null, - - /** - * Public member to access CSS top position of the LogReader container. - * - * @property top - * @type String - */ - top : null, - - /** - * Public member to access CSS left position of the LogReader container. - * - * @property left - * @type String - */ - left : null, - - /** - * Public member to access CSS right position of the LogReader container. - * - * @property right - * @type String - */ - right : null, - - /** - * Public member to access CSS bottom position of the LogReader container. - * - * @property bottom - * @type String - */ - bottom : null, - - /** - * Public member to access CSS font size of the LogReader container. - * - * @property fontSize - * @type String - */ - fontSize : null, - - /** - * Whether or not the footer UI is enabled for the LogReader. - * - * @property footerEnabled - * @type Boolean - * @default true - */ - footerEnabled : true, - - /** - * Whether or not output is verbose (more readable). Setting to true will make - * output more compact (less readable). - * - * @property verboseOutput - * @type Boolean - * @default true - */ - verboseOutput : true, - - /** - * Custom output format for log messages. Defaults to null, which falls - * back to verboseOutput param deciding between LogReader.VERBOSE_TEMPLATE - * and LogReader.BASIC_TEMPLATE. Use bracketed place holders to mark where - * message info should go. Available place holder names include: - *
                      - *
                    • category
                    • - *
                    • label
                    • - *
                    • sourceAndDetail
                    • - *
                    • message
                    • - *
                    • localTime
                    • - *
                    • elapsedTime
                    • - *
                    • totalTime
                    • - *
                    - * - * @property entryFormat - * @type String - * @default null - */ - entryFormat : null, - - /** - * Whether or not newest message is printed on top. - * - * @property newestOnTop - * @type Boolean - */ - newestOnTop : true, - - /** - * Output timeout buffer in milliseconds. - * - * @property outputBuffer - * @type Number - * @default 100 - */ - outputBuffer : 100, - - /** - * Maximum number of messages a LogReader console will display. - * - * @property thresholdMax - * @type Number - * @default 500 - */ - thresholdMax : 500, - - /** - * When a LogReader console reaches its thresholdMax, it will clear out messages - * and print out the latest thresholdMin number of messages. - * - * @property thresholdMin - * @type Number - * @default 100 - */ - thresholdMin : 100, - - /** - * True when LogReader is in a collapsed state, false otherwise. - * - * @property isCollapsed - * @type Boolean - * @default false - */ - isCollapsed : false, - - /** - * True when LogReader is in a paused state, false otherwise. - * - * @property isPaused - * @type Boolean - * @default false - */ - isPaused : false, - - /** - * Enables draggable LogReader if DragDrop Utility is present. - * - * @property draggable - * @type Boolean - * @default true - */ - draggable : true, - - ///////////////////////////////////////////////////////////////////////////// - // - // Public methods - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Public accessor to the unique name of the LogReader instance. - * - * @method toString - * @return {String} Unique name of the LogReader instance. - */ - toString : function() { - return "LogReader instance" + this._sName; - }, - /** - * Pauses output of log messages. While paused, log messages are not lost, but - * get saved to a buffer and then output upon resume of LogReader. - * - * @method pause - */ - pause : function() { - this.isPaused = true; - this._timeout = null; - this.logReaderEnabled = false; - if (this._btnPause) { - this._btnPause.value = "Resume"; - } - }, - - /** - * Resumes output of log messages, including outputting any log messages that - * have been saved to buffer while paused. - * - * @method resume - */ - resume : function() { - this.isPaused = false; - this.logReaderEnabled = true; - this._printBuffer(); - if (this._btnPause) { - this._btnPause.value = "Pause"; - } - }, - - /** - * Adds the UI to the DOM, attaches event listeners, and bootstraps initial - * UI state. - * - * @method render - */ - render : function () { - if (this.rendered) { - return; - } - - this._initContainerEl(); - - this._initHeaderEl(); - this._initConsoleEl(); - this._initFooterEl(); - - this._initCategories(); - this._initSources(); - - this._initDragDrop(); - - // Subscribe to Logger custom events - Logger.newLogEvent.subscribe(this._onNewLog, this); - Logger.logResetEvent.subscribe(this._onReset, this); - - Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this); - Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this); - - this.rendered = true; - - this._filterLogs(); - }, - - /** - * Removes the UI from the DOM entirely and detaches all event listeners. - * Implementers should note that Logger will still accumulate messages. - * - * @method destroy - */ - destroy : function () { - Event.purgeElement(this._elContainer,true); - this._elContainer.innerHTML = ''; - this._elContainer.parentNode.removeChild(this._elContainer); - - this.rendered = false; - }, - - /** - * Hides UI of LogReader. Logging functionality is not disrupted. - * - * @method hide - */ - hide : function() { - this._elContainer.style.display = "none"; - }, - - /** - * Shows UI of LogReader. Logging functionality is not disrupted. - * - * @method show - */ - show : function() { - this._elContainer.style.display = "block"; - }, - - /** - * Collapses UI of LogReader. Logging functionality is not disrupted. - * - * @method collapse - */ - collapse : function() { - this._elConsole.style.display = "none"; - if(this._elFt) { - this._elFt.style.display = "none"; - } - this._btnCollapse.value = "Expand"; - this.isCollapsed = true; - }, - - /** - * Expands UI of LogReader. Logging functionality is not disrupted. - * - * @method expand - */ - expand : function() { - this._elConsole.style.display = "block"; - if(this._elFt) { - this._elFt.style.display = "block"; - } - this._btnCollapse.value = "Collapse"; - this.isCollapsed = false; - }, - - /** - * Returns related checkbox element for given filter (i.e., category or source). - * - * @method getCheckbox - * @param {String} Category or source name. - * @return {Array} Array of all filter checkboxes. - */ - getCheckbox : function(filter) { - return this._filterCheckboxes[filter]; - }, - - /** - * Returns array of enabled categories. - * - * @method getCategories - * @return {String[]} Array of enabled categories. - */ - getCategories : function() { - return this._categoryFilters; - }, - - /** - * Shows log messages associated with given category. - * - * @method showCategory - * @param {String} Category name. - */ - showCategory : function(sCategory) { - var filtersArray = this._categoryFilters; - // Don't do anything if category is already enabled - // Use Array.indexOf if available... - if(filtersArray.indexOf) { - if(filtersArray.indexOf(sCategory) > -1) { - return; - } - } - // ...or do it the old-fashioned way - else { - for(var i=0; i -1) { - return; - } - } - // ...or do it the old-fashioned way - else { - for(var i=0; i", and "&" to HTML entities. - * - * @method html2Text - * @param sHtml {String} String to convert. - * @private - */ - html2Text : function(sHtml) { - if(sHtml) { - sHtml += ""; - return sHtml.replace(/&/g, "&"). - replace(//g, ">"); - } - return ""; - }, - -///////////////////////////////////////////////////////////////////////////// -// -// Private member variables -// -///////////////////////////////////////////////////////////////////////////// - - /** - * Name of LogReader instance. - * - * @property _sName - * @type String - * @private - */ - _sName : null, - - //TODO: remove - /** - * A class member shared by all LogReaders if a container needs to be - * created during instantiation. Will be null if a container element never needs to - * be created on the fly, such as when the implementer passes in their own element. - * - * @property _elDefaultContainer - * @type HTMLElement - * @private - */ - //YAHOO.widget.LogReader._elDefaultContainer = null; - - /** - * Buffer of log message objects for batch output. - * - * @property _buffer - * @type Object[] - * @private - */ - _buffer : null, - - /** - * Number of log messages output to console. - * - * @property _consoleMsgCount - * @type Number - * @default 0 - * @private - */ - _consoleMsgCount : 0, - - /** - * Date of last output log message. - * - * @property _lastTime - * @type Date - * @private - */ - _lastTime : null, - - /** - * Batched output timeout ID. - * - * @property _timeout - * @type Number - * @private - */ - _timeout : null, - - /** - * Hash of filters and their related checkbox elements. - * - * @property _filterCheckboxes - * @type Object - * @private - */ - _filterCheckboxes : null, - - /** - * Array of filters for log message categories. - * - * @property _categoryFilters - * @type String[] - * @private - */ - _categoryFilters : null, - - /** - * Array of filters for log message sources. - * - * @property _sourceFilters - * @type String[] - * @private - */ - _sourceFilters : null, - - /** - * LogReader container element. - * - * @property _elContainer - * @type HTMLElement - * @private - */ - _elContainer : null, - - /** - * LogReader header element. - * - * @property _elHd - * @type HTMLElement - * @private - */ - _elHd : null, - - /** - * LogReader collapse element. - * - * @property _elCollapse - * @type HTMLElement - * @private - */ - _elCollapse : null, - - /** - * LogReader collapse button element. - * - * @property _btnCollapse - * @type HTMLElement - * @private - */ - _btnCollapse : null, - - /** - * LogReader title header element. - * - * @property _title - * @type HTMLElement - * @private - */ - _title : null, - - /** - * LogReader console element. - * - * @property _elConsole - * @type HTMLElement - * @private - */ - _elConsole : null, - - /** - * LogReader footer element. - * - * @property _elFt - * @type HTMLElement - * @private - */ - _elFt : null, - - /** - * LogReader buttons container element. - * - * @property _elBtns - * @type HTMLElement - * @private - */ - _elBtns : null, - - /** - * Container element for LogReader category filter checkboxes. - * - * @property _elCategoryFilters - * @type HTMLElement - * @private - */ - _elCategoryFilters : null, - - /** - * Container element for LogReader source filter checkboxes. - * - * @property _elSourceFilters - * @type HTMLElement - * @private - */ - _elSourceFilters : null, - - /** - * LogReader pause button element. - * - * @property _btnPause - * @type HTMLElement - * @private - */ - _btnPause : null, - - /** - * Clear button element. - * - * @property _btnClear - * @type HTMLElement - * @private - */ - _btnClear : null, - - ///////////////////////////////////////////////////////////////////////////// - // - // Private methods - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Initializes the instance's message buffer, start time, etc - * - * @method _init - * @param container {String|HTMLElement} (optional) the render target - * @param config {Object} (optional) instance configuration - * @protected - */ - _init : function (container, config) { - // Internal vars - this._buffer = []; // output buffer - this._filterCheckboxes = {}; // pointers to checkboxes - this._lastTime = Logger.getStartTime(); // timestamp of last log message to console - - // Parse config vars here - if (config && (config.constructor == Object)) { - for(var param in config) { - if (config.hasOwnProperty(param)) { - this[param] = config[param]; - } - } - } - - this._elContainer = Dom.get(container); - - YAHOO.log("LogReader initialized", null, this.toString()); - }, - - /** - * Initializes the primary container element. - * - * @method _initContainerEl - * @private - */ - _initContainerEl : function() { - - // Default the container if unset or not a div - if(!this._elContainer || !/div$/i.test(this._elContainer.tagName)) { - this._elContainer = d.body.insertBefore(make("div"),d.body.firstChild); - // Only position absolutely if an in-DOM element is not supplied - Dom.addClass(this._elContainer,"yui-log-container"); - } - - Dom.addClass(this._elContainer,"yui-log"); - - // If implementer has provided container values, trust and set those - var style = this._elContainer.style, - styleProps = ['width','right','top','fontSize'], - prop,i; - - for (i = styleProps.length - 1; i >= 0; --i) { - prop = styleProps[i]; - if (this[prop]){ - style[prop] = this[prop]; - } - } - - if(this.left) { - style.left = this.left; - style.right = "auto"; - } - if(this.bottom) { - style.bottom = this.bottom; - style.top = "auto"; - } - - // Opera needs a little prodding to reflow sometimes - if (YAHOO.env.ua.opera) { - d.body.style += ''; - } - - }, - - /** - * Initializes the header element. - * - * @method _initHeaderEl - * @private - */ - _initHeaderEl : function() { - // Destroy header if present - if(this._elHd) { - // Unhook DOM events - Event.purgeElement(this._elHd, true); - - // Remove DOM elements - this._elHd.innerHTML = ""; - } - - // Create header - // TODO: refactor this into an innerHTML - this._elHd = make("div",{ - id: 'yui-log-hd' + this._sName, - className: "yui-log-hd" - }); - - this._elCollapse = make("div",{ className: 'yui-log-btns' }); - - this._btnCollapse = make("input",{ - type: 'button', - className: 'yui-log-button', - value: 'Collapse' - }); - Event.on(this._btnCollapse,'click',this._onClickCollapseBtn,this); - - - this._title = make("h4",{ innerHTML : "Logger Console" }); - - this._elCollapse.appendChild(this._btnCollapse); - this._elHd.appendChild(this._elCollapse); - this._elHd.appendChild(this._title); - this._elContainer.appendChild(this._elHd); - }, - - /** - * Initializes the console element. - * - * @method _initConsoleEl - * @private - */ - _initConsoleEl : function() { - // Destroy console - if(this._elConsole) { - // Unhook DOM events - Event.purgeElement(this._elConsole, true); - - // Remove DOM elements - this._elConsole.innerHTML = ""; - } - - // Ceate console - this._elConsole = make("div", { className: "yui-log-bd" }); - - // If implementer has provided console, trust and set those - if(this.height) { - this._elConsole.style.height = this.height; - } - - this._elContainer.appendChild(this._elConsole); - }, - - /** - * Initializes the footer element. - * - * @method _initFooterEl - * @private - */ - _initFooterEl : function() { - // Don't create footer elements if footer is disabled - if(this.footerEnabled) { - // Destroy console - if(this._elFt) { - // Unhook DOM events - Event.purgeElement(this._elFt, true); - - // Remove DOM elements - this._elFt.innerHTML = ""; - } - - // TODO: use innerHTML - this._elFt = make("div",{ className: "yui-log-ft" }); - this._elBtns = make("div", { className: "yui-log-btns" }); - this._btnPause = make("input", { - type: "button", - className: "yui-log-button", - value: "Pause" - }); - - Event.on(this._btnPause,'click',this._onClickPauseBtn,this); - - this._btnClear = make("input", { - type: "button", - className: "yui-log-button", - value: "Clear" - }); - - Event.on(this._btnClear,'click',this._onClickClearBtn,this); - - this._elCategoryFilters = make("div", { className: "yui-log-categoryfilters" }); - this._elSourceFilters = make("div", { className: "yui-log-sourcefilters" }); - - this._elBtns.appendChild(this._btnPause); - this._elBtns.appendChild(this._btnClear); - this._elFt.appendChild(this._elBtns); - this._elFt.appendChild(this._elCategoryFilters); - this._elFt.appendChild(this._elSourceFilters); - this._elContainer.appendChild(this._elFt); - } - }, - - /** - * Initializes Drag and Drop on the header element. - * - * @method _initDragDrop - * @private - */ - _initDragDrop : function() { - // If Drag and Drop utility is available... - // ...and draggable is true... - // ...then make the header draggable - if(u.DD && this.draggable && this._elHd) { - var ylog_dd = new u.DD(this._elContainer); - ylog_dd.setHandleElId(this._elHd.id); - //TODO: use class name - this._elHd.style.cursor = "move"; - } - }, - - /** - * Initializes category filters. - * - * @method _initCategories - * @private - */ - _initCategories : function() { - // Initialize category filters - this._categoryFilters = []; - var aInitialCategories = Logger.categories; - - for(var j=0; j < aInitialCategories.length; j++) { - var sCategory = aInitialCategories[j]; - - // Add category to the internal array of filters - this._categoryFilters.push(sCategory); - - // Add checkbox element if UI is enabled - if(this._elCategoryFilters) { - this._createCategoryCheckbox(sCategory); - } - } - }, - - /** - * Initializes source filters. - * - * @method _initSources - * @private - */ - _initSources : function() { - // Initialize source filters - this._sourceFilters = []; - var aInitialSources = Logger.sources; - - for(var j=0; j < aInitialSources.length; j++) { - var sSource = aInitialSources[j]; - - // Add source to the internal array of filters - this._sourceFilters.push(sSource); - - // Add checkbox element if UI is enabled - if(this._elSourceFilters) { - this._createSourceCheckbox(sSource); - } - } - }, - - /** - * Creates the UI for a category filter in the LogReader footer element. - * - * @method _createCategoryCheckbox - * @param sCategory {String} Category name. - * @private - */ - _createCategoryCheckbox : function(sCategory) { - if(this._elFt) { - var filter = make("span",{ className: "yui-log-filtergrp" }), - check = make("input", { - id: "yui-log-filter-" + sCategory + this._sName, - className: "yui-log-filter-" + sCategory, - type: "checkbox", - category: sCategory - }), - label = make("label", { - htmlFor: check.id, - className: sCategory, - innerHTML: sCategory - }); - - - // Subscribe to the click event - Event.on(check,'click',this._onCheckCategory,this); - - this._filterCheckboxes[sCategory] = check; - - // Append el at the end so IE 5.5 can set "type" attribute - // and THEN set checked property - filter.appendChild(check); - filter.appendChild(label); - this._elCategoryFilters.appendChild(filter); - check.checked = true; - } - }, - - /** - * Creates a checkbox in the LogReader footer element to filter by source. - * - * @method _createSourceCheckbox - * @param sSource {String} Source name. - * @private - */ - _createSourceCheckbox : function(sSource) { - if(this._elFt) { - var filter = make("span",{ className: "yui-log-filtergrp" }), - check = make("input", { - id: "yui-log-filter-" + sSource + this._sName, - className: "yui-log-filter-" + sSource, - type: "checkbox", - source: sSource - }), - label = make("label", { - htmlFor: check.id, - className: sSource, - innerHTML: sSource - }); - - - // Subscribe to the click event - Event.on(check,'click',this._onCheckSource,this); - - this._filterCheckboxes[sSource] = check; - - // Append el at the end so IE 5.5 can set "type" attribute - // and THEN set checked property - filter.appendChild(check); - filter.appendChild(label); - this._elSourceFilters.appendChild(filter); - check.checked = true; - } - }, - - /** - * Reprints all log messages in the stack through filters. - * - * @method _filterLogs - * @private - */ - _filterLogs : function() { - // Reprint stack with new filters - if (this._elConsole !== null) { - this.clearConsole(); - this._printToConsole(Logger.getStack()); - } - }, - - /** - * Sends buffer of log messages to output and clears buffer. - * - * @method _printBuffer - * @private - */ - _printBuffer : function() { - this._timeout = null; - - if(this._elConsole !== null) { - var thresholdMax = this.thresholdMax; - thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500; - if(this._consoleMsgCount < thresholdMax) { - var entries = []; - for (var i=0; i this.thresholdMax)) { - thresholdMin = 0; - } - entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0; - - // Iterate through all log entries - for(i=entriesStartIndex; i0){C=G.substring(0,D);A=G.substring(D,G.length);}else{C=G;}if(this._isNewSource(C)){this._createNewSource(C);}}var H=new Date();var J=new YAHOO.widget.LogMsg({msg:B,time:H,category:F,source:C,sourceDetail:A});var I=this._stack;var E=this.maxStackEntries;if(E&&!isNaN(E)&&(I.length>=E)){I.shift();}I.push(J);this.newLogEvent.fire(J);if(this._browserConsoleEnabled){this._printToBrowserConsole(J);}return true;}else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.handleWindowErrors=function(){if(!YAHOO.widget.Logger._windowErrorsHandled){if(window.error){YAHOO.widget.Logger._origOnWindowError=window.onerror;}window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger._windowErrorsHandled=true;YAHOO.log("Logger handling of window.onerror has been enabled.");}else{YAHOO.log("Logger handling of window.onerror had already been enabled.");}};YAHOO.widget.Logger.unhandleWindowErrors=function(){if(YAHOO.widget.Logger._windowErrorsHandled){if(YAHOO.widget.Logger._origOnWindowError){window.onerror=YAHOO.widget.Logger._origOnWindowError;YAHOO.widget.Logger._origOnWindowError=null;}else{window.onerror=null;}YAHOO.widget.Logger._windowErrorsHandled=false;YAHOO.log("Logger handling of window.onerror has been disabled.");}else{YAHOO.log("Logger handling of window.onerror had already been disabled.");}};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(A){this.categories.push(A);this.categoryCreateEvent.fire(A);};YAHOO.widget.Logger._isNewCategory=function(B){for(var A=0;A{label} {totalTime}ms (+{elapsedTime}) {localTime}:

                    {sourceAndDetail}

                    {message}

                    ",BASIC_TEMPLATE:"

                    {label} {totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}

                    "});F.prototype={logReaderEnabled:true,width:null,height:null,top:null,left:null,right:null,bottom:null,fontSize:null,footerEnabled:true,verboseOutput:true,entryFormat:null,newestOnTop:true,outputBuffer:100,thresholdMax:500,thresholdMin:100,isCollapsed:false,isPaused:false,draggable:true,toString:function(){return"LogReader instance"+this._sName;},pause:function(){this.isPaused=true;this._timeout=null;this.logReaderEnabled=false;if(this._btnPause){this._btnPause.value="Resume"; -}},resume:function(){this.isPaused=false;this.logReaderEnabled=true;this._printBuffer();if(this._btnPause){this._btnPause.value="Pause";}},render:function(){if(this.rendered){return;}this._initContainerEl();this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initCategories();this._initSources();this._initDragDrop();C.newLogEvent.subscribe(this._onNewLog,this);C.logResetEvent.subscribe(this._onReset,this);C.categoryCreateEvent.subscribe(this._onCategoryCreate,this);C.sourceCreateEvent.subscribe(this._onSourceCreate,this);this.rendered=true;this._filterLogs();},destroy:function(){A.purgeElement(this._elContainer,true);this._elContainer.innerHTML="";this._elContainer.parentNode.removeChild(this._elContainer);this.rendered=false;},hide:function(){this._elContainer.style.display="none";},show:function(){this._elContainer.style.display="block";},collapse:function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}this._btnCollapse.value="Expand";this.isCollapsed=true;},expand:function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}this._btnCollapse.value="Collapse";this.isCollapsed=false;},getCheckbox:function(H){return this._filterCheckboxes[H];},getCategories:function(){return this._categoryFilters;},showCategory:function(I){var K=this._categoryFilters;if(K.indexOf){if(K.indexOf(I)>-1){return;}}else{for(var H=0;H-1){return;}}else{for(var I=0;I/g,">");}return"";},_sName:null,_buffer:null,_consoleMsgCount:0,_lastTime:null,_timeout:null,_filterCheckboxes:null,_categoryFilters:null,_sourceFilters:null,_elContainer:null,_elHd:null,_elCollapse:null,_btnCollapse:null,_title:null,_elConsole:null,_elFt:null,_elBtns:null,_elCategoryFilters:null,_elSourceFilters:null,_btnPause:null,_btnClear:null,_init:function(H,I){this._buffer=[];this._filterCheckboxes={};this._lastTime=C.getStartTime();if(I&&(I.constructor==Object)){for(var J in I){if(I.hasOwnProperty(J)){this[J]=I[J];}}}this._elContainer=E.get(H);YAHOO.log("LogReader initialized",null,this.toString());},_initContainerEl:function(){if(!this._elContainer||!/div$/i.test(this._elContainer.tagName)){this._elContainer=G.body.insertBefore(B("div"),G.body.firstChild);E.addClass(this._elContainer,"yui-log-container");}E.addClass(this._elContainer,"yui-log");var J=this._elContainer.style,H=["width","right","top","fontSize"],K,I;for(I=H.length-1;I>=0;--I){K=H[I];if(this[K]){J[K]=this[K];}}if(this.left){J.left=this.left;J.right="auto";}if(this.bottom){J.bottom=this.bottom;J.top="auto";}if(YAHOO.env.ua.opera){G.body.style+="";}},_initHeaderEl:function(){if(this._elHd){A.purgeElement(this._elHd,true);this._elHd.innerHTML="";}this._elHd=B("div",{id:"yui-log-hd"+this._sName,className:"yui-log-hd"});this._elCollapse=B("div",{className:"yui-log-btns"});this._btnCollapse=B("input",{type:"button",className:"yui-log-button",value:"Collapse"});A.on(this._btnCollapse,"click",this._onClickCollapseBtn,this);this._title=B("h4",{innerHTML:"Logger Console"});this._elCollapse.appendChild(this._btnCollapse);this._elHd.appendChild(this._elCollapse);this._elHd.appendChild(this._title);this._elContainer.appendChild(this._elHd);},_initConsoleEl:function(){if(this._elConsole){A.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}this._elConsole=B("div",{className:"yui-log-bd"});if(this.height){this._elConsole.style.height=this.height;}this._elContainer.appendChild(this._elConsole);},_initFooterEl:function(){if(this.footerEnabled){if(this._elFt){A.purgeElement(this._elFt,true);this._elFt.innerHTML="";}this._elFt=B("div",{className:"yui-log-ft"});this._elBtns=B("div",{className:"yui-log-btns"});this._btnPause=B("input",{type:"button",className:"yui-log-button",value:"Pause"});A.on(this._btnPause,"click",this._onClickPauseBtn,this);this._btnClear=B("input",{type:"button",className:"yui-log-button",value:"Clear"});A.on(this._btnClear,"click",this._onClickClearBtn,this);this._elCategoryFilters=B("div",{className:"yui-log-categoryfilters"});this._elSourceFilters=B("div",{className:"yui-log-sourcefilters"});this._elBtns.appendChild(this._btnPause);this._elBtns.appendChild(this._btnClear);this._elFt.appendChild(this._elBtns);this._elFt.appendChild(this._elCategoryFilters); -this._elFt.appendChild(this._elSourceFilters);this._elContainer.appendChild(this._elFt);}},_initDragDrop:function(){if(D.DD&&this.draggable&&this._elHd){var H=new D.DD(this._elContainer);H.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}},_initCategories:function(){this._categoryFilters=[];var J=C.categories;for(var H=0;Hthis.thresholdMax)){X=0;}R=(I>X)?(I-X):0;for(O=R;O 0) { - // Substring until first space - sClass = sSource.substring(0,spaceIndex); - // The rest of the source - sDetail = sSource.substring(spaceIndex,sSource.length); - } - else { - sClass = sSource; - } - if(this._isNewSource(sClass)) { - this._createNewSource(sClass); - } - } - - var timestamp = new Date(); - var logEntry = new YAHOO.widget.LogMsg({ - msg: sMsg, - time: timestamp, - category: sCategory, - source: sClass, - sourceDetail: sDetail - }); - - var stack = this._stack; - var maxStackEntries = this.maxStackEntries; - if(maxStackEntries && !isNaN(maxStackEntries) && - (stack.length >= maxStackEntries)) { - stack.shift(); - } - stack.push(logEntry); - this.newLogEvent.fire(logEntry); - - if(this._browserConsoleEnabled) { - this._printToBrowserConsole(logEntry); - } - return true; - } - else { - return false; - } - }; - - /** - * Resets internal stack and startTime, enables Logger, and fires logResetEvent. - * - * @method reset - */ - YAHOO.widget.Logger.reset = function() { - this._stack = []; - this._startTime = new Date().getTime(); - this.loggerEnabled = true; - this.log("Logger reset"); - this.logResetEvent.fire(); - }; - - /** - * Public accessor to internal stack of log message objects. - * - * @method getStack - * @return {Object[]} Array of log message objects. - */ - YAHOO.widget.Logger.getStack = function() { - return this._stack; - }; - - /** - * Public accessor to internal start time. - * - * @method getStartTime - * @return {Date} Internal date of when Logger singleton was initialized. - */ - YAHOO.widget.Logger.getStartTime = function() { - return this._startTime; - }; - - /** - * Disables output to the browser's global console.log() function, which is used - * by the Firebug extension to Firefox as well as Safari. - * - * @method disableBrowserConsole - */ - YAHOO.widget.Logger.disableBrowserConsole = function() { - YAHOO.log("Logger output to the function console.log() has been disabled."); - this._browserConsoleEnabled = false; - }; - - /** - * Enables output to the browser's global console.log() function, which is used - * by the Firebug extension to Firefox as well as Safari. - * - * @method enableBrowserConsole - */ - YAHOO.widget.Logger.enableBrowserConsole = function() { - this._browserConsoleEnabled = true; - YAHOO.log("Logger output to the function console.log() has been enabled."); - }; - - /** - * Surpresses native JavaScript errors and outputs to console. By default, - * Logger does not handle JavaScript window error events. - * NB: Not all browsers support the window.onerror event. - * - * @method handleWindowErrors - */ - YAHOO.widget.Logger.handleWindowErrors = function() { - if(!YAHOO.widget.Logger._windowErrorsHandled) { - // Save any previously defined handler to call - if(window.error) { - YAHOO.widget.Logger._origOnWindowError = window.onerror; - } - window.onerror = YAHOO.widget.Logger._onWindowError; - YAHOO.widget.Logger._windowErrorsHandled = true; - YAHOO.log("Logger handling of window.onerror has been enabled."); - } - else { - YAHOO.log("Logger handling of window.onerror had already been enabled."); - } - }; - - /** - * Unsurpresses native JavaScript errors. By default, - * Logger does not handle JavaScript window error events. - * NB: Not all browsers support the window.onerror event. - * - * @method unhandleWindowErrors - */ - YAHOO.widget.Logger.unhandleWindowErrors = function() { - if(YAHOO.widget.Logger._windowErrorsHandled) { - // Revert to any previously defined handler to call - if(YAHOO.widget.Logger._origOnWindowError) { - window.onerror = YAHOO.widget.Logger._origOnWindowError; - YAHOO.widget.Logger._origOnWindowError = null; - } - else { - window.onerror = null; - } - YAHOO.widget.Logger._windowErrorsHandled = false; - YAHOO.log("Logger handling of window.onerror has been disabled."); - } - else { - YAHOO.log("Logger handling of window.onerror had already been disabled."); - } - }; - - ///////////////////////////////////////////////////////////////////////////// - // - // Public events - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Fired when a new category has been created. - * - * @event categoryCreateEvent - * @param sCategory {String} Category name. - */ - YAHOO.widget.Logger.categoryCreateEvent = - new YAHOO.util.CustomEvent("categoryCreate", this, true); - - /** - * Fired when a new source has been named. - * - * @event sourceCreateEvent - * @param sSource {String} Source name. - */ - YAHOO.widget.Logger.sourceCreateEvent = - new YAHOO.util.CustomEvent("sourceCreate", this, true); - - /** - * Fired when a new log message has been created. - * - * @event newLogEvent - * @param sMsg {String} Log message. - */ - YAHOO.widget.Logger.newLogEvent = new YAHOO.util.CustomEvent("newLog", this, true); - - /** - * Fired when the Logger has been reset has been created. - * - * @event logResetEvent - */ - YAHOO.widget.Logger.logResetEvent = new YAHOO.util.CustomEvent("logReset", this, true); - - ///////////////////////////////////////////////////////////////////////////// - // - // Private methods - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Creates a new category of log messages and fires categoryCreateEvent. - * - * @method _createNewCategory - * @param sCategory {String} Category name. - * @private - */ - YAHOO.widget.Logger._createNewCategory = function(sCategory) { - this.categories.push(sCategory); - this.categoryCreateEvent.fire(sCategory); - }; - - /** - * Checks to see if a category has already been created. - * - * @method _isNewCategory - * @param sCategory {String} Category name. - * @return {Boolean} Returns true if category is unknown, else returns false. - * @private - */ - YAHOO.widget.Logger._isNewCategory = function(sCategory) { - for(var i=0; i < this.categories.length; i++) { - if(sCategory == this.categories[i]) { - return false; - } - } - return true; - }; - - /** - * Creates a new source of log messages and fires sourceCreateEvent. - * - * @method _createNewSource - * @param sSource {String} Source name. - * @private - */ - YAHOO.widget.Logger._createNewSource = function(sSource) { - this.sources.push(sSource); - this.sourceCreateEvent.fire(sSource); - }; - - /** - * Checks to see if a source already exists. - * - * @method _isNewSource - * @param sSource {String} Source name. - * @return {Boolean} Returns true if source is unknown, else returns false. - * @private - */ - YAHOO.widget.Logger._isNewSource = function(sSource) { - if(sSource) { - for(var i=0; i < this.sources.length; i++) { - if(sSource == this.sources[i]) { - return false; - } - } - return true; - } - }; - - /** - * Outputs a log message to global console.log() function. - * - * @method _printToBrowserConsole - * @param oEntry {Object} Log entry object. - * @private - */ - YAHOO.widget.Logger._printToBrowserConsole = function(oEntry) { - if(window.console && console.log) { - var category = oEntry.category; - var label = oEntry.category.substring(0,4).toUpperCase(); - - var time = oEntry.time; - var localTime; - if (time.toLocaleTimeString) { - localTime = time.toLocaleTimeString(); - } - else { - localTime = time.toString(); - } - - var msecs = time.getTime(); - var elapsedTime = (YAHOO.widget.Logger._lastTime) ? - (msecs - YAHOO.widget.Logger._lastTime) : 0; - YAHOO.widget.Logger._lastTime = msecs; - - var output = - localTime + " (" + - elapsedTime + "ms): " + - oEntry.source + ": "; - - // for bug 1987607 - if (YAHOO.env.ua.webkit) { - output += oEntry.msg; - } - - console.log(output, oEntry.msg); - } - }; - - ///////////////////////////////////////////////////////////////////////////// - // - // Private event handlers - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Handles logging of messages due to window error events. - * - * @method _onWindowError - * @param sMsg {String} The error message. - * @param sUrl {String} URL of the error. - * @param sLine {String} Line number of the error. - * @private - */ - YAHOO.widget.Logger._onWindowError = function(sMsg,sUrl,sLine) { - // Logger is not in scope of this event handler - try { - YAHOO.widget.Logger.log(sMsg+' ('+sUrl+', line '+sLine+')', "window"); - if(YAHOO.widget.Logger._origOnWindowError) { - YAHOO.widget.Logger._origOnWindowError(); - } - } - catch(e) { - return false; - } - }; - - ///////////////////////////////////////////////////////////////////////////// - // - // First log - // - ///////////////////////////////////////////////////////////////////////////// - - YAHOO.widget.Logger.log("Logger initialized"); -} - -/****************************************************************************/ -/****************************************************************************/ -/****************************************************************************/ -(function () { -var Logger = YAHOO.widget.Logger, - u = YAHOO.util, - Dom = u.Dom, - Event = u.Event, - d = document; - -function make(el,props) { - el = d.createElement(el); - if (props) { - for (var p in props) { - if (props.hasOwnProperty(p)) { - el[p] = props[p]; - } - } - } - return el; -} - -/** - * The LogReader class provides UI to read messages logged to YAHOO.widget.Logger. - * - * @class LogReader - * @constructor - * @param elContainer {HTMLElement} (optional) DOM element reference of an existing DIV. - * @param elContainer {String} (optional) String ID of an existing DIV. - * @param oConfigs {Object} (optional) Object literal of configuration params. - */ -function LogReader(elContainer, oConfigs) { - this._sName = LogReader._index; - LogReader._index++; - - this._init.apply(this,arguments); - - /** - * Render the LogReader immediately upon instantiation. If set to false, - * you must call myLogReader.render() to generate the UI. - * - * @property autoRender - * @type {Boolean} - * @default true - */ - if (this.autoRender !== false) { - this.render(); - } -} - -///////////////////////////////////////////////////////////////////////////// -// -// Static member variables -// -///////////////////////////////////////////////////////////////////////////// -YAHOO.lang.augmentObject(LogReader, { - /** - * Internal class member to index multiple LogReader instances. - * - * @property _memberName - * @static - * @type Number - * @default 0 - * @private - */ - _index : 0, - - /** - * Node template for the log entries - * @property ENTRY_TEMPLATE - * @static - * @type {HTMLElement} - * @default pre element with class yui-log-entry - */ - ENTRY_TEMPLATE : (function () { - return make('pre',{ className: 'yui-log-entry' }); - })(), - - /** - * Template used for innerHTML of verbose entry output. - * @property VERBOSE_TEMPLATE - * @static - * @default "<p><span class='{category}'>{label}</span>{totalTime}ms (+{elapsedTime}) {localTime}:</p><p>{sourceAndDetail}</p><p>{message}</p>" - */ - VERBOSE_TEMPLATE : "

                    {label} {totalTime}ms (+{elapsedTime}) {localTime}:

                    {sourceAndDetail}

                    {message}

                    ", - - /** - * Template used for innerHTML of compact entry output. - * @property BASIC_TEMPLATE - * @static - * @default "<p><span class='{category}'>{label}</span>{totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}</p>" - */ - BASIC_TEMPLATE : "

                    {label} {totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}

                    " -}); - -///////////////////////////////////////////////////////////////////////////// -// -// Public member variables -// -///////////////////////////////////////////////////////////////////////////// - -LogReader.prototype = { - /** - * Whether or not LogReader is enabled to output log messages. - * - * @property logReaderEnabled - * @type Boolean - * @default true - */ - logReaderEnabled : true, - - /** - * Public member to access CSS width of the LogReader container. - * - * @property width - * @type String - */ - width : null, - - /** - * Public member to access CSS height of the LogReader container. - * - * @property height - * @type String - */ - height : null, - - /** - * Public member to access CSS top position of the LogReader container. - * - * @property top - * @type String - */ - top : null, - - /** - * Public member to access CSS left position of the LogReader container. - * - * @property left - * @type String - */ - left : null, - - /** - * Public member to access CSS right position of the LogReader container. - * - * @property right - * @type String - */ - right : null, - - /** - * Public member to access CSS bottom position of the LogReader container. - * - * @property bottom - * @type String - */ - bottom : null, - - /** - * Public member to access CSS font size of the LogReader container. - * - * @property fontSize - * @type String - */ - fontSize : null, - - /** - * Whether or not the footer UI is enabled for the LogReader. - * - * @property footerEnabled - * @type Boolean - * @default true - */ - footerEnabled : true, - - /** - * Whether or not output is verbose (more readable). Setting to true will make - * output more compact (less readable). - * - * @property verboseOutput - * @type Boolean - * @default true - */ - verboseOutput : true, - - /** - * Custom output format for log messages. Defaults to null, which falls - * back to verboseOutput param deciding between LogReader.VERBOSE_TEMPLATE - * and LogReader.BASIC_TEMPLATE. Use bracketed place holders to mark where - * message info should go. Available place holder names include: - *
                      - *
                    • category
                    • - *
                    • label
                    • - *
                    • sourceAndDetail
                    • - *
                    • message
                    • - *
                    • localTime
                    • - *
                    • elapsedTime
                    • - *
                    • totalTime
                    • - *
                    - * - * @property entryFormat - * @type String - * @default null - */ - entryFormat : null, - - /** - * Whether or not newest message is printed on top. - * - * @property newestOnTop - * @type Boolean - */ - newestOnTop : true, - - /** - * Output timeout buffer in milliseconds. - * - * @property outputBuffer - * @type Number - * @default 100 - */ - outputBuffer : 100, - - /** - * Maximum number of messages a LogReader console will display. - * - * @property thresholdMax - * @type Number - * @default 500 - */ - thresholdMax : 500, - - /** - * When a LogReader console reaches its thresholdMax, it will clear out messages - * and print out the latest thresholdMin number of messages. - * - * @property thresholdMin - * @type Number - * @default 100 - */ - thresholdMin : 100, - - /** - * True when LogReader is in a collapsed state, false otherwise. - * - * @property isCollapsed - * @type Boolean - * @default false - */ - isCollapsed : false, - - /** - * True when LogReader is in a paused state, false otherwise. - * - * @property isPaused - * @type Boolean - * @default false - */ - isPaused : false, - - /** - * Enables draggable LogReader if DragDrop Utility is present. - * - * @property draggable - * @type Boolean - * @default true - */ - draggable : true, - - ///////////////////////////////////////////////////////////////////////////// - // - // Public methods - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Public accessor to the unique name of the LogReader instance. - * - * @method toString - * @return {String} Unique name of the LogReader instance. - */ - toString : function() { - return "LogReader instance" + this._sName; - }, - /** - * Pauses output of log messages. While paused, log messages are not lost, but - * get saved to a buffer and then output upon resume of LogReader. - * - * @method pause - */ - pause : function() { - this.isPaused = true; - this._timeout = null; - this.logReaderEnabled = false; - if (this._btnPause) { - this._btnPause.value = "Resume"; - } - }, - - /** - * Resumes output of log messages, including outputting any log messages that - * have been saved to buffer while paused. - * - * @method resume - */ - resume : function() { - this.isPaused = false; - this.logReaderEnabled = true; - this._printBuffer(); - if (this._btnPause) { - this._btnPause.value = "Pause"; - } - }, - - /** - * Adds the UI to the DOM, attaches event listeners, and bootstraps initial - * UI state. - * - * @method render - */ - render : function () { - if (this.rendered) { - return; - } - - this._initContainerEl(); - - this._initHeaderEl(); - this._initConsoleEl(); - this._initFooterEl(); - - this._initCategories(); - this._initSources(); - - this._initDragDrop(); - - // Subscribe to Logger custom events - Logger.newLogEvent.subscribe(this._onNewLog, this); - Logger.logResetEvent.subscribe(this._onReset, this); - - Logger.categoryCreateEvent.subscribe(this._onCategoryCreate, this); - Logger.sourceCreateEvent.subscribe(this._onSourceCreate, this); - - this.rendered = true; - - this._filterLogs(); - }, - - /** - * Removes the UI from the DOM entirely and detaches all event listeners. - * Implementers should note that Logger will still accumulate messages. - * - * @method destroy - */ - destroy : function () { - Event.purgeElement(this._elContainer,true); - this._elContainer.innerHTML = ''; - this._elContainer.parentNode.removeChild(this._elContainer); - - this.rendered = false; - }, - - /** - * Hides UI of LogReader. Logging functionality is not disrupted. - * - * @method hide - */ - hide : function() { - this._elContainer.style.display = "none"; - }, - - /** - * Shows UI of LogReader. Logging functionality is not disrupted. - * - * @method show - */ - show : function() { - this._elContainer.style.display = "block"; - }, - - /** - * Collapses UI of LogReader. Logging functionality is not disrupted. - * - * @method collapse - */ - collapse : function() { - this._elConsole.style.display = "none"; - if(this._elFt) { - this._elFt.style.display = "none"; - } - this._btnCollapse.value = "Expand"; - this.isCollapsed = true; - }, - - /** - * Expands UI of LogReader. Logging functionality is not disrupted. - * - * @method expand - */ - expand : function() { - this._elConsole.style.display = "block"; - if(this._elFt) { - this._elFt.style.display = "block"; - } - this._btnCollapse.value = "Collapse"; - this.isCollapsed = false; - }, - - /** - * Returns related checkbox element for given filter (i.e., category or source). - * - * @method getCheckbox - * @param {String} Category or source name. - * @return {Array} Array of all filter checkboxes. - */ - getCheckbox : function(filter) { - return this._filterCheckboxes[filter]; - }, - - /** - * Returns array of enabled categories. - * - * @method getCategories - * @return {String[]} Array of enabled categories. - */ - getCategories : function() { - return this._categoryFilters; - }, - - /** - * Shows log messages associated with given category. - * - * @method showCategory - * @param {String} Category name. - */ - showCategory : function(sCategory) { - var filtersArray = this._categoryFilters; - // Don't do anything if category is already enabled - // Use Array.indexOf if available... - if(filtersArray.indexOf) { - if(filtersArray.indexOf(sCategory) > -1) { - return; - } - } - // ...or do it the old-fashioned way - else { - for(var i=0; i -1) { - return; - } - } - // ...or do it the old-fashioned way - else { - for(var i=0; i", and "&" to HTML entities. - * - * @method html2Text - * @param sHtml {String} String to convert. - * @private - */ - html2Text : function(sHtml) { - if(sHtml) { - sHtml += ""; - return sHtml.replace(/&/g, "&"). - replace(//g, ">"); - } - return ""; - }, - -///////////////////////////////////////////////////////////////////////////// -// -// Private member variables -// -///////////////////////////////////////////////////////////////////////////// - - /** - * Name of LogReader instance. - * - * @property _sName - * @type String - * @private - */ - _sName : null, - - //TODO: remove - /** - * A class member shared by all LogReaders if a container needs to be - * created during instantiation. Will be null if a container element never needs to - * be created on the fly, such as when the implementer passes in their own element. - * - * @property _elDefaultContainer - * @type HTMLElement - * @private - */ - //YAHOO.widget.LogReader._elDefaultContainer = null; - - /** - * Buffer of log message objects for batch output. - * - * @property _buffer - * @type Object[] - * @private - */ - _buffer : null, - - /** - * Number of log messages output to console. - * - * @property _consoleMsgCount - * @type Number - * @default 0 - * @private - */ - _consoleMsgCount : 0, - - /** - * Date of last output log message. - * - * @property _lastTime - * @type Date - * @private - */ - _lastTime : null, - - /** - * Batched output timeout ID. - * - * @property _timeout - * @type Number - * @private - */ - _timeout : null, - - /** - * Hash of filters and their related checkbox elements. - * - * @property _filterCheckboxes - * @type Object - * @private - */ - _filterCheckboxes : null, - - /** - * Array of filters for log message categories. - * - * @property _categoryFilters - * @type String[] - * @private - */ - _categoryFilters : null, - - /** - * Array of filters for log message sources. - * - * @property _sourceFilters - * @type String[] - * @private - */ - _sourceFilters : null, - - /** - * LogReader container element. - * - * @property _elContainer - * @type HTMLElement - * @private - */ - _elContainer : null, - - /** - * LogReader header element. - * - * @property _elHd - * @type HTMLElement - * @private - */ - _elHd : null, - - /** - * LogReader collapse element. - * - * @property _elCollapse - * @type HTMLElement - * @private - */ - _elCollapse : null, - - /** - * LogReader collapse button element. - * - * @property _btnCollapse - * @type HTMLElement - * @private - */ - _btnCollapse : null, - - /** - * LogReader title header element. - * - * @property _title - * @type HTMLElement - * @private - */ - _title : null, - - /** - * LogReader console element. - * - * @property _elConsole - * @type HTMLElement - * @private - */ - _elConsole : null, - - /** - * LogReader footer element. - * - * @property _elFt - * @type HTMLElement - * @private - */ - _elFt : null, - - /** - * LogReader buttons container element. - * - * @property _elBtns - * @type HTMLElement - * @private - */ - _elBtns : null, - - /** - * Container element for LogReader category filter checkboxes. - * - * @property _elCategoryFilters - * @type HTMLElement - * @private - */ - _elCategoryFilters : null, - - /** - * Container element for LogReader source filter checkboxes. - * - * @property _elSourceFilters - * @type HTMLElement - * @private - */ - _elSourceFilters : null, - - /** - * LogReader pause button element. - * - * @property _btnPause - * @type HTMLElement - * @private - */ - _btnPause : null, - - /** - * Clear button element. - * - * @property _btnClear - * @type HTMLElement - * @private - */ - _btnClear : null, - - ///////////////////////////////////////////////////////////////////////////// - // - // Private methods - // - ///////////////////////////////////////////////////////////////////////////// - - /** - * Initializes the instance's message buffer, start time, etc - * - * @method _init - * @param container {String|HTMLElement} (optional) the render target - * @param config {Object} (optional) instance configuration - * @protected - */ - _init : function (container, config) { - // Internal vars - this._buffer = []; // output buffer - this._filterCheckboxes = {}; // pointers to checkboxes - this._lastTime = Logger.getStartTime(); // timestamp of last log message to console - - // Parse config vars here - if (config && (config.constructor == Object)) { - for(var param in config) { - if (config.hasOwnProperty(param)) { - this[param] = config[param]; - } - } - } - - this._elContainer = Dom.get(container); - - YAHOO.log("LogReader initialized", null, this.toString()); - }, - - /** - * Initializes the primary container element. - * - * @method _initContainerEl - * @private - */ - _initContainerEl : function() { - - // Default the container if unset or not a div - if(!this._elContainer || !/div$/i.test(this._elContainer.tagName)) { - this._elContainer = d.body.insertBefore(make("div"),d.body.firstChild); - // Only position absolutely if an in-DOM element is not supplied - Dom.addClass(this._elContainer,"yui-log-container"); - } - - Dom.addClass(this._elContainer,"yui-log"); - - // If implementer has provided container values, trust and set those - var style = this._elContainer.style, - styleProps = ['width','right','top','fontSize'], - prop,i; - - for (i = styleProps.length - 1; i >= 0; --i) { - prop = styleProps[i]; - if (this[prop]){ - style[prop] = this[prop]; - } - } - - if(this.left) { - style.left = this.left; - style.right = "auto"; - } - if(this.bottom) { - style.bottom = this.bottom; - style.top = "auto"; - } - - // Opera needs a little prodding to reflow sometimes - if (YAHOO.env.ua.opera) { - d.body.style += ''; - } - - }, - - /** - * Initializes the header element. - * - * @method _initHeaderEl - * @private - */ - _initHeaderEl : function() { - // Destroy header if present - if(this._elHd) { - // Unhook DOM events - Event.purgeElement(this._elHd, true); - - // Remove DOM elements - this._elHd.innerHTML = ""; - } - - // Create header - // TODO: refactor this into an innerHTML - this._elHd = make("div",{ - id: 'yui-log-hd' + this._sName, - className: "yui-log-hd" - }); - - this._elCollapse = make("div",{ className: 'yui-log-btns' }); - - this._btnCollapse = make("input",{ - type: 'button', - className: 'yui-log-button', - value: 'Collapse' - }); - Event.on(this._btnCollapse,'click',this._onClickCollapseBtn,this); - - - this._title = make("h4",{ innerHTML : "Logger Console" }); - - this._elCollapse.appendChild(this._btnCollapse); - this._elHd.appendChild(this._elCollapse); - this._elHd.appendChild(this._title); - this._elContainer.appendChild(this._elHd); - }, - - /** - * Initializes the console element. - * - * @method _initConsoleEl - * @private - */ - _initConsoleEl : function() { - // Destroy console - if(this._elConsole) { - // Unhook DOM events - Event.purgeElement(this._elConsole, true); - - // Remove DOM elements - this._elConsole.innerHTML = ""; - } - - // Ceate console - this._elConsole = make("div", { className: "yui-log-bd" }); - - // If implementer has provided console, trust and set those - if(this.height) { - this._elConsole.style.height = this.height; - } - - this._elContainer.appendChild(this._elConsole); - }, - - /** - * Initializes the footer element. - * - * @method _initFooterEl - * @private - */ - _initFooterEl : function() { - // Don't create footer elements if footer is disabled - if(this.footerEnabled) { - // Destroy console - if(this._elFt) { - // Unhook DOM events - Event.purgeElement(this._elFt, true); - - // Remove DOM elements - this._elFt.innerHTML = ""; - } - - // TODO: use innerHTML - this._elFt = make("div",{ className: "yui-log-ft" }); - this._elBtns = make("div", { className: "yui-log-btns" }); - this._btnPause = make("input", { - type: "button", - className: "yui-log-button", - value: "Pause" - }); - - Event.on(this._btnPause,'click',this._onClickPauseBtn,this); - - this._btnClear = make("input", { - type: "button", - className: "yui-log-button", - value: "Clear" - }); - - Event.on(this._btnClear,'click',this._onClickClearBtn,this); - - this._elCategoryFilters = make("div", { className: "yui-log-categoryfilters" }); - this._elSourceFilters = make("div", { className: "yui-log-sourcefilters" }); - - this._elBtns.appendChild(this._btnPause); - this._elBtns.appendChild(this._btnClear); - this._elFt.appendChild(this._elBtns); - this._elFt.appendChild(this._elCategoryFilters); - this._elFt.appendChild(this._elSourceFilters); - this._elContainer.appendChild(this._elFt); - } - }, - - /** - * Initializes Drag and Drop on the header element. - * - * @method _initDragDrop - * @private - */ - _initDragDrop : function() { - // If Drag and Drop utility is available... - // ...and draggable is true... - // ...then make the header draggable - if(u.DD && this.draggable && this._elHd) { - var ylog_dd = new u.DD(this._elContainer); - ylog_dd.setHandleElId(this._elHd.id); - //TODO: use class name - this._elHd.style.cursor = "move"; - } - }, - - /** - * Initializes category filters. - * - * @method _initCategories - * @private - */ - _initCategories : function() { - // Initialize category filters - this._categoryFilters = []; - var aInitialCategories = Logger.categories; - - for(var j=0; j < aInitialCategories.length; j++) { - var sCategory = aInitialCategories[j]; - - // Add category to the internal array of filters - this._categoryFilters.push(sCategory); - - // Add checkbox element if UI is enabled - if(this._elCategoryFilters) { - this._createCategoryCheckbox(sCategory); - } - } - }, - - /** - * Initializes source filters. - * - * @method _initSources - * @private - */ - _initSources : function() { - // Initialize source filters - this._sourceFilters = []; - var aInitialSources = Logger.sources; - - for(var j=0; j < aInitialSources.length; j++) { - var sSource = aInitialSources[j]; - - // Add source to the internal array of filters - this._sourceFilters.push(sSource); - - // Add checkbox element if UI is enabled - if(this._elSourceFilters) { - this._createSourceCheckbox(sSource); - } - } - }, - - /** - * Creates the UI for a category filter in the LogReader footer element. - * - * @method _createCategoryCheckbox - * @param sCategory {String} Category name. - * @private - */ - _createCategoryCheckbox : function(sCategory) { - if(this._elFt) { - var filter = make("span",{ className: "yui-log-filtergrp" }), - check = make("input", { - id: "yui-log-filter-" + sCategory + this._sName, - className: "yui-log-filter-" + sCategory, - type: "checkbox", - category: sCategory - }), - label = make("label", { - htmlFor: check.id, - className: sCategory, - innerHTML: sCategory - }); - - - // Subscribe to the click event - Event.on(check,'click',this._onCheckCategory,this); - - this._filterCheckboxes[sCategory] = check; - - // Append el at the end so IE 5.5 can set "type" attribute - // and THEN set checked property - filter.appendChild(check); - filter.appendChild(label); - this._elCategoryFilters.appendChild(filter); - check.checked = true; - } - }, - - /** - * Creates a checkbox in the LogReader footer element to filter by source. - * - * @method _createSourceCheckbox - * @param sSource {String} Source name. - * @private - */ - _createSourceCheckbox : function(sSource) { - if(this._elFt) { - var filter = make("span",{ className: "yui-log-filtergrp" }), - check = make("input", { - id: "yui-log-filter-" + sSource + this._sName, - className: "yui-log-filter-" + sSource, - type: "checkbox", - source: sSource - }), - label = make("label", { - htmlFor: check.id, - className: sSource, - innerHTML: sSource - }); - - - // Subscribe to the click event - Event.on(check,'click',this._onCheckSource,this); - - this._filterCheckboxes[sSource] = check; - - // Append el at the end so IE 5.5 can set "type" attribute - // and THEN set checked property - filter.appendChild(check); - filter.appendChild(label); - this._elSourceFilters.appendChild(filter); - check.checked = true; - } - }, - - /** - * Reprints all log messages in the stack through filters. - * - * @method _filterLogs - * @private - */ - _filterLogs : function() { - // Reprint stack with new filters - if (this._elConsole !== null) { - this.clearConsole(); - this._printToConsole(Logger.getStack()); - } - }, - - /** - * Sends buffer of log messages to output and clears buffer. - * - * @method _printBuffer - * @private - */ - _printBuffer : function() { - this._timeout = null; - - if(this._elConsole !== null) { - var thresholdMax = this.thresholdMax; - thresholdMax = (thresholdMax && !isNaN(thresholdMax)) ? thresholdMax : 500; - if(this._consoleMsgCount < thresholdMax) { - var entries = []; - for (var i=0; i this.thresholdMax)) { - thresholdMin = 0; - } - entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0; - - // Iterate through all log entries - for(i=entriesStartIndex; i - *
                  • rowsPerPage : n (int)
                  • - *
                  • totalRecords : n (int or Paginator.VALUE_UNLIMITED)
                  • - *
                  • containers : id | el | arr (HTMLElement reference, its id, or an array of either)
                  • - * - * - * @namespace YAHOO.widget - * @class Paginator - * @constructor - * @param config {Object} Object literal to set instance and ui component - * configuration. - */ -function Paginator(config) { - var UNLIMITED = Paginator.VALUE_UNLIMITED, - attrib, initialPage, records, perPage, startIndex; - - config = isObject(config) ? config : {}; - - this.initConfig(); - - this.initEvents(); - - // Set the basic config keys first - this.set('rowsPerPage',config.rowsPerPage,true); - if (Paginator.isNumeric(config.totalRecords)) { - this.set('totalRecords',config.totalRecords,true); - } - - this.initUIComponents(); - - // Update the other config values - for (attrib in config) { - if (config.hasOwnProperty(attrib)) { - this.set(attrib,config[attrib],true); - } - } - - // Calculate the initial record offset - initialPage = this.get('initialPage'); - records = this.get('totalRecords'); - perPage = this.get('rowsPerPage'); - if (initialPage > 1 && perPage !== UNLIMITED) { - startIndex = (initialPage - 1) * perPage; - if (records === UNLIMITED || startIndex < records) { - this.set('recordOffset',startIndex,true); - } - } -} - - -// Static members -lang.augmentObject(Paginator, { - /** - * Incrementing index used to give instances unique ids. - * @static - * @property Paginator.id - * @type number - * @private - */ - id : 0, - - /** - * Base of id strings used for ui components. - * @static - * @property Paginator.ID_BASE - * @type string - * @private - */ - ID_BASE : 'yui-pg', - - /** - * Used to identify unset, optional configurations, or used explicitly in - * the case of totalRecords to indicate unlimited pagination. - * @static - * @property Paginator.VALUE_UNLIMITED - * @type number - * @final - */ - VALUE_UNLIMITED : -1, - - /** - * Default template used by Paginator instances. Update this if you want - * all new Paginators to use a different default template. - * @static - * @property Paginator.TEMPLATE_DEFAULT - * @type string - */ - TEMPLATE_DEFAULT : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}", - - /** - * Common alternate pagination format, including page links, links for - * previous, next, first and last pages as well as a rows-per-page - * dropdown. Offered as a convenience. - * @static - * @property Paginator.TEMPLATE_ROWS_PER_PAGE - * @type string - */ - TEMPLATE_ROWS_PER_PAGE : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}", - - /** - * Storage object for UI Components - * @static - * @property Paginator.ui - */ - ui : {}, - - /** - * Similar to YAHOO.lang.isNumber, but allows numeric strings. This is - * is used for attribute validation in conjunction with getters that return - * numbers. - * - * @method Paginator.isNumeric - * @param v {Number|String} value to be checked for number or numeric string - * @returns {Boolean} true if the input is coercable into a finite number - * @static - */ - isNumeric : function (v) { - return isFinite(+v); - }, - - /** - * Return a number or null from input - * - * @method Paginator.toNumber - * @param n {Number|String} a number or numeric string - * @return Number - * @static - */ - toNumber : function (n) { - return isFinite(+n) ? +n : null; - } - -},true); - - -// Instance members and methods -Paginator.prototype = { - - // Instance members - - /** - * Array of nodes in which to render pagination controls. This is set via - * the "containers" attribute. - * @property _containers - * @type Array(HTMLElement) - * @private - */ - _containers : [], - - /** - * Flag used to indicate multiple attributes are being updated via setState - * @property _batch - * @type boolean - * @protected - */ - _batch : false, - - /** - * Used by setState to indicate when a page change has occurred - * @property _pageChanged - * @type boolean - * @protected - */ - _pageChanged : false, - - /** - * Temporary state cache used by setState to keep track of the previous - * state for eventual pageChange event firing - * @property _state - * @type Object - * @protected - */ - _state : null, - - - // Instance methods - - /** - * Initialize the Paginator's attributes (see YAHOO.util.Element class - * AttributeProvider). - * @method initConfig - * @private - */ - initConfig : function () { - - var UNLIMITED = Paginator.VALUE_UNLIMITED; - - /** - * REQUIRED. Number of records constituting a "page" - * @attribute rowsPerPage - * @type integer - */ - this.setAttributeConfig('rowsPerPage', { - value : 0, - validator : Paginator.isNumeric, - setter : Paginator.toNumber - }); - - /** - * REQUIRED. Node references or ids of nodes in which to render the - * pagination controls. - * @attribute containers - * @type {string|HTMLElement|Array(string|HTMLElement)} - */ - this.setAttributeConfig('containers', { - value : null, - validator : function (val) { - if (!isArray(val)) { - val = [val]; - } - for (var i = 0, len = val.length; i < len; ++i) { - if (isString(val[i]) || - (isObject(val[i]) && val[i].nodeType === 1)) { - continue; - } - return false; - } - return true; - }, - method : function (val) { - val = Dom.get(val); - if (!isArray(val)) { - val = [val]; - } - this._containers = val; - } - }); - - /** - * Total number of records to paginate through - * @attribute totalRecords - * @type integer - * @default 0 - */ - this.setAttributeConfig('totalRecords', { - value : 0, - validator : Paginator.isNumeric, - setter : Paginator.toNumber - }); - - /** - * Zero based index of the record considered first on the current page. - * For page based interactions, don't modify this attribute directly; - * use setPage(n). - * @attribute recordOffset - * @type integer - * @default 0 - */ - this.setAttributeConfig('recordOffset', { - value : 0, - validator : function (val) { - var total = this.get('totalRecords'); - if (Paginator.isNumeric(val)) { - val = +val; - return total === UNLIMITED || total > val || - (total === 0 && val === 0); - } - - return false; - }, - setter : Paginator.toNumber - }); - - /** - * Page to display on initial paint - * @attribute initialPage - * @type integer - * @default 1 - */ - this.setAttributeConfig('initialPage', { - value : 1, - validator : Paginator.isNumeric, - setter : Paginator.toNumber - }); - - /** - * Template used to render controls. The string will be used as - * innerHTML on all specified container nodes. Bracketed keys - * (e.g. {pageLinks}) in the string will be replaced with an instance - * of the so named ui component. - * @see Paginator.TEMPLATE_DEFAULT - * @see Paginator.TEMPLATE_ROWS_PER_PAGE - * @attribute template - * @type string - */ - this.setAttributeConfig('template', { - value : Paginator.TEMPLATE_DEFAULT, - validator : isString - }); - - /** - * Class assigned to the element(s) containing pagination controls. - * @attribute containerClass - * @type string - * @default 'yui-pg-container' - */ - this.setAttributeConfig('containerClass', { - value : 'yui-pg-container', - validator : isString - }); - - /** - * Display pagination controls even when there is only one page. Set - * to false to forgo rendering and/or hide the containers when there - * is only one page of data. Note if you are using the rowsPerPage - * dropdown ui component, visibility will be maintained as long as the - * number of records exceeds the smallest page size. - * @attribute alwaysVisible - * @type boolean - * @default true - */ - this.setAttributeConfig('alwaysVisible', { - value : true, - validator : lang.isBoolean - }); - - /** - * Update the UI immediately upon interaction. If false, changeRequest - * subscribers or other external code will need to explicitly set the - * new values in the paginator to trigger repaint. - * @attribute updateOnChange - * @type boolean - * @default false - * @deprecated use changeRequest listener that calls setState - */ - this.setAttributeConfig('updateOnChange', { - value : false, - validator : lang.isBoolean - }); - - - - // Read only attributes - - /** - * Unique id assigned to this instance - * @attribute id - * @type integer - * @final - */ - this.setAttributeConfig('id', { - value : Paginator.id++, - readOnly : true - }); - - /** - * Indicator of whether the DOM nodes have been initially created - * @attribute rendered - * @type boolean - * @final - */ - this.setAttributeConfig('rendered', { - value : false, - readOnly : true - }); - - }, - - /** - * Initialize registered ui components onto this instance. - * @method initUIComponents - * @private - */ - initUIComponents : function () { - var ui = Paginator.ui, - name,UIComp; - for (name in ui) { - if (ui.hasOwnProperty(name)) { - UIComp = ui[name]; - if (isObject(UIComp) && isFunction(UIComp.init)) { - UIComp.init(this); - } - } - } - }, - - /** - * Initialize this instance's CustomEvents. - * @method initEvents - * @private - */ - initEvents : function () { - /** - * Event fired when the Paginator is initially rendered - * @event render - */ - this.createEvent('render'); - - /** - * Event fired when the Paginator is initially rendered - * @event rendered - * @deprecated use render event - */ - this.createEvent('rendered'); // backward compatibility - - /** - * Event fired when a change in pagination values is requested, - * either by interacting with the various ui components or via the - * setStartIndex(n) etc APIs. - * Subscribers will receive the proposed state as the first parameter. - * The proposed state object will contain the following keys: - *
                      - *
                    • paginator - the Paginator instance
                    • - *
                    • page
                    • - *
                    • totalRecords
                    • - *
                    • recordOffset - index of the first record on the new page
                    • - *
                    • rowsPerPage
                    • - *
                    • records - array containing [start index, end index] for the records on the new page
                    • - *
                    • before - object literal with all these keys for the current state
                    • - *
                    - * @event changeRequest - */ - this.createEvent('changeRequest'); - - /** - * Event fired when attribute changes have resulted in the calculated - * current page changing. - * @event pageChange - */ - this.createEvent('pageChange'); - - /** - * Event that fires before the destroy event. - * @event beforeDestroy - */ - this.createEvent('beforeDestroy'); - - /** - * Event used to trigger cleanup of ui components - * @event destroy - */ - this.createEvent('destroy'); - - this._selfSubscribe(); - }, - - /** - * Subscribes to instance attribute change events to automate certain - * behaviors. - * @method _selfSubscribe - * @protected - */ - _selfSubscribe : function () { - // Listen for changes to totalRecords and alwaysVisible - this.subscribe('totalRecordsChange',this.updateVisibility,this,true); - this.subscribe('alwaysVisibleChange',this.updateVisibility,this,true); - - // Fire the pageChange event when appropriate - this.subscribe('totalRecordsChange',this._handleStateChange,this,true); - this.subscribe('recordOffsetChange',this._handleStateChange,this,true); - this.subscribe('rowsPerPageChange',this._handleStateChange,this,true); - - // Update recordOffset when totalRecords is reduced below - this.subscribe('totalRecordsChange',this._syncRecordOffset,this,true); - }, - - /** - * Sets recordOffset to the starting index of the previous page when - * totalRecords is reduced below the current recordOffset. - * @method _syncRecordOffset - * @param e {Event} totalRecordsChange event - * @protected - */ - _syncRecordOffset : function (e) { - var v = e.newValue,rpp,state; - if (e.prevValue !== v) { - if (v !== Paginator.VALUE_UNLIMITED) { - rpp = this.get('rowsPerPage'); - - if (rpp && this.get('recordOffset') >= v) { - state = this.getState({ - totalRecords : e.prevValue, - recordOffset : this.get('recordOffset') - }); - - this.set('recordOffset', state.before.recordOffset); - this._firePageChange(state); - } - } - } - }, - - /** - * Fires the pageChange event when the state attributes have changed in - * such a way as to locate the current recordOffset on a new page. - * @method _handleStateChange - * @param e {Event} the attribute change event - * @protected - */ - _handleStateChange : function (e) { - if (e.prevValue !== e.newValue) { - var change = this._state || {}, - state; - - change[e.type.replace(/Change$/,'')] = e.prevValue; - state = this.getState(change); - - if (state.page !== state.before.page) { - if (this._batch) { - this._pageChanged = true; - } else { - this._firePageChange(state); - } - } - } - }, - - /** - * Fires a pageChange event in the form of a standard attribute change - * event with additional properties prevState and newState. - * @method _firePageChange - * @param state {Object} the result of getState(oldState) - * @protected - */ - _firePageChange : function (state) { - if (isObject(state)) { - var current = state.before; - delete state.before; - this.fireEvent('pageChange',{ - type : 'pageChange', - prevValue : state.page, - newValue : current.page, - prevState : state, - newState : current - }); - } - }, - - /** - * Render the pagination controls per the format attribute into the - * specified container nodes. - * @method render - * @return the Paginator instance - * @chainable - */ - render : function () { - if (this.get('rendered')) { - return this; - } - - var template = this.get('template'), - state = this.getState(), - // ex. yui-pg0-1 (first paginator, second container) - id_base = Paginator.ID_BASE + this.get('id') + '-', - i, len; - - // Assemble the containers, keeping them hidden - for (i = 0, len = this._containers.length; i < len; ++i) { - this._renderTemplate(this._containers[i],template,id_base+i,true); - } - - // Show the containers if appropriate - this.updateVisibility(); - - // Set render attribute manually to support its readOnly contract - if (this._containers.length) { - this.setAttributeConfig('rendered', { value: true }); - - this.fireEvent('render', state); - // For backward compatibility - this.fireEvent('rendered', state); - } - - return this; - }, - - /** - * Creates the individual ui components and renders them into a container. - * - * @method _renderTemplate - * @param container {HTMLElement} where to add the ui components - * @param template {String} the template to use as a guide for rendering - * @param id_base {String} id base for the container's ui components - * @param hide {Boolean} leave the container hidden after assembly - * @protected - */ - _renderTemplate : function (container, template, id_base, hide) { - var containerClass = this.get('containerClass'), - markers, i, len; - - if (!container) { - return; - } - - // Hide the container while its contents are rendered - Dom.setStyle(container,'display','none'); - - Dom.addClass(container, containerClass); - - // Place the template innerHTML, adding marker spans to the template - // html to indicate drop zones for ui components - container.innerHTML = template.replace(/\{([a-z0-9_ \-]+)\}/gi, - ''); - - // Replace each marker with the ui component's render() output - markers = Dom.getElementsByClassName('yui-pg-ui','span',container); - - for (i = 0, len = markers.length; i < len; ++i) { - this.renderUIComponent(markers[i], id_base); - } - - if (!hide) { - // Show the container allowing page reflow - Dom.setStyle(container,'display',''); - } - }, - - /** - * Replaces a marker node with a rendered UI component, determined by the - * yui-pg-ui-(UI component class name) in the marker's className. e.g. - * yui-pg-ui-PageLinks => new YAHOO.widget.Paginator.ui.PageLinks(this) - * - * @method renderUIComponent - * @param marker {HTMLElement} the marker node to replace - * @param id_base {String} string base the component's generated id - */ - renderUIComponent : function (marker, id_base) { - var par = marker.parentNode, - name = /yui-pg-ui-(\w+)/.exec(marker.className), - UIComp = name && Paginator.ui[name[1]], - comp; - - if (isFunction(UIComp)) { - comp = new UIComp(this); - if (isFunction(comp.render)) { - par.replaceChild(comp.render(id_base),marker); - } - } - }, - - /** - * Removes controls from the page and unhooks events. - * @method destroy - */ - destroy : function () { - this.fireEvent('beforeDestroy'); - this.fireEvent('destroy'); - - this.setAttributeConfig('rendered',{value:false}); - this.unsubscribeAll(); - }, - - /** - * Hides the containers if there is only one page of data and attribute - * alwaysVisible is false. Conversely, it displays the containers if either - * there is more than one page worth of data or alwaysVisible is turned on. - * @method updateVisibility - */ - updateVisibility : function (e) { - var alwaysVisible = this.get('alwaysVisible'), - totalRecords,visible,rpp,rppOptions,i,len; - - if (!e || e.type === 'alwaysVisibleChange' || !alwaysVisible) { - totalRecords = this.get('totalRecords'); - visible = true; - rpp = this.get('rowsPerPage'); - rppOptions = this.get('rowsPerPageOptions'); - - if (isArray(rppOptions)) { - for (i = 0, len = rppOptions.length; i < len; ++i) { - rpp = Math.min(rpp,rppOptions[i]); - } - } - - if (totalRecords !== Paginator.VALUE_UNLIMITED && - totalRecords <= rpp) { - visible = false; - } - - visible = visible || alwaysVisible; - - for (i = 0, len = this._containers.length; i < len; ++i) { - Dom.setStyle(this._containers[i],'display', - visible ? '' : 'none'); - } - } - }, - - - - - /** - * Get the configured container nodes - * @method getContainerNodes - * @return {Array} array of HTMLElement nodes - */ - getContainerNodes : function () { - return this._containers; - }, - - /** - * Get the total number of pages in the data set according to the current - * rowsPerPage and totalRecords values. If totalRecords is not set, or - * set to YAHOO.widget.Paginator.VALUE_UNLIMITED, returns - * YAHOO.widget.Paginator.VALUE_UNLIMITED. - * @method getTotalPages - * @return {number} - */ - getTotalPages : function () { - var records = this.get('totalRecords'), - perPage = this.get('rowsPerPage'); - - // rowsPerPage not set. Can't calculate - if (!perPage) { - return null; - } - - if (records === Paginator.VALUE_UNLIMITED) { - return Paginator.VALUE_UNLIMITED; - } - - return Math.ceil(records/perPage); - }, - - /** - * Does the requested page have any records? - * @method hasPage - * @param page {number} the page in question - * @return {boolean} - */ - hasPage : function (page) { - if (!lang.isNumber(page) || page < 1) { - return false; - } - - var totalPages = this.getTotalPages(); - - return (totalPages === Paginator.VALUE_UNLIMITED || totalPages >= page); - }, - - /** - * Get the page number corresponding to the current record offset. - * @method getCurrentPage - * @return {number} - */ - getCurrentPage : function () { - var perPage = this.get('rowsPerPage'); - if (!perPage || !this.get('totalRecords')) { - return 0; - } - return Math.floor(this.get('recordOffset') / perPage) + 1; - }, - - /** - * Are there records on the next page? - * @method hasNextPage - * @return {boolean} - */ - hasNextPage : function () { - var currentPage = this.getCurrentPage(), - totalPages = this.getTotalPages(); - - return currentPage && (totalPages === Paginator.VALUE_UNLIMITED || currentPage < totalPages); - }, - - /** - * Get the page number of the next page, or null if the current page is the - * last page. - * @method getNextPage - * @return {number} - */ - getNextPage : function () { - return this.hasNextPage() ? this.getCurrentPage() + 1 : null; - }, - - /** - * Is there a page before the current page? - * @method hasPreviousPage - * @return {boolean} - */ - hasPreviousPage : function () { - return (this.getCurrentPage() > 1); - }, - - /** - * Get the page number of the previous page, or null if the current page - * is the first page. - * @method getPreviousPage - * @return {number} - */ - getPreviousPage : function () { - return (this.hasPreviousPage() ? this.getCurrentPage() - 1 : 1); - }, - - /** - * Get the start and end record indexes of the specified page. - * @method getPageRecords - * @param page {number} (optional) The page (current page if not specified) - * @return {Array} [start_index, end_index] - */ - getPageRecords : function (page) { - if (!lang.isNumber(page)) { - page = this.getCurrentPage(); - } - - var perPage = this.get('rowsPerPage'), - records = this.get('totalRecords'), - start, end; - - if (!page || !perPage) { - return null; - } - - start = (page - 1) * perPage; - if (records !== Paginator.VALUE_UNLIMITED) { - if (start >= records) { - return null; - } - end = Math.min(start + perPage, records) - 1; - } else { - end = start + perPage - 1; - } - - return [start,end]; - }, - - /** - * Set the current page to the provided page number if possible. - * @method setPage - * @param newPage {number} the new page number - * @param silent {boolean} whether to forcibly avoid firing the - * changeRequest event - */ - setPage : function (page,silent) { - if (this.hasPage(page) && page !== this.getCurrentPage()) { - if (this.get('updateOnChange') || silent) { - this.set('recordOffset', (page - 1) * this.get('rowsPerPage')); - } else { - this.fireEvent('changeRequest',this.getState({'page':page})); - } - } - }, - - /** - * Get the number of rows per page. - * @method getRowsPerPage - * @return {number} the current setting of the rowsPerPage attribute - */ - getRowsPerPage : function () { - return this.get('rowsPerPage'); - }, - - /** - * Set the number of rows per page. - * @method setRowsPerPage - * @param rpp {number} the new number of rows per page - * @param silent {boolean} whether to forcibly avoid firing the - * changeRequest event - */ - setRowsPerPage : function (rpp,silent) { - if (Paginator.isNumeric(rpp) && +rpp > 0 && - +rpp !== this.get('rowsPerPage')) { - if (this.get('updateOnChange') || silent) { - this.set('rowsPerPage',rpp); - } else { - this.fireEvent('changeRequest', - this.getState({'rowsPerPage':+rpp})); - } - } - }, - - /** - * Get the total number of records. - * @method getTotalRecords - * @return {number} the current setting of totalRecords attribute - */ - getTotalRecords : function () { - return this.get('totalRecords'); - }, - - /** - * Set the total number of records. - * @method setTotalRecords - * @param total {number} the new total number of records - * @param silent {boolean} whether to forcibly avoid firing the changeRequest event - */ - setTotalRecords : function (total,silent) { - if (Paginator.isNumeric(total) && +total >= 0 && - +total !== this.get('totalRecords')) { - if (this.get('updateOnChange') || silent) { - this.set('totalRecords',total); - } else { - this.fireEvent('changeRequest', - this.getState({'totalRecords':+total})); - } - } - }, - - /** - * Get the index of the first record on the current page - * @method getStartIndex - * @return {number} the index of the first record on the current page - */ - getStartIndex : function () { - return this.get('recordOffset'); - }, - - /** - * Move the record offset to a new starting index. This will likely cause - * the calculated current page to change. You should probably use setPage. - * @method setStartIndex - * @param offset {number} the new record offset - * @param silent {boolean} whether to forcibly avoid firing the changeRequest event - */ - setStartIndex : function (offset,silent) { - if (Paginator.isNumeric(offset) && +offset >= 0 && - +offset !== this.get('recordOffset')) { - if (this.get('updateOnChange') || silent) { - this.set('recordOffset',offset); - } else { - this.fireEvent('changeRequest', - this.getState({'recordOffset':+offset})); - } - } - }, - - /** - * Get an object literal describing the current state of the paginator. If - * an object literal of proposed values is passed, the proposed state will - * be returned as an object literal with the following keys: - *
                      - *
                    • paginator - instance of the Paginator
                    • - *
                    • page - number
                    • - *
                    • totalRecords - number
                    • - *
                    • recordOffset - number
                    • - *
                    • rowsPerPage - number
                    • - *
                    • records - [ start_index, end_index ]
                    • - *
                    • before - (OPTIONAL) { state object literal for current state }
                    • - *
                    - * @method getState - * @return {object} - * @param changes {object} OPTIONAL object literal with proposed values - * Supported change keys include: - *
                      - *
                    • rowsPerPage
                    • - *
                    • totalRecords
                    • - *
                    • recordOffset OR
                    • - *
                    • page
                    • - *
                    - */ - getState : function (changes) { - var UNLIMITED = Paginator.VALUE_UNLIMITED, - M = Math, max = M.max, ceil = M.ceil, - currentState, state, offset; - - function normalizeOffset(offset,total,rpp) { - if (offset <= 0 || total === 0) { - return 0; - } - if (total === UNLIMITED || total > offset) { - return offset - (offset % rpp); - } - return total - (total % rpp || rpp); - } - - currentState = { - paginator : this, - totalRecords : this.get('totalRecords'), - rowsPerPage : this.get('rowsPerPage'), - records : this.getPageRecords() - }; - currentState.recordOffset = normalizeOffset( - this.get('recordOffset'), - currentState.totalRecords, - currentState.rowsPerPage); - currentState.page = ceil(currentState.recordOffset / - currentState.rowsPerPage) + 1; - - if (!changes) { - return currentState; - } - - state = { - paginator : this, - before : currentState, - - rowsPerPage : changes.rowsPerPage || currentState.rowsPerPage, - totalRecords : (Paginator.isNumeric(changes.totalRecords) ? - max(changes.totalRecords,UNLIMITED) : - +currentState.totalRecords) - }; - - if (state.totalRecords === 0) { - state.recordOffset = - state.page = 0; - } else { - offset = Paginator.isNumeric(changes.page) ? - (changes.page - 1) * state.rowsPerPage : - Paginator.isNumeric(changes.recordOffset) ? - +changes.recordOffset : - currentState.recordOffset; - - state.recordOffset = normalizeOffset(offset, - state.totalRecords, - state.rowsPerPage); - - state.page = ceil(state.recordOffset / state.rowsPerPage) + 1; - } - - state.records = [ state.recordOffset, - state.recordOffset + state.rowsPerPage - 1 ]; - - // limit upper index to totalRecords - 1 - if (state.totalRecords !== UNLIMITED && - state.recordOffset < state.totalRecords && state.records && - state.records[1] > state.totalRecords - 1) { - state.records[1] = state.totalRecords - 1; - } - - return state; - }, - - /** - * Convenience method to facilitate setting state attributes rowsPerPage, - * totalRecords, recordOffset in batch. Also supports calculating - * recordOffset from state.page if state.recordOffset is not provided. - * Fires only a single pageChange event, if appropriate. - * This will not fire a changeRequest event. - * @method setState - * @param state {Object} Object literal of attribute:value pairs to set - */ - setState : function (state) { - if (isObject(state)) { - // get flux state based on current state with before state as well - this._state = this.getState({}); - - // use just the state props from the input obj - state = { - page : state.page, - rowsPerPage : state.rowsPerPage, - totalRecords : state.totalRecords, - recordOffset : state.recordOffset - }; - - // calculate recordOffset from page if recordOffset not specified. - // not using lang.isNumber for support of numeric strings - if (state.page && state.recordOffset === undefined) { - state.recordOffset = (state.page - 1) * - (state.rowsPerPage || this.get('rowsPerPage')); - } - - this._batch = true; - this._pageChanged = false; - - for (var k in state) { - if (state.hasOwnProperty(k) && this._configs.hasOwnProperty(k)) { - this.set(k,state[k]); - } - } - - this._batch = false; - - if (this._pageChanged) { - this._pageChanged = false; - - this._firePageChange(this.getState(this._state)); - } - } - } -}; - -lang.augmentProto(Paginator, YAHOO.util.AttributeProvider); - -YAHOO.widget.Paginator = Paginator; -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the textual report of current pagination status. - * E.g. "Now viewing page 1 of 13". - * - * @namespace YAHOO.widget.Paginator.ui - * @class CurrentPageReport - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.CurrentPageReport = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange', this.update,this,true); - p.subscribe('rowsPerPageChange', this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('pageReportTemplateChange', this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - //TODO: make this work - p.subscribe('pageReportClassChange', this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.CurrentPageReport.init = function (p) { - - /** - * CSS class assigned to the span containing the info. - * @attribute pageReportClass - * @default 'yui-pg-current' - */ - p.setAttributeConfig('pageReportClass', { - value : 'yui-pg-current', - validator : l.isString - }); - - /** - * Used as innerHTML for the span. Place holders in the form of {name} - * will be replaced with the so named value from the key:value map - * generated by the function held in the pageReportValueGenerator attribute. - * @attribute pageReportTemplate - * @default '({currentPage} of {totalPages})' - * @see pageReportValueGenerator attribute - */ - p.setAttributeConfig('pageReportTemplate', { - value : '({currentPage} of {totalPages})', - validator : l.isString - }); - - /** - * Function to generate the value map used to populate the - * pageReportTemplate. The function is passed the Paginator instance as a - * parameter. The default function returns a map with the following keys: - *
                      - *
                    • currentPage
                    • - *
                    • totalPages
                    • - *
                    • startIndex
                    • - *
                    • endIndex
                    • - *
                    • startRecord
                    • - *
                    • endRecord
                    • - *
                    • totalRecords
                    • - *
                    - * @attribute pageReportValueGenarator - */ - p.setAttributeConfig('pageReportValueGenerator', { - value : function (paginator) { - var curPage = paginator.getCurrentPage(), - records = paginator.getPageRecords(); - - return { - 'currentPage' : records ? curPage : 0, - 'totalPages' : paginator.getTotalPages(), - 'startIndex' : records ? records[0] : 0, - 'endIndex' : records ? records[1] : 0, - 'startRecord' : records ? records[0] + 1 : 0, - 'endRecord' : records ? records[1] + 1 : 0, - 'totalRecords': paginator.get('totalRecords') - }; - }, - validator : l.isFunction - }); -}; - -/** - * Replace place holders in a string with the named values found in an - * object literal. - * @static - * @method sprintf - * @param template {string} The content string containing place holders - * @param values {object} The key:value pairs used to replace the place holders - * @return {string} - */ -Paginator.ui.CurrentPageReport.sprintf = function (template, values) { - return template.replace(/\{([\w\s\-]+)\}/g, function (x,key) { - return (key in values) ? values[key] : ''; - }); -}; - -Paginator.ui.CurrentPageReport.prototype = { - - /** - * Span node containing the formatted info - * @property span - * @type HTMLElement - * @private - */ - span : null, - - - /** - * Generate the span containing info formatted per the pageReportTemplate - * attribute. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - this.span = document.createElement('span'); - this.span.id = id_base + '-page-report'; - this.span.className = this.paginator.get('pageReportClass'); - this.update(); - - return this.span; - }, - - /** - * Regenerate the content of the span if appropriate. Calls - * CurrentPageReport.sprintf with the value of the pageReportTemplate - * attribute and the value map returned from pageReportValueGenerator - * function. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - this.span.innerHTML = Paginator.ui.CurrentPageReport.sprintf( - this.paginator.get('pageReportTemplate'), - this.paginator.get('pageReportValueGenerator')(this.paginator)); - }, - - /** - * Removes the link/span node and clears event listeners - * removal. - * @method destroy - * @private - */ - destroy : function () { - this.span.parentNode.removeChild(this.span); - this.span = null; - } - -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the page links - * - * @namespace YAHOO.widget.Paginator.ui - * @class PageLinks - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.PageLinks = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('pageLinksChange', this.rebuild,this,true); - p.subscribe('pageLinkClassChange', this.rebuild,this,true); - p.subscribe('currentPageClassChange', this.rebuild,this,true); - p.subscribe('destroy',this.destroy,this,true); - - //TODO: Make this work - p.subscribe('pageLinksContainerClassChange', this.rebuild,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.PageLinks.init = function (p) { - - /** - * CSS class assigned to each page link/span. - * @attribute pageLinkClass - * @default 'yui-pg-page' - */ - p.setAttributeConfig('pageLinkClass', { - value : 'yui-pg-page', - validator : l.isString - }); - - /** - * CSS class assigned to the current page span. - * @attribute currentPageClass - * @default 'yui-pg-current-page' - */ - p.setAttributeConfig('currentPageClass', { - value : 'yui-pg-current-page', - validator : l.isString - }); - - /** - * CSS class assigned to the span containing the page links. - * @attribute pageLinksContainerClass - * @default 'yui-pg-pages' - */ - p.setAttributeConfig('pageLinksContainerClass', { - value : 'yui-pg-pages', - validator : l.isString - }); - - /** - * Maximum number of page links to display at one time. - * @attribute pageLinks - * @default 10 - */ - p.setAttributeConfig('pageLinks', { - value : 10, - validator : Paginator.isNumeric - }); - - /** - * Function used generate the innerHTML for each page link/span. The - * function receives as parameters the page number and a reference to the - * paginator object. - * @attribute pageLabelBuilder - * @default function (page, paginator) { return page; } - */ - p.setAttributeConfig('pageLabelBuilder', { - value : function (page, paginator) { return page; }, - validator : l.isFunction - }); -}; - -/** - * Calculates start and end page numbers given a current page, attempting - * to keep the current page in the middle - * @static - * @method calculateRange - * @param {int} currentPage The current page - * @param {int} totalPages (optional) Maximum number of pages - * @param {int} numPages (optional) Preferred number of pages in range - * @return {Array} [start_page_number, end_page_number] - */ -Paginator.ui.PageLinks.calculateRange = function (currentPage,totalPages,numPages) { - var UNLIMITED = Paginator.VALUE_UNLIMITED, - start, end, delta; - - // Either has no pages, or unlimited pages. Show none. - if (!currentPage || numPages === 0 || totalPages === 0 || - (totalPages === UNLIMITED && numPages === UNLIMITED)) { - return [0,-1]; - } - - // Limit requested pageLinks if there are fewer totalPages - if (totalPages !== UNLIMITED) { - numPages = numPages === UNLIMITED ? - totalPages : - Math.min(numPages,totalPages); - } - - // Determine start and end, trying to keep current in the middle - start = Math.max(1,Math.ceil(currentPage - (numPages/2))); - if (totalPages === UNLIMITED) { - end = start + numPages - 1; - } else { - end = Math.min(totalPages, start + numPages - 1); - } - - // Adjust the start index when approaching the last page - delta = numPages - (end - start + 1); - start = Math.max(1, start - delta); - - return [start,end]; -}; - - -Paginator.ui.PageLinks.prototype = { - - /** - * Current page - * @property current - * @type number - * @private - */ - current : 0, - - /** - * Span node containing the page links - * @property container - * @type HTMLElement - * @private - */ - container : null, - - - /** - * Generate the nodes and return the container node containing page links - * appropriate to the current pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator; - - // Set up container - this.container = document.createElement('span'); - this.container.id = id_base + '-pages'; - this.container.className = p.get('pageLinksContainerClass'); - YAHOO.util.Event.on(this.container,'click',this.onClick,this,true); - - // Call update, flagging a need to rebuild - this.update({newValue : null, rebuild : true}); - - return this.container; - }, - - /** - * Update the links if appropriate - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var p = this.paginator, - currentPage = p.getCurrentPage(); - - // Replace content if there's been a change - if (this.current !== currentPage || !currentPage || e.rebuild) { - var labelBuilder = p.get('pageLabelBuilder'), - range = Paginator.ui.PageLinks.calculateRange( - currentPage, - p.getTotalPages(), - p.get('pageLinks')), - start = range[0], - end = range[1], - content = '', - linkTemplate,i; - - linkTemplate = '' + - labelBuilder(i,p) + ''; - } else { - content += - linkTemplate + i + '">' + labelBuilder(i,p) + ''; - } - } - - this.container.innerHTML = content; - } - }, - - /** - * Force a rebuild of the page links. - * @method rebuild - * @param e {CustomEvent} The calling change event - */ - rebuild : function (e) { - e.rebuild = true; - this.update(e); - }, - - /** - * Removes the page links container node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.container,true); - this.container.parentNode.removeChild(this.container); - this.container = null; - }, - - /** - * Listener for the container's onclick event. Looks for qualifying link - * clicks, and pulls the page number from the link's page attribute. - * Sends link's page attribute to the Paginator's setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - var t = YAHOO.util.Event.getTarget(e); - if (t && YAHOO.util.Dom.hasClass(t, - this.paginator.get('pageLinkClass'))) { - - YAHOO.util.Event.stopEvent(e); - - this.paginator.setPage(parseInt(t.getAttribute('page'),10)); - } - } - -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the first page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class FirstPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.FirstPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('firstPageLinkLabelChange',this.update,this,true); - p.subscribe('firstPageLinkClassChange',this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.FirstPageLink.init = function (p) { - - /** - * Used as innerHTML for the first page link/span. - * @attribute firstPageLinkLabel - * @default '<< first' - */ - p.setAttributeConfig('firstPageLinkLabel', { - value : '<< first', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute firstPageLinkClass - * @default 'yui-pg-first' - */ - p.setAttributeConfig('firstPageLinkClass', { - value : 'yui-pg-first', - validator : l.isString - }); -}; - -// Instance members and methods -Paginator.ui.FirstPageLink.prototype = { - - /** - * The currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('firstPageLinkClass'), - label = p.get('firstPageLinkLabel'); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - - this.link.id = id_base + '-first-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-first-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.current = p.getCurrentPage() > 1 ? this.link : this.span; - return this.current; - }, - - /** - * Swap the link and span nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var par = this.current ? this.current.parentNode : null; - if (this.paginator.getCurrentPage() > 1) { - if (par && this.current === this.span) { - par.replaceChild(this.link,this.current); - this.current = this.link; - } - } else { - if (par && this.current === this.link) { - par.replaceChild(this.span,this.current); - this.current = this.span; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * removal. - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Pass new value to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(1); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the last page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class LastPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.LastPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('lastPageLinkLabelChange',this.update,this,true); - p.subscribe('lastPageLinkClassChange', this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param paginator {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.LastPageLink.init = function (p) { - - /** - * Used as innerHTML for the last page link/span. - * @attribute lastPageLinkLabel - * @default 'last >>' - */ - p.setAttributeConfig('lastPageLinkLabel', { - value : 'last >>', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute lastPageLinkClass - * @default 'yui-pg-last' - */ - p.setAttributeConfig('lastPageLinkClass', { - value : 'yui-pg-last', - validator : l.isString - }); -}; - -Paginator.ui.LastPageLink.prototype = { - - /** - * Currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link HTMLElement node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - /** - * Empty place holder node for when the last page link is inappropriate to - * display in any form (unlimited paging). - * @property na - * @type HTMLElement - * @private - */ - na : null, - - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('lastPageLinkClass'), - label = p.get('lastPageLinkLabel'), - last = p.getTotalPages(); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - this.na = this.span.cloneNode(false); - - this.link.id = id_base + '-last-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-last-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.na.id = id_base + '-last-na'; - - switch (last) { - case Paginator.VALUE_UNLIMITED : - this.current = this.na; break; - case p.getCurrentPage() : - this.current = this.span; break; - default : - this.current = this.link; - } - - return this.current; - }, - - /** - * Swap the link, span, and na nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event (ignored) - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var par = this.current ? this.current.parentNode : null, - after = this.link; - - if (par) { - switch (this.paginator.getTotalPages()) { - case Paginator.VALUE_UNLIMITED : - after = this.na; break; - case this.paginator.getCurrentPage() : - after = this.span; break; - } - - if (this.current !== after) { - par.replaceChild(after,this.current); - this.current = after; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Passes to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(this.paginator.getTotalPages()); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the next page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class NextPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.NextPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange', this.update,this,true); - p.subscribe('rowsPerPageChange', this.update,this,true); - p.subscribe('totalRecordsChange', this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('nextPageLinkLabelChange', this.update,this,true); - p.subscribe('nextPageLinkClassChange', this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.NextPageLink.init = function (p) { - - /** - * Used as innerHTML for the next page link/span. - * @attribute nextPageLinkLabel - * @default 'next >' - */ - p.setAttributeConfig('nextPageLinkLabel', { - value : 'next >', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute nextPageLinkClass - * @default 'yui-pg-next' - */ - p.setAttributeConfig('nextPageLinkClass', { - value : 'yui-pg-next', - validator : l.isString - }); -}; - -Paginator.ui.NextPageLink.prototype = { - - /** - * Currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('nextPageLinkClass'), - label = p.get('nextPageLinkLabel'), - last = p.getTotalPages(); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - - this.link.id = id_base + '-next-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-next-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.current = p.getCurrentPage() === last ? this.span : this.link; - - return this.current; - }, - - /** - * Swap the link and span nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var last = this.paginator.getTotalPages(), - par = this.current ? this.current.parentNode : null; - - if (this.paginator.getCurrentPage() !== last) { - if (par && this.current === this.span) { - par.replaceChild(this.link,this.current); - this.current = this.link; - } - } else if (this.current === this.link) { - if (par) { - par.replaceChild(this.span,this.current); - this.current = this.span; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Passes to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(this.paginator.getNextPage()); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the previous page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class PreviousPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.PreviousPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('previousPageLinkLabelChange',this.update,this,true); - p.subscribe('previousPageLinkClassChange',this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.PreviousPageLink.init = function (p) { - - /** - * Used as innerHTML for the previous page link/span. - * @attribute previousPageLinkLabel - * @default '< prev' - */ - p.setAttributeConfig('previousPageLinkLabel', { - value : '< prev', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute previousPageLinkClass - * @default 'yui-pg-previous' - */ - p.setAttributeConfig('previousPageLinkClass', { - value : 'yui-pg-previous', - validator : l.isString - }); -}; - -Paginator.ui.PreviousPageLink.prototype = { - - /** - * Currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('previousPageLinkClass'), - label = p.get('previousPageLinkLabel'); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - - this.link.id = id_base + '-prev-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-prev-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.current = p.getCurrentPage() > 1 ? this.link : this.span; - return this.current; - }, - - /** - * Swap the link and span nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var par = this.current ? this.current.parentNode : null; - if (this.paginator.getCurrentPage() > 1) { - if (par && this.current === this.span) { - par.replaceChild(this.link,this.current); - this.current = this.link; - } - } else { - if (par && this.current === this.link) { - par.replaceChild(this.span,this.current); - this.current = this.span; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Passes to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(this.paginator.getPreviousPage()); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the rows-per-page dropdown - * - * @namespace YAHOO.widget.Paginator.ui - * @class RowsPerPageDropdown - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.RowsPerPageDropdown = function (p) { - this.paginator = p; - - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('rowsPerPageOptionsChange',this.rebuild,this,true); - p.subscribe('totalRecordsChange',this._handleTotalRecordsChange,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('rowsPerPageDropdownClassChange',this.rebuild,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.RowsPerPageDropdown.init = function (p) { - - /** - * Array of available rows-per-page sizes. Converted into select options. - * Array values may be positive integers or object literals in the form
                    - * { value : NUMBER, text : STRING } - * @attribute rowsPerPageOptions - * @default [] - */ - p.setAttributeConfig('rowsPerPageOptions', { - value : [], - validator : l.isArray - }); - - /** - * CSS class assigned to the select node - * @attribute rowsPerPageDropdownClass - * @default 'yui-pg-rpp-options' - */ - p.setAttributeConfig('rowsPerPageDropdownClass', { - value : 'yui-pg-rpp-options', - validator : l.isString - }); -}; - -Paginator.ui.RowsPerPageDropdown.prototype = { - - /** - * select node - * @property select - * @type HTMLElement - * @private - */ - select : null, - - - /** - * option node for the optional All value - * - * @property all - * @type HTMLElement - * @protected - */ - all : null, - - /** - * Generate the select and option nodes and returns the select node. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - this.select = document.createElement('select'); - this.select.id = id_base + '-rpp'; - this.select.className = this.paginator.get('rowsPerPageDropdownClass'); - this.select.title = 'Rows per page'; - - YAHOO.util.Event.on(this.select,'change',this.onChange,this,true); - - this.rebuild(); - - return this.select; - }, - - /** - * (Re)generate the select options. - * @method rebuild - */ - rebuild : function (e) { - var p = this.paginator, - sel = this.select, - options = p.get('rowsPerPageOptions'), - opt,cfg,val,i,len; - - this.all = null; - - for (i = 0, len = options.length; i < len; ++i) { - cfg = options[i]; - opt = sel.options[i] || - sel.appendChild(document.createElement('option')); - val = l.isValue(cfg.value) ? cfg.value : cfg; - opt.innerHTML = l.isValue(cfg.text) ? cfg.text : cfg; - - if (l.isString(val) && val.toLowerCase() === 'all') { - this.all = opt; - opt.value = p.get('totalRecords'); - } else{ - opt.value = val; - } - - } - - while (sel.options.length > options.length) { - sel.removeChild(sel.firstChild); - } - - this.update(); - }, - - /** - * Select the appropriate option if changed. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var rpp = this.paginator.get('rowsPerPage')+'', - options = this.select.options, - i,len; - - for (i = 0, len = options.length; i < len; ++i) { - if (options[i].value === rpp) { - options[i].selected = true; - break; - } - } - }, - - /** - * Listener for the select's onchange event. Sent to setRowsPerPage method. - * @method onChange - * @param e {DOMEvent} The change event - */ - onChange : function (e) { - this.paginator.setRowsPerPage( - parseInt(this.select.options[this.select.selectedIndex].value,10)); - }, - - /** - * Updates the all option value (and Paginator's rowsPerPage attribute if - * necessary) in response to a change in the Paginator's totalRecords. - * - * @method _handleTotalRecordsChange - * @param e {Event} attribute change event - * @protected - */ - _handleTotalRecordsChange : function (e) { - if (!this.all || (e && e.prevValue === e.newValue)) { - return; - } - - this.all.value = e.newValue; - if (this.all.selected) { - this.paginator.set('rowsPerPage',e.newValue); - } - }, - - /** - * Removes the select node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.select); - this.select.parentNode.removeChild(this.select); - this.select = null; - } -}; - -})(); -YAHOO.register("paginator", YAHOO.widget.Paginator, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/paginator-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/paginator-min.js deleted file mode 100644 index 967323a537..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/paginator/paginator-min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var D=YAHOO.util.Dom,F=YAHOO.lang,B=F.isObject,E=F.isFunction,C=F.isArray,A=F.isString;function G(K){var N=G.VALUE_UNLIMITED,L,H,I,J,M;K=B(K)?K:{};this.initConfig();this.initEvents();this.set("rowsPerPage",K.rowsPerPage,true);if(G.isNumeric(K.totalRecords)){this.set("totalRecords",K.totalRecords,true);}this.initUIComponents();for(L in K){if(K.hasOwnProperty(L)){this.set(L,K[L],true);}}H=this.get("initialPage");I=this.get("totalRecords");J=this.get("rowsPerPage");if(H>1&&J!==N){M=(H-1)*J;if(I===N||MJ||(I===0&&J===0);}return false;},setter:G.toNumber});this.setAttributeConfig("initialPage",{value:1,validator:G.isNumeric,setter:G.toNumber});this.setAttributeConfig("template",{value:G.TEMPLATE_DEFAULT,validator:A});this.setAttributeConfig("containerClass",{value:"yui-pg-container",validator:A});this.setAttributeConfig("alwaysVisible",{value:true,validator:F.isBoolean});this.setAttributeConfig("updateOnChange",{value:false,validator:F.isBoolean});this.setAttributeConfig("id",{value:G.id++,readOnly:true});this.setAttributeConfig("rendered",{value:false,readOnly:true});},initUIComponents:function(){var J=G.ui,I,H;for(I in J){if(J.hasOwnProperty(I)){H=J[I];if(B(H)&&E(H.init)){H.init(this);}}}},initEvents:function(){this.createEvent("render");this.createEvent("rendered");this.createEvent("changeRequest");this.createEvent("pageChange");this.createEvent("beforeDestroy");this.createEvent("destroy");this._selfSubscribe();},_selfSubscribe:function(){this.subscribe("totalRecordsChange",this.updateVisibility,this,true);this.subscribe("alwaysVisibleChange",this.updateVisibility,this,true);this.subscribe("totalRecordsChange",this._handleStateChange,this,true);this.subscribe("recordOffsetChange",this._handleStateChange,this,true);this.subscribe("rowsPerPageChange",this._handleStateChange,this,true);this.subscribe("totalRecordsChange",this._syncRecordOffset,this,true);},_syncRecordOffset:function(K){var H=K.newValue,J,I;if(K.prevValue!==H){if(H!==G.VALUE_UNLIMITED){J=this.get("rowsPerPage");if(J&&this.get("recordOffset")>=H){I=this.getState({totalRecords:K.prevValue,recordOffset:this.get("recordOffset")});this.set("recordOffset",I.before.recordOffset);this._firePageChange(I);}}}},_handleStateChange:function(I){if(I.prevValue!==I.newValue){var J=this._state||{},H;J[I.type.replace(/Change$/,"")]=I.prevValue;H=this.getState(J);if(H.page!==H.before.page){if(this._batch){this._pageChanged=true;}else{this._firePageChange(H);}}}},_firePageChange:function(H){if(B(H)){var I=H.before;delete H.before;this.fireEvent("pageChange",{type:"pageChange",prevValue:H.page,newValue:I.page,prevState:H,newState:I});}},render:function(){if(this.get("rendered")){return this;}var K=this.get("template"),L=this.getState(),J=G.ID_BASE+this.get("id")+"-",I,H;for(I=0,H=this._containers.length;I');N=D.getElementsByClassName("yui-pg-ui","span",I);for(J=0,H=N.length;J=I);},getCurrentPage:function(){var H=this.get("rowsPerPage");if(!H||!this.get("totalRecords")){return 0;}return Math.floor(this.get("recordOffset")/H)+1;},hasNextPage:function(){var H=this.getCurrentPage(),I=this.getTotalPages();return H&&(I===G.VALUE_UNLIMITED||H1); -},getPreviousPage:function(){return(this.hasPreviousPage()?this.getCurrentPage()-1:1);},getPageRecords:function(K){if(!F.isNumber(K)){K=this.getCurrentPage();}var J=this.get("rowsPerPage"),I=this.get("totalRecords"),L,H;if(!K||!J){return null;}L=(K-1)*J;if(I!==G.VALUE_UNLIMITED){if(L>=I){return null;}H=Math.min(L+J,I)-1;}else{H=L+J-1;}return[L,H];},setPage:function(I,H){if(this.hasPage(I)&&I!==this.getCurrentPage()){if(this.get("updateOnChange")||H){this.set("recordOffset",(I-1)*this.get("rowsPerPage"));}else{this.fireEvent("changeRequest",this.getState({"page":I}));}}},getRowsPerPage:function(){return this.get("rowsPerPage");},setRowsPerPage:function(I,H){if(G.isNumeric(I)&&+I>0&&+I!==this.get("rowsPerPage")){if(this.get("updateOnChange")||H){this.set("rowsPerPage",I);}else{this.fireEvent("changeRequest",this.getState({"rowsPerPage":+I}));}}},getTotalRecords:function(){return this.get("totalRecords");},setTotalRecords:function(I,H){if(G.isNumeric(I)&&+I>=0&&+I!==this.get("totalRecords")){if(this.get("updateOnChange")||H){this.set("totalRecords",I);}else{this.fireEvent("changeRequest",this.getState({"totalRecords":+I}));}}},getStartIndex:function(){return this.get("recordOffset");},setStartIndex:function(I,H){if(G.isNumeric(I)&&+I>=0&&+I!==this.get("recordOffset")){if(this.get("updateOnChange")||H){this.set("recordOffset",I);}else{this.fireEvent("changeRequest",this.getState({"recordOffset":+I}));}}},getState:function(O){var Q=G.VALUE_UNLIMITED,L=Math,N=L.max,P=L.ceil,J,H,K;function I(S,M,R){if(S<=0||M===0){return 0;}if(M===Q||M>S){return S-(S%R);}return M-(M%R||R);}J={paginator:this,totalRecords:this.get("totalRecords"),rowsPerPage:this.get("rowsPerPage"),records:this.getPageRecords()};J.recordOffset=I(this.get("recordOffset"),J.totalRecords,J.rowsPerPage);J.page=P(J.recordOffset/J.rowsPerPage)+1;if(!O){return J;}H={paginator:this,before:J,rowsPerPage:O.rowsPerPage||J.rowsPerPage,totalRecords:(G.isNumeric(O.totalRecords)?N(O.totalRecords,Q):+J.totalRecords)};if(H.totalRecords===0){H.recordOffset=H.page=0;}else{K=G.isNumeric(O.page)?(O.page-1)*H.rowsPerPage:G.isNumeric(O.recordOffset)?+O.recordOffset:J.recordOffset;H.recordOffset=I(K,H.totalRecords,H.rowsPerPage);H.page=P(H.recordOffset/H.rowsPerPage)+1;}H.records=[H.recordOffset,H.recordOffset+H.rowsPerPage-1];if(H.totalRecords!==Q&&H.recordOffsetH.totalRecords-1){H.records[1]=H.totalRecords-1;}return H;},setState:function(I){if(B(I)){this._state=this.getState({});I={page:I.page,rowsPerPage:I.rowsPerPage,totalRecords:I.totalRecords,recordOffset:I.recordOffset};if(I.page&&I.recordOffset===undefined){I.recordOffset=(I.page-1)*(I.rowsPerPage||this.get("rowsPerPage"));}this._batch=true;this._pageChanged=false;for(var H in I){if(I.hasOwnProperty(H)&&this._configs.hasOwnProperty(H)){this.set(H,I[H]);}}this._batch=false;if(this._pageChanged){this._pageChanged=false;this._firePageChange(this.getState(this._state));}}}};F.augmentProto(G,YAHOO.util.AttributeProvider);YAHOO.widget.Paginator=G;})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.CurrentPageReport=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("pageReportTemplateChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("pageReportClassChange",this.update,this,true);};B.ui.CurrentPageReport.init=function(C){C.setAttributeConfig("pageReportClass",{value:"yui-pg-current",validator:A.isString});C.setAttributeConfig("pageReportTemplate",{value:"({currentPage} of {totalPages})",validator:A.isString});C.setAttributeConfig("pageReportValueGenerator",{value:function(F){var E=F.getCurrentPage(),D=F.getPageRecords();return{"currentPage":D?E:0,"totalPages":F.getTotalPages(),"startIndex":D?D[0]:0,"endIndex":D?D[1]:0,"startRecord":D?D[0]+1:0,"endRecord":D?D[1]+1:0,"totalRecords":F.get("totalRecords")};},validator:A.isFunction});};B.ui.CurrentPageReport.sprintf=function(D,C){return D.replace(/\{([\w\s\-]+)\}/g,function(E,F){return(F in C)?C[F]:"";});};B.ui.CurrentPageReport.prototype={span:null,render:function(C){this.span=document.createElement("span");this.span.id=C+"-page-report";this.span.className=this.paginator.get("pageReportClass");this.update();return this.span;},update:function(C){if(C&&C.prevValue===C.newValue){return;}this.span.innerHTML=B.ui.CurrentPageReport.sprintf(this.paginator.get("pageReportTemplate"),this.paginator.get("pageReportValueGenerator")(this.paginator));},destroy:function(){this.span.parentNode.removeChild(this.span);this.span=null;}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.PageLinks=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("pageLinksChange",this.rebuild,this,true);C.subscribe("pageLinkClassChange",this.rebuild,this,true);C.subscribe("currentPageClassChange",this.rebuild,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("pageLinksContainerClassChange",this.rebuild,this,true);};B.ui.PageLinks.init=function(C){C.setAttributeConfig("pageLinkClass",{value:"yui-pg-page",validator:A.isString});C.setAttributeConfig("currentPageClass",{value:"yui-pg-current-page",validator:A.isString});C.setAttributeConfig("pageLinksContainerClass",{value:"yui-pg-pages",validator:A.isString});C.setAttributeConfig("pageLinks",{value:10,validator:B.isNumeric});C.setAttributeConfig("pageLabelBuilder",{value:function(D,E){return D;},validator:A.isFunction});};B.ui.PageLinks.calculateRange=function(E,F,D){var I=B.VALUE_UNLIMITED,H,C,G;if(!E||D===0||F===0||(F===I&&D===I)){return[0,-1];}if(F!==I){D=D===I?F:Math.min(D,F);}H=Math.max(1,Math.ceil(E-(D/2)));if(F===I){C=H+D-1;}else{C=Math.min(F,H+D-1);}G=D-(C-H+1);H=Math.max(1,H-G);return[H,C];};B.ui.PageLinks.prototype={current:0,container:null,render:function(C){var D=this.paginator; -this.container=document.createElement("span");this.container.id=C+"-pages";this.container.className=D.get("pageLinksContainerClass");YAHOO.util.Event.on(this.container,"click",this.onClick,this,true);this.update({newValue:null,rebuild:true});return this.container;},update:function(J){if(J&&J.prevValue===J.newValue){return;}var E=this.paginator,I=E.getCurrentPage();if(this.current!==I||!I||J.rebuild){var L=E.get("pageLabelBuilder"),H=B.ui.PageLinks.calculateRange(I,E.getTotalPages(),E.get("pageLinks")),D=H[0],F=H[1],K="",C,G;C=''+L(G,E)+"";}else{K+=C+G+'">'+L(G,E)+"";}}this.container.innerHTML=K;}},rebuild:function(C){C.rebuild=true;this.update(C);},destroy:function(){YAHOO.util.Event.purgeElement(this.container,true);this.container.parentNode.removeChild(this.container);this.container=null;},onClick:function(D){var C=YAHOO.util.Event.getTarget(D);if(C&&YAHOO.util.Dom.hasClass(C,this.paginator.get("pageLinkClass"))){YAHOO.util.Event.stopEvent(D);this.paginator.setPage(parseInt(C.getAttribute("page"),10));}}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.FirstPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("firstPageLinkLabelChange",this.update,this,true);C.subscribe("firstPageLinkClassChange",this.update,this,true);};B.ui.FirstPageLink.init=function(C){C.setAttributeConfig("firstPageLinkLabel",{value:"<< first",validator:A.isString});C.setAttributeConfig("firstPageLinkClass",{value:"yui-pg-first",validator:A.isString});};B.ui.FirstPageLink.prototype={current:null,link:null,span:null,render:function(D){var E=this.paginator,F=E.get("firstPageLinkClass"),C=E.get("firstPageLinkLabel");this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=D+"-first-link";this.link.href="#";this.link.className=F;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-first-span";this.span.className=F;this.span.innerHTML=C;this.current=E.getCurrentPage()>1?this.link:this.span;return this.current;},update:function(D){if(D&&D.prevValue===D.newValue){return;}var C=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()>1){if(C&&this.current===this.span){C.replaceChild(this.link,this.current);this.current=this.link;}}else{if(C&&this.current===this.link){C.replaceChild(this.span,this.current);this.current=this.span;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(1);}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.LastPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("lastPageLinkLabelChange",this.update,this,true);C.subscribe("lastPageLinkClassChange",this.update,this,true);};B.ui.LastPageLink.init=function(C){C.setAttributeConfig("lastPageLinkLabel",{value:"last >>",validator:A.isString});C.setAttributeConfig("lastPageLinkClass",{value:"yui-pg-last",validator:A.isString});};B.ui.LastPageLink.prototype={current:null,link:null,span:null,na:null,render:function(D){var F=this.paginator,G=F.get("lastPageLinkClass"),C=F.get("lastPageLinkLabel"),E=F.getTotalPages();this.link=document.createElement("a");this.span=document.createElement("span");this.na=this.span.cloneNode(false);this.link.id=D+"-last-link";this.link.href="#";this.link.className=G;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-last-span";this.span.className=G;this.span.innerHTML=C;this.na.id=D+"-last-na";switch(E){case B.VALUE_UNLIMITED:this.current=this.na;break;case F.getCurrentPage():this.current=this.span;break;default:this.current=this.link;}return this.current;},update:function(D){if(D&&D.prevValue===D.newValue){return;}var C=this.current?this.current.parentNode:null,E=this.link;if(C){switch(this.paginator.getTotalPages()){case B.VALUE_UNLIMITED:E=this.na;break;case this.paginator.getCurrentPage():E=this.span;break;}if(this.current!==E){C.replaceChild(E,this.current);this.current=E;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(this.paginator.getTotalPages());}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.NextPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("nextPageLinkLabelChange",this.update,this,true);C.subscribe("nextPageLinkClassChange",this.update,this,true);};B.ui.NextPageLink.init=function(C){C.setAttributeConfig("nextPageLinkLabel",{value:"next >",validator:A.isString});C.setAttributeConfig("nextPageLinkClass",{value:"yui-pg-next",validator:A.isString});};B.ui.NextPageLink.prototype={current:null,link:null,span:null,render:function(D){var F=this.paginator,G=F.get("nextPageLinkClass"),C=F.get("nextPageLinkLabel"),E=F.getTotalPages();this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=D+"-next-link";this.link.href="#";this.link.className=G;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-next-span";this.span.className=G; -this.span.innerHTML=C;this.current=F.getCurrentPage()===E?this.span:this.link;return this.current;},update:function(E){if(E&&E.prevValue===E.newValue){return;}var D=this.paginator.getTotalPages(),C=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()!==D){if(C&&this.current===this.span){C.replaceChild(this.link,this.current);this.current=this.link;}}else{if(this.current===this.link){if(C){C.replaceChild(this.span,this.current);this.current=this.span;}}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(this.paginator.getNextPage());}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.PreviousPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("previousPageLinkLabelChange",this.update,this,true);C.subscribe("previousPageLinkClassChange",this.update,this,true);};B.ui.PreviousPageLink.init=function(C){C.setAttributeConfig("previousPageLinkLabel",{value:"< prev",validator:A.isString});C.setAttributeConfig("previousPageLinkClass",{value:"yui-pg-previous",validator:A.isString});};B.ui.PreviousPageLink.prototype={current:null,link:null,span:null,render:function(D){var E=this.paginator,F=E.get("previousPageLinkClass"),C=E.get("previousPageLinkLabel");this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=D+"-prev-link";this.link.href="#";this.link.className=F;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-prev-span";this.span.className=F;this.span.innerHTML=C;this.current=E.getCurrentPage()>1?this.link:this.span;return this.current;},update:function(D){if(D&&D.prevValue===D.newValue){return;}var C=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()>1){if(C&&this.current===this.span){C.replaceChild(this.link,this.current);this.current=this.link;}}else{if(C&&this.current===this.link){C.replaceChild(this.span,this.current);this.current=this.span;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(this.paginator.getPreviousPage());}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.RowsPerPageDropdown=function(C){this.paginator=C;C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("rowsPerPageOptionsChange",this.rebuild,this,true);C.subscribe("totalRecordsChange",this._handleTotalRecordsChange,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("rowsPerPageDropdownClassChange",this.rebuild,this,true);};B.ui.RowsPerPageDropdown.init=function(C){C.setAttributeConfig("rowsPerPageOptions",{value:[],validator:A.isArray});C.setAttributeConfig("rowsPerPageDropdownClass",{value:"yui-pg-rpp-options",validator:A.isString});};B.ui.RowsPerPageDropdown.prototype={select:null,all:null,render:function(C){this.select=document.createElement("select");this.select.id=C+"-rpp";this.select.className=this.paginator.get("rowsPerPageDropdownClass");this.select.title="Rows per page";YAHOO.util.Event.on(this.select,"change",this.onChange,this,true);this.rebuild();return this.select;},rebuild:function(J){var C=this.paginator,E=this.select,K=C.get("rowsPerPageOptions"),D,I,F,G,H;this.all=null;for(G=0,H=K.length;GK.length){E.removeChild(E.firstChild);}this.update();},update:function(G){if(G&&G.prevValue===G.newValue){return;}var F=this.paginator.get("rowsPerPage")+"",D=this.select.options,E,C;for(E=0,C=D.length;E - *
                  • rowsPerPage : n (int)
                  • - *
                  • totalRecords : n (int or Paginator.VALUE_UNLIMITED)
                  • - *
                  • containers : id | el | arr (HTMLElement reference, its id, or an array of either)
                  • - * - * - * @namespace YAHOO.widget - * @class Paginator - * @constructor - * @param config {Object} Object literal to set instance and ui component - * configuration. - */ -function Paginator(config) { - var UNLIMITED = Paginator.VALUE_UNLIMITED, - attrib, initialPage, records, perPage, startIndex; - - config = isObject(config) ? config : {}; - - this.initConfig(); - - this.initEvents(); - - // Set the basic config keys first - this.set('rowsPerPage',config.rowsPerPage,true); - if (Paginator.isNumeric(config.totalRecords)) { - this.set('totalRecords',config.totalRecords,true); - } - - this.initUIComponents(); - - // Update the other config values - for (attrib in config) { - if (config.hasOwnProperty(attrib)) { - this.set(attrib,config[attrib],true); - } - } - - // Calculate the initial record offset - initialPage = this.get('initialPage'); - records = this.get('totalRecords'); - perPage = this.get('rowsPerPage'); - if (initialPage > 1 && perPage !== UNLIMITED) { - startIndex = (initialPage - 1) * perPage; - if (records === UNLIMITED || startIndex < records) { - this.set('recordOffset',startIndex,true); - } - } -} - - -// Static members -lang.augmentObject(Paginator, { - /** - * Incrementing index used to give instances unique ids. - * @static - * @property Paginator.id - * @type number - * @private - */ - id : 0, - - /** - * Base of id strings used for ui components. - * @static - * @property Paginator.ID_BASE - * @type string - * @private - */ - ID_BASE : 'yui-pg', - - /** - * Used to identify unset, optional configurations, or used explicitly in - * the case of totalRecords to indicate unlimited pagination. - * @static - * @property Paginator.VALUE_UNLIMITED - * @type number - * @final - */ - VALUE_UNLIMITED : -1, - - /** - * Default template used by Paginator instances. Update this if you want - * all new Paginators to use a different default template. - * @static - * @property Paginator.TEMPLATE_DEFAULT - * @type string - */ - TEMPLATE_DEFAULT : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}", - - /** - * Common alternate pagination format, including page links, links for - * previous, next, first and last pages as well as a rows-per-page - * dropdown. Offered as a convenience. - * @static - * @property Paginator.TEMPLATE_ROWS_PER_PAGE - * @type string - */ - TEMPLATE_ROWS_PER_PAGE : "{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}", - - /** - * Storage object for UI Components - * @static - * @property Paginator.ui - */ - ui : {}, - - /** - * Similar to YAHOO.lang.isNumber, but allows numeric strings. This is - * is used for attribute validation in conjunction with getters that return - * numbers. - * - * @method Paginator.isNumeric - * @param v {Number|String} value to be checked for number or numeric string - * @returns {Boolean} true if the input is coercable into a finite number - * @static - */ - isNumeric : function (v) { - return isFinite(+v); - }, - - /** - * Return a number or null from input - * - * @method Paginator.toNumber - * @param n {Number|String} a number or numeric string - * @return Number - * @static - */ - toNumber : function (n) { - return isFinite(+n) ? +n : null; - } - -},true); - - -// Instance members and methods -Paginator.prototype = { - - // Instance members - - /** - * Array of nodes in which to render pagination controls. This is set via - * the "containers" attribute. - * @property _containers - * @type Array(HTMLElement) - * @private - */ - _containers : [], - - /** - * Flag used to indicate multiple attributes are being updated via setState - * @property _batch - * @type boolean - * @protected - */ - _batch : false, - - /** - * Used by setState to indicate when a page change has occurred - * @property _pageChanged - * @type boolean - * @protected - */ - _pageChanged : false, - - /** - * Temporary state cache used by setState to keep track of the previous - * state for eventual pageChange event firing - * @property _state - * @type Object - * @protected - */ - _state : null, - - - // Instance methods - - /** - * Initialize the Paginator's attributes (see YAHOO.util.Element class - * AttributeProvider). - * @method initConfig - * @private - */ - initConfig : function () { - - var UNLIMITED = Paginator.VALUE_UNLIMITED; - - /** - * REQUIRED. Number of records constituting a "page" - * @attribute rowsPerPage - * @type integer - */ - this.setAttributeConfig('rowsPerPage', { - value : 0, - validator : Paginator.isNumeric, - setter : Paginator.toNumber - }); - - /** - * REQUIRED. Node references or ids of nodes in which to render the - * pagination controls. - * @attribute containers - * @type {string|HTMLElement|Array(string|HTMLElement)} - */ - this.setAttributeConfig('containers', { - value : null, - validator : function (val) { - if (!isArray(val)) { - val = [val]; - } - for (var i = 0, len = val.length; i < len; ++i) { - if (isString(val[i]) || - (isObject(val[i]) && val[i].nodeType === 1)) { - continue; - } - return false; - } - return true; - }, - method : function (val) { - val = Dom.get(val); - if (!isArray(val)) { - val = [val]; - } - this._containers = val; - } - }); - - /** - * Total number of records to paginate through - * @attribute totalRecords - * @type integer - * @default 0 - */ - this.setAttributeConfig('totalRecords', { - value : 0, - validator : Paginator.isNumeric, - setter : Paginator.toNumber - }); - - /** - * Zero based index of the record considered first on the current page. - * For page based interactions, don't modify this attribute directly; - * use setPage(n). - * @attribute recordOffset - * @type integer - * @default 0 - */ - this.setAttributeConfig('recordOffset', { - value : 0, - validator : function (val) { - var total = this.get('totalRecords'); - if (Paginator.isNumeric(val)) { - val = +val; - return total === UNLIMITED || total > val || - (total === 0 && val === 0); - } - - return false; - }, - setter : Paginator.toNumber - }); - - /** - * Page to display on initial paint - * @attribute initialPage - * @type integer - * @default 1 - */ - this.setAttributeConfig('initialPage', { - value : 1, - validator : Paginator.isNumeric, - setter : Paginator.toNumber - }); - - /** - * Template used to render controls. The string will be used as - * innerHTML on all specified container nodes. Bracketed keys - * (e.g. {pageLinks}) in the string will be replaced with an instance - * of the so named ui component. - * @see Paginator.TEMPLATE_DEFAULT - * @see Paginator.TEMPLATE_ROWS_PER_PAGE - * @attribute template - * @type string - */ - this.setAttributeConfig('template', { - value : Paginator.TEMPLATE_DEFAULT, - validator : isString - }); - - /** - * Class assigned to the element(s) containing pagination controls. - * @attribute containerClass - * @type string - * @default 'yui-pg-container' - */ - this.setAttributeConfig('containerClass', { - value : 'yui-pg-container', - validator : isString - }); - - /** - * Display pagination controls even when there is only one page. Set - * to false to forgo rendering and/or hide the containers when there - * is only one page of data. Note if you are using the rowsPerPage - * dropdown ui component, visibility will be maintained as long as the - * number of records exceeds the smallest page size. - * @attribute alwaysVisible - * @type boolean - * @default true - */ - this.setAttributeConfig('alwaysVisible', { - value : true, - validator : lang.isBoolean - }); - - /** - * Update the UI immediately upon interaction. If false, changeRequest - * subscribers or other external code will need to explicitly set the - * new values in the paginator to trigger repaint. - * @attribute updateOnChange - * @type boolean - * @default false - * @deprecated use changeRequest listener that calls setState - */ - this.setAttributeConfig('updateOnChange', { - value : false, - validator : lang.isBoolean - }); - - - - // Read only attributes - - /** - * Unique id assigned to this instance - * @attribute id - * @type integer - * @final - */ - this.setAttributeConfig('id', { - value : Paginator.id++, - readOnly : true - }); - - /** - * Indicator of whether the DOM nodes have been initially created - * @attribute rendered - * @type boolean - * @final - */ - this.setAttributeConfig('rendered', { - value : false, - readOnly : true - }); - - }, - - /** - * Initialize registered ui components onto this instance. - * @method initUIComponents - * @private - */ - initUIComponents : function () { - var ui = Paginator.ui, - name,UIComp; - for (name in ui) { - if (ui.hasOwnProperty(name)) { - UIComp = ui[name]; - if (isObject(UIComp) && isFunction(UIComp.init)) { - UIComp.init(this); - } - } - } - }, - - /** - * Initialize this instance's CustomEvents. - * @method initEvents - * @private - */ - initEvents : function () { - /** - * Event fired when the Paginator is initially rendered - * @event render - */ - this.createEvent('render'); - - /** - * Event fired when the Paginator is initially rendered - * @event rendered - * @deprecated use render event - */ - this.createEvent('rendered'); // backward compatibility - - /** - * Event fired when a change in pagination values is requested, - * either by interacting with the various ui components or via the - * setStartIndex(n) etc APIs. - * Subscribers will receive the proposed state as the first parameter. - * The proposed state object will contain the following keys: - *
                      - *
                    • paginator - the Paginator instance
                    • - *
                    • page
                    • - *
                    • totalRecords
                    • - *
                    • recordOffset - index of the first record on the new page
                    • - *
                    • rowsPerPage
                    • - *
                    • records - array containing [start index, end index] for the records on the new page
                    • - *
                    • before - object literal with all these keys for the current state
                    • - *
                    - * @event changeRequest - */ - this.createEvent('changeRequest'); - - /** - * Event fired when attribute changes have resulted in the calculated - * current page changing. - * @event pageChange - */ - this.createEvent('pageChange'); - - /** - * Event that fires before the destroy event. - * @event beforeDestroy - */ - this.createEvent('beforeDestroy'); - - /** - * Event used to trigger cleanup of ui components - * @event destroy - */ - this.createEvent('destroy'); - - this._selfSubscribe(); - }, - - /** - * Subscribes to instance attribute change events to automate certain - * behaviors. - * @method _selfSubscribe - * @protected - */ - _selfSubscribe : function () { - // Listen for changes to totalRecords and alwaysVisible - this.subscribe('totalRecordsChange',this.updateVisibility,this,true); - this.subscribe('alwaysVisibleChange',this.updateVisibility,this,true); - - // Fire the pageChange event when appropriate - this.subscribe('totalRecordsChange',this._handleStateChange,this,true); - this.subscribe('recordOffsetChange',this._handleStateChange,this,true); - this.subscribe('rowsPerPageChange',this._handleStateChange,this,true); - - // Update recordOffset when totalRecords is reduced below - this.subscribe('totalRecordsChange',this._syncRecordOffset,this,true); - }, - - /** - * Sets recordOffset to the starting index of the previous page when - * totalRecords is reduced below the current recordOffset. - * @method _syncRecordOffset - * @param e {Event} totalRecordsChange event - * @protected - */ - _syncRecordOffset : function (e) { - var v = e.newValue,rpp,state; - if (e.prevValue !== v) { - if (v !== Paginator.VALUE_UNLIMITED) { - rpp = this.get('rowsPerPage'); - - if (rpp && this.get('recordOffset') >= v) { - state = this.getState({ - totalRecords : e.prevValue, - recordOffset : this.get('recordOffset') - }); - - this.set('recordOffset', state.before.recordOffset); - this._firePageChange(state); - } - } - } - }, - - /** - * Fires the pageChange event when the state attributes have changed in - * such a way as to locate the current recordOffset on a new page. - * @method _handleStateChange - * @param e {Event} the attribute change event - * @protected - */ - _handleStateChange : function (e) { - if (e.prevValue !== e.newValue) { - var change = this._state || {}, - state; - - change[e.type.replace(/Change$/,'')] = e.prevValue; - state = this.getState(change); - - if (state.page !== state.before.page) { - if (this._batch) { - this._pageChanged = true; - } else { - this._firePageChange(state); - } - } - } - }, - - /** - * Fires a pageChange event in the form of a standard attribute change - * event with additional properties prevState and newState. - * @method _firePageChange - * @param state {Object} the result of getState(oldState) - * @protected - */ - _firePageChange : function (state) { - if (isObject(state)) { - var current = state.before; - delete state.before; - this.fireEvent('pageChange',{ - type : 'pageChange', - prevValue : state.page, - newValue : current.page, - prevState : state, - newState : current - }); - } - }, - - /** - * Render the pagination controls per the format attribute into the - * specified container nodes. - * @method render - * @return the Paginator instance - * @chainable - */ - render : function () { - if (this.get('rendered')) { - return this; - } - - var template = this.get('template'), - state = this.getState(), - // ex. yui-pg0-1 (first paginator, second container) - id_base = Paginator.ID_BASE + this.get('id') + '-', - i, len; - - // Assemble the containers, keeping them hidden - for (i = 0, len = this._containers.length; i < len; ++i) { - this._renderTemplate(this._containers[i],template,id_base+i,true); - } - - // Show the containers if appropriate - this.updateVisibility(); - - // Set render attribute manually to support its readOnly contract - if (this._containers.length) { - this.setAttributeConfig('rendered', { value: true }); - - this.fireEvent('render', state); - // For backward compatibility - this.fireEvent('rendered', state); - } - - return this; - }, - - /** - * Creates the individual ui components and renders them into a container. - * - * @method _renderTemplate - * @param container {HTMLElement} where to add the ui components - * @param template {String} the template to use as a guide for rendering - * @param id_base {String} id base for the container's ui components - * @param hide {Boolean} leave the container hidden after assembly - * @protected - */ - _renderTemplate : function (container, template, id_base, hide) { - var containerClass = this.get('containerClass'), - markers, i, len; - - if (!container) { - return; - } - - // Hide the container while its contents are rendered - Dom.setStyle(container,'display','none'); - - Dom.addClass(container, containerClass); - - // Place the template innerHTML, adding marker spans to the template - // html to indicate drop zones for ui components - container.innerHTML = template.replace(/\{([a-z0-9_ \-]+)\}/gi, - ''); - - // Replace each marker with the ui component's render() output - markers = Dom.getElementsByClassName('yui-pg-ui','span',container); - - for (i = 0, len = markers.length; i < len; ++i) { - this.renderUIComponent(markers[i], id_base); - } - - if (!hide) { - // Show the container allowing page reflow - Dom.setStyle(container,'display',''); - } - }, - - /** - * Replaces a marker node with a rendered UI component, determined by the - * yui-pg-ui-(UI component class name) in the marker's className. e.g. - * yui-pg-ui-PageLinks => new YAHOO.widget.Paginator.ui.PageLinks(this) - * - * @method renderUIComponent - * @param marker {HTMLElement} the marker node to replace - * @param id_base {String} string base the component's generated id - */ - renderUIComponent : function (marker, id_base) { - var par = marker.parentNode, - name = /yui-pg-ui-(\w+)/.exec(marker.className), - UIComp = name && Paginator.ui[name[1]], - comp; - - if (isFunction(UIComp)) { - comp = new UIComp(this); - if (isFunction(comp.render)) { - par.replaceChild(comp.render(id_base),marker); - } - } - }, - - /** - * Removes controls from the page and unhooks events. - * @method destroy - */ - destroy : function () { - this.fireEvent('beforeDestroy'); - this.fireEvent('destroy'); - - this.setAttributeConfig('rendered',{value:false}); - this.unsubscribeAll(); - }, - - /** - * Hides the containers if there is only one page of data and attribute - * alwaysVisible is false. Conversely, it displays the containers if either - * there is more than one page worth of data or alwaysVisible is turned on. - * @method updateVisibility - */ - updateVisibility : function (e) { - var alwaysVisible = this.get('alwaysVisible'), - totalRecords,visible,rpp,rppOptions,i,len; - - if (!e || e.type === 'alwaysVisibleChange' || !alwaysVisible) { - totalRecords = this.get('totalRecords'); - visible = true; - rpp = this.get('rowsPerPage'); - rppOptions = this.get('rowsPerPageOptions'); - - if (isArray(rppOptions)) { - for (i = 0, len = rppOptions.length; i < len; ++i) { - rpp = Math.min(rpp,rppOptions[i]); - } - } - - if (totalRecords !== Paginator.VALUE_UNLIMITED && - totalRecords <= rpp) { - visible = false; - } - - visible = visible || alwaysVisible; - - for (i = 0, len = this._containers.length; i < len; ++i) { - Dom.setStyle(this._containers[i],'display', - visible ? '' : 'none'); - } - } - }, - - - - - /** - * Get the configured container nodes - * @method getContainerNodes - * @return {Array} array of HTMLElement nodes - */ - getContainerNodes : function () { - return this._containers; - }, - - /** - * Get the total number of pages in the data set according to the current - * rowsPerPage and totalRecords values. If totalRecords is not set, or - * set to YAHOO.widget.Paginator.VALUE_UNLIMITED, returns - * YAHOO.widget.Paginator.VALUE_UNLIMITED. - * @method getTotalPages - * @return {number} - */ - getTotalPages : function () { - var records = this.get('totalRecords'), - perPage = this.get('rowsPerPage'); - - // rowsPerPage not set. Can't calculate - if (!perPage) { - return null; - } - - if (records === Paginator.VALUE_UNLIMITED) { - return Paginator.VALUE_UNLIMITED; - } - - return Math.ceil(records/perPage); - }, - - /** - * Does the requested page have any records? - * @method hasPage - * @param page {number} the page in question - * @return {boolean} - */ - hasPage : function (page) { - if (!lang.isNumber(page) || page < 1) { - return false; - } - - var totalPages = this.getTotalPages(); - - return (totalPages === Paginator.VALUE_UNLIMITED || totalPages >= page); - }, - - /** - * Get the page number corresponding to the current record offset. - * @method getCurrentPage - * @return {number} - */ - getCurrentPage : function () { - var perPage = this.get('rowsPerPage'); - if (!perPage || !this.get('totalRecords')) { - return 0; - } - return Math.floor(this.get('recordOffset') / perPage) + 1; - }, - - /** - * Are there records on the next page? - * @method hasNextPage - * @return {boolean} - */ - hasNextPage : function () { - var currentPage = this.getCurrentPage(), - totalPages = this.getTotalPages(); - - return currentPage && (totalPages === Paginator.VALUE_UNLIMITED || currentPage < totalPages); - }, - - /** - * Get the page number of the next page, or null if the current page is the - * last page. - * @method getNextPage - * @return {number} - */ - getNextPage : function () { - return this.hasNextPage() ? this.getCurrentPage() + 1 : null; - }, - - /** - * Is there a page before the current page? - * @method hasPreviousPage - * @return {boolean} - */ - hasPreviousPage : function () { - return (this.getCurrentPage() > 1); - }, - - /** - * Get the page number of the previous page, or null if the current page - * is the first page. - * @method getPreviousPage - * @return {number} - */ - getPreviousPage : function () { - return (this.hasPreviousPage() ? this.getCurrentPage() - 1 : 1); - }, - - /** - * Get the start and end record indexes of the specified page. - * @method getPageRecords - * @param page {number} (optional) The page (current page if not specified) - * @return {Array} [start_index, end_index] - */ - getPageRecords : function (page) { - if (!lang.isNumber(page)) { - page = this.getCurrentPage(); - } - - var perPage = this.get('rowsPerPage'), - records = this.get('totalRecords'), - start, end; - - if (!page || !perPage) { - return null; - } - - start = (page - 1) * perPage; - if (records !== Paginator.VALUE_UNLIMITED) { - if (start >= records) { - return null; - } - end = Math.min(start + perPage, records) - 1; - } else { - end = start + perPage - 1; - } - - return [start,end]; - }, - - /** - * Set the current page to the provided page number if possible. - * @method setPage - * @param newPage {number} the new page number - * @param silent {boolean} whether to forcibly avoid firing the - * changeRequest event - */ - setPage : function (page,silent) { - if (this.hasPage(page) && page !== this.getCurrentPage()) { - if (this.get('updateOnChange') || silent) { - this.set('recordOffset', (page - 1) * this.get('rowsPerPage')); - } else { - this.fireEvent('changeRequest',this.getState({'page':page})); - } - } - }, - - /** - * Get the number of rows per page. - * @method getRowsPerPage - * @return {number} the current setting of the rowsPerPage attribute - */ - getRowsPerPage : function () { - return this.get('rowsPerPage'); - }, - - /** - * Set the number of rows per page. - * @method setRowsPerPage - * @param rpp {number} the new number of rows per page - * @param silent {boolean} whether to forcibly avoid firing the - * changeRequest event - */ - setRowsPerPage : function (rpp,silent) { - if (Paginator.isNumeric(rpp) && +rpp > 0 && - +rpp !== this.get('rowsPerPage')) { - if (this.get('updateOnChange') || silent) { - this.set('rowsPerPage',rpp); - } else { - this.fireEvent('changeRequest', - this.getState({'rowsPerPage':+rpp})); - } - } - }, - - /** - * Get the total number of records. - * @method getTotalRecords - * @return {number} the current setting of totalRecords attribute - */ - getTotalRecords : function () { - return this.get('totalRecords'); - }, - - /** - * Set the total number of records. - * @method setTotalRecords - * @param total {number} the new total number of records - * @param silent {boolean} whether to forcibly avoid firing the changeRequest event - */ - setTotalRecords : function (total,silent) { - if (Paginator.isNumeric(total) && +total >= 0 && - +total !== this.get('totalRecords')) { - if (this.get('updateOnChange') || silent) { - this.set('totalRecords',total); - } else { - this.fireEvent('changeRequest', - this.getState({'totalRecords':+total})); - } - } - }, - - /** - * Get the index of the first record on the current page - * @method getStartIndex - * @return {number} the index of the first record on the current page - */ - getStartIndex : function () { - return this.get('recordOffset'); - }, - - /** - * Move the record offset to a new starting index. This will likely cause - * the calculated current page to change. You should probably use setPage. - * @method setStartIndex - * @param offset {number} the new record offset - * @param silent {boolean} whether to forcibly avoid firing the changeRequest event - */ - setStartIndex : function (offset,silent) { - if (Paginator.isNumeric(offset) && +offset >= 0 && - +offset !== this.get('recordOffset')) { - if (this.get('updateOnChange') || silent) { - this.set('recordOffset',offset); - } else { - this.fireEvent('changeRequest', - this.getState({'recordOffset':+offset})); - } - } - }, - - /** - * Get an object literal describing the current state of the paginator. If - * an object literal of proposed values is passed, the proposed state will - * be returned as an object literal with the following keys: - *
                      - *
                    • paginator - instance of the Paginator
                    • - *
                    • page - number
                    • - *
                    • totalRecords - number
                    • - *
                    • recordOffset - number
                    • - *
                    • rowsPerPage - number
                    • - *
                    • records - [ start_index, end_index ]
                    • - *
                    • before - (OPTIONAL) { state object literal for current state }
                    • - *
                    - * @method getState - * @return {object} - * @param changes {object} OPTIONAL object literal with proposed values - * Supported change keys include: - *
                      - *
                    • rowsPerPage
                    • - *
                    • totalRecords
                    • - *
                    • recordOffset OR
                    • - *
                    • page
                    • - *
                    - */ - getState : function (changes) { - var UNLIMITED = Paginator.VALUE_UNLIMITED, - M = Math, max = M.max, ceil = M.ceil, - currentState, state, offset; - - function normalizeOffset(offset,total,rpp) { - if (offset <= 0 || total === 0) { - return 0; - } - if (total === UNLIMITED || total > offset) { - return offset - (offset % rpp); - } - return total - (total % rpp || rpp); - } - - currentState = { - paginator : this, - totalRecords : this.get('totalRecords'), - rowsPerPage : this.get('rowsPerPage'), - records : this.getPageRecords() - }; - currentState.recordOffset = normalizeOffset( - this.get('recordOffset'), - currentState.totalRecords, - currentState.rowsPerPage); - currentState.page = ceil(currentState.recordOffset / - currentState.rowsPerPage) + 1; - - if (!changes) { - return currentState; - } - - state = { - paginator : this, - before : currentState, - - rowsPerPage : changes.rowsPerPage || currentState.rowsPerPage, - totalRecords : (Paginator.isNumeric(changes.totalRecords) ? - max(changes.totalRecords,UNLIMITED) : - +currentState.totalRecords) - }; - - if (state.totalRecords === 0) { - state.recordOffset = - state.page = 0; - } else { - offset = Paginator.isNumeric(changes.page) ? - (changes.page - 1) * state.rowsPerPage : - Paginator.isNumeric(changes.recordOffset) ? - +changes.recordOffset : - currentState.recordOffset; - - state.recordOffset = normalizeOffset(offset, - state.totalRecords, - state.rowsPerPage); - - state.page = ceil(state.recordOffset / state.rowsPerPage) + 1; - } - - state.records = [ state.recordOffset, - state.recordOffset + state.rowsPerPage - 1 ]; - - // limit upper index to totalRecords - 1 - if (state.totalRecords !== UNLIMITED && - state.recordOffset < state.totalRecords && state.records && - state.records[1] > state.totalRecords - 1) { - state.records[1] = state.totalRecords - 1; - } - - return state; - }, - - /** - * Convenience method to facilitate setting state attributes rowsPerPage, - * totalRecords, recordOffset in batch. Also supports calculating - * recordOffset from state.page if state.recordOffset is not provided. - * Fires only a single pageChange event, if appropriate. - * This will not fire a changeRequest event. - * @method setState - * @param state {Object} Object literal of attribute:value pairs to set - */ - setState : function (state) { - if (isObject(state)) { - // get flux state based on current state with before state as well - this._state = this.getState({}); - - // use just the state props from the input obj - state = { - page : state.page, - rowsPerPage : state.rowsPerPage, - totalRecords : state.totalRecords, - recordOffset : state.recordOffset - }; - - // calculate recordOffset from page if recordOffset not specified. - // not using lang.isNumber for support of numeric strings - if (state.page && state.recordOffset === undefined) { - state.recordOffset = (state.page - 1) * - (state.rowsPerPage || this.get('rowsPerPage')); - } - - this._batch = true; - this._pageChanged = false; - - for (var k in state) { - if (state.hasOwnProperty(k) && this._configs.hasOwnProperty(k)) { - this.set(k,state[k]); - } - } - - this._batch = false; - - if (this._pageChanged) { - this._pageChanged = false; - - this._firePageChange(this.getState(this._state)); - } - } - } -}; - -lang.augmentProto(Paginator, YAHOO.util.AttributeProvider); - -YAHOO.widget.Paginator = Paginator; -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the textual report of current pagination status. - * E.g. "Now viewing page 1 of 13". - * - * @namespace YAHOO.widget.Paginator.ui - * @class CurrentPageReport - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.CurrentPageReport = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange', this.update,this,true); - p.subscribe('rowsPerPageChange', this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('pageReportTemplateChange', this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - //TODO: make this work - p.subscribe('pageReportClassChange', this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.CurrentPageReport.init = function (p) { - - /** - * CSS class assigned to the span containing the info. - * @attribute pageReportClass - * @default 'yui-pg-current' - */ - p.setAttributeConfig('pageReportClass', { - value : 'yui-pg-current', - validator : l.isString - }); - - /** - * Used as innerHTML for the span. Place holders in the form of {name} - * will be replaced with the so named value from the key:value map - * generated by the function held in the pageReportValueGenerator attribute. - * @attribute pageReportTemplate - * @default '({currentPage} of {totalPages})' - * @see pageReportValueGenerator attribute - */ - p.setAttributeConfig('pageReportTemplate', { - value : '({currentPage} of {totalPages})', - validator : l.isString - }); - - /** - * Function to generate the value map used to populate the - * pageReportTemplate. The function is passed the Paginator instance as a - * parameter. The default function returns a map with the following keys: - *
                      - *
                    • currentPage
                    • - *
                    • totalPages
                    • - *
                    • startIndex
                    • - *
                    • endIndex
                    • - *
                    • startRecord
                    • - *
                    • endRecord
                    • - *
                    • totalRecords
                    • - *
                    - * @attribute pageReportValueGenarator - */ - p.setAttributeConfig('pageReportValueGenerator', { - value : function (paginator) { - var curPage = paginator.getCurrentPage(), - records = paginator.getPageRecords(); - - return { - 'currentPage' : records ? curPage : 0, - 'totalPages' : paginator.getTotalPages(), - 'startIndex' : records ? records[0] : 0, - 'endIndex' : records ? records[1] : 0, - 'startRecord' : records ? records[0] + 1 : 0, - 'endRecord' : records ? records[1] + 1 : 0, - 'totalRecords': paginator.get('totalRecords') - }; - }, - validator : l.isFunction - }); -}; - -/** - * Replace place holders in a string with the named values found in an - * object literal. - * @static - * @method sprintf - * @param template {string} The content string containing place holders - * @param values {object} The key:value pairs used to replace the place holders - * @return {string} - */ -Paginator.ui.CurrentPageReport.sprintf = function (template, values) { - return template.replace(/\{([\w\s\-]+)\}/g, function (x,key) { - return (key in values) ? values[key] : ''; - }); -}; - -Paginator.ui.CurrentPageReport.prototype = { - - /** - * Span node containing the formatted info - * @property span - * @type HTMLElement - * @private - */ - span : null, - - - /** - * Generate the span containing info formatted per the pageReportTemplate - * attribute. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - this.span = document.createElement('span'); - this.span.id = id_base + '-page-report'; - this.span.className = this.paginator.get('pageReportClass'); - this.update(); - - return this.span; - }, - - /** - * Regenerate the content of the span if appropriate. Calls - * CurrentPageReport.sprintf with the value of the pageReportTemplate - * attribute and the value map returned from pageReportValueGenerator - * function. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - this.span.innerHTML = Paginator.ui.CurrentPageReport.sprintf( - this.paginator.get('pageReportTemplate'), - this.paginator.get('pageReportValueGenerator')(this.paginator)); - }, - - /** - * Removes the link/span node and clears event listeners - * removal. - * @method destroy - * @private - */ - destroy : function () { - this.span.parentNode.removeChild(this.span); - this.span = null; - } - -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the page links - * - * @namespace YAHOO.widget.Paginator.ui - * @class PageLinks - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.PageLinks = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('pageLinksChange', this.rebuild,this,true); - p.subscribe('pageLinkClassChange', this.rebuild,this,true); - p.subscribe('currentPageClassChange', this.rebuild,this,true); - p.subscribe('destroy',this.destroy,this,true); - - //TODO: Make this work - p.subscribe('pageLinksContainerClassChange', this.rebuild,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.PageLinks.init = function (p) { - - /** - * CSS class assigned to each page link/span. - * @attribute pageLinkClass - * @default 'yui-pg-page' - */ - p.setAttributeConfig('pageLinkClass', { - value : 'yui-pg-page', - validator : l.isString - }); - - /** - * CSS class assigned to the current page span. - * @attribute currentPageClass - * @default 'yui-pg-current-page' - */ - p.setAttributeConfig('currentPageClass', { - value : 'yui-pg-current-page', - validator : l.isString - }); - - /** - * CSS class assigned to the span containing the page links. - * @attribute pageLinksContainerClass - * @default 'yui-pg-pages' - */ - p.setAttributeConfig('pageLinksContainerClass', { - value : 'yui-pg-pages', - validator : l.isString - }); - - /** - * Maximum number of page links to display at one time. - * @attribute pageLinks - * @default 10 - */ - p.setAttributeConfig('pageLinks', { - value : 10, - validator : Paginator.isNumeric - }); - - /** - * Function used generate the innerHTML for each page link/span. The - * function receives as parameters the page number and a reference to the - * paginator object. - * @attribute pageLabelBuilder - * @default function (page, paginator) { return page; } - */ - p.setAttributeConfig('pageLabelBuilder', { - value : function (page, paginator) { return page; }, - validator : l.isFunction - }); -}; - -/** - * Calculates start and end page numbers given a current page, attempting - * to keep the current page in the middle - * @static - * @method calculateRange - * @param {int} currentPage The current page - * @param {int} totalPages (optional) Maximum number of pages - * @param {int} numPages (optional) Preferred number of pages in range - * @return {Array} [start_page_number, end_page_number] - */ -Paginator.ui.PageLinks.calculateRange = function (currentPage,totalPages,numPages) { - var UNLIMITED = Paginator.VALUE_UNLIMITED, - start, end, delta; - - // Either has no pages, or unlimited pages. Show none. - if (!currentPage || numPages === 0 || totalPages === 0 || - (totalPages === UNLIMITED && numPages === UNLIMITED)) { - return [0,-1]; - } - - // Limit requested pageLinks if there are fewer totalPages - if (totalPages !== UNLIMITED) { - numPages = numPages === UNLIMITED ? - totalPages : - Math.min(numPages,totalPages); - } - - // Determine start and end, trying to keep current in the middle - start = Math.max(1,Math.ceil(currentPage - (numPages/2))); - if (totalPages === UNLIMITED) { - end = start + numPages - 1; - } else { - end = Math.min(totalPages, start + numPages - 1); - } - - // Adjust the start index when approaching the last page - delta = numPages - (end - start + 1); - start = Math.max(1, start - delta); - - return [start,end]; -}; - - -Paginator.ui.PageLinks.prototype = { - - /** - * Current page - * @property current - * @type number - * @private - */ - current : 0, - - /** - * Span node containing the page links - * @property container - * @type HTMLElement - * @private - */ - container : null, - - - /** - * Generate the nodes and return the container node containing page links - * appropriate to the current pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator; - - // Set up container - this.container = document.createElement('span'); - this.container.id = id_base + '-pages'; - this.container.className = p.get('pageLinksContainerClass'); - YAHOO.util.Event.on(this.container,'click',this.onClick,this,true); - - // Call update, flagging a need to rebuild - this.update({newValue : null, rebuild : true}); - - return this.container; - }, - - /** - * Update the links if appropriate - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var p = this.paginator, - currentPage = p.getCurrentPage(); - - // Replace content if there's been a change - if (this.current !== currentPage || !currentPage || e.rebuild) { - var labelBuilder = p.get('pageLabelBuilder'), - range = Paginator.ui.PageLinks.calculateRange( - currentPage, - p.getTotalPages(), - p.get('pageLinks')), - start = range[0], - end = range[1], - content = '', - linkTemplate,i; - - linkTemplate = '' + - labelBuilder(i,p) + ''; - } else { - content += - linkTemplate + i + '">' + labelBuilder(i,p) + ''; - } - } - - this.container.innerHTML = content; - } - }, - - /** - * Force a rebuild of the page links. - * @method rebuild - * @param e {CustomEvent} The calling change event - */ - rebuild : function (e) { - e.rebuild = true; - this.update(e); - }, - - /** - * Removes the page links container node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.container,true); - this.container.parentNode.removeChild(this.container); - this.container = null; - }, - - /** - * Listener for the container's onclick event. Looks for qualifying link - * clicks, and pulls the page number from the link's page attribute. - * Sends link's page attribute to the Paginator's setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - var t = YAHOO.util.Event.getTarget(e); - if (t && YAHOO.util.Dom.hasClass(t, - this.paginator.get('pageLinkClass'))) { - - YAHOO.util.Event.stopEvent(e); - - this.paginator.setPage(parseInt(t.getAttribute('page'),10)); - } - } - -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the first page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class FirstPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.FirstPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('firstPageLinkLabelChange',this.update,this,true); - p.subscribe('firstPageLinkClassChange',this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.FirstPageLink.init = function (p) { - - /** - * Used as innerHTML for the first page link/span. - * @attribute firstPageLinkLabel - * @default '<< first' - */ - p.setAttributeConfig('firstPageLinkLabel', { - value : '<< first', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute firstPageLinkClass - * @default 'yui-pg-first' - */ - p.setAttributeConfig('firstPageLinkClass', { - value : 'yui-pg-first', - validator : l.isString - }); -}; - -// Instance members and methods -Paginator.ui.FirstPageLink.prototype = { - - /** - * The currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('firstPageLinkClass'), - label = p.get('firstPageLinkLabel'); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - - this.link.id = id_base + '-first-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-first-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.current = p.getCurrentPage() > 1 ? this.link : this.span; - return this.current; - }, - - /** - * Swap the link and span nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var par = this.current ? this.current.parentNode : null; - if (this.paginator.getCurrentPage() > 1) { - if (par && this.current === this.span) { - par.replaceChild(this.link,this.current); - this.current = this.link; - } - } else { - if (par && this.current === this.link) { - par.replaceChild(this.span,this.current); - this.current = this.span; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * removal. - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Pass new value to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(1); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the last page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class LastPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.LastPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('lastPageLinkLabelChange',this.update,this,true); - p.subscribe('lastPageLinkClassChange', this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param paginator {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.LastPageLink.init = function (p) { - - /** - * Used as innerHTML for the last page link/span. - * @attribute lastPageLinkLabel - * @default 'last >>' - */ - p.setAttributeConfig('lastPageLinkLabel', { - value : 'last >>', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute lastPageLinkClass - * @default 'yui-pg-last' - */ - p.setAttributeConfig('lastPageLinkClass', { - value : 'yui-pg-last', - validator : l.isString - }); -}; - -Paginator.ui.LastPageLink.prototype = { - - /** - * Currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link HTMLElement node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - /** - * Empty place holder node for when the last page link is inappropriate to - * display in any form (unlimited paging). - * @property na - * @type HTMLElement - * @private - */ - na : null, - - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('lastPageLinkClass'), - label = p.get('lastPageLinkLabel'), - last = p.getTotalPages(); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - this.na = this.span.cloneNode(false); - - this.link.id = id_base + '-last-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-last-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.na.id = id_base + '-last-na'; - - switch (last) { - case Paginator.VALUE_UNLIMITED : - this.current = this.na; break; - case p.getCurrentPage() : - this.current = this.span; break; - default : - this.current = this.link; - } - - return this.current; - }, - - /** - * Swap the link, span, and na nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event (ignored) - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var par = this.current ? this.current.parentNode : null, - after = this.link; - - if (par) { - switch (this.paginator.getTotalPages()) { - case Paginator.VALUE_UNLIMITED : - after = this.na; break; - case this.paginator.getCurrentPage() : - after = this.span; break; - } - - if (this.current !== after) { - par.replaceChild(after,this.current); - this.current = after; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Passes to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(this.paginator.getTotalPages()); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the next page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class NextPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.NextPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange', this.update,this,true); - p.subscribe('rowsPerPageChange', this.update,this,true); - p.subscribe('totalRecordsChange', this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('nextPageLinkLabelChange', this.update,this,true); - p.subscribe('nextPageLinkClassChange', this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.NextPageLink.init = function (p) { - - /** - * Used as innerHTML for the next page link/span. - * @attribute nextPageLinkLabel - * @default 'next >' - */ - p.setAttributeConfig('nextPageLinkLabel', { - value : 'next >', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute nextPageLinkClass - * @default 'yui-pg-next' - */ - p.setAttributeConfig('nextPageLinkClass', { - value : 'yui-pg-next', - validator : l.isString - }); -}; - -Paginator.ui.NextPageLink.prototype = { - - /** - * Currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('nextPageLinkClass'), - label = p.get('nextPageLinkLabel'), - last = p.getTotalPages(); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - - this.link.id = id_base + '-next-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-next-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.current = p.getCurrentPage() === last ? this.span : this.link; - - return this.current; - }, - - /** - * Swap the link and span nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var last = this.paginator.getTotalPages(), - par = this.current ? this.current.parentNode : null; - - if (this.paginator.getCurrentPage() !== last) { - if (par && this.current === this.span) { - par.replaceChild(this.link,this.current); - this.current = this.link; - } - } else if (this.current === this.link) { - if (par) { - par.replaceChild(this.span,this.current); - this.current = this.span; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Passes to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(this.paginator.getNextPage()); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the link to jump to the previous page. - * - * @namespace YAHOO.widget.Paginator.ui - * @class PreviousPageLink - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.PreviousPageLink = function (p) { - this.paginator = p; - - p.subscribe('recordOffsetChange',this.update,this,true); - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('totalRecordsChange',this.update,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('previousPageLinkLabelChange',this.update,this,true); - p.subscribe('previousPageLinkClassChange',this.update,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.PreviousPageLink.init = function (p) { - - /** - * Used as innerHTML for the previous page link/span. - * @attribute previousPageLinkLabel - * @default '< prev' - */ - p.setAttributeConfig('previousPageLinkLabel', { - value : '< prev', - validator : l.isString - }); - - /** - * CSS class assigned to the link/span - * @attribute previousPageLinkClass - * @default 'yui-pg-previous' - */ - p.setAttributeConfig('previousPageLinkClass', { - value : 'yui-pg-previous', - validator : l.isString - }); -}; - -Paginator.ui.PreviousPageLink.prototype = { - - /** - * Currently placed HTMLElement node - * @property current - * @type HTMLElement - * @private - */ - current : null, - - /** - * Link node - * @property link - * @type HTMLElement - * @private - */ - link : null, - - /** - * Span node (inactive link) - * @property span - * @type HTMLElement - * @private - */ - span : null, - - - /** - * Generate the nodes and return the appropriate node given the current - * pagination state. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - var p = this.paginator, - c = p.get('previousPageLinkClass'), - label = p.get('previousPageLinkLabel'); - - this.link = document.createElement('a'); - this.span = document.createElement('span'); - - this.link.id = id_base + '-prev-link'; - this.link.href = '#'; - this.link.className = c; - this.link.innerHTML = label; - YAHOO.util.Event.on(this.link,'click',this.onClick,this,true); - - this.span.id = id_base + '-prev-span'; - this.span.className = c; - this.span.innerHTML = label; - - this.current = p.getCurrentPage() > 1 ? this.link : this.span; - return this.current; - }, - - /** - * Swap the link and span nodes if appropriate. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var par = this.current ? this.current.parentNode : null; - if (this.paginator.getCurrentPage() > 1) { - if (par && this.current === this.span) { - par.replaceChild(this.link,this.current); - this.current = this.link; - } - } else { - if (par && this.current === this.link) { - par.replaceChild(this.span,this.current); - this.current = this.span; - } - } - }, - - /** - * Removes the link/span node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.link); - this.current.parentNode.removeChild(this.current); - this.link = this.span = null; - }, - - /** - * Listener for the link's onclick event. Passes to setPage method. - * @method onClick - * @param e {DOMEvent} The click event - */ - onClick : function (e) { - YAHOO.util.Event.stopEvent(e); - this.paginator.setPage(this.paginator.getPreviousPage()); - } -}; - -})(); -(function () { - -var Paginator = YAHOO.widget.Paginator, - l = YAHOO.lang; - -/** - * ui Component to generate the rows-per-page dropdown - * - * @namespace YAHOO.widget.Paginator.ui - * @class RowsPerPageDropdown - * @for YAHOO.widget.Paginator - * - * @constructor - * @param p {Pagintor} Paginator instance to attach to - */ -Paginator.ui.RowsPerPageDropdown = function (p) { - this.paginator = p; - - p.subscribe('rowsPerPageChange',this.update,this,true); - p.subscribe('rowsPerPageOptionsChange',this.rebuild,this,true); - p.subscribe('totalRecordsChange',this._handleTotalRecordsChange,this,true); - p.subscribe('destroy',this.destroy,this,true); - - // TODO: make this work - p.subscribe('rowsPerPageDropdownClassChange',this.rebuild,this,true); -}; - -/** - * Decorates Paginator instances with new attributes. Called during - * Paginator instantiation. - * @method init - * @param p {Paginator} Paginator instance to decorate - * @static - */ -Paginator.ui.RowsPerPageDropdown.init = function (p) { - - /** - * Array of available rows-per-page sizes. Converted into select options. - * Array values may be positive integers or object literals in the form
                    - * { value : NUMBER, text : STRING } - * @attribute rowsPerPageOptions - * @default [] - */ - p.setAttributeConfig('rowsPerPageOptions', { - value : [], - validator : l.isArray - }); - - /** - * CSS class assigned to the select node - * @attribute rowsPerPageDropdownClass - * @default 'yui-pg-rpp-options' - */ - p.setAttributeConfig('rowsPerPageDropdownClass', { - value : 'yui-pg-rpp-options', - validator : l.isString - }); -}; - -Paginator.ui.RowsPerPageDropdown.prototype = { - - /** - * select node - * @property select - * @type HTMLElement - * @private - */ - select : null, - - - /** - * option node for the optional All value - * - * @property all - * @type HTMLElement - * @protected - */ - all : null, - - /** - * Generate the select and option nodes and returns the select node. - * @method render - * @param id_base {string} used to create unique ids for generated nodes - * @return {HTMLElement} - */ - render : function (id_base) { - this.select = document.createElement('select'); - this.select.id = id_base + '-rpp'; - this.select.className = this.paginator.get('rowsPerPageDropdownClass'); - this.select.title = 'Rows per page'; - - YAHOO.util.Event.on(this.select,'change',this.onChange,this,true); - - this.rebuild(); - - return this.select; - }, - - /** - * (Re)generate the select options. - * @method rebuild - */ - rebuild : function (e) { - var p = this.paginator, - sel = this.select, - options = p.get('rowsPerPageOptions'), - opt,cfg,val,i,len; - - this.all = null; - - for (i = 0, len = options.length; i < len; ++i) { - cfg = options[i]; - opt = sel.options[i] || - sel.appendChild(document.createElement('option')); - val = l.isValue(cfg.value) ? cfg.value : cfg; - opt.innerHTML = l.isValue(cfg.text) ? cfg.text : cfg; - - if (l.isString(val) && val.toLowerCase() === 'all') { - this.all = opt; - opt.value = p.get('totalRecords'); - } else{ - opt.value = val; - } - - } - - while (sel.options.length > options.length) { - sel.removeChild(sel.firstChild); - } - - this.update(); - }, - - /** - * Select the appropriate option if changed. - * @method update - * @param e {CustomEvent} The calling change event - */ - update : function (e) { - if (e && e.prevValue === e.newValue) { - return; - } - - var rpp = this.paginator.get('rowsPerPage')+'', - options = this.select.options, - i,len; - - for (i = 0, len = options.length; i < len; ++i) { - if (options[i].value === rpp) { - options[i].selected = true; - break; - } - } - }, - - /** - * Listener for the select's onchange event. Sent to setRowsPerPage method. - * @method onChange - * @param e {DOMEvent} The change event - */ - onChange : function (e) { - this.paginator.setRowsPerPage( - parseInt(this.select.options[this.select.selectedIndex].value,10)); - }, - - /** - * Updates the all option value (and Paginator's rowsPerPage attribute if - * necessary) in response to a change in the Paginator's totalRecords. - * - * @method _handleTotalRecordsChange - * @param e {Event} attribute change event - * @protected - */ - _handleTotalRecordsChange : function (e) { - if (!this.all || (e && e.prevValue === e.newValue)) { - return; - } - - this.all.value = e.newValue; - if (this.all.selected) { - this.paginator.set('rowsPerPage',e.newValue); - } - }, - - /** - * Removes the select node and clears event listeners - * @method destroy - * @private - */ - destroy : function () { - YAHOO.util.Event.purgeElement(this.select); - this.select.parentNode.removeChild(this.select); - this.select = null; - } -}; - -})(); -YAHOO.register("paginator", YAHOO.widget.Paginator, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-debug.js deleted file mode 100644 index c59b37e377..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-debug.js +++ /dev/null @@ -1,557 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("tool"); - -/** - * The YUI JavaScript profiler. - * @module profiler - * @namespace YAHOO.tool - * @requires yahoo - */ - -/** - * Profiles functions in JavaScript. - * @namespace YAHOO.tool - * @class Profiler - * @static - */ -YAHOO.tool.Profiler = function(){ - - - //------------------------------------------------------------------------- - // Private Variables and Functions - //------------------------------------------------------------------------- - - var container = {}, //Container object on which to put the original unprofiled methods. - report = {}, //Profiling information for functions - stopwatches = {}, //Additional stopwatch information - - WATCH_STARTED = 0, - WATCH_STOPPED = 1, - WATCH_PAUSED = 2, - - lang = YAHOO.lang; - - /** - * Creates a report object with the given name. - * @param {String} name The name to store for the report object. - * @return {Void} - * @method createReport - * @private - */ - function createReport(name){ - report[name] = { - calls: 0, - max: 0, - min: 0, - avg: 0, - points: [] - }; - } - - /** - * Called when a method ends execution. Marks the start and end time of the - * method so it can calculate how long the function took to execute. Also - * updates min/max/avg calculations for the function. - * @param {String} name The name of the function to mark as stopped. - * @param {int} duration The number of milliseconds it took the function to - * execute. - * @return {Void} - * @method saveDataPoint - * @private - * @static - */ - function saveDataPoint(name, duration){ - - //get the function data - var functionData /*:Object*/ = report[name]; - - //just in case clear() was called - if (!functionData){ - functionData = createReport(name); - } - - //increment the calls - functionData.calls++; - functionData.points.push(duration); - - //if it's already been called at least once, do more complex calculations - if (functionData.calls > 1) { - functionData.avg = ((functionData.avg*(functionData.calls-1))+duration)/functionData.calls; - functionData.min = Math.min(functionData.min, duration); - functionData.max = Math.max(functionData.max, duration); - } else { - functionData.avg = duration; - functionData.min = duration; - functionData.max = duration; - } - - } - - //------------------------------------------------------------------------- - // Singleton Object - //------------------------------------------------------------------------- - - return { - - //------------------------------------------------------------------------- - // Utility Methods - //------------------------------------------------------------------------- - - /** - * Removes all report data from the profiler. - * @param {String} name (Optional) The name of the report to clear. If - * omitted, then all report data is cleared. - * @return {Void} - * @method clear - * @static - */ - clear: function(name){ - if (lang.isString(name)){ - delete report[name]; - delete stopwatches[name]; - } else { - report = {}; - stopwatches = {}; - } - }, - - /** - * Returns the uninstrumented version of a function/object. - * @param {String} name The name of the function/object to retrieve. - * @return {Function|Object} The uninstrumented version of a function/object. - * @method getOriginal - * @static - */ - getOriginal: function(name){ - return container[name]; - }, - - /** - * Instruments a method to have profiling calls. - * @param {String} name The name of the report for the function. - * @param {Function} method The function to instrument. - * @return {Function} An instrumented version of the function. - * @method instrument - * @static - */ - instrument: function(name, method){ - - //create instrumented version of function - var newMethod = function () { - - var start = new Date(), - retval = method.apply(this, arguments), - stop = new Date(); - - saveDataPoint(name, stop-start); - - return retval; - - }; - - //copy the function properties over - lang.augmentObject(newMethod, method); - - //assign prototype and flag as being profiled - newMethod.__yuiProfiled = true; - newMethod.prototype = method.prototype; - - //store original method - container[name] = method; - container[name].__yuiFuncName = name; - - //create the report - createReport(name); - - //return the new method - return newMethod; - }, - - //------------------------------------------------------------------------- - // Stopwatch Methods - //------------------------------------------------------------------------- - - /** - * Pauses profiling information for a given name. - * @param {String} name The name of the data point. - * @return {Void} - * @method pause - * @static - */ - pause: function(name){ - var now = new Date(), - stopwatch = stopwatches[name]; - - if (stopwatch && stopwatch.state == WATCH_STARTED){ - stopwatch.total += (now - stopwatch.start); - stopwatch.start = 0; - stopwatch.state = WATCH_PAUSED; - } - - }, - - /** - * Start profiling information for a given name. The name cannot be the name - * of a registered function or object. This is used to start timing for a - * particular block of code rather than instrumenting the entire function. - * @param {String} name The name of the data point. - * @return {Void} - * @method start - * @static - */ - start: function(name){ - if(container[name]){ - throw new Error("Cannot use '" + name + "' for profiling through start(), name is already in use."); - } else { - - //create report if necessary - if (!report[name]){ - createReport(name); - } - - //create stopwatch object if necessary - if (!stopwatches[name]){ - stopwatches[name] = { - state: WATCH_STOPPED, - start: 0, - total: 0 - }; - } - - if (stopwatches[name].state == WATCH_STOPPED){ - stopwatches[name].state = WATCH_STARTED; - stopwatches[name].start = new Date(); - } - - } - }, - - /** - * Stops profiling information for a given name. - * @param {String} name The name of the data point. - * @return {Void} - * @method stop - * @static - */ - stop: function(name){ - var now = new Date(), - stopwatch = stopwatches[name]; - - if (stopwatch){ - if (stopwatch.state == WATCH_STARTED){ - saveDataPoint(name, stopwatch.total + (now - stopwatch.start)); - } else if (stopwatch.state == WATCH_PAUSED){ - saveDataPoint(name, stopwatch.total); - } - - //reset stopwatch information - stopwatch.start = 0; - stopwatch.total = 0; - stopwatch.state = WATCH_STOPPED; - } - }, - - //------------------------------------------------------------------------- - // Reporting Methods - //------------------------------------------------------------------------- - - /** - * Returns the average amount of time (in milliseconds) that the function - * with the given name takes to execute. - * @param {String} name The name of the function whose data should be returned. - * If an object type method, it should be 'constructor.prototype.methodName'; - * a normal object method would just be 'object.methodName'. - * @return {float} The average time it takes the function to execute. - * @method getAverage - * @static - */ - getAverage : function (name /*:String*/) /*:float*/ { - return report[name].avg; - }, - - /** - * Returns the number of times that the given function has been called. - * @param {String} name The name of the function whose data should be returned. - * @return {int} The number of times the function was called. - * @method getCallCount - * @static - */ - getCallCount : function (name /*:String*/) /*:int*/ { - return report[name].calls; - }, - - /** - * Returns the maximum amount of time (in milliseconds) that the function - * with the given name takes to execute. - * @param {String} name The name of the function whose data should be returned. - * If an object type method, it should be 'constructor.prototype.methodName'; - * a normal object method would just be 'object.methodName'. - * @return {float} The maximum time it takes the function to execute. - * @method getMax - * @static - */ - getMax : function (name /*:String*/) /*:int*/ { - return report[name].max; - }, - - /** - * Returns the minimum amount of time (in milliseconds) that the function - * with the given name takes to execute. - * @param {String} name The name of the function whose data should be returned. - * If an object type method, it should be 'constructor.prototype.methodName'; - * a normal object method would just be 'object.methodName'. - * @return {float} The minimum time it takes the function to execute. - * @method getMin - * @static - */ - getMin : function (name /*:String*/) /*:int*/ { - return report[name].min; - }, - - /** - * Returns an object containing profiling data for a single function. - * The object has an entry for min, max, avg, calls, and points). - * @return {Object} An object containing profile data for a given function. - * @method getFunctionReport - * @static - * @deprecated Use getReport() instead. - */ - getFunctionReport : function (name /*:String*/) /*:Object*/ { - return report[name]; - }, - - /** - * Returns an object containing profiling data for a single function. - * The object has an entry for min, max, avg, calls, and points). - * @return {Object} An object containing profile data for a given function. - * @method getReport - * @static - */ - getReport : function (name /*:String*/) /*:Object*/ { - return report[name]; - }, - - /** - * Returns an object containing profiling data for all of the functions - * that were profiled. The object has an entry for each function and - * returns all information (min, max, average, calls, etc.) for each - * function. - * @return {Object} An object containing all profile data. - * @static - */ - getFullReport : function (filter /*:Function*/) /*:Object*/ { - filter = filter || function(){return true;}; - - if (lang.isFunction(filter)) { - var fullReport = {}; - - for (var name in report){ - if (filter(report[name])){ - fullReport[name] = report[name]; - } - } - - return fullReport; - } - }, - - //------------------------------------------------------------------------- - // Profiling Methods - //------------------------------------------------------------------------- - - /** - * Sets up a constructor for profiling, including all properties and methods on the prototype. - * @param {string} name The fully-qualified name of the function including namespace information. - * @param {Object} owner (Optional) The object that owns the function (namespace or containing object). - * @return {Void} - * @method registerConstructor - * @static - */ - registerConstructor : function (name /*:String*/, owner /*:Object*/) /*:Void*/ { - this.registerFunction(name, owner, true); - }, - - /** - * Sets up a function for profiling. It essentially overwrites the function with one - * that has instrumentation data. This method also creates an entry for the function - * in the profile report. The original function is stored on the container object. - * @param {String} name The full name of the function including namespacing. This - * is the name of the function that is stored in the report. - * @param {Object} owner (Optional) The object that owns the function. If the function - * isn't global then this argument is required. This could be the namespace that - * the function belongs to, such as YAHOO.util.Dom, or the object on which it's - * a method. - * @param {Boolean} registerPrototype (Optional) Indicates that the prototype should - * also be instrumented. Setting to true has the same effect as calling - * registerConstructor(). - * @return {Void} - * @method registerFunction - * @static - */ - registerFunction : function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{ - - //figure out the function name without namespacing - var funcName = (name.indexOf(".") > -1 ? - name.substring(name.lastIndexOf(".")+1) : name), - method, - prototype; - - //if owner isn't an object, try to find it from the name - if (!lang.isObject(owner)){ - owner = eval(name.substring(0, name.lastIndexOf("."))); - } - - //get the method and prototype - method = owner[funcName]; - prototype = method.prototype; - - //see if the method has already been registered - if (lang.isFunction(method) && !method.__yuiProfiled){ - - //replace the function with the profiling one - owner[funcName] = this.instrument(name, method); - - /* - * Store original function information. We store the actual - * function as well as the owner and the name used to identify - * the function so it can be restored later. - */ - container[name].__yuiOwner = owner; - container[name].__yuiFuncName = funcName; //overwrite with less-specific name - - //register prototype if necessary - if (registerPrototype) { - this.registerObject(name + ".prototype", prototype); - } - - } - - }, - - - /** - * Sets up an object for profiling. It takes the object and looks for functions. - * When a function is found, registerMethod() is called on it. If set to recrusive - * mode, it will also setup objects found inside of this object for profiling, - * using the same methodology. - * @param {String} name The name of the object to profile (shows up in report). - * @param {Object} owner (Optional) The object represented by the name. - * @param {Boolean} recurse (Optional) Determines if subobject methods are also profiled. - * @return {Void} - * @method registerObject - * @static - */ - registerObject : function (name /*:String*/, object /*:Object*/, recurse /*:Boolean*/) /*:Void*/{ - - //get the object - object = (lang.isObject(object) ? object : eval(name)); - - //save the object - container[name] = object; - - for (var prop in object) { - if (typeof object[prop] == "function"){ - if (prop != "constructor" && prop != "superclass"){ //don't do constructor or superclass, it's recursive - this.registerFunction(name + "." + prop, object); - } - } else if (typeof object[prop] == "object" && recurse){ - this.registerObject(name + "." + prop, object[prop], recurse); - } - } - - }, - - /** - * Removes a constructor function from profiling. Reverses the registerConstructor() method. - * @param {String} name The full name of the function including namespacing. This - * is the name of the function that is stored in the report. - * @return {Void} - * @method unregisterFunction - * @static - */ - unregisterConstructor : function(name /*:String*/) /*:Void*/{ - - //see if the method has been registered - if (lang.isFunction(container[name])){ - this.unregisterFunction(name, true); - } - }, - - /** - * Removes function from profiling. Reverses the registerFunction() method. - * @param {String} name The full name of the function including namespacing. This - * is the name of the function that is stored in the report. - * @return {Void} - * @method unregisterFunction - * @static - */ - unregisterFunction : function(name /*:String*/, unregisterPrototype /*:Boolean*/) /*:Void*/{ - - //see if the method has been registered - if (lang.isFunction(container[name])){ - - //check to see if you should unregister the prototype - if (unregisterPrototype){ - this.unregisterObject(name + ".prototype", container[name].prototype); - } - - //get original data - var owner /*:Object*/ = container[name].__yuiOwner, - funcName /*:String*/ = container[name].__yuiFuncName; - - //delete extra information - delete container[name].__yuiOwner; - delete container[name].__yuiFuncName; - - //replace instrumented function - owner[funcName] = container[name]; - - //delete supporting information - delete container[name]; - } - - - }, - - /** - * Unregisters an object for profiling. It takes the object and looks for functions. - * When a function is found, unregisterMethod() is called on it. If set to recrusive - * mode, it will also unregister objects found inside of this object, - * using the same methodology. - * @param {String} name The name of the object to unregister. - * @param {Boolean} recurse (Optional) Determines if subobject methods should also be - * unregistered. - * @return {Void} - * @method unregisterObject - * @static - */ - unregisterObject : function (name /*:String*/, recurse /*:Boolean*/) /*:Void*/{ - - //get the object - if (lang.isObject(container[name])){ - var object = container[name]; - - for (var prop in object) { - if (typeof object[prop] == "function"){ - this.unregisterFunction(name + "." + prop); - } else if (typeof object[prop] == "object" && recurse){ - this.unregisterObject(name + "." + prop, recurse); - } - } - - delete container[name]; - } - - } - - - }; - -}(); - -YAHOO.register("profiler", YAHOO.tool.Profiler, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-min.js deleted file mode 100644 index 8e1cda9f2a..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("tool");YAHOO.tool.Profiler=function(){var container={},report={},stopwatches={},WATCH_STARTED=0,WATCH_STOPPED=1,WATCH_PAUSED=2,lang=YAHOO.lang;function createReport(name){report[name]={calls:0,max:0,min:0,avg:0,points:[]};}function saveDataPoint(name,duration){var functionData=report[name];if(!functionData){functionData=createReport(name);}functionData.calls++;functionData.points.push(duration);if(functionData.calls>1){functionData.avg=((functionData.avg*(functionData.calls-1))+duration)/functionData.calls;functionData.min=Math.min(functionData.min,duration);functionData.max=Math.max(functionData.max,duration);}else{functionData.avg=duration;functionData.min=duration;functionData.max=duration;}}return{clear:function(name){if(lang.isString(name)){delete report[name];delete stopwatches[name];}else{report={};stopwatches={};}},getOriginal:function(name){return container[name];},instrument:function(name,method){var newMethod=function(){var start=new Date(),retval=method.apply(this,arguments),stop=new Date();saveDataPoint(name,stop-start);return retval;};lang.augmentObject(newMethod,method);newMethod.__yuiProfiled=true;newMethod.prototype=method.prototype;container[name]=method;container[name].__yuiFuncName=name;createReport(name);return newMethod;},pause:function(name){var now=new Date(),stopwatch=stopwatches[name];if(stopwatch&&stopwatch.state==WATCH_STARTED){stopwatch.total+=(now-stopwatch.start);stopwatch.start=0;stopwatch.state=WATCH_PAUSED;}},start:function(name){if(container[name]){throw new Error("Cannot use '"+name+"' for profiling through start(), name is already in use.");}else{if(!report[name]){createReport(name);}if(!stopwatches[name]){stopwatches[name]={state:WATCH_STOPPED,start:0,total:0};}if(stopwatches[name].state==WATCH_STOPPED){stopwatches[name].state=WATCH_STARTED;stopwatches[name].start=new Date();}}},stop:function(name){var now=new Date(),stopwatch=stopwatches[name];if(stopwatch){if(stopwatch.state==WATCH_STARTED){saveDataPoint(name,stopwatch.total+(now-stopwatch.start));}else{if(stopwatch.state==WATCH_PAUSED){saveDataPoint(name,stopwatch.total);}}stopwatch.start=0;stopwatch.total=0;stopwatch.state=WATCH_STOPPED;}},getAverage:function(name){return report[name].avg;},getCallCount:function(name){return report[name].calls;},getMax:function(name){return report[name].max;},getMin:function(name){return report[name].min;},getFunctionReport:function(name){return report[name];},getReport:function(name){return report[name];},getFullReport:function(filter){filter=filter||function(){return true;};if(lang.isFunction(filter)){var fullReport={};for(var name in report){if(filter(report[name])){fullReport[name]=report[name];}}return fullReport;}},registerConstructor:function(name,owner){this.registerFunction(name,owner,true);},registerFunction:function(name,owner,registerPrototype){var funcName=(name.indexOf(".")>-1?name.substring(name.lastIndexOf(".")+1):name),method,prototype;if(!lang.isObject(owner)){owner=eval(name.substring(0,name.lastIndexOf(".")));}method=owner[funcName];prototype=method.prototype;if(lang.isFunction(method)&&!method.__yuiProfiled){owner[funcName]=this.instrument(name,method);container[name].__yuiOwner=owner;container[name].__yuiFuncName=funcName;if(registerPrototype){this.registerObject(name+".prototype",prototype);}}},registerObject:function(name,object,recurse){object=(lang.isObject(object)?object:eval(name));container[name]=object;for(var prop in object){if(typeof object[prop]=="function"){if(prop!="constructor"&&prop!="superclass"){this.registerFunction(name+"."+prop,object);}}else{if(typeof object[prop]=="object"&&recurse){this.registerObject(name+"."+prop,object[prop],recurse);}}}},unregisterConstructor:function(name){if(lang.isFunction(container[name])){this.unregisterFunction(name,true);}},unregisterFunction:function(name,unregisterPrototype){if(lang.isFunction(container[name])){if(unregisterPrototype){this.unregisterObject(name+".prototype",container[name].prototype);}var owner=container[name].__yuiOwner,funcName=container[name].__yuiFuncName;delete container[name].__yuiOwner;delete container[name].__yuiFuncName;owner[funcName]=container[name];delete container[name];}},unregisterObject:function(name,recurse){if(lang.isObject(container[name])){var object=container[name];for(var prop in object){if(typeof object[prop]=="function"){this.unregisterFunction(name+"."+prop);}else{if(typeof object[prop]=="object"&&recurse){this.unregisterObject(name+"."+prop,recurse);}}}delete container[name];}}};}();YAHOO.register("profiler",YAHOO.tool.Profiler,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler.js deleted file mode 100644 index c59b37e377..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profiler/profiler.js +++ /dev/null @@ -1,557 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("tool"); - -/** - * The YUI JavaScript profiler. - * @module profiler - * @namespace YAHOO.tool - * @requires yahoo - */ - -/** - * Profiles functions in JavaScript. - * @namespace YAHOO.tool - * @class Profiler - * @static - */ -YAHOO.tool.Profiler = function(){ - - - //------------------------------------------------------------------------- - // Private Variables and Functions - //------------------------------------------------------------------------- - - var container = {}, //Container object on which to put the original unprofiled methods. - report = {}, //Profiling information for functions - stopwatches = {}, //Additional stopwatch information - - WATCH_STARTED = 0, - WATCH_STOPPED = 1, - WATCH_PAUSED = 2, - - lang = YAHOO.lang; - - /** - * Creates a report object with the given name. - * @param {String} name The name to store for the report object. - * @return {Void} - * @method createReport - * @private - */ - function createReport(name){ - report[name] = { - calls: 0, - max: 0, - min: 0, - avg: 0, - points: [] - }; - } - - /** - * Called when a method ends execution. Marks the start and end time of the - * method so it can calculate how long the function took to execute. Also - * updates min/max/avg calculations for the function. - * @param {String} name The name of the function to mark as stopped. - * @param {int} duration The number of milliseconds it took the function to - * execute. - * @return {Void} - * @method saveDataPoint - * @private - * @static - */ - function saveDataPoint(name, duration){ - - //get the function data - var functionData /*:Object*/ = report[name]; - - //just in case clear() was called - if (!functionData){ - functionData = createReport(name); - } - - //increment the calls - functionData.calls++; - functionData.points.push(duration); - - //if it's already been called at least once, do more complex calculations - if (functionData.calls > 1) { - functionData.avg = ((functionData.avg*(functionData.calls-1))+duration)/functionData.calls; - functionData.min = Math.min(functionData.min, duration); - functionData.max = Math.max(functionData.max, duration); - } else { - functionData.avg = duration; - functionData.min = duration; - functionData.max = duration; - } - - } - - //------------------------------------------------------------------------- - // Singleton Object - //------------------------------------------------------------------------- - - return { - - //------------------------------------------------------------------------- - // Utility Methods - //------------------------------------------------------------------------- - - /** - * Removes all report data from the profiler. - * @param {String} name (Optional) The name of the report to clear. If - * omitted, then all report data is cleared. - * @return {Void} - * @method clear - * @static - */ - clear: function(name){ - if (lang.isString(name)){ - delete report[name]; - delete stopwatches[name]; - } else { - report = {}; - stopwatches = {}; - } - }, - - /** - * Returns the uninstrumented version of a function/object. - * @param {String} name The name of the function/object to retrieve. - * @return {Function|Object} The uninstrumented version of a function/object. - * @method getOriginal - * @static - */ - getOriginal: function(name){ - return container[name]; - }, - - /** - * Instruments a method to have profiling calls. - * @param {String} name The name of the report for the function. - * @param {Function} method The function to instrument. - * @return {Function} An instrumented version of the function. - * @method instrument - * @static - */ - instrument: function(name, method){ - - //create instrumented version of function - var newMethod = function () { - - var start = new Date(), - retval = method.apply(this, arguments), - stop = new Date(); - - saveDataPoint(name, stop-start); - - return retval; - - }; - - //copy the function properties over - lang.augmentObject(newMethod, method); - - //assign prototype and flag as being profiled - newMethod.__yuiProfiled = true; - newMethod.prototype = method.prototype; - - //store original method - container[name] = method; - container[name].__yuiFuncName = name; - - //create the report - createReport(name); - - //return the new method - return newMethod; - }, - - //------------------------------------------------------------------------- - // Stopwatch Methods - //------------------------------------------------------------------------- - - /** - * Pauses profiling information for a given name. - * @param {String} name The name of the data point. - * @return {Void} - * @method pause - * @static - */ - pause: function(name){ - var now = new Date(), - stopwatch = stopwatches[name]; - - if (stopwatch && stopwatch.state == WATCH_STARTED){ - stopwatch.total += (now - stopwatch.start); - stopwatch.start = 0; - stopwatch.state = WATCH_PAUSED; - } - - }, - - /** - * Start profiling information for a given name. The name cannot be the name - * of a registered function or object. This is used to start timing for a - * particular block of code rather than instrumenting the entire function. - * @param {String} name The name of the data point. - * @return {Void} - * @method start - * @static - */ - start: function(name){ - if(container[name]){ - throw new Error("Cannot use '" + name + "' for profiling through start(), name is already in use."); - } else { - - //create report if necessary - if (!report[name]){ - createReport(name); - } - - //create stopwatch object if necessary - if (!stopwatches[name]){ - stopwatches[name] = { - state: WATCH_STOPPED, - start: 0, - total: 0 - }; - } - - if (stopwatches[name].state == WATCH_STOPPED){ - stopwatches[name].state = WATCH_STARTED; - stopwatches[name].start = new Date(); - } - - } - }, - - /** - * Stops profiling information for a given name. - * @param {String} name The name of the data point. - * @return {Void} - * @method stop - * @static - */ - stop: function(name){ - var now = new Date(), - stopwatch = stopwatches[name]; - - if (stopwatch){ - if (stopwatch.state == WATCH_STARTED){ - saveDataPoint(name, stopwatch.total + (now - stopwatch.start)); - } else if (stopwatch.state == WATCH_PAUSED){ - saveDataPoint(name, stopwatch.total); - } - - //reset stopwatch information - stopwatch.start = 0; - stopwatch.total = 0; - stopwatch.state = WATCH_STOPPED; - } - }, - - //------------------------------------------------------------------------- - // Reporting Methods - //------------------------------------------------------------------------- - - /** - * Returns the average amount of time (in milliseconds) that the function - * with the given name takes to execute. - * @param {String} name The name of the function whose data should be returned. - * If an object type method, it should be 'constructor.prototype.methodName'; - * a normal object method would just be 'object.methodName'. - * @return {float} The average time it takes the function to execute. - * @method getAverage - * @static - */ - getAverage : function (name /*:String*/) /*:float*/ { - return report[name].avg; - }, - - /** - * Returns the number of times that the given function has been called. - * @param {String} name The name of the function whose data should be returned. - * @return {int} The number of times the function was called. - * @method getCallCount - * @static - */ - getCallCount : function (name /*:String*/) /*:int*/ { - return report[name].calls; - }, - - /** - * Returns the maximum amount of time (in milliseconds) that the function - * with the given name takes to execute. - * @param {String} name The name of the function whose data should be returned. - * If an object type method, it should be 'constructor.prototype.methodName'; - * a normal object method would just be 'object.methodName'. - * @return {float} The maximum time it takes the function to execute. - * @method getMax - * @static - */ - getMax : function (name /*:String*/) /*:int*/ { - return report[name].max; - }, - - /** - * Returns the minimum amount of time (in milliseconds) that the function - * with the given name takes to execute. - * @param {String} name The name of the function whose data should be returned. - * If an object type method, it should be 'constructor.prototype.methodName'; - * a normal object method would just be 'object.methodName'. - * @return {float} The minimum time it takes the function to execute. - * @method getMin - * @static - */ - getMin : function (name /*:String*/) /*:int*/ { - return report[name].min; - }, - - /** - * Returns an object containing profiling data for a single function. - * The object has an entry for min, max, avg, calls, and points). - * @return {Object} An object containing profile data for a given function. - * @method getFunctionReport - * @static - * @deprecated Use getReport() instead. - */ - getFunctionReport : function (name /*:String*/) /*:Object*/ { - return report[name]; - }, - - /** - * Returns an object containing profiling data for a single function. - * The object has an entry for min, max, avg, calls, and points). - * @return {Object} An object containing profile data for a given function. - * @method getReport - * @static - */ - getReport : function (name /*:String*/) /*:Object*/ { - return report[name]; - }, - - /** - * Returns an object containing profiling data for all of the functions - * that were profiled. The object has an entry for each function and - * returns all information (min, max, average, calls, etc.) for each - * function. - * @return {Object} An object containing all profile data. - * @static - */ - getFullReport : function (filter /*:Function*/) /*:Object*/ { - filter = filter || function(){return true;}; - - if (lang.isFunction(filter)) { - var fullReport = {}; - - for (var name in report){ - if (filter(report[name])){ - fullReport[name] = report[name]; - } - } - - return fullReport; - } - }, - - //------------------------------------------------------------------------- - // Profiling Methods - //------------------------------------------------------------------------- - - /** - * Sets up a constructor for profiling, including all properties and methods on the prototype. - * @param {string} name The fully-qualified name of the function including namespace information. - * @param {Object} owner (Optional) The object that owns the function (namespace or containing object). - * @return {Void} - * @method registerConstructor - * @static - */ - registerConstructor : function (name /*:String*/, owner /*:Object*/) /*:Void*/ { - this.registerFunction(name, owner, true); - }, - - /** - * Sets up a function for profiling. It essentially overwrites the function with one - * that has instrumentation data. This method also creates an entry for the function - * in the profile report. The original function is stored on the container object. - * @param {String} name The full name of the function including namespacing. This - * is the name of the function that is stored in the report. - * @param {Object} owner (Optional) The object that owns the function. If the function - * isn't global then this argument is required. This could be the namespace that - * the function belongs to, such as YAHOO.util.Dom, or the object on which it's - * a method. - * @param {Boolean} registerPrototype (Optional) Indicates that the prototype should - * also be instrumented. Setting to true has the same effect as calling - * registerConstructor(). - * @return {Void} - * @method registerFunction - * @static - */ - registerFunction : function(name /*:String*/, owner /*:Object*/, registerPrototype /*:Boolean*/) /*:Void*/{ - - //figure out the function name without namespacing - var funcName = (name.indexOf(".") > -1 ? - name.substring(name.lastIndexOf(".")+1) : name), - method, - prototype; - - //if owner isn't an object, try to find it from the name - if (!lang.isObject(owner)){ - owner = eval(name.substring(0, name.lastIndexOf("."))); - } - - //get the method and prototype - method = owner[funcName]; - prototype = method.prototype; - - //see if the method has already been registered - if (lang.isFunction(method) && !method.__yuiProfiled){ - - //replace the function with the profiling one - owner[funcName] = this.instrument(name, method); - - /* - * Store original function information. We store the actual - * function as well as the owner and the name used to identify - * the function so it can be restored later. - */ - container[name].__yuiOwner = owner; - container[name].__yuiFuncName = funcName; //overwrite with less-specific name - - //register prototype if necessary - if (registerPrototype) { - this.registerObject(name + ".prototype", prototype); - } - - } - - }, - - - /** - * Sets up an object for profiling. It takes the object and looks for functions. - * When a function is found, registerMethod() is called on it. If set to recrusive - * mode, it will also setup objects found inside of this object for profiling, - * using the same methodology. - * @param {String} name The name of the object to profile (shows up in report). - * @param {Object} owner (Optional) The object represented by the name. - * @param {Boolean} recurse (Optional) Determines if subobject methods are also profiled. - * @return {Void} - * @method registerObject - * @static - */ - registerObject : function (name /*:String*/, object /*:Object*/, recurse /*:Boolean*/) /*:Void*/{ - - //get the object - object = (lang.isObject(object) ? object : eval(name)); - - //save the object - container[name] = object; - - for (var prop in object) { - if (typeof object[prop] == "function"){ - if (prop != "constructor" && prop != "superclass"){ //don't do constructor or superclass, it's recursive - this.registerFunction(name + "." + prop, object); - } - } else if (typeof object[prop] == "object" && recurse){ - this.registerObject(name + "." + prop, object[prop], recurse); - } - } - - }, - - /** - * Removes a constructor function from profiling. Reverses the registerConstructor() method. - * @param {String} name The full name of the function including namespacing. This - * is the name of the function that is stored in the report. - * @return {Void} - * @method unregisterFunction - * @static - */ - unregisterConstructor : function(name /*:String*/) /*:Void*/{ - - //see if the method has been registered - if (lang.isFunction(container[name])){ - this.unregisterFunction(name, true); - } - }, - - /** - * Removes function from profiling. Reverses the registerFunction() method. - * @param {String} name The full name of the function including namespacing. This - * is the name of the function that is stored in the report. - * @return {Void} - * @method unregisterFunction - * @static - */ - unregisterFunction : function(name /*:String*/, unregisterPrototype /*:Boolean*/) /*:Void*/{ - - //see if the method has been registered - if (lang.isFunction(container[name])){ - - //check to see if you should unregister the prototype - if (unregisterPrototype){ - this.unregisterObject(name + ".prototype", container[name].prototype); - } - - //get original data - var owner /*:Object*/ = container[name].__yuiOwner, - funcName /*:String*/ = container[name].__yuiFuncName; - - //delete extra information - delete container[name].__yuiOwner; - delete container[name].__yuiFuncName; - - //replace instrumented function - owner[funcName] = container[name]; - - //delete supporting information - delete container[name]; - } - - - }, - - /** - * Unregisters an object for profiling. It takes the object and looks for functions. - * When a function is found, unregisterMethod() is called on it. If set to recrusive - * mode, it will also unregister objects found inside of this object, - * using the same methodology. - * @param {String} name The name of the object to unregister. - * @param {Boolean} recurse (Optional) Determines if subobject methods should also be - * unregistered. - * @return {Void} - * @method unregisterObject - * @static - */ - unregisterObject : function (name /*:String*/, recurse /*:Boolean*/) /*:Void*/{ - - //get the object - if (lang.isObject(container[name])){ - var object = container[name]; - - for (var prop in object) { - if (typeof object[prop] == "function"){ - this.unregisterFunction(name + "." + prop); - } else if (typeof object[prop] == "object" && recurse){ - this.unregisterObject(name + "." + prop, recurse); - } - } - - delete container[name]; - } - - } - - - }; - -}(); - -YAHOO.register("profiler", YAHOO.tool.Profiler, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/profilerviewer-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/profilerviewer-core.css deleted file mode 100644 index 62d05f6031..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/profilerviewer-core.css +++ /dev/null @@ -1,6 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/asc.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/asc.gif deleted file mode 100644 index a1fe7385d5ac940629233f0dc4bbd61f20959c3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/desc.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/desc.gif deleted file mode 100644 index c114f290c8ba1ff4173e129b1ef7e4f3f5e2bb5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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{ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/header_background.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/header_background.png deleted file mode 100644 index 3ef7909d3ed04956a06c5d9017076ea30e0ced27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer-skin.css deleted file mode 100644 index 4e2bd2739c..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer-skin.css +++ /dev/null @@ -1,167 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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;} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css deleted file mode 100644 index d1e7832276..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/profilerviewer.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/wait.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/assets/skins/sam/wait.gif deleted file mode 100644 index 471c1a4f93f2cabf0b3a85c3ff8e0a8aadefc548..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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. - * @module profilerviewer - * @requires yahoo, dom, event, element, profiler, yuiloader - */ - - /** - * A widget to view YUI Profiler output. - * @namespace YAHOO.widget - * @class ProfilerViewer - * @extends YAHOO.util.Element - * @constructor - * @param {HTMLElement | String | Object} el(optional) The html - * element into which the ProfileViewer should be rendered. - * An element will be created if none provided. - * @param {Object} attr (optional) A key map of the ProfilerViewer's - * initial attributes. Ignored if first arg is an attributes object. - */ - YAHOO.widget.ProfilerViewer = function(el, attr) { - attr = attr || {}; - if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) { - attr = el; - el = attr.element || null; - } - if (!el && !attr.element) { - el = this._createProfilerViewerElement(); - } - - YAHOO.widget.ProfilerViewer.superclass.constructor.call(this, el, attr); - - this._init(); - - YAHOO.log("ProfilerViewer instantiated.", "info", "ProfilerViewer"); - }; - - YAHOO.extend(YAHOO.widget.ProfilerViewer, YAHOO.util.Element); - - // Static members of YAHOO.widget.ProfilerViewer: - YAHOO.lang.augmentObject(YAHOO.widget.ProfilerViewer, { - /** - * Classname for ProfilerViewer containing element. - * @static - * @property CLASS - * @type string - * @public - * @default "yui-pv" - */ - CLASS: 'yui-pv', - - /** - * Classname for ProfilerViewer button dashboard. - * @static - * @property CLASS_DASHBOARD - * @type string - * @public - * @default "yui-pv-dashboard" - */ - CLASS_DASHBOARD: 'yui-pv-dashboard', - - /** - * Classname for the "refresh data" button. - * @static - * @property CLASS_REFRESH - * @type string - * @public - * @default "yui-pv-refresh" - */ - CLASS_REFRESH: 'yui-pv-refresh', - - /** - * Classname for busy indicator in the dashboard. - * @static - * @property CLASS_BUSY - * @type string - * @public - * @default "yui-pv-busy" - */ - CLASS_BUSY: 'yui-pv-busy', - - /** - * Classname for element containing the chart and chart - * legend elements. - * @static - * @property CLASS_CHART_CONTAINER - * @type string - * @public - * @default "yui-pv-chartcontainer" - */ - CLASS_CHART_CONTAINER: 'yui-pv-chartcontainer', - - /** - * Classname for element containing the chart. - * @static - * @property CLASS_CHART - * @type string - * @public - * @default "yui-pv-chart" - */ - CLASS_CHART: 'yui-pv-chart', - - /** - * Classname for element containing the chart's legend. - * @static - * @property CLASS_CHART_LEGEND - * @type string - * @public - * @default "yui-pv-chartlegend" - */ - CLASS_CHART_LEGEND: 'yui-pv-chartlegend', - - /** - * Classname for element containing the datatable. - * @static - * @property CLASS_TABLE - * @type string - * @public - * @default "yui-pv-table" - */ - CLASS_TABLE: 'yui-pv-table', - - /** - * Strings used in the UI. - * @static - * @property STRINGS - * @object - * @public - * @default English language strings for UI. - */ - STRINGS: { - title: "YUI Profiler (beta)", - buttons: { - viewprofiler: "View Profiler Data", - hideprofiler: "Hide Profiler Report", - showchart: "Show Chart", - hidechart: "Hide Chart", - refreshdata: "Refresh Data" - }, - colHeads: { - //key: [column head label, width in pixels] - fn: ["Function/Method", null], //must auto-size - calls: ["Calls", 40], - avg: ["Average", 80], - min: ["Shortest", 70], - max: ["Longest", 70], - total: ["Total Time", 70], - pct: ["Percent", 70] - }, - millisecondsAbbrev: "ms", - initMessage: "initialiazing chart...", - installFlashMessage: "Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the Adobe Flash Player Download Center." - }, - - /** - * Function used to format numbers in milliseconds - * for chart; must be publicly accessible, per Charts spec. - * @static - * @property timeAxisLabelFunction - * @type function - * @private - */ - timeAxisLabelFunction: function(n) { - var a = (n === Math.floor(n)) ? n : (Math.round(n*1000))/1000; - return (a + " " + YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev); - }, - - /** - * Function used to format percent numbers for chart; must - * be publicly accessible, per Charts spec. - * @static - * @property percentAxisLabelFunction - * @type function - * @private - */ - percentAxisLabelFunction: function(n) { - var a = (n === Math.floor(n)) ? n : (Math.round(n*100))/100; - return (a + "%"); - } - - - },true); - - - // - // STANDARD SHORTCUTS - // - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; - var Profiler = YAHOO.tool.Profiler; - var PV = YAHOO.widget.ProfilerViewer; - var proto = PV.prototype; - - - // - // PUBLIC METHODS - // - - /** - * Refreshes the data displayed in the ProfilerViewer. When called, - * this will invoke a refresh of the DataTable and (if displayed) - * the Chart. - * @method refreshData - * @return void - * @public - */ - proto.refreshData = function() { - YAHOO.log("Data refresh requested via refreshData method.", "info", "ProfilerViewer"); - this.fireEvent("dataRefreshEvent"); - }; - - /** - * Returns the element containing the console's header. - * @method getHeadEl - * @return HTMLElement - * @public - */ - proto.getHeadEl = function() { - YAHOO.log("Head element requested via getHeadEl.", "info", "ProfilerViewer"); - return (this._headEl) ? Dom.get(this._headEl) : false; - }; - - /** - * Returns the element containing the console's body, including - * the chart and the datatable.. - * @method getBodyEl - * @return HTMLElement - * @public - */ - proto.getBodyEl = function() { - YAHOO.log("Body element requested via getBodyEl.", "info", "ProfilerViewer"); - return (this._bodyEl) ? Dom.get(this._bodyEl) : false; - }; - - /** - * Returns the element containing the console's chart. - * @method getChartEl - * @return HTMLElement - * @public - */ - proto.getChartEl = function() { - YAHOO.log("Chart element requested via getChartEl.", "info", "ProfilerViewer"); - return (this._chartEl) ? Dom.get(this._chartEl) : false; - }; - - /** - * Returns the element containing the console's dataTable. - * @method getTableEl - * @return HTMLElement - * @public - */ - proto.getTableEl = function() { - YAHOO.log("DataTable element requested via getTableEl.", "info", "ProfilerViewer"); - return (this._tableEl) ? Dom.get(this._tableEl) : false; - }; - - /** - * Returns the element containing the console's DataTable - * instance. - * @method getDataTable - * @return YAHOO.widget.DataTable - * @public - */ - proto.getDataTable = function() { - YAHOO.log("DataTable instance requested via getDataTable.", "info", "ProfilerViewer"); - return this._dataTable; - }; - - /** - * Returns the element containing the console's Chart instance. - * @method getChart - * @return YAHOO.widget.BarChart - * @public - */ - proto.getChart = function() { - YAHOO.log("Chart instance requested via getChart.", "info", "ProfilerViewer"); - return this._chart; - }; - - - // - // PRIVATE PROPERTIES - // - proto._rendered = false; - proto._headEl = null; - proto._bodyEl = null; - proto._toggleVisibleEl = null; - proto._busyEl = null; - proto._busy = false; - - proto._tableEl = null; - proto._dataTable = null; - - proto._chartEl = null; - proto._chartLegendEl = null; - proto._chartElHeight = 250; - proto._chart = null; - proto._chartInitialized = false; - - // - // PRIVATE METHODS - // - - proto._init = function() { - /** - * CUSTOM EVENTS - **/ - - /** - * Fired when a data refresh is requested. No arguments are passed - * with this event. - * - * @event refreshDataEvent - */ - this.createEvent("dataRefreshEvent"); - - /** - * Fired when the viewer canvas first renders. No arguments are passed - * with this event. - * - * @event renderEvent - */ - this.createEvent("renderEvent"); - - this.on("dataRefreshEvent", this._refreshDataTable, this, true); - - this._initLauncherDOM(); - - if(this.get("showChart")) { - this.on("sortedByChange", this._refreshChart); - } - - YAHOO.log("ProfilerViewer instance initialization complete.", "info", "ProfilerViewer"); - }; - - /** - * If no element is passed in, create it as the first element - * in the document. - * @method _createProfilerViewerElement - * @return HTMLElement - * @private - */ - proto._createProfilerViewerElement = function() { - YAHOO.log("Creating root element...", "info", "ProfilerViewer"); - - var el = document.createElement("div"); - document.body.insertBefore(el, document.body.firstChild); - Dom.addClass(el, this.SKIN_CLASS); - Dom.addClass(el, PV.CLASS); - YAHOO.log(el); - return el; - }; - - /** - * Provides a readable name for the ProfilerViewer instance. - * @method toString - * @return String - * @private - */ - proto.toString = function() { - return "ProfilerViewer " + (this.get('id') || this.get('tagName')); - }; - - /** - * Toggles visibility of the viewer canvas. - * @method _toggleVisible - * @return void - * @private - */ - proto._toggleVisible = function() { - YAHOO.log("Toggling visibility to " + !this.get("visible") + ".", "info", "ProfilerViewer"); - - var newVis = (this.get("visible")) ? false : true; - this.set("visible", newVis); - }; - - /** - * Shows the viewer canvas. - * @method show - * @return void - * @private - */ - proto._show = function() { - if(!this._busy) { - this._setBusyState(true); - if(!this._rendered) { - var loader = new YAHOO.util.YUILoader(); - if (this.get("base")) { - loader.base = this.get("base"); - } - - var modules = ["datatable"]; - if(this.get("showChart")) { - modules.push("charts"); - } - - loader.insert({ require: modules, - onSuccess: function() { - this._render(); - }, - scope: this}); - } else { - var el = this.get("element"); - Dom.removeClass(el, "yui-pv-minimized"); - this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler; - - //The Flash Charts component can't be set to display:none, - //and even after positioning it offscreen the screen - //may fail to repaint in some browsers. Adding an empty - //style rule to the console body can help force a repaint: - Dom.addClass(el, "yui-pv-null"); - Dom.removeClass(el, "yui-pv-null"); - - //Always refresh data when changing to visible: - this.refreshData(); - } - } - }; - - /** - * Hides the viewer canvas. - * @method hide - * @return void - * @private - */ - proto._hide = function() { - this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.viewprofiler; - Dom.addClass(this.get("element"), "yui-pv-minimized"); - }; - - /** - * Render the viewer canvas - * @method _render - * @return void - * @private - */ - proto._render = function() { - YAHOO.log("Beginning to render ProfilerViewer canvas...", "info", "ProfilerViewer"); - - Dom.removeClass(this.get("element"), "yui-pv-minimized"); - - this._initViewerDOM(); - this._initDataTable(); - if(this.get("showChart")) { - this._initChartDOM(); - this._initChart(); - } - this._rendered = true; - this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler; - - this.fireEvent("renderEvent"); - - YAHOO.log("ProfilerViewer rendering complete...", "info", "ProfilerViewer"); - }; - - /** - * Set up the DOM structure for the ProfilerViewer launcher. - * @method _initLauncherDOM - * @private - */ - proto._initLauncherDOM = function() { - YAHOO.log("Creating the launcher...", "info", "ProfilerViewer"); - - var el = this.get("element"); - Dom.addClass(el, PV.CLASS); - Dom.addClass(el, "yui-pv-minimized"); - - this._headEl = document.createElement("div"); - Dom.addClass(this._headEl, "hd"); - - var s = PV.STRINGS.buttons; - var b = (this.get("visible")) ? s.hideprofiler : s.viewprofiler; - - this._toggleVisibleEl = this._createButton(b, this._headEl); - - this._refreshEl = this._createButton(s.refreshdata, this._headEl); - Dom.addClass(this._refreshEl, PV.CLASS_REFRESH); - - this._busyEl = document.createElement("span"); - this._headEl.appendChild(this._busyEl); - - var title = document.createElement("h4"); - title.innerHTML = PV.STRINGS.title; - this._headEl.appendChild(title); - - el.appendChild(this._headEl); - - Event.on(this._toggleVisibleEl, "click", this._toggleVisible, this, true); - Event.on(this._refreshEl, "click", function() { - if(!this._busy) { - this._setBusyState(true); - this.fireEvent("dataRefreshEvent"); - } - }, this, true); - }; - - /** - * Set up the DOM structure for the ProfilerViewer canvas, - * including the holder for the DataTable. - * @method _initViewerDOM - * @private - */ - proto._initViewerDOM = function() { - YAHOO.log("Creating DOM structure for viewer...", "info", "ProfilerViewer"); - - var el = this.get("element"); - this._bodyEl = document.createElement("div"); - Dom.addClass(this._bodyEl, "bd"); - this._tableEl = document.createElement("div"); - Dom.addClass(this._tableEl, PV.CLASS_TABLE); - this._bodyEl.appendChild(this._tableEl); - el.appendChild(this._bodyEl); - }; - - /** - * Set up the DOM structure for the ProfilerViewer canvas. - * @method _initChartDOM - * @private - */ - proto._initChartDOM = function() { - YAHOO.log("Adding DOM structure for chart...", "info", "ProfilerViewer"); - - this._chartContainer = document.createElement("div"); - Dom.addClass(this._chartContainer, PV.CLASS_CHART_CONTAINER); - - var chl = document.createElement("div"); - Dom.addClass(chl, PV.CLASS_CHART_LEGEND); - - var chw = document.createElement("div"); - - this._chartLegendEl = document.createElement("dl"); - this._chartLegendEl.innerHTML = "
                    " + PV.STRINGS.initMessage + "
                    "; - - this._chartEl = document.createElement("div"); - Dom.addClass(this._chartEl, PV.CLASS_CHART); - - var msg = document.createElement("p"); - msg.innerHTML = PV.STRINGS.installFlashMessage; - this._chartEl.appendChild(msg); - - this._chartContainer.appendChild(chl); - chl.appendChild(chw); - chw.appendChild(this._chartLegendEl); - this._chartContainer.appendChild(this._chartEl); - this._bodyEl.insertBefore(this._chartContainer,this._tableEl); - }; - - - /** - * Create anchor elements for use as buttons. Args: label - * is text to appear on the face of the button, parentEl - * is the el to which the anchor will be attached, position - * is true for inserting as the first node and false for - * inserting as the last node of the parentEl. - * @method _createButton - * @private - */ - proto._createButton = function(label, parentEl, position) { - var b = document.createElement("a"); - b.innerHTML = b.title = label; - if(parentEl) { - if(!position) { - parentEl.appendChild(b); - } else { - parentEl.insertBefore(b, parentEl.firstChild); - } - } - return b; - }; - - /** - * Set's console busy state. - * @method _setBusyState - * @private - **/ - proto._setBusyState = function(b) { - if(b) { - Dom.addClass(this._busyEl, PV.CLASS_BUSY); - this._busy = true; - } else { - Dom.removeClass(this._busyEl, PV.CLASS_BUSY); - this._busy = false; - } - }; - - /** - * Generages a sorting function based on current sortedBy - * values. - * @method _createProfilerViewerElement - * @private - **/ - proto._genSortFunction = function(key, dir) { - var by = key; - var direction = dir; - return function(a, b) { - if (direction == YAHOO.widget.DataTable.CLASS_ASC) { - return a[by] - b[by]; - } else { - return ((a[by] - b[by]) * -1); - } - }; - }; - - /** - * Utility function for array sums. - * @method _arraySum - * @private - **/ - var _arraySum = function(arr){ - var ct = 0; - for(var i = 0; i < arr.length; ct+=arr[i++]){} - return ct; - }; - - /** - * Retrieves data from Profiler, filtering and sorting as needed - * based on current widget state. Adds calculated percentage - * column and function name to data returned by Profiler. - * @method _getProfilerData - * @private - **/ - proto._getProfilerData = function() { - YAHOO.log("Profiler data requested from function DataSource.", "info", "ProfilerViewer"); - - var obj = Profiler.getFullReport(); - var arr = []; - var totalTime = 0; - for (name in obj) { - if (YAHOO.lang.hasOwnProperty(obj, name)) { - var r = obj[name]; - var o = {}; - o.fn = name; //add function name to record - o.points = r.points.slice(); //copy live array - o.calls = r.calls; - o.min = r.min; - o.max = r.max; - o.avg = r.avg; - o.total = _arraySum(o.points); - o.points = r.points; - var f = this.get("filter"); - if((!f) || (f(o))) { - arr.push(o); - totalTime += o.total; - } - } - } - - //add calculated percentage column - for (var i = 0, j = arr.length; i < j; i++) { - arr[i].pct = (totalTime) ? (arr[i].total * 100) / totalTime : 0; - } - - var sortedBy = this.get("sortedBy"); - var key = sortedBy.key; - var dir = sortedBy.dir; - - arr.sort(this._genSortFunction(key, dir)); - - YAHOO.log("Returning data from DataSource: " + YAHOO.lang.dump(arr), "info", "ProfilerViewer"); - - return arr; - }; - - /** - * Set up the DataTable. - * @method _initDataTable - * @private - */ - proto._initDataTable = function() { - YAHOO.log("Creating DataTable instance...", "info", "ProfilerViewer"); - - var self = this; - - //Set up the JS Function DataSource, pulling data from - //the Profiler. - this._dataSource = new YAHOO.util.DataSource( - function() { - return self._getProfilerData.call(self); - }, - { - responseType: YAHOO.util.DataSource.TYPE_JSARRAY, - maxCacheEntries: 0 - } - ); - var ds = this._dataSource; - - ds.responseSchema = - { - fields: [ "fn", "avg", "calls", "max", "min", "total", "pct", "points"] - }; - - //Set up the DataTable. - var formatTimeValue = function(elCell, oRecord, oColumn, oData) { - var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*1000))/1000; - elCell.innerHTML = a + " " + PV.STRINGS.millisecondsAbbrev; - }; - - var formatPercent = function(elCell, oRecord, oColumn, oData) { - var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*100))/100; - elCell.innerHTML = a + "%"; - }; - - var a = YAHOO.widget.DataTable.CLASS_ASC; - var d = YAHOO.widget.DataTable.CLASS_DESC; - var c = PV.STRINGS.colHeads; - var f = formatTimeValue; - - var cols = [ - {key:"fn", sortable:true, label: c.fn[0], - sortOptions: {defaultDir:a}, - resizeable: (YAHOO.util.DragDrop) ? true : false, - minWidth:c.fn[1]}, - {key:"calls", sortable:true, label: c.calls[0], - sortOptions: {defaultDir:d}, - width:c.calls[1]}, - {key:"avg", sortable:true, label: c.avg[0], - sortOptions: {defaultDir:d}, - formatter:f, - width:c.avg[1]}, - {key:"min", sortable:true, label: c.min[0], - sortOptions: {defaultDir:a}, - formatter:f, - width:c.min[1]}, - {key:"max", sortable:true, label: c.max[0], - sortOptions: {defaultDir:d}, - formatter:f, - width:c.max[1]}, - {key:"total", sortable:true, label: c.total[0], - sortOptions: {defaultDir:d}, - formatter:f, - width:c.total[1]}, - {key:"pct", sortable:true, label: c.pct[0], - sortOptions: {defaultDir:d}, - formatter:formatPercent, - width:c.pct[1]} - ]; - - this._dataTable = new YAHOO.widget.DataTable(this._tableEl, cols, ds, { - scrollable:true, - height:this.get("tableHeight"), - initialRequest:null, - sortedBy: { - key: "total", - dir: YAHOO.widget.DataTable.CLASS_DESC - } - }); - var dt = this._dataTable; - - //Wire up DataTable events to drive the rest of the UI. - dt.subscribe("sortedByChange", this._sortedByChange, this, true); - dt.subscribe("renderEvent", this._dataTableRenderHandler, this, true); - dt.subscribe("initEvent", this._dataTableRenderHandler, this, true); - Event.on(this._tableEl.getElementsByTagName("th"), "click", this._thClickHandler, this, true); - YAHOO.log("DataTable initialized.", "info", "ProfilerViewer"); - }; - - /** - * Proxy the sort event in DataTable into the ProfilerViewer - * attribute. - * @method _sortedByChange - * @private - **/ - proto._sortedByChange = function(o) { - if(o.newValue && o.newValue.key) { - YAHOO.log("Relaying DataTable sortedBy value change; new key: " + o.newValue.key + "; new direction: " + o.newValue.dir + ".", "info", "ProfilerViewer"); - this.set("sortedBy", {key: o.newValue.key, dir:o.newValue.dir}); - } - }; - - /** - * Proxy the render event in DataTable into the ProfilerViewer - * attribute. - * @method _dataTableRenderHandler - * @private - **/ - proto._dataTableRenderHandler = function(o) { - YAHOO.log("DataTable's render event has fired.", "info", "ProfilerViewer"); - this._setBusyState(false); - }; - - /** - * Event handler for clicks on the DataTable's sortable column - * heads. - * @method _thClickHandler - * @private - **/ - proto._thClickHandler = function(o) { - YAHOO.log("DataTable's header row was clicked for sorting.", "info", "ProfilerViewer"); - this._setBusyState(true); - }; - - /** - * Refresh DataTable, getting new data from Profiler. - * @method _refreshDataTable - * @private - **/ - proto._refreshDataTable = function(args) { - YAHOO.log("Beginning to refresh DataTable contents...", "info", "ProfilerViewer"); - var dt = this._dataTable; - dt.getDataSource().sendRequest("", dt.onDataReturnInitializeTable, dt); - YAHOO.log("DataTable refresh complete.", "info", "ProfilerViewer"); - }; - - /** - * Refresh chart, getting new data from table. - * @method _refreshChart - * @private - **/ - proto._refreshChart = function() { - YAHOO.log("Beginning to refresh Chart contents...", "info", "ProfilerViewer"); - - switch (this.get("sortedBy").key) { - case "fn": - /*Keep the same data on the chart, but force update to - reflect new sort order on function/method name: */ - this._chart.set("dataSource", this._chart.get("dataSource")); - /*no further action necessary; chart redraws*/ - return; - case "calls": - /*Null out the xAxis formatting before redrawing chart.*/ - this._chart.set("xAxis", this._chartAxisDefinitionPlain); - break; - case "pct": - this._chart.set("xAxis", this._chartAxisDefinitionPercent); - break; - default: - /*Set the default xAxis; redraw legend; set the new series definition.*/ - this._chart.set("xAxis", this._chartAxisDefinitionTime); - break; - } - - this._drawChartLegend(); - this._chart.set("series", this._getSeriesDef(this.get("sortedBy").key)); - - YAHOO.log("Chart refresh complete.", "info", "ProfilerViewer"); - }; - - /** - * Get data for the Chart from DataTable recordset - * @method _getChartData - * @private - */ - proto._getChartData = function() { - YAHOO.log("Getting data for chart from function DataSource.", "info", "ProfilerViewer"); - //var records = this._getProfilerData(); - var records = this._dataTable.getRecordSet().getRecords(0, this.get("maxChartFunctions")); - var arr = []; - for (var i = 0, j = records.length; i, - * calls : , - * avg : , - * max: , - * min: , - * total: - * points : - * } - * - * For example, you would use the follwing filter function to - * return only functions that have been called at least once: - * - * function(o) { - * return (o.calls > 0); - * } - * - * @attribute filter - * @type function - * @default null - */ - this.setAttributeConfig('filter', { - value: attr.filter || null, - validator: YAHOO.lang.isFunction - }); - - /** - * The path to the YUI Charts swf file; must be a full URI - * or a path relative to the page being profiled. Changes at runtime - * not supported; pass this value in at instantiation. - * @attribute swfUrl - * @type string - * @default "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf" - */ - this.setAttributeConfig('swfUrl', { - value: attr.swfUrl || "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf" - }); - - /** - * The maximum number of functions to profile in the chart. The - * greater the number of functions, the greater the height of the - * chart canvas. - * height. - * @attribute maxChartFunctions - * @type int - * @default 6 - */ - this.setAttributeConfig('maxChartFunctions', { - value: attr.maxChartFunctions || 6, - method: function(s) { - if(this._rendered) { - this._sizeChartCanvas(); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * The style object that defines the chart's visual presentation. - * Conforms to the style attribute passed to the Charts Control - * constructor. See Charts Control User's Guide for more information - * on how to format this object. - * @attribute chartStyle - * @type obj - * @default See JS source for default definitions. - */ - this.setAttributeConfig('chartStyle', { - value: attr.chartStyle || { - font: - { - name: "Arial", - color: 0xeeee5c, - size: 12 - }, - background: - { - color: "6e6e63" - } - }, - method: function() { - if(this._rendered && this.get("showChart")) { - this._refreshChart(); - } - } - }); - - /** - * The series definition information to use when charting - * specific fields on the chart. displayName, xField, - * and style members are used to construct the series - * definition; the "group" member is the array of fields - * that should be charted when the table is sorted by a - * given field. - * @attribute chartSeriesDefinitions - * @type obj - * @default See JS source for full default definitions. - */ - this.setAttributeConfig('chartSeriesDefinitions', { - value: attr.chartSeriesDefinitions || { - total: { - displayName: PV.STRINGS.colHeads.total[0], - xField: "total", - style: {color:"4d95dd", size:20}, - group: ["total"] - }, - calls: { - displayName: PV.STRINGS.colHeads.calls[0], - xField: "calls", - style: {color:"edff9f", size:20}, - group: ["calls"] - }, - avg: { - displayName: PV.STRINGS.colHeads.avg[0], - xField: "avg", - style: {color:"209daf", size:9}, - group: ["avg", "min", "max"] - }, - min: { - displayName: PV.STRINGS.colHeads.min[0], - xField: "min", - style: {color:"b6ecf4", size:9}, - group: ["avg", "min", "max"] - }, - max: { - displayName: PV.STRINGS.colHeads.max[0], - xField: "max", - style: {color:"29c7de", size:9}, - group: ["avg", "min", "max"] - }, - pct: { - displayName: PV.STRINGS.colHeads.pct[0], - xField: "pct", - style: {color:"C96EDB", size:20}, - group: ["pct"] - } - }, - method: function() { - if(this._rendered && this.get("showChart")) { - this._refreshChart(); - } - } - }); - - /** - * The default visibility setting for the viewer canvas. If true, - * the viewer will load all necessary files and render itself - * immediately upon instantiation; otherwise, the viewer will - * load only minimal resources until the user toggles visibility - * via the UI. - * @attribute visible - * @type boolean - * @default false - */ - this.setAttributeConfig('visible', { - value: attr.visible || false, - validator: YAHOO.lang.isBoolean, - method: function(b) { - if(b) { - this._show(); - } else { - if (this._rendered) { - this._hide(); - } - } - } - }); - - /** - * The default visibility setting for the chart. - * @attribute showChart - * @type boolean - * @default true - */ - this.setAttributeConfig('showChart', { - value: attr.showChart || true, - validator: YAHOO.lang.isBoolean, - writeOnce: true - - }); - - YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this, attr); - - YAHOO.log("Attributes initialized.", "info", "ProfilerViewer"); - }; - -})(); -YAHOO.register("profilerviewer", YAHOO.widget.ProfilerViewer, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/profilerviewer-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/profilerviewer-min.js deleted file mode 100644 index 72a93cbda9..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/profilerviewer/profilerviewer-min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){YAHOO.widget.ProfilerViewer=function(H,G){G=G||{};if(arguments.length==1&&!YAHOO.lang.isString(H)&&!H.nodeName){G=H;H=G.element||null;}if(!H&&!G.element){H=this._createProfilerViewerElement();}YAHOO.widget.ProfilerViewer.superclass.constructor.call(this,H,G);this._init();};YAHOO.extend(YAHOO.widget.ProfilerViewer,YAHOO.util.Element);YAHOO.lang.augmentObject(YAHOO.widget.ProfilerViewer,{CLASS:"yui-pv",CLASS_DASHBOARD:"yui-pv-dashboard",CLASS_REFRESH:"yui-pv-refresh",CLASS_BUSY:"yui-pv-busy",CLASS_CHART_CONTAINER:"yui-pv-chartcontainer",CLASS_CHART:"yui-pv-chart",CLASS_CHART_LEGEND:"yui-pv-chartlegend",CLASS_TABLE:"yui-pv-table",STRINGS:{title:"YUI Profiler (beta)",buttons:{viewprofiler:"View Profiler Data",hideprofiler:"Hide Profiler Report",showchart:"Show Chart",hidechart:"Hide Chart",refreshdata:"Refresh Data"},colHeads:{fn:["Function/Method",null],calls:["Calls",40],avg:["Average",80],min:["Shortest",70],max:["Longest",70],total:["Total Time",70],pct:["Percent",70]},millisecondsAbbrev:"ms",initMessage:"initialiazing chart...",installFlashMessage:"Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the Adobe Flash Player Download Center."},timeAxisLabelFunction:function(H){var G=(H===Math.floor(H))?H:(Math.round(H*1000))/1000;return(G+" "+YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev);},percentAxisLabelFunction:function(H){var G=(H===Math.floor(H))?H:(Math.round(H*100))/100;return(G+"%");}},true);var C=YAHOO.util.Dom;var A=YAHOO.util.Event;var B=YAHOO.tool.Profiler;var E=YAHOO.widget.ProfilerViewer;var D=E.prototype;D.refreshData=function(){this.fireEvent("dataRefreshEvent");};D.getHeadEl=function(){return(this._headEl)?C.get(this._headEl):false;};D.getBodyEl=function(){return(this._bodyEl)?C.get(this._bodyEl):false;};D.getChartEl=function(){return(this._chartEl)?C.get(this._chartEl):false;};D.getTableEl=function(){return(this._tableEl)?C.get(this._tableEl):false;};D.getDataTable=function(){return this._dataTable;};D.getChart=function(){return this._chart;};D._rendered=false;D._headEl=null;D._bodyEl=null;D._toggleVisibleEl=null;D._busyEl=null;D._busy=false;D._tableEl=null;D._dataTable=null;D._chartEl=null;D._chartLegendEl=null;D._chartElHeight=250;D._chart=null;D._chartInitialized=false;D._init=function(){this.createEvent("dataRefreshEvent");this.createEvent("renderEvent");this.on("dataRefreshEvent",this._refreshDataTable,this,true);this._initLauncherDOM();if(this.get("showChart")){this.on("sortedByChange",this._refreshChart);}};D._createProfilerViewerElement=function(){var G=document.createElement("div");document.body.insertBefore(G,document.body.firstChild);C.addClass(G,this.SKIN_CLASS);C.addClass(G,E.CLASS);return G;};D.toString=function(){return"ProfilerViewer "+(this.get("id")||this.get("tagName"));};D._toggleVisible=function(){var G=(this.get("visible"))?false:true;this.set("visible",G);};D._show=function(){if(!this._busy){this._setBusyState(true);if(!this._rendered){var G=new YAHOO.util.YUILoader();if(this.get("base")){G.base=this.get("base");}var H=["datatable"];if(this.get("showChart")){H.push("charts");}G.insert({require:H,onSuccess:function(){this._render();},scope:this});}else{var I=this.get("element");C.removeClass(I,"yui-pv-minimized");this._toggleVisibleEl.innerHTML=E.STRINGS.buttons.hideprofiler;C.addClass(I,"yui-pv-null");C.removeClass(I,"yui-pv-null");this.refreshData();}}};D._hide=function(){this._toggleVisibleEl.innerHTML=E.STRINGS.buttons.viewprofiler;C.addClass(this.get("element"),"yui-pv-minimized");};D._render=function(){C.removeClass(this.get("element"),"yui-pv-minimized");this._initViewerDOM();this._initDataTable();if(this.get("showChart")){this._initChartDOM();this._initChart();}this._rendered=true;this._toggleVisibleEl.innerHTML=E.STRINGS.buttons.hideprofiler;this.fireEvent("renderEvent");};D._initLauncherDOM=function(){var I=this.get("element");C.addClass(I,E.CLASS);C.addClass(I,"yui-pv-minimized");this._headEl=document.createElement("div");C.addClass(this._headEl,"hd");var H=E.STRINGS.buttons;var G=(this.get("visible"))?H.hideprofiler:H.viewprofiler;this._toggleVisibleEl=this._createButton(G,this._headEl);this._refreshEl=this._createButton(H.refreshdata,this._headEl);C.addClass(this._refreshEl,E.CLASS_REFRESH);this._busyEl=document.createElement("span");this._headEl.appendChild(this._busyEl);var J=document.createElement("h4");J.innerHTML=E.STRINGS.title;this._headEl.appendChild(J);I.appendChild(this._headEl);A.on(this._toggleVisibleEl,"click",this._toggleVisible,this,true);A.on(this._refreshEl,"click",function(){if(!this._busy){this._setBusyState(true);this.fireEvent("dataRefreshEvent");}},this,true);};D._initViewerDOM=function(){var G=this.get("element");this._bodyEl=document.createElement("div");C.addClass(this._bodyEl,"bd");this._tableEl=document.createElement("div");C.addClass(this._tableEl,E.CLASS_TABLE);this._bodyEl.appendChild(this._tableEl);G.appendChild(this._bodyEl);};D._initChartDOM=function(){this._chartContainer=document.createElement("div");C.addClass(this._chartContainer,E.CLASS_CHART_CONTAINER);var H=document.createElement("div");C.addClass(H,E.CLASS_CHART_LEGEND);var G=document.createElement("div");this._chartLegendEl=document.createElement("dl");this._chartLegendEl.innerHTML="
                    "+E.STRINGS.initMessage+"
                    ";this._chartEl=document.createElement("div");C.addClass(this._chartEl,E.CLASS_CHART);var I=document.createElement("p");I.innerHTML=E.STRINGS.installFlashMessage;this._chartEl.appendChild(I);this._chartContainer.appendChild(H);H.appendChild(G);G.appendChild(this._chartLegendEl);this._chartContainer.appendChild(this._chartEl);this._bodyEl.insertBefore(this._chartContainer,this._tableEl);};D._createButton=function(I,J,H){var G=document.createElement("a");G.innerHTML=G.title=I;if(J){if(!H){J.appendChild(G);}else{J.insertBefore(G,J.firstChild);}}return G;};D._setBusyState=function(G){if(G){C.addClass(this._busyEl,E.CLASS_BUSY); -this._busy=true;}else{C.removeClass(this._busyEl,E.CLASS_BUSY);this._busy=false;}};D._genSortFunction=function(H,G){var J=H;var I=G;return function(L,K){if(I==YAHOO.widget.DataTable.CLASS_ASC){return L[J]-K[J];}else{return((L[J]-K[J])*-1);}};};var F=function(G){var I=0;for(var H=0;H. - * @module profilerviewer - * @requires yahoo, dom, event, element, profiler, yuiloader - */ - - /** - * A widget to view YUI Profiler output. - * @namespace YAHOO.widget - * @class ProfilerViewer - * @extends YAHOO.util.Element - * @constructor - * @param {HTMLElement | String | Object} el(optional) The html - * element into which the ProfileViewer should be rendered. - * An element will be created if none provided. - * @param {Object} attr (optional) A key map of the ProfilerViewer's - * initial attributes. Ignored if first arg is an attributes object. - */ - YAHOO.widget.ProfilerViewer = function(el, attr) { - attr = attr || {}; - if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) { - attr = el; - el = attr.element || null; - } - if (!el && !attr.element) { - el = this._createProfilerViewerElement(); - } - - YAHOO.widget.ProfilerViewer.superclass.constructor.call(this, el, attr); - - this._init(); - - }; - - YAHOO.extend(YAHOO.widget.ProfilerViewer, YAHOO.util.Element); - - // Static members of YAHOO.widget.ProfilerViewer: - YAHOO.lang.augmentObject(YAHOO.widget.ProfilerViewer, { - /** - * Classname for ProfilerViewer containing element. - * @static - * @property CLASS - * @type string - * @public - * @default "yui-pv" - */ - CLASS: 'yui-pv', - - /** - * Classname for ProfilerViewer button dashboard. - * @static - * @property CLASS_DASHBOARD - * @type string - * @public - * @default "yui-pv-dashboard" - */ - CLASS_DASHBOARD: 'yui-pv-dashboard', - - /** - * Classname for the "refresh data" button. - * @static - * @property CLASS_REFRESH - * @type string - * @public - * @default "yui-pv-refresh" - */ - CLASS_REFRESH: 'yui-pv-refresh', - - /** - * Classname for busy indicator in the dashboard. - * @static - * @property CLASS_BUSY - * @type string - * @public - * @default "yui-pv-busy" - */ - CLASS_BUSY: 'yui-pv-busy', - - /** - * Classname for element containing the chart and chart - * legend elements. - * @static - * @property CLASS_CHART_CONTAINER - * @type string - * @public - * @default "yui-pv-chartcontainer" - */ - CLASS_CHART_CONTAINER: 'yui-pv-chartcontainer', - - /** - * Classname for element containing the chart. - * @static - * @property CLASS_CHART - * @type string - * @public - * @default "yui-pv-chart" - */ - CLASS_CHART: 'yui-pv-chart', - - /** - * Classname for element containing the chart's legend. - * @static - * @property CLASS_CHART_LEGEND - * @type string - * @public - * @default "yui-pv-chartlegend" - */ - CLASS_CHART_LEGEND: 'yui-pv-chartlegend', - - /** - * Classname for element containing the datatable. - * @static - * @property CLASS_TABLE - * @type string - * @public - * @default "yui-pv-table" - */ - CLASS_TABLE: 'yui-pv-table', - - /** - * Strings used in the UI. - * @static - * @property STRINGS - * @object - * @public - * @default English language strings for UI. - */ - STRINGS: { - title: "YUI Profiler (beta)", - buttons: { - viewprofiler: "View Profiler Data", - hideprofiler: "Hide Profiler Report", - showchart: "Show Chart", - hidechart: "Hide Chart", - refreshdata: "Refresh Data" - }, - colHeads: { - //key: [column head label, width in pixels] - fn: ["Function/Method", null], //must auto-size - calls: ["Calls", 40], - avg: ["Average", 80], - min: ["Shortest", 70], - max: ["Longest", 70], - total: ["Total Time", 70], - pct: ["Percent", 70] - }, - millisecondsAbbrev: "ms", - initMessage: "initialiazing chart...", - installFlashMessage: "Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the Adobe Flash Player Download Center." - }, - - /** - * Function used to format numbers in milliseconds - * for chart; must be publicly accessible, per Charts spec. - * @static - * @property timeAxisLabelFunction - * @type function - * @private - */ - timeAxisLabelFunction: function(n) { - var a = (n === Math.floor(n)) ? n : (Math.round(n*1000))/1000; - return (a + " " + YAHOO.widget.ProfilerViewer.STRINGS.millisecondsAbbrev); - }, - - /** - * Function used to format percent numbers for chart; must - * be publicly accessible, per Charts spec. - * @static - * @property percentAxisLabelFunction - * @type function - * @private - */ - percentAxisLabelFunction: function(n) { - var a = (n === Math.floor(n)) ? n : (Math.round(n*100))/100; - return (a + "%"); - } - - - },true); - - - // - // STANDARD SHORTCUTS - // - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; - var Profiler = YAHOO.tool.Profiler; - var PV = YAHOO.widget.ProfilerViewer; - var proto = PV.prototype; - - - // - // PUBLIC METHODS - // - - /** - * Refreshes the data displayed in the ProfilerViewer. When called, - * this will invoke a refresh of the DataTable and (if displayed) - * the Chart. - * @method refreshData - * @return void - * @public - */ - proto.refreshData = function() { - this.fireEvent("dataRefreshEvent"); - }; - - /** - * Returns the element containing the console's header. - * @method getHeadEl - * @return HTMLElement - * @public - */ - proto.getHeadEl = function() { - return (this._headEl) ? Dom.get(this._headEl) : false; - }; - - /** - * Returns the element containing the console's body, including - * the chart and the datatable.. - * @method getBodyEl - * @return HTMLElement - * @public - */ - proto.getBodyEl = function() { - return (this._bodyEl) ? Dom.get(this._bodyEl) : false; - }; - - /** - * Returns the element containing the console's chart. - * @method getChartEl - * @return HTMLElement - * @public - */ - proto.getChartEl = function() { - return (this._chartEl) ? Dom.get(this._chartEl) : false; - }; - - /** - * Returns the element containing the console's dataTable. - * @method getTableEl - * @return HTMLElement - * @public - */ - proto.getTableEl = function() { - return (this._tableEl) ? Dom.get(this._tableEl) : false; - }; - - /** - * Returns the element containing the console's DataTable - * instance. - * @method getDataTable - * @return YAHOO.widget.DataTable - * @public - */ - proto.getDataTable = function() { - return this._dataTable; - }; - - /** - * Returns the element containing the console's Chart instance. - * @method getChart - * @return YAHOO.widget.BarChart - * @public - */ - proto.getChart = function() { - return this._chart; - }; - - - // - // PRIVATE PROPERTIES - // - proto._rendered = false; - proto._headEl = null; - proto._bodyEl = null; - proto._toggleVisibleEl = null; - proto._busyEl = null; - proto._busy = false; - - proto._tableEl = null; - proto._dataTable = null; - - proto._chartEl = null; - proto._chartLegendEl = null; - proto._chartElHeight = 250; - proto._chart = null; - proto._chartInitialized = false; - - // - // PRIVATE METHODS - // - - proto._init = function() { - /** - * CUSTOM EVENTS - **/ - - /** - * Fired when a data refresh is requested. No arguments are passed - * with this event. - * - * @event refreshDataEvent - */ - this.createEvent("dataRefreshEvent"); - - /** - * Fired when the viewer canvas first renders. No arguments are passed - * with this event. - * - * @event renderEvent - */ - this.createEvent("renderEvent"); - - this.on("dataRefreshEvent", this._refreshDataTable, this, true); - - this._initLauncherDOM(); - - if(this.get("showChart")) { - this.on("sortedByChange", this._refreshChart); - } - - }; - - /** - * If no element is passed in, create it as the first element - * in the document. - * @method _createProfilerViewerElement - * @return HTMLElement - * @private - */ - proto._createProfilerViewerElement = function() { - - var el = document.createElement("div"); - document.body.insertBefore(el, document.body.firstChild); - Dom.addClass(el, this.SKIN_CLASS); - Dom.addClass(el, PV.CLASS); - return el; - }; - - /** - * Provides a readable name for the ProfilerViewer instance. - * @method toString - * @return String - * @private - */ - proto.toString = function() { - return "ProfilerViewer " + (this.get('id') || this.get('tagName')); - }; - - /** - * Toggles visibility of the viewer canvas. - * @method _toggleVisible - * @return void - * @private - */ - proto._toggleVisible = function() { - - var newVis = (this.get("visible")) ? false : true; - this.set("visible", newVis); - }; - - /** - * Shows the viewer canvas. - * @method show - * @return void - * @private - */ - proto._show = function() { - if(!this._busy) { - this._setBusyState(true); - if(!this._rendered) { - var loader = new YAHOO.util.YUILoader(); - if (this.get("base")) { - loader.base = this.get("base"); - } - - var modules = ["datatable"]; - if(this.get("showChart")) { - modules.push("charts"); - } - - loader.insert({ require: modules, - onSuccess: function() { - this._render(); - }, - scope: this}); - } else { - var el = this.get("element"); - Dom.removeClass(el, "yui-pv-minimized"); - this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler; - - //The Flash Charts component can't be set to display:none, - //and even after positioning it offscreen the screen - //may fail to repaint in some browsers. Adding an empty - //style rule to the console body can help force a repaint: - Dom.addClass(el, "yui-pv-null"); - Dom.removeClass(el, "yui-pv-null"); - - //Always refresh data when changing to visible: - this.refreshData(); - } - } - }; - - /** - * Hides the viewer canvas. - * @method hide - * @return void - * @private - */ - proto._hide = function() { - this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.viewprofiler; - Dom.addClass(this.get("element"), "yui-pv-minimized"); - }; - - /** - * Render the viewer canvas - * @method _render - * @return void - * @private - */ - proto._render = function() { - - Dom.removeClass(this.get("element"), "yui-pv-minimized"); - - this._initViewerDOM(); - this._initDataTable(); - if(this.get("showChart")) { - this._initChartDOM(); - this._initChart(); - } - this._rendered = true; - this._toggleVisibleEl.innerHTML = PV.STRINGS.buttons.hideprofiler; - - this.fireEvent("renderEvent"); - - }; - - /** - * Set up the DOM structure for the ProfilerViewer launcher. - * @method _initLauncherDOM - * @private - */ - proto._initLauncherDOM = function() { - - var el = this.get("element"); - Dom.addClass(el, PV.CLASS); - Dom.addClass(el, "yui-pv-minimized"); - - this._headEl = document.createElement("div"); - Dom.addClass(this._headEl, "hd"); - - var s = PV.STRINGS.buttons; - var b = (this.get("visible")) ? s.hideprofiler : s.viewprofiler; - - this._toggleVisibleEl = this._createButton(b, this._headEl); - - this._refreshEl = this._createButton(s.refreshdata, this._headEl); - Dom.addClass(this._refreshEl, PV.CLASS_REFRESH); - - this._busyEl = document.createElement("span"); - this._headEl.appendChild(this._busyEl); - - var title = document.createElement("h4"); - title.innerHTML = PV.STRINGS.title; - this._headEl.appendChild(title); - - el.appendChild(this._headEl); - - Event.on(this._toggleVisibleEl, "click", this._toggleVisible, this, true); - Event.on(this._refreshEl, "click", function() { - if(!this._busy) { - this._setBusyState(true); - this.fireEvent("dataRefreshEvent"); - } - }, this, true); - }; - - /** - * Set up the DOM structure for the ProfilerViewer canvas, - * including the holder for the DataTable. - * @method _initViewerDOM - * @private - */ - proto._initViewerDOM = function() { - - var el = this.get("element"); - this._bodyEl = document.createElement("div"); - Dom.addClass(this._bodyEl, "bd"); - this._tableEl = document.createElement("div"); - Dom.addClass(this._tableEl, PV.CLASS_TABLE); - this._bodyEl.appendChild(this._tableEl); - el.appendChild(this._bodyEl); - }; - - /** - * Set up the DOM structure for the ProfilerViewer canvas. - * @method _initChartDOM - * @private - */ - proto._initChartDOM = function() { - - this._chartContainer = document.createElement("div"); - Dom.addClass(this._chartContainer, PV.CLASS_CHART_CONTAINER); - - var chl = document.createElement("div"); - Dom.addClass(chl, PV.CLASS_CHART_LEGEND); - - var chw = document.createElement("div"); - - this._chartLegendEl = document.createElement("dl"); - this._chartLegendEl.innerHTML = "
                    " + PV.STRINGS.initMessage + "
                    "; - - this._chartEl = document.createElement("div"); - Dom.addClass(this._chartEl, PV.CLASS_CHART); - - var msg = document.createElement("p"); - msg.innerHTML = PV.STRINGS.installFlashMessage; - this._chartEl.appendChild(msg); - - this._chartContainer.appendChild(chl); - chl.appendChild(chw); - chw.appendChild(this._chartLegendEl); - this._chartContainer.appendChild(this._chartEl); - this._bodyEl.insertBefore(this._chartContainer,this._tableEl); - }; - - - /** - * Create anchor elements for use as buttons. Args: label - * is text to appear on the face of the button, parentEl - * is the el to which the anchor will be attached, position - * is true for inserting as the first node and false for - * inserting as the last node of the parentEl. - * @method _createButton - * @private - */ - proto._createButton = function(label, parentEl, position) { - var b = document.createElement("a"); - b.innerHTML = b.title = label; - if(parentEl) { - if(!position) { - parentEl.appendChild(b); - } else { - parentEl.insertBefore(b, parentEl.firstChild); - } - } - return b; - }; - - /** - * Set's console busy state. - * @method _setBusyState - * @private - **/ - proto._setBusyState = function(b) { - if(b) { - Dom.addClass(this._busyEl, PV.CLASS_BUSY); - this._busy = true; - } else { - Dom.removeClass(this._busyEl, PV.CLASS_BUSY); - this._busy = false; - } - }; - - /** - * Generages a sorting function based on current sortedBy - * values. - * @method _createProfilerViewerElement - * @private - **/ - proto._genSortFunction = function(key, dir) { - var by = key; - var direction = dir; - return function(a, b) { - if (direction == YAHOO.widget.DataTable.CLASS_ASC) { - return a[by] - b[by]; - } else { - return ((a[by] - b[by]) * -1); - } - }; - }; - - /** - * Utility function for array sums. - * @method _arraySum - * @private - **/ - var _arraySum = function(arr){ - var ct = 0; - for(var i = 0; i < arr.length; ct+=arr[i++]){} - return ct; - }; - - /** - * Retrieves data from Profiler, filtering and sorting as needed - * based on current widget state. Adds calculated percentage - * column and function name to data returned by Profiler. - * @method _getProfilerData - * @private - **/ - proto._getProfilerData = function() { - - var obj = Profiler.getFullReport(); - var arr = []; - var totalTime = 0; - for (name in obj) { - if (YAHOO.lang.hasOwnProperty(obj, name)) { - var r = obj[name]; - var o = {}; - o.fn = name; //add function name to record - o.points = r.points.slice(); //copy live array - o.calls = r.calls; - o.min = r.min; - o.max = r.max; - o.avg = r.avg; - o.total = _arraySum(o.points); - o.points = r.points; - var f = this.get("filter"); - if((!f) || (f(o))) { - arr.push(o); - totalTime += o.total; - } - } - } - - //add calculated percentage column - for (var i = 0, j = arr.length; i < j; i++) { - arr[i].pct = (totalTime) ? (arr[i].total * 100) / totalTime : 0; - } - - var sortedBy = this.get("sortedBy"); - var key = sortedBy.key; - var dir = sortedBy.dir; - - arr.sort(this._genSortFunction(key, dir)); - - - return arr; - }; - - /** - * Set up the DataTable. - * @method _initDataTable - * @private - */ - proto._initDataTable = function() { - - var self = this; - - //Set up the JS Function DataSource, pulling data from - //the Profiler. - this._dataSource = new YAHOO.util.DataSource( - function() { - return self._getProfilerData.call(self); - }, - { - responseType: YAHOO.util.DataSource.TYPE_JSARRAY, - maxCacheEntries: 0 - } - ); - var ds = this._dataSource; - - ds.responseSchema = - { - fields: [ "fn", "avg", "calls", "max", "min", "total", "pct", "points"] - }; - - //Set up the DataTable. - var formatTimeValue = function(elCell, oRecord, oColumn, oData) { - var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*1000))/1000; - elCell.innerHTML = a + " " + PV.STRINGS.millisecondsAbbrev; - }; - - var formatPercent = function(elCell, oRecord, oColumn, oData) { - var a = (oData === Math.floor(oData)) ? oData : (Math.round(oData*100))/100; - elCell.innerHTML = a + "%"; - }; - - var a = YAHOO.widget.DataTable.CLASS_ASC; - var d = YAHOO.widget.DataTable.CLASS_DESC; - var c = PV.STRINGS.colHeads; - var f = formatTimeValue; - - var cols = [ - {key:"fn", sortable:true, label: c.fn[0], - sortOptions: {defaultDir:a}, - resizeable: (YAHOO.util.DragDrop) ? true : false, - minWidth:c.fn[1]}, - {key:"calls", sortable:true, label: c.calls[0], - sortOptions: {defaultDir:d}, - width:c.calls[1]}, - {key:"avg", sortable:true, label: c.avg[0], - sortOptions: {defaultDir:d}, - formatter:f, - width:c.avg[1]}, - {key:"min", sortable:true, label: c.min[0], - sortOptions: {defaultDir:a}, - formatter:f, - width:c.min[1]}, - {key:"max", sortable:true, label: c.max[0], - sortOptions: {defaultDir:d}, - formatter:f, - width:c.max[1]}, - {key:"total", sortable:true, label: c.total[0], - sortOptions: {defaultDir:d}, - formatter:f, - width:c.total[1]}, - {key:"pct", sortable:true, label: c.pct[0], - sortOptions: {defaultDir:d}, - formatter:formatPercent, - width:c.pct[1]} - ]; - - this._dataTable = new YAHOO.widget.DataTable(this._tableEl, cols, ds, { - scrollable:true, - height:this.get("tableHeight"), - initialRequest:null, - sortedBy: { - key: "total", - dir: YAHOO.widget.DataTable.CLASS_DESC - } - }); - var dt = this._dataTable; - - //Wire up DataTable events to drive the rest of the UI. - dt.subscribe("sortedByChange", this._sortedByChange, this, true); - dt.subscribe("renderEvent", this._dataTableRenderHandler, this, true); - dt.subscribe("initEvent", this._dataTableRenderHandler, this, true); - Event.on(this._tableEl.getElementsByTagName("th"), "click", this._thClickHandler, this, true); - }; - - /** - * Proxy the sort event in DataTable into the ProfilerViewer - * attribute. - * @method _sortedByChange - * @private - **/ - proto._sortedByChange = function(o) { - if(o.newValue && o.newValue.key) { - this.set("sortedBy", {key: o.newValue.key, dir:o.newValue.dir}); - } - }; - - /** - * Proxy the render event in DataTable into the ProfilerViewer - * attribute. - * @method _dataTableRenderHandler - * @private - **/ - proto._dataTableRenderHandler = function(o) { - this._setBusyState(false); - }; - - /** - * Event handler for clicks on the DataTable's sortable column - * heads. - * @method _thClickHandler - * @private - **/ - proto._thClickHandler = function(o) { - this._setBusyState(true); - }; - - /** - * Refresh DataTable, getting new data from Profiler. - * @method _refreshDataTable - * @private - **/ - proto._refreshDataTable = function(args) { - var dt = this._dataTable; - dt.getDataSource().sendRequest("", dt.onDataReturnInitializeTable, dt); - }; - - /** - * Refresh chart, getting new data from table. - * @method _refreshChart - * @private - **/ - proto._refreshChart = function() { - - switch (this.get("sortedBy").key) { - case "fn": - /*Keep the same data on the chart, but force update to - reflect new sort order on function/method name: */ - this._chart.set("dataSource", this._chart.get("dataSource")); - /*no further action necessary; chart redraws*/ - return; - case "calls": - /*Null out the xAxis formatting before redrawing chart.*/ - this._chart.set("xAxis", this._chartAxisDefinitionPlain); - break; - case "pct": - this._chart.set("xAxis", this._chartAxisDefinitionPercent); - break; - default: - /*Set the default xAxis; redraw legend; set the new series definition.*/ - this._chart.set("xAxis", this._chartAxisDefinitionTime); - break; - } - - this._drawChartLegend(); - this._chart.set("series", this._getSeriesDef(this.get("sortedBy").key)); - - }; - - /** - * Get data for the Chart from DataTable recordset - * @method _getChartData - * @private - */ - proto._getChartData = function() { - //var records = this._getProfilerData(); - var records = this._dataTable.getRecordSet().getRecords(0, this.get("maxChartFunctions")); - var arr = []; - for (var i = 0, j = records.length; i, - * calls : , - * avg : , - * max: , - * min: , - * total: - * points : - * } - * - * For example, you would use the follwing filter function to - * return only functions that have been called at least once: - * - * function(o) { - * return (o.calls > 0); - * } - * - * @attribute filter - * @type function - * @default null - */ - this.setAttributeConfig('filter', { - value: attr.filter || null, - validator: YAHOO.lang.isFunction - }); - - /** - * The path to the YUI Charts swf file; must be a full URI - * or a path relative to the page being profiled. Changes at runtime - * not supported; pass this value in at instantiation. - * @attribute swfUrl - * @type string - * @default "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf" - */ - this.setAttributeConfig('swfUrl', { - value: attr.swfUrl || "http://yui.yahooapis.com/2.5.0/build/charts/assets/charts.swf" - }); - - /** - * The maximum number of functions to profile in the chart. The - * greater the number of functions, the greater the height of the - * chart canvas. - * height. - * @attribute maxChartFunctions - * @type int - * @default 6 - */ - this.setAttributeConfig('maxChartFunctions', { - value: attr.maxChartFunctions || 6, - method: function(s) { - if(this._rendered) { - this._sizeChartCanvas(); - } - }, - validator: YAHOO.lang.isNumber - }); - - /** - * The style object that defines the chart's visual presentation. - * Conforms to the style attribute passed to the Charts Control - * constructor. See Charts Control User's Guide for more information - * on how to format this object. - * @attribute chartStyle - * @type obj - * @default See JS source for default definitions. - */ - this.setAttributeConfig('chartStyle', { - value: attr.chartStyle || { - font: - { - name: "Arial", - color: 0xeeee5c, - size: 12 - }, - background: - { - color: "6e6e63" - } - }, - method: function() { - if(this._rendered && this.get("showChart")) { - this._refreshChart(); - } - } - }); - - /** - * The series definition information to use when charting - * specific fields on the chart. displayName, xField, - * and style members are used to construct the series - * definition; the "group" member is the array of fields - * that should be charted when the table is sorted by a - * given field. - * @attribute chartSeriesDefinitions - * @type obj - * @default See JS source for full default definitions. - */ - this.setAttributeConfig('chartSeriesDefinitions', { - value: attr.chartSeriesDefinitions || { - total: { - displayName: PV.STRINGS.colHeads.total[0], - xField: "total", - style: {color:"4d95dd", size:20}, - group: ["total"] - }, - calls: { - displayName: PV.STRINGS.colHeads.calls[0], - xField: "calls", - style: {color:"edff9f", size:20}, - group: ["calls"] - }, - avg: { - displayName: PV.STRINGS.colHeads.avg[0], - xField: "avg", - style: {color:"209daf", size:9}, - group: ["avg", "min", "max"] - }, - min: { - displayName: PV.STRINGS.colHeads.min[0], - xField: "min", - style: {color:"b6ecf4", size:9}, - group: ["avg", "min", "max"] - }, - max: { - displayName: PV.STRINGS.colHeads.max[0], - xField: "max", - style: {color:"29c7de", size:9}, - group: ["avg", "min", "max"] - }, - pct: { - displayName: PV.STRINGS.colHeads.pct[0], - xField: "pct", - style: {color:"C96EDB", size:20}, - group: ["pct"] - } - }, - method: function() { - if(this._rendered && this.get("showChart")) { - this._refreshChart(); - } - } - }); - - /** - * The default visibility setting for the viewer canvas. If true, - * the viewer will load all necessary files and render itself - * immediately upon instantiation; otherwise, the viewer will - * load only minimal resources until the user toggles visibility - * via the UI. - * @attribute visible - * @type boolean - * @default false - */ - this.setAttributeConfig('visible', { - value: attr.visible || false, - validator: YAHOO.lang.isBoolean, - method: function(b) { - if(b) { - this._show(); - } else { - if (this._rendered) { - this._hide(); - } - } - } - }); - - /** - * The default visibility setting for the chart. - * @attribute showChart - * @type boolean - * @default true - */ - this.setAttributeConfig('showChart', { - value: attr.showChart || true, - validator: YAHOO.lang.isBoolean, - writeOnce: true - - }); - - YAHOO.widget.ProfilerViewer.superclass.initAttributes.call(this, attr); - - }; - -})(); -YAHOO.register("profilerviewer", YAHOO.widget.ProfilerViewer, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/progressbar-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/progressbar-core.css deleted file mode 100644 index 31af4bba3d..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/progressbar-core.css +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* several */ - -.yui-pb-bar, -.yui-pb-mask { - width:100%; - height:100%; -} - -/* contentBox */ -.yui-pb { - position:relative; - top:0; - left:0; - - width:200px; - height:20px; - - padding:0; - border:none; - margin:0; - - text-align:left; -} - -/* mask */ - -.yui-pb-mask { - position:absolute; - top:0; - left:0; - - z-index:2; -} - -.yui-pb-mask div { - width:50%; - height:50%; - background-repeat:no-repeat; - padding:0; - position: absolute; -} - -.yui-pb-tl { - background-position: top left; -} -.yui-pb-tr { - background-position: top right; - left:50%; -} -.yui-pb-bl { - background-position: bottom left; - top:50%; -} -.yui-pb-br { - background-position: bottom right; - left:50%; - top:50%; -} - -/* bar */ -.yui-pb-bar { - margin:0; - position:absolute; - left:0; - top:0; - z-index:1; -} - -.yui-pb-ltr .yui-pb-bar { - _position:static -} - -.yui-pb-rtl .yui-pb-bar { - background-position:right; -} - -.yui-pb-btt .yui-pb-bar { - background-position:left bottom; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/back-h.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/back-h.png deleted file mode 100644 index 5f69f4e2564357c83eddcecd5f104e14ecf09d49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^8bBP#!2~4rHx?TMDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe3dtTpz6=aiY77hwEes65fIoOOtf|Nms9M{<~TG{NqzV`0JLv$@3}2r!1e&d7^!S-DO!ayYtzu zlYbXZdwJtvz~-c)`W2~GWd>K)%(x?;HM38a$5dPGdwUdyvi-fkSZmx?=65Sx>H+$T N!PC{xWt~$(695Wxh_(O# diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/back-v.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/back-v.png deleted file mode 100644 index 658574a9d560febf6f58a6a005e602ae734f97da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^fk3Rm!2~2Z4>V?gr~;43Vg?4j!ywFfJby(BP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eBzCyA`kS_y6l^O#>Lkk1LFQ8Dv3kHT#0|tgy z2@DKYGZ+}e3+C(!v;j)&_H=O!$#8xetNtMognoD1W&+apvb;IkbSm6HPD+>;$YzUet;PS1vwR5kn@U@xAZc*X`bN{qf6~>%I#YFG@c*bNAWmV~4vw71T)EP4+yI zm~wtolli{h{KvO{m;tHh|I%4jCy1_T3f;gJc5v07ee4g7Yue6#khD9T{)1zz`*b-fq}tl1_Oh5!JJ)zHb9Bj zo-U3d8P0E~+HyA*iX83NS6;e=XVR0zjVBT|NT_&L{`FGpKAL2Fa>10KxKFts1mAI{ zTl(++c+cBw&>1Hg`q?f)-lTL;*t$N(e z5?hd3GOgj$2NlMp2LqYB{x-9SR9ACql#~mV9Q=7MjH&2tFH1^vHs=YGaG?o#I;s{w z@^7uZwW|JFk^J=j)5pJVtzYr_iPcWOb;5U<>=m}`da)?fz4zkhFyGbPdQqiUBy97q c5+S&cLBv9~EU0~*E702vp00i_>zopr03oxJMgRZ+ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/bar-v.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/bar-v.png deleted file mode 100644 index 2efd664d9abdddff7e06ec512e0198f5fcaf1a56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 387 zcmeAS@N?(olHy`uVBq!ia0vp^0YI$5!2~3qF}(@{Qk(@Ik;M!Qe1}1p@p%4<6rdnu zage(c!@6@aFM%AEbVpxD28NCO+{4xi!)|R=d;J&iHZ8yvVO_gGSA|3s-364JloT@b e|NoWUGS9D3dxyvWMZl0`VDNPHb6Mw<&;$VKhMGhG diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar-skin.css deleted file mode 100644 index 460dc80815..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar-skin.css +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-pb-bar { - background-color:blue; -} - -.yui-pb { - border: thin solid #808080 -} - -.yui-skin-sam .yui-pb { - background-color: transparent; - border: solid #808080; - border-width:1px 0; -} - -.yui-skin-sam .yui-pb-rtl,.yui-skin-sam .yui-pb-ltr { - background-image: url(back-h.png); - background-repeat:repeat-x; -} - -.yui-skin-sam .yui-pb-ttb,.yui-skin-sam .yui-pb-btt { - background-image: url(back-v.png); - background-repeat:repeat-y; -} -.yui-skin-sam .yui-pb-bar{ - background-color:transparent; -} - -.yui-skin-sam .yui-pb-ltr .yui-pb-bar,.yui-skin-sam .yui-pb-rtl .yui-pb-bar { - background-image:url(bar-h.png); - background-repeat:repeat-x; -} -.yui-skin-sam .yui-pb-ttb .yui-pb-bar,.yui-skin-sam .yui-pb-btt .yui-pb-bar { - background-image:url(bar-v.png); - background-repeat:repeat-y; -} - -.yui-skin-sam .yui-pb-mask { - border: solid #808080; - border-width:0 1px; - margin: 0 -1px; -} - -.yui-skin-sam .yui-pb-caption { - color:#000; - text-align:center; - margin:0 auto; -} -.yui-skin-sam .yui-pb-range { - color:#a6a6a6; -} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar.css deleted file mode 100644 index d71e6e852f..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/assets/skins/sam/progressbar.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-pb-bar,.yui-pb-mask{width:100%;height:100%;}.yui-pb{position:relative;top:0;left:0;width:200px;height:20px;padding:0;border:none;margin:0;text-align:left;}.yui-pb-mask{position:absolute;top:0;left:0;z-index:2;}.yui-pb-mask div{width:50%;height:50%;background-repeat:no-repeat;padding:0;position:absolute;}.yui-pb-tl{background-position:top left;}.yui-pb-tr{background-position:top right;left:50%;}.yui-pb-bl{background-position:bottom left;top:50%;}.yui-pb-br{background-position:bottom right;left:50%;top:50%;}.yui-pb-bar{margin:0;position:absolute;left:0;top:0;z-index:1;}.yui-pb-ltr .yui-pb-bar{_position:static;}.yui-pb-rtl .yui-pb-bar{background-position:right;}.yui-pb-btt .yui-pb-bar{background-position:left bottom;}.yui-pb-bar{background-color:blue;}.yui-pb{border:thin solid #808080;}.yui-skin-sam .yui-pb{background-color:transparent;border:solid #808080;border-width:1px 0;}.yui-skin-sam .yui-pb-rtl,.yui-skin-sam .yui-pb-ltr{background-image:url(back-h.png);background-repeat:repeat-x;}.yui-skin-sam .yui-pb-ttb,.yui-skin-sam .yui-pb-btt{background-image:url(back-v.png);background-repeat:repeat-y;}.yui-skin-sam .yui-pb-bar{background-color:transparent;}.yui-skin-sam .yui-pb-ltr .yui-pb-bar,.yui-skin-sam .yui-pb-rtl .yui-pb-bar{background-image:url(bar-h.png);background-repeat:repeat-x;}.yui-skin-sam .yui-pb-ttb .yui-pb-bar,.yui-skin-sam .yui-pb-btt .yui-pb-bar{background-image:url(bar-v.png);background-repeat:repeat-y;}.yui-skin-sam .yui-pb-mask{border:solid #808080;border-width:0 1px;margin:0 -1px;}.yui-skin-sam .yui-pb-caption{color:#000;text-align:center;margin:0 auto;}.yui-skin-sam .yui-pb-range{color:#a6a6a6;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-debug.js deleted file mode 100644 index 8f99b0b273..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-debug.js +++ /dev/null @@ -1,691 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * - * @module progressbar - * @requires yahoo, dom, event, element - * @optional animation - * @title ProgressBar Widget - */ - -(function () { - var Dom = YAHOO.util.Dom, - Lang = YAHOO.lang, - // ClassNames - CLASS_PROGBAR = 'yui-pb', - CLASS_MASK = CLASS_PROGBAR + '-mask', - CLASS_BAR = CLASS_PROGBAR + '-bar', - CLASS_ANIM = CLASS_PROGBAR + '-anim', - CLASS_TL = CLASS_PROGBAR + '-tl', - CLASS_TR = CLASS_PROGBAR + '-tr', - CLASS_BL = CLASS_PROGBAR + '-bl', - CLASS_BR = CLASS_PROGBAR + '-br', - - // Configuration attributes - WIDTH = 'width', - HEIGHT = 'height', - MIN_VALUE = 'minValue', - MAX_VALUE = 'maxValue', - VALUE = 'value', - ANIM = 'anim', - DIRECTION = 'direction', - DIRECTION_LTR = 'ltr', - DIRECTION_RTL = 'rtl', - DIRECTION_TTB = 'ttb', - DIRECTION_BTT = 'btt', - BAR_EL = 'barEl', - MASK_EL = 'maskEl', - ARIA_TEXT_TEMPLATE = 'ariaTextTemplate', - - // Events - START = 'start', - PROGRESS = 'progress', - COMPLETE = 'complete'; - - /** - * The ProgressBar widget provides an easy way to draw a bar depicting progress of an operation, - * a level meter, rating or any such simple linear measure. - * It allows for highly customized styles including animation, vertical or horizontal and forward or reverse. - * @namespace YAHOO.widget - * @class ProgressBar - * @extends YAHOO.util.Element - * @param oConfigs {object} An object containing any configuration attributes to be set - * @constructor - */ - var Prog = function(oConfigs) { - YAHOO.log('Creating ProgressBar instance','info','ProgressBar'); - - Prog.superclass.constructor.call(this, document.createElement('div') , oConfigs); - this._init(oConfigs); - - }; - - YAHOO.widget.ProgressBar = Prog; - - /** - * String containing the HTML string which is the basis for the Progress Bar. - * - * @property ProgressBar.MARKUP - * @type String - * @static - * @final - * @default (too long) - */ - Prog.MARKUP = [ - '
                    ' - ].join(''); - - - Lang.extend(Prog, YAHOO.util.Element, { - /** - * Initialization code for the widget, separate from the constructor to allow for overriding/patching. - * It is called after initAttributes - * - * @method _init - * @param oConfigs {Object} (Optional) Object literal definition of configuration values. - * @protected - */ - _init: function (oConfigs) { - /** - * Fires when the value is about to change. It reports the starting value - * @event start - * @type CustomEvent - * @param value {Number} the current (initial) value - */ - // No actual creation required, event will be created when subscribed to - //this.createEvent(START); - /** - * If animation is active, it will trigger several times during the animation providing intermediate values - * If animation is not active, it will fire only once providing the end value - * @event progress - * @type CustomEvent - * @param value{Number} the current, changing value - */ - // No actual creation required, event will be created when subscribed to - //this.createEvent(PROGRESS); - /** - * Fires at the end of the animation or immediately upon changing values if animation is not loaded - * @event complete - * @type CustomEvent - * @param value {Number} the current (final) value - */ - // No actual creation required, event will be created when listened to - //this.createEvent(COMPLETE); - - - }, - /** - * Implementation of Element's abstract method. Sets up config values. - * - * @method initAttributes - * @param oConfigs {Object} (Optional) Object literal definition of configuration values. - * @private - */ - initAttributes: function (oConfigs) { - YAHOO.log('Initializing configuration attributes','info','ProgressBar'); - - Prog.superclass.initAttributes.call(this, oConfigs); - this.set('innerHTML',Prog.MARKUP); - this.addClass(CLASS_PROGBAR); - - // I need to apply at least the following styles, if present in oConfigs, - // to the ProgressBar so when it later reads the width and height, - // they are already set to the correct values. - // id is important because it can be used as a CSS selector. - var key, presets = ['id',WIDTH,HEIGHT,'class','style']; - while((key = presets.pop())) { - if (key in oConfigs) { - this.set(key,oConfigs[key]); - } - } - - - /** - * @attribute barEl - * @description Reference to the HTML object that makes the moving bar (read-only) - * @type HTMLElement (div) - * @readonly - */ - this.setAttributeConfig(BAR_EL, { - readOnly: true, - value: this.getElementsByClassName(CLASS_BAR)[0] - }); - /** - * @attribute maskEl - * @description Reference to the HTML object that overlays the bar providing the mask. (read-only) - * @type HTMLElement (table) - * @readonly - */ - this.setAttributeConfig(MASK_EL, { - readOnly: true, - value: this.getElementsByClassName(CLASS_MASK)[0] - }); - - - /** - * @attribute direction - * @description Direction of movement of the bar. - * It can be any of 'ltr' (left to right), 'rtl' (the reverse) , 'ttb' (top to bottom) or 'btt'. - * Can only be set once and only before rendering. - * @default 'ltr' - * @type String (any of "ltr", "rtl", "ttb" or "btt") - */ - this.setAttributeConfig(DIRECTION, { - value:DIRECTION_LTR, - validator:function(value) { - if (this._rendered) { return false; } - switch (value) { - case DIRECTION_LTR: - case DIRECTION_RTL: - case DIRECTION_TTB: - case DIRECTION_BTT: - return true; - default: - return false; - } - }, - method: function(value) { - this._barSizeFunction = this._barSizeFunctions[this.get(ANIM)?1:0][value]; - } - }); - - /** - * @attribute maxValue - * @description Represents the top value for the bar. - * The bar will be fully extended when reaching this value. - * Values higher than this will be ignored. - * @default 100 - * @type Number - */ - this.setAttributeConfig(MAX_VALUE, { - value: 100, - validator: Lang.isNumber, - method: function (value) { - this.get('element').setAttribute('aria-valuemax',value); - if (this.get(VALUE) > value) { this.set(VALUE,value); } - } - }); - - /** - * @attribute minValue - * @description Represents the lowest value for the bar. - * The bar will be totally collapsed when reaching this value. - * Values lower than this will be ignored. - * @default 0 - * @type Number - */ - - this.setAttributeConfig(MIN_VALUE, { - value: 0, - validator: Lang.isNumber, - method: function (value) { - this.get('element').setAttribute('aria-valuemin',value); - if (this.get(VALUE) < value) { this.set(VALUE,value); } - } - }); - /** - * @attribute width - * @description Width of the ProgressBar. - * If a number, it will be assumed to be in pixels. - * If a string it should be a valid setting for the CSS width attribute. - * It will always be returned as a string including units. - * @default "200px" - * @type Number or String - */ - - this.setAttributeConfig(WIDTH, { - getter: function() { - return this.getStyle(WIDTH); - }, - method: this._widthChange - }); - - - /** - * @attribute height - * @description Height of the ProgressBar. - * If a number, it will be assumed to be in pixels. - * If a string it should be a valid setting for the CSS height attribute. - * It will always be returned as a string including units. - * @default "20px" - * @type Number or String - */ - this.setAttributeConfig(HEIGHT, { - getter:function() { - return this.getStyle(HEIGHT); - }, - method: this._heightChange - }); - - - - /** - * @attribute ariaTextTemplate - * @description Text to be voiced by screen readers. - * The text is processed by YAHOO.lang.substitute. - * It can use the placeholders {value}, {minValue} and {maxValue} - * @default "{value}" - * @type String - */ - this.setAttributeConfig(ARIA_TEXT_TEMPLATE, { - value:'{value}' - }); - - /** - * @attribute value - * @description The value for the bar. - * Valid values are in between the minValue and maxValue attributes. - * @default 0 - * @type Number - */ - this.setAttributeConfig(VALUE, { - value: 0, - validator: function(value) { - return Lang.isNumber(value) && value >= this.get(MIN_VALUE) && value <= this.get(MAX_VALUE); - }, - method: this._valueChange - }); - - /** - * @attribute anim - * @description it accepts either a boolean (recommended) or an instance of YAHOO.util.Anim. - * If a boolean, it will enable/disable animation creating its own instance of the animation utility. - * If given an instance of YAHOO.util.Anim it will use that instance. - * The animation utility needs to be loaded. - * When read, it returns the instance of the animation utility in use or null if none. - * It can be used to set the animation parameters such as easing methods or duration. - * @default null - * @type {boolean} or {instance of YAHOO.util.Anim} - */ - this.setAttributeConfig(ANIM, { - validator: function(value) { - return !!YAHOO.util.Anim; - }, - setter: this._animSetter - }); - - - }, - /** - * Renders the ProgressBar into the given container. - * If the container has other content, the ProgressBar will be appended to it. - * If the second argument is provided, the ProgressBar will be inserted before the given child. - * The method is chainable since it returns a reference to this instance. - * @method render - * @param el {HTML Element} HTML element that will contain the ProgressBar - * @param before {HTML Element} (optional) If present, the ProgressBar will be inserted before this element. - * @return {YAHOO.widget.ProgressBar} - * @chainable - */ - render: function(parent,before) { - - YAHOO.log('start render','info','ProgressBar'); - if (this._rendered) { return; } - this._rendered = true; - - var direction = this.get(DIRECTION); - - // If the developer set a className attribute on initialization, - // Element would have wiped out my own classNames - // So I need to insist on them, plus add the one for direction. - this.addClass(CLASS_PROGBAR); - this.addClass(CLASS_PROGBAR + '-' + direction); - - var container = this.get('element'); - container.tabIndex = 0; - container.setAttribute('role','progressbar'); - container.setAttribute('aria-valuemin',this.get(MIN_VALUE)); - container.setAttribute('aria-valuemax',this.get(MAX_VALUE)); - - this.appendTo(parent,before); - - - // I need to use the non-animated bar resizing function for initial redraw - this._barSizeFunction = this._barSizeFunctions[0][direction]; - this.redraw(); - this._previousValue = this.get(VALUE); - this._fixEdges(); - // I can now set the correct bar resizer - if (this.get(ANIM)) { - this._barSizeFunction = this._barSizeFunctions[1][direction]; - } - - this.on('minValueChange',this.redraw); - this.on('maxValueChange',this.redraw); - - return this; - }, - - /** - * Recalculates the bar size and position and redraws it - * @method redraw - * @return void - */ - redraw: function () { - YAHOO.log('Redraw','info','ProgressBar'); - this._recalculateConstants(); - this._valueChange(this.get(VALUE)); - }, - - /** - * Destroys the ProgressBar, related objects and unsubscribes from all events - * @method destroy - * @return void - */ - destroy: function() { - YAHOO.log('destroy','info','ProgressBar'); - this.set(ANIM,false); - this.unsubscribeAll(); - var el = this.get('element'); - if (el.parentNode) { el.parentNode.removeChild(el); } - }, - /** - * The previous value setting for the bar. Used mostly as information to event listeners - * @property _previousValue - * @type Number - * @private - * @default 0 - */ - _previousValue:0, - /** - * The actual space (in pixels) available for the bar within the mask (excludes margins) - * @property _barSpace - * @type Number - * @private - * @default 100 - */ - _barSpace:100, - /** - * The factor to convert the actual value of the bar into pixels - * @property _barSpace - * @type Number - * @private - * @default 1 - */ - _barFactor:1, - - /** - * A flag to signal that rendering has already happened - * @property _rendered - * @type boolean - * @private - * @default false - */ - _rendered:false, - - /** - * Function to be used to calculate bar size. - * It is picked from _barSizeFunctions - * depending on direction and whether animation is active. - * @property _barSizeFunction - * @type {function} - * @default null - * @private - */ - _barSizeFunction: null, - - /** - * Method called when the height attribute is changed - * @method _heightChange - * @param {int or string} value New height, in pixels if int or string including units - * @return void - * @private - */ - _heightChange: function(value) { - if (Lang.isNumber(value)) { - value += 'px'; - } - this.setStyle(HEIGHT,value); - this._fixEdges(); - this.redraw(); - }, - - /** - * Method called when the height attribute is changed - * @method _widthChange - * @param {int or string} value New width, in pixels if int or string including units - * @return void - * @private - */ - _widthChange: function(value) { - if (Lang.isNumber(value)) { - value += 'px'; - } - this.setStyle(WIDTH,value); - this._fixEdges(); - this.redraw(); - }, - - /** - * Due to rounding differences, some browsers fail to cover the whole area - * with the mask quadrants when the width or height is odd. This method - * stretches the lower and/or right quadrants to make the difference. - * @method _fixEdges - * @return void - * @private - */ - _fixEdges:function() { - if (!this._rendered || YAHOO.env.ua.ie || YAHOO.env.ua.gecko ) { return; } - var maskEl = this.get(MASK_EL), - tlEl = Dom.getElementsByClassName(CLASS_TL,undefined,maskEl)[0], - trEl = Dom.getElementsByClassName(CLASS_TR,undefined,maskEl)[0], - blEl = Dom.getElementsByClassName(CLASS_BL,undefined,maskEl)[0], - brEl = Dom.getElementsByClassName(CLASS_BR,undefined,maskEl)[0], - newSize = (parseInt(Dom.getStyle(maskEl,HEIGHT),10) - - parseInt(Dom.getStyle(tlEl,HEIGHT),10)) + 'px'; - - Dom.setStyle(blEl,HEIGHT,newSize); - Dom.setStyle(brEl,HEIGHT,newSize); - newSize = (parseInt(Dom.getStyle(maskEl,WIDTH),10) - - parseInt(Dom.getStyle(tlEl,WIDTH),10)) + 'px'; - Dom.setStyle(trEl,WIDTH,newSize); - Dom.setStyle(brEl,WIDTH,newSize); - }, - - - - /** - * Calculates some auxiliary values to make the rendering faster - * @method _recalculateConstants - * @return void - * @private - */ - _recalculateConstants: function() { - YAHOO.log('Recalculating auxiliary factors','info','ProgressBar'); - var barEl = this.get(BAR_EL); - - switch (this.get(DIRECTION)) { - case DIRECTION_LTR: - case DIRECTION_RTL: - this._barSpace = parseInt(this.get(WIDTH),10) - - (parseInt(Dom.getStyle(barEl,'marginLeft'),10) || 0) - - (parseInt(Dom.getStyle(barEl,'marginRight'),10) || 0); - break; - case DIRECTION_TTB: - case DIRECTION_BTT: - this._barSpace = parseInt(this.get(HEIGHT),10) - - (parseInt(Dom.getStyle(barEl,'marginTop'),10) || 0)- - (parseInt(Dom.getStyle(barEl,'marginBottom'),10) || 0); - break; - } - this._barFactor = this._barSpace / (this.get(MAX_VALUE) - (this.get(MIN_VALUE) || 0)) || 1; - }, - - /** - * Called in response to a change in the anim attribute. - * It creates and sets up or destroys the instance of the animation utility that will move the bar - * @method _animSetter - * @return void - * @private - */ - _animSetter: function (value) { - var anim, barEl = this.get(BAR_EL); - if (value) { - YAHOO.log('Turning animation on','info','ProgressBar'); - if (value instanceof YAHOO.util.Anim) { - anim = value; - } else { - anim = new YAHOO.util.Anim(barEl); - } - anim.onTween.subscribe(this._animOnTween,this,true); - anim.onComplete.subscribe(this._animComplete,this,true); - - // Temporary solution until http://yuilibrary.com/projects/yui2/ticket/2528222 gets solved: - var oldSetAttribute = anim.setAttribute, - pb = this; - switch(this.get(DIRECTION)) { - case DIRECTION_BTT: - anim.setAttribute = function(attr , val , unit) { - val = Math.round(val); - oldSetAttribute.call(this,attr,val,unit); - Dom.setStyle(barEl,'top',(pb._barSpace - val) + 'px'); - }; - break; - case DIRECTION_RTL: - anim.setAttribute = function(attr , val , unit) { - val = Math.round(val); - oldSetAttribute.call(this,attr,val,unit); - Dom.setStyle(barEl,'left',(pb._barSpace - val) + 'px'); - }; - break; - } - // up to here - - } else { - YAHOO.log('Turning animation off','info','ProgressBar'); - anim = this.get(ANIM); - if (anim) { - anim.onTween.unsubscribeAll(); - anim.onComplete.unsubscribeAll(); - } - anim = null; - } - this._barSizeFunction = this._barSizeFunctions[anim?1:0][this.get(DIRECTION)]; - return anim; - }, - - _animComplete: function() { - YAHOO.log('Animation completed','info','ProgressBar'); - var value = this.get(VALUE); - this._previousValue = value; - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE, value); - Dom.removeClass(this.get(BAR_EL),CLASS_ANIM); - }, - _animOnTween:function (name,oArgs) { - var value = Math.floor(this._tweenFactor * oArgs[0].currentFrame + this._previousValue); - // The following fills the logger window too fast - //YAHOO.log('Animation onTween at: ' + value,'info','ProgressBar'); - this.fireEvent(PROGRESS,value); - }, - - /** - * Called in response to a change in the value attribute. - * Moves the bar to reflect the new value - * @method _valueChange - * @return void - * @private - */ - _valueChange: function (value) { - YAHOO.log('set value: ' + value,'info','ProgressBar'); - var anim = this.get(ANIM), - pixelValue = Math.floor((value - this.get(MIN_VALUE)) * this._barFactor), - barEl = this.get(BAR_EL); - - this._setAriaText(value); - if (this._rendered) { - if (anim) { - anim.stop(); - if (anim.isAnimated()) { anim._onComplete.fire(); } // see: http://yuilibrary.com/projects/yui2/ticket/2528217 - } - this.fireEvent(START,this._previousValue); - this._barSizeFunction(value, pixelValue, barEl, anim); - } - }, - - /** - * Utility method to set the ARIA value attributes - * @method _setAriaText - * @return void - * @private - */ - _setAriaText: function(value) { - // When animated, this fills the logger window too fast - //YAHOO.log('Show template','info','ProgressBar'); - - var container = this.get('element'), - text = Lang.substitute(this.get(ARIA_TEXT_TEMPLATE),{ - value:value, - minValue:this.get(MIN_VALUE), - maxValue:this.get(MAX_VALUE) - }); - container.setAttribute('aria-valuenow',value); - container.setAttribute('aria-valuetext',text); - } - }); - /** - * Collection of functions used by to calculate the size of the bar. - * One of this will be used depending on direction and whether animation is active. - * @property _barSizeFunctions - * @type {collection of functions} - * @private - */ - var b = [{},{}]; - Prog.prototype._barSizeFunctions = b; - - b[0][DIRECTION_LTR] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,WIDTH, pixelValue + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[0][DIRECTION_RTL] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,WIDTH, pixelValue + 'px'); - Dom.setStyle(barEl,'left',(this._barSpace - pixelValue) + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[0][DIRECTION_TTB] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,HEIGHT, pixelValue + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[0][DIRECTION_BTT] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,HEIGHT, pixelValue + 'px'); - Dom.setStyle(barEl,'top', (this._barSpace - pixelValue) + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[1][DIRECTION_LTR] = function(value, pixelValue, barEl, anim) { - Dom.addClass(barEl,CLASS_ANIM); - this._tweenFactor = (value - this._previousValue) / anim.totalFrames / anim.duration; - anim.attributes = {width:{ to: pixelValue }}; - anim.animate(); - }; - b[1][DIRECTION_RTL] = b[1][DIRECTION_LTR]; - b[1][DIRECTION_TTB] = function(value, pixelValue, barEl, anim) { - Dom.addClass(barEl,CLASS_ANIM); - this._tweenFactor = (value - this._previousValue) / anim.totalFrames / anim.duration; - anim.attributes = {height:{to: pixelValue}}; - anim.animate(); - }; - b[1][DIRECTION_BTT] = b[1][DIRECTION_TTB]; - -})(); - -YAHOO.register("progressbar", YAHOO.widget.ProgressBar, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-min.js deleted file mode 100644 index 02e7a00d16..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar-min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var B=YAHOO.util.Dom,H=YAHOO.lang,X="yui-pb",Z=X+"-mask",W=X+"-bar",V=X+"-anim",M=X+"-tl",K=X+"-tr",J=X+"-bl",F=X+"-br",G="width",S="height",L="minValue",U="maxValue",I="value",A="anim",T="direction",D="ltr",P="rtl",d="ttb",O="btt",E="barEl",C="maskEl",R="ariaTextTemplate",Y="start",c="progress",Q="complete";var N=function(b){N.superclass.constructor.call(this,document.createElement("div"),b);this._init(b);};YAHOO.widget.ProgressBar=N;N.MARKUP=['
                    '].join("");H.extend(N,YAHOO.util.Element,{_init:function(b){},initAttributes:function(f){N.superclass.initAttributes.call(this,f);this.set("innerHTML",N.MARKUP);this.addClass(X);var e,b=["id",G,S,"class","style"];while((e=b.pop())){if(e in f){this.set(e,f[e]);}}this.setAttributeConfig(E,{readOnly:true,value:this.getElementsByClassName(W)[0]});this.setAttributeConfig(C,{readOnly:true,value:this.getElementsByClassName(Z)[0]});this.setAttributeConfig(T,{value:D,validator:function(g){if(this._rendered){return false;}switch(g){case D:case P:case d:case O:return true;default:return false;}},method:function(g){this._barSizeFunction=this._barSizeFunctions[this.get(A)?1:0][g];}});this.setAttributeConfig(U,{value:100,validator:H.isNumber,method:function(g){this.get("element").setAttribute("aria-valuemax",g);if(this.get(I)>g){this.set(I,g);}}});this.setAttributeConfig(L,{value:0,validator:H.isNumber,method:function(g){this.get("element").setAttribute("aria-valuemin",g);if(this.get(I)=this.get(L)&&g<=this.get(U);},method:this._valueChange});this.setAttributeConfig(A,{validator:function(g){return !!YAHOO.util.Anim;},setter:this._animSetter});},render:function(e,f){if(this._rendered){return;}this._rendered=true;var g=this.get(T);this.addClass(X);this.addClass(X+"-"+g);var b=this.get("element");b.tabIndex=0;b.setAttribute("role","progressbar");b.setAttribute("aria-valuemin",this.get(L));b.setAttribute("aria-valuemax",this.get(U));this.appendTo(e,f);this._barSizeFunction=this._barSizeFunctions[0][g];this.redraw();this._previousValue=this.get(I);this._fixEdges();if(this.get(A)){this._barSizeFunction=this._barSizeFunctions[1][g];}this.on("minValueChange",this.redraw);this.on("maxValueChange",this.redraw);return this;},redraw:function(){this._recalculateConstants();this._valueChange(this.get(I));},destroy:function(){this.set(A,false);this.unsubscribeAll();var b=this.get("element");if(b.parentNode){b.parentNode.removeChild(b);}},_previousValue:0,_barSpace:100,_barFactor:1,_rendered:false,_barSizeFunction:null,_heightChange:function(b){if(H.isNumber(b)){b+="px";}this.setStyle(S,b);this._fixEdges();this.redraw();},_widthChange:function(b){if(H.isNumber(b)){b+="px";}this.setStyle(G,b);this._fixEdges();this.redraw();},_fixEdges:function(){if(!this._rendered||YAHOO.env.ua.ie||YAHOO.env.ua.gecko){return;}var g=this.get(C),i=B.getElementsByClassName(M,undefined,g)[0],f=B.getElementsByClassName(K,undefined,g)[0],h=B.getElementsByClassName(J,undefined,g)[0],e=B.getElementsByClassName(F,undefined,g)[0],b=(parseInt(B.getStyle(g,S),10)-parseInt(B.getStyle(i,S),10))+"px";B.setStyle(h,S,b);B.setStyle(e,S,b);b=(parseInt(B.getStyle(g,G),10)-parseInt(B.getStyle(i,G),10))+"px";B.setStyle(f,G,b);B.setStyle(e,G,b);},_recalculateConstants:function(){var b=this.get(E);switch(this.get(T)){case D:case P:this._barSpace=parseInt(this.get(G),10)-(parseInt(B.getStyle(b,"marginLeft"),10)||0)-(parseInt(B.getStyle(b,"marginRight"),10)||0);break;case d:case O:this._barSpace=parseInt(this.get(S),10)-(parseInt(B.getStyle(b,"marginTop"),10)||0)-(parseInt(B.getStyle(b,"marginBottom"),10)||0);break;}this._barFactor=this._barSpace/(this.get(U)-(this.get(L)||0))||1;},_animSetter:function(g){var f,b=this.get(E);if(g){if(g instanceof YAHOO.util.Anim){f=g;}else{f=new YAHOO.util.Anim(b);}f.onTween.subscribe(this._animOnTween,this,true);f.onComplete.subscribe(this._animComplete,this,true);var h=f.setAttribute,e=this;switch(this.get(T)){case O:f.setAttribute=function(i,k,j){k=Math.round(k);h.call(this,i,k,j);B.setStyle(b,"top",(e._barSpace-k)+"px");};break;case P:f.setAttribute=function(i,k,j){k=Math.round(k);h.call(this,i,k,j);B.setStyle(b,"left",(e._barSpace-k)+"px");};break;}}else{f=this.get(A);if(f){f.onTween.unsubscribeAll();f.onComplete.unsubscribeAll();}f=null;}this._barSizeFunction=this._barSizeFunctions[f?1:0][this.get(T)];return f;},_animComplete:function(){var b=this.get(I);this._previousValue=b;this.fireEvent(c,b);this.fireEvent(Q,b);B.removeClass(this.get(E),V);},_animOnTween:function(b,e){var f=Math.floor(this._tweenFactor*e[0].currentFrame+this._previousValue);this.fireEvent(c,f);},_valueChange:function(g){var f=this.get(A),b=Math.floor((g-this.get(L))*this._barFactor),e=this.get(E);this._setAriaText(g);if(this._rendered){if(f){f.stop();if(f.isAnimated()){f._onComplete.fire();}}this.fireEvent(Y,this._previousValue);this._barSizeFunction(g,b,e,f);}},_setAriaText:function(e){var b=this.get("element"),f=H.substitute(this.get(R),{value:e,minValue:this.get(L),maxValue:this.get(U)});b.setAttribute("aria-valuenow",e);b.setAttribute("aria-valuetext",f);}});var a=[{},{}];N.prototype._barSizeFunctions=a;a[0][D]=function(g,b,e,f){B.setStyle(e,G,b+"px");this.fireEvent(c,g);this.fireEvent(Q,g);};a[0][P]=function(g,b,e,f){B.setStyle(e,G,b+"px");B.setStyle(e,"left",(this._barSpace-b)+"px");this.fireEvent(c,g);this.fireEvent(Q,g);};a[0][d]=function(g,b,e,f){B.setStyle(e,S,b+"px");this.fireEvent(c,g);this.fireEvent(Q,g);};a[0][O]=function(g,b,e,f){B.setStyle(e,S,b+"px");B.setStyle(e,"top",(this._barSpace-b)+"px"); -this.fireEvent(c,g);this.fireEvent(Q,g);};a[1][D]=function(g,b,e,f){B.addClass(e,V);this._tweenFactor=(g-this._previousValue)/f.totalFrames/f.duration;f.attributes={width:{to:b}};f.animate();};a[1][P]=a[1][D];a[1][d]=function(g,b,e,f){B.addClass(e,V);this._tweenFactor=(g-this._previousValue)/f.totalFrames/f.duration;f.attributes={height:{to:b}};f.animate();};a[1][O]=a[1][d];})();YAHOO.register("progressbar",YAHOO.widget.ProgressBar,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar.js deleted file mode 100644 index 45e5cc9137..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/progressbar/progressbar.js +++ /dev/null @@ -1,677 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * - * @module progressbar - * @requires yahoo, dom, event, element - * @optional animation - * @title ProgressBar Widget - */ - -(function () { - var Dom = YAHOO.util.Dom, - Lang = YAHOO.lang, - // ClassNames - CLASS_PROGBAR = 'yui-pb', - CLASS_MASK = CLASS_PROGBAR + '-mask', - CLASS_BAR = CLASS_PROGBAR + '-bar', - CLASS_ANIM = CLASS_PROGBAR + '-anim', - CLASS_TL = CLASS_PROGBAR + '-tl', - CLASS_TR = CLASS_PROGBAR + '-tr', - CLASS_BL = CLASS_PROGBAR + '-bl', - CLASS_BR = CLASS_PROGBAR + '-br', - - // Configuration attributes - WIDTH = 'width', - HEIGHT = 'height', - MIN_VALUE = 'minValue', - MAX_VALUE = 'maxValue', - VALUE = 'value', - ANIM = 'anim', - DIRECTION = 'direction', - DIRECTION_LTR = 'ltr', - DIRECTION_RTL = 'rtl', - DIRECTION_TTB = 'ttb', - DIRECTION_BTT = 'btt', - BAR_EL = 'barEl', - MASK_EL = 'maskEl', - ARIA_TEXT_TEMPLATE = 'ariaTextTemplate', - - // Events - START = 'start', - PROGRESS = 'progress', - COMPLETE = 'complete'; - - /** - * The ProgressBar widget provides an easy way to draw a bar depicting progress of an operation, - * a level meter, rating or any such simple linear measure. - * It allows for highly customized styles including animation, vertical or horizontal and forward or reverse. - * @namespace YAHOO.widget - * @class ProgressBar - * @extends YAHOO.util.Element - * @param oConfigs {object} An object containing any configuration attributes to be set - * @constructor - */ - var Prog = function(oConfigs) { - - Prog.superclass.constructor.call(this, document.createElement('div') , oConfigs); - this._init(oConfigs); - - }; - - YAHOO.widget.ProgressBar = Prog; - - /** - * String containing the HTML string which is the basis for the Progress Bar. - * - * @property ProgressBar.MARKUP - * @type String - * @static - * @final - * @default (too long) - */ - Prog.MARKUP = [ - '
                    ' - ].join(''); - - - Lang.extend(Prog, YAHOO.util.Element, { - /** - * Initialization code for the widget, separate from the constructor to allow for overriding/patching. - * It is called after initAttributes - * - * @method _init - * @param oConfigs {Object} (Optional) Object literal definition of configuration values. - * @protected - */ - _init: function (oConfigs) { - /** - * Fires when the value is about to change. It reports the starting value - * @event start - * @type CustomEvent - * @param value {Number} the current (initial) value - */ - // No actual creation required, event will be created when subscribed to - //this.createEvent(START); - /** - * If animation is active, it will trigger several times during the animation providing intermediate values - * If animation is not active, it will fire only once providing the end value - * @event progress - * @type CustomEvent - * @param value{Number} the current, changing value - */ - // No actual creation required, event will be created when subscribed to - //this.createEvent(PROGRESS); - /** - * Fires at the end of the animation or immediately upon changing values if animation is not loaded - * @event complete - * @type CustomEvent - * @param value {Number} the current (final) value - */ - // No actual creation required, event will be created when listened to - //this.createEvent(COMPLETE); - - - }, - /** - * Implementation of Element's abstract method. Sets up config values. - * - * @method initAttributes - * @param oConfigs {Object} (Optional) Object literal definition of configuration values. - * @private - */ - initAttributes: function (oConfigs) { - - Prog.superclass.initAttributes.call(this, oConfigs); - this.set('innerHTML',Prog.MARKUP); - this.addClass(CLASS_PROGBAR); - - // I need to apply at least the following styles, if present in oConfigs, - // to the ProgressBar so when it later reads the width and height, - // they are already set to the correct values. - // id is important because it can be used as a CSS selector. - var key, presets = ['id',WIDTH,HEIGHT,'class','style']; - while((key = presets.pop())) { - if (key in oConfigs) { - this.set(key,oConfigs[key]); - } - } - - - /** - * @attribute barEl - * @description Reference to the HTML object that makes the moving bar (read-only) - * @type HTMLElement (div) - * @readonly - */ - this.setAttributeConfig(BAR_EL, { - readOnly: true, - value: this.getElementsByClassName(CLASS_BAR)[0] - }); - /** - * @attribute maskEl - * @description Reference to the HTML object that overlays the bar providing the mask. (read-only) - * @type HTMLElement (table) - * @readonly - */ - this.setAttributeConfig(MASK_EL, { - readOnly: true, - value: this.getElementsByClassName(CLASS_MASK)[0] - }); - - - /** - * @attribute direction - * @description Direction of movement of the bar. - * It can be any of 'ltr' (left to right), 'rtl' (the reverse) , 'ttb' (top to bottom) or 'btt'. - * Can only be set once and only before rendering. - * @default 'ltr' - * @type String (any of "ltr", "rtl", "ttb" or "btt") - */ - this.setAttributeConfig(DIRECTION, { - value:DIRECTION_LTR, - validator:function(value) { - if (this._rendered) { return false; } - switch (value) { - case DIRECTION_LTR: - case DIRECTION_RTL: - case DIRECTION_TTB: - case DIRECTION_BTT: - return true; - default: - return false; - } - }, - method: function(value) { - this._barSizeFunction = this._barSizeFunctions[this.get(ANIM)?1:0][value]; - } - }); - - /** - * @attribute maxValue - * @description Represents the top value for the bar. - * The bar will be fully extended when reaching this value. - * Values higher than this will be ignored. - * @default 100 - * @type Number - */ - this.setAttributeConfig(MAX_VALUE, { - value: 100, - validator: Lang.isNumber, - method: function (value) { - this.get('element').setAttribute('aria-valuemax',value); - if (this.get(VALUE) > value) { this.set(VALUE,value); } - } - }); - - /** - * @attribute minValue - * @description Represents the lowest value for the bar. - * The bar will be totally collapsed when reaching this value. - * Values lower than this will be ignored. - * @default 0 - * @type Number - */ - - this.setAttributeConfig(MIN_VALUE, { - value: 0, - validator: Lang.isNumber, - method: function (value) { - this.get('element').setAttribute('aria-valuemin',value); - if (this.get(VALUE) < value) { this.set(VALUE,value); } - } - }); - /** - * @attribute width - * @description Width of the ProgressBar. - * If a number, it will be assumed to be in pixels. - * If a string it should be a valid setting for the CSS width attribute. - * It will always be returned as a string including units. - * @default "200px" - * @type Number or String - */ - - this.setAttributeConfig(WIDTH, { - getter: function() { - return this.getStyle(WIDTH); - }, - method: this._widthChange - }); - - - /** - * @attribute height - * @description Height of the ProgressBar. - * If a number, it will be assumed to be in pixels. - * If a string it should be a valid setting for the CSS height attribute. - * It will always be returned as a string including units. - * @default "20px" - * @type Number or String - */ - this.setAttributeConfig(HEIGHT, { - getter:function() { - return this.getStyle(HEIGHT); - }, - method: this._heightChange - }); - - - - /** - * @attribute ariaTextTemplate - * @description Text to be voiced by screen readers. - * The text is processed by YAHOO.lang.substitute. - * It can use the placeholders {value}, {minValue} and {maxValue} - * @default "{value}" - * @type String - */ - this.setAttributeConfig(ARIA_TEXT_TEMPLATE, { - value:'{value}' - }); - - /** - * @attribute value - * @description The value for the bar. - * Valid values are in between the minValue and maxValue attributes. - * @default 0 - * @type Number - */ - this.setAttributeConfig(VALUE, { - value: 0, - validator: function(value) { - return Lang.isNumber(value) && value >= this.get(MIN_VALUE) && value <= this.get(MAX_VALUE); - }, - method: this._valueChange - }); - - /** - * @attribute anim - * @description it accepts either a boolean (recommended) or an instance of YAHOO.util.Anim. - * If a boolean, it will enable/disable animation creating its own instance of the animation utility. - * If given an instance of YAHOO.util.Anim it will use that instance. - * The animation utility needs to be loaded. - * When read, it returns the instance of the animation utility in use or null if none. - * It can be used to set the animation parameters such as easing methods or duration. - * @default null - * @type {boolean} or {instance of YAHOO.util.Anim} - */ - this.setAttributeConfig(ANIM, { - validator: function(value) { - return !!YAHOO.util.Anim; - }, - setter: this._animSetter - }); - - - }, - /** - * Renders the ProgressBar into the given container. - * If the container has other content, the ProgressBar will be appended to it. - * If the second argument is provided, the ProgressBar will be inserted before the given child. - * The method is chainable since it returns a reference to this instance. - * @method render - * @param el {HTML Element} HTML element that will contain the ProgressBar - * @param before {HTML Element} (optional) If present, the ProgressBar will be inserted before this element. - * @return {YAHOO.widget.ProgressBar} - * @chainable - */ - render: function(parent,before) { - - if (this._rendered) { return; } - this._rendered = true; - - var direction = this.get(DIRECTION); - - // If the developer set a className attribute on initialization, - // Element would have wiped out my own classNames - // So I need to insist on them, plus add the one for direction. - this.addClass(CLASS_PROGBAR); - this.addClass(CLASS_PROGBAR + '-' + direction); - - var container = this.get('element'); - container.tabIndex = 0; - container.setAttribute('role','progressbar'); - container.setAttribute('aria-valuemin',this.get(MIN_VALUE)); - container.setAttribute('aria-valuemax',this.get(MAX_VALUE)); - - this.appendTo(parent,before); - - - // I need to use the non-animated bar resizing function for initial redraw - this._barSizeFunction = this._barSizeFunctions[0][direction]; - this.redraw(); - this._previousValue = this.get(VALUE); - this._fixEdges(); - // I can now set the correct bar resizer - if (this.get(ANIM)) { - this._barSizeFunction = this._barSizeFunctions[1][direction]; - } - - this.on('minValueChange',this.redraw); - this.on('maxValueChange',this.redraw); - - return this; - }, - - /** - * Recalculates the bar size and position and redraws it - * @method redraw - * @return void - */ - redraw: function () { - this._recalculateConstants(); - this._valueChange(this.get(VALUE)); - }, - - /** - * Destroys the ProgressBar, related objects and unsubscribes from all events - * @method destroy - * @return void - */ - destroy: function() { - this.set(ANIM,false); - this.unsubscribeAll(); - var el = this.get('element'); - if (el.parentNode) { el.parentNode.removeChild(el); } - }, - /** - * The previous value setting for the bar. Used mostly as information to event listeners - * @property _previousValue - * @type Number - * @private - * @default 0 - */ - _previousValue:0, - /** - * The actual space (in pixels) available for the bar within the mask (excludes margins) - * @property _barSpace - * @type Number - * @private - * @default 100 - */ - _barSpace:100, - /** - * The factor to convert the actual value of the bar into pixels - * @property _barSpace - * @type Number - * @private - * @default 1 - */ - _barFactor:1, - - /** - * A flag to signal that rendering has already happened - * @property _rendered - * @type boolean - * @private - * @default false - */ - _rendered:false, - - /** - * Function to be used to calculate bar size. - * It is picked from _barSizeFunctions - * depending on direction and whether animation is active. - * @property _barSizeFunction - * @type {function} - * @default null - * @private - */ - _barSizeFunction: null, - - /** - * Method called when the height attribute is changed - * @method _heightChange - * @param {int or string} value New height, in pixels if int or string including units - * @return void - * @private - */ - _heightChange: function(value) { - if (Lang.isNumber(value)) { - value += 'px'; - } - this.setStyle(HEIGHT,value); - this._fixEdges(); - this.redraw(); - }, - - /** - * Method called when the height attribute is changed - * @method _widthChange - * @param {int or string} value New width, in pixels if int or string including units - * @return void - * @private - */ - _widthChange: function(value) { - if (Lang.isNumber(value)) { - value += 'px'; - } - this.setStyle(WIDTH,value); - this._fixEdges(); - this.redraw(); - }, - - /** - * Due to rounding differences, some browsers fail to cover the whole area - * with the mask quadrants when the width or height is odd. This method - * stretches the lower and/or right quadrants to make the difference. - * @method _fixEdges - * @return void - * @private - */ - _fixEdges:function() { - if (!this._rendered || YAHOO.env.ua.ie || YAHOO.env.ua.gecko ) { return; } - var maskEl = this.get(MASK_EL), - tlEl = Dom.getElementsByClassName(CLASS_TL,undefined,maskEl)[0], - trEl = Dom.getElementsByClassName(CLASS_TR,undefined,maskEl)[0], - blEl = Dom.getElementsByClassName(CLASS_BL,undefined,maskEl)[0], - brEl = Dom.getElementsByClassName(CLASS_BR,undefined,maskEl)[0], - newSize = (parseInt(Dom.getStyle(maskEl,HEIGHT),10) - - parseInt(Dom.getStyle(tlEl,HEIGHT),10)) + 'px'; - - Dom.setStyle(blEl,HEIGHT,newSize); - Dom.setStyle(brEl,HEIGHT,newSize); - newSize = (parseInt(Dom.getStyle(maskEl,WIDTH),10) - - parseInt(Dom.getStyle(tlEl,WIDTH),10)) + 'px'; - Dom.setStyle(trEl,WIDTH,newSize); - Dom.setStyle(brEl,WIDTH,newSize); - }, - - - - /** - * Calculates some auxiliary values to make the rendering faster - * @method _recalculateConstants - * @return void - * @private - */ - _recalculateConstants: function() { - var barEl = this.get(BAR_EL); - - switch (this.get(DIRECTION)) { - case DIRECTION_LTR: - case DIRECTION_RTL: - this._barSpace = parseInt(this.get(WIDTH),10) - - (parseInt(Dom.getStyle(barEl,'marginLeft'),10) || 0) - - (parseInt(Dom.getStyle(barEl,'marginRight'),10) || 0); - break; - case DIRECTION_TTB: - case DIRECTION_BTT: - this._barSpace = parseInt(this.get(HEIGHT),10) - - (parseInt(Dom.getStyle(barEl,'marginTop'),10) || 0)- - (parseInt(Dom.getStyle(barEl,'marginBottom'),10) || 0); - break; - } - this._barFactor = this._barSpace / (this.get(MAX_VALUE) - (this.get(MIN_VALUE) || 0)) || 1; - }, - - /** - * Called in response to a change in the anim attribute. - * It creates and sets up or destroys the instance of the animation utility that will move the bar - * @method _animSetter - * @return void - * @private - */ - _animSetter: function (value) { - var anim, barEl = this.get(BAR_EL); - if (value) { - if (value instanceof YAHOO.util.Anim) { - anim = value; - } else { - anim = new YAHOO.util.Anim(barEl); - } - anim.onTween.subscribe(this._animOnTween,this,true); - anim.onComplete.subscribe(this._animComplete,this,true); - - // Temporary solution until http://yuilibrary.com/projects/yui2/ticket/2528222 gets solved: - var oldSetAttribute = anim.setAttribute, - pb = this; - switch(this.get(DIRECTION)) { - case DIRECTION_BTT: - anim.setAttribute = function(attr , val , unit) { - val = Math.round(val); - oldSetAttribute.call(this,attr,val,unit); - Dom.setStyle(barEl,'top',(pb._barSpace - val) + 'px'); - }; - break; - case DIRECTION_RTL: - anim.setAttribute = function(attr , val , unit) { - val = Math.round(val); - oldSetAttribute.call(this,attr,val,unit); - Dom.setStyle(barEl,'left',(pb._barSpace - val) + 'px'); - }; - break; - } - // up to here - - } else { - anim = this.get(ANIM); - if (anim) { - anim.onTween.unsubscribeAll(); - anim.onComplete.unsubscribeAll(); - } - anim = null; - } - this._barSizeFunction = this._barSizeFunctions[anim?1:0][this.get(DIRECTION)]; - return anim; - }, - - _animComplete: function() { - var value = this.get(VALUE); - this._previousValue = value; - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE, value); - Dom.removeClass(this.get(BAR_EL),CLASS_ANIM); - }, - _animOnTween:function (name,oArgs) { - var value = Math.floor(this._tweenFactor * oArgs[0].currentFrame + this._previousValue); - this.fireEvent(PROGRESS,value); - }, - - /** - * Called in response to a change in the value attribute. - * Moves the bar to reflect the new value - * @method _valueChange - * @return void - * @private - */ - _valueChange: function (value) { - var anim = this.get(ANIM), - pixelValue = Math.floor((value - this.get(MIN_VALUE)) * this._barFactor), - barEl = this.get(BAR_EL); - - this._setAriaText(value); - if (this._rendered) { - if (anim) { - anim.stop(); - if (anim.isAnimated()) { anim._onComplete.fire(); } // see: http://yuilibrary.com/projects/yui2/ticket/2528217 - } - this.fireEvent(START,this._previousValue); - this._barSizeFunction(value, pixelValue, barEl, anim); - } - }, - - /** - * Utility method to set the ARIA value attributes - * @method _setAriaText - * @return void - * @private - */ - _setAriaText: function(value) { - - var container = this.get('element'), - text = Lang.substitute(this.get(ARIA_TEXT_TEMPLATE),{ - value:value, - minValue:this.get(MIN_VALUE), - maxValue:this.get(MAX_VALUE) - }); - container.setAttribute('aria-valuenow',value); - container.setAttribute('aria-valuetext',text); - } - }); - /** - * Collection of functions used by to calculate the size of the bar. - * One of this will be used depending on direction and whether animation is active. - * @property _barSizeFunctions - * @type {collection of functions} - * @private - */ - var b = [{},{}]; - Prog.prototype._barSizeFunctions = b; - - b[0][DIRECTION_LTR] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,WIDTH, pixelValue + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[0][DIRECTION_RTL] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,WIDTH, pixelValue + 'px'); - Dom.setStyle(barEl,'left',(this._barSpace - pixelValue) + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[0][DIRECTION_TTB] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,HEIGHT, pixelValue + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[0][DIRECTION_BTT] = function(value, pixelValue, barEl, anim) { - Dom.setStyle(barEl,HEIGHT, pixelValue + 'px'); - Dom.setStyle(barEl,'top', (this._barSpace - pixelValue) + 'px'); - this.fireEvent(PROGRESS,value); - this.fireEvent(COMPLETE,value); - }; - b[1][DIRECTION_LTR] = function(value, pixelValue, barEl, anim) { - Dom.addClass(barEl,CLASS_ANIM); - this._tweenFactor = (value - this._previousValue) / anim.totalFrames / anim.duration; - anim.attributes = {width:{ to: pixelValue }}; - anim.animate(); - }; - b[1][DIRECTION_RTL] = b[1][DIRECTION_LTR]; - b[1][DIRECTION_TTB] = function(value, pixelValue, barEl, anim) { - Dom.addClass(barEl,CLASS_ANIM); - this._tweenFactor = (value - this._previousValue) / anim.totalFrames / anim.duration; - anim.attributes = {height:{to: pixelValue}}; - anim.animate(); - }; - b[1][DIRECTION_BTT] = b[1][DIRECTION_TTB]; - -})(); - -YAHOO.register("progressbar", YAHOO.widget.ProgressBar, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts-grids/reset-fonts-grids.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts-grids/reset-fonts-grids.css deleted file mode 100644 index 55bff7b16b..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts-grids/reset-fonts-grids.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}body{text-align:center;}#doc,#doc2,#doc3,#doc4,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.25em;}#doc2{width:73.076em;*width:71.25em;}#doc3{margin:auto 10px;width:auto;}#doc4{width:74.923em;*width:73.05em;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main,.yui-g .yui-u .yui-g{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.30769em;*width:12.00em;}.yui-t1 #yui-main .yui-b{margin-left:13.30769em;*margin-left:13.05em;}.yui-t2 .yui-b{float:left;width:13.8461em;*width:13.50em;}.yui-t2 #yui-main .yui-b{margin-left:14.8461em;*margin-left:14.55em;}.yui-t3 .yui-b{float:left;width:23.0769em;*width:22.50em;}.yui-t3 #yui-main .yui-b{margin-left:24.0769em;*margin-left:23.62em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.50em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.55em;}.yui-t5 .yui-b{float:right;width:18.4615em;*width:18.00em;}.yui-t5 #yui-main .yui-b{margin-right:19.4615em;*margin-right:19.125em;}.yui-t6 .yui-b{float:right;width:23.0769em;*width:22.50em;}.yui-t6 #yui-main .yui-b{margin-right:24.0769em;*margin-right:23.62em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf,.yui-gc .yui-u,.yui-gd .yui-g,.yui-g .yui-gc .yui-u,.yui-ge .yui-u,.yui-ge .yui-g,.yui-gf .yui-g,.yui-gf .yui-u{float:right;}.yui-g div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first,.yui-g .yui-gc div.first,.yui-g .yui-ge div.first,.yui-gc div.first div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g,.yui-g .yui-gb,.yui-g .yui-gc,.yui-g .yui-gd,.yui-g .yui-ge,.yui-g .yui-gf{width:49.1%;}.yui-gb .yui-u,.yui-g .yui-gb .yui-u,.yui-gb .yui-g,.yui-gb .yui-gb,.yui-gb .yui-gc,.yui-gb .yui-gd,.yui-gb .yui-ge,.yui-gb .yui-gf,.yui-gc .yui-u,.yui-gc .yui-g,.yui-gd .yui-u{width:32%;margin-left:1.99%;}.yui-gb .yui-u{*margin-left:1.9%;*width:31.9%;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-ge .yui-u,.yui-gf div.first{width:24%;}.yui-g .yui-gb div.first,.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-g .yui-g .yui-u,.yui-gb .yui-g .yui-u,.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u,.yui-ge .yui-g .yui-u,.yui-gf .yui-g .yui-u{width:49%;*width:48.1%;*margin-left:0;}.yui-g .yui-g .yui-u{width:48.1%;}.yui-g .yui-gb div.first,.yui-gb .yui-gb div.first{*margin-right:0;*width:32%;_width:31.7%;}.yui-g .yui-gc div.first,.yui-gd .yui-g{width:66%;}.yui-gb .yui-g div.first{*margin-right:4%;_margin-right:1.3%;}.yui-gb .yui-gc div.first,.yui-gb .yui-gd div.first{*margin-right:0;}.yui-gb .yui-gb .yui-u,.yui-gb .yui-gc .yui-u{*margin-left:1.8%;_margin-left:4%;}.yui-g .yui-gb .yui-u{_margin-left:1.0%;}.yui-gb .yui-gd .yui-u{*width:66%;_width:61.2%;}.yui-gb .yui-gd div.first{*width:31%;_width:29.5%;}.yui-g .yui-gc .yui-u,.yui-gb .yui-gc .yui-u{width:32%;_float:right;margin-right:0;_margin-left:0;}.yui-gb .yui-gc div.first{width:66%;*float:left;*margin-left:0;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf .yui-u{margin:0;}.yui-gb .yui-gb .yui-u{_margin-left:.7%;}.yui-gb .yui-g div.first,.yui-gb .yui-gb div.first{*margin-left:0;}.yui-gc .yui-g .yui-u,.yui-gd .yui-g .yui-u{*width:48.1%;*margin-left:0;}.yui-gb .yui-gd div.first{width:32%;}.yui-g .yui-gd div.first{_width:29.9%;}.yui-ge .yui-g{width:24%;}.yui-gf .yui-g{width:74.2%;}.yui-gb .yui-ge div.yui-u,.yui-gb .yui-gf div.yui-u{float:right;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf div.first{float:left;}.yui-gb .yui-ge .yui-u,.yui-gb .yui-gf div.first{*width:24%;_width:20%;}.yui-gb .yui-ge div.first,.yui-gb .yui-gf .yui-u{*width:73.5%;_width:65.5%;}.yui-ge div.first .yui-gd .yui-u{width:65%;}.yui-ge div.first .yui-gd div.first{width:32%;}#hd:after,#bd:after,#ft:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#hd,#bd,#ft,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts/reset-fonts.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts/reset-fonts.css deleted file mode 100644 index fba64732fc..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset-fonts/reset-fonts.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset-min.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset-min.css deleted file mode 100644 index 5a4ce28602..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset-min.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset.css deleted file mode 100644 index 6956dae2ef..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/reset/reset.css +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * YUI Reset - * @module reset - * @namespace - * @requires - */ -html { - color: #000; - background: #FFF; -} - -body, -div, -dl, -dt, -dd, -ul, -ol, -li, -h1, -h2, -h3, -h4, -h5, -h6, -pre, -code, -form, -fieldset, -legend, -input, -button, -textarea, -p, -blockquote, -th, -td { - margin: 0; - padding: 0; -} - -table { - border-collapse: collapse; - border-spacing: 0; -} - -fieldset, -img { - border: 0; -} - -address, -caption, -cite, -code, -dfn, -em, -strong, -th, -var, -optgroup { - font-style: inherit; - font-weight: inherit; -} - -del, -ins { - text-decoration: none; -} - -li { - list-style: none; -} - -caption, -th { - text-align: left; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: 100%; - font-weight: normal; -} - -q:before, -q:after { - content: ''; -} - -abbr, -acronym { - border: 0; - font-variant: normal; -} - -sup { - vertical-align: baseline; -} - -sub { - vertical-align: baseline; -} - -/*because legend doesn't inherit in IE */ -legend { - color: #000; -} - -input, -button, -textarea, -select, -optgroup, -option { - font-family: inherit; - font-size: inherit; - font-style: inherit; - font-weight: inherit; -} - -/*@purpose To enable resizing for IE */ -/*@branch For IE6-Win, IE7-Win */ -input, -button, -textarea, -select { - *font-size: 100%; -} - - - diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/resize-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/resize-core.css deleted file mode 100644 index da63c6a9ab..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/resize-core.css +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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; /* IE hasLayout */ - z-index: 9999; -} -.yui-resize-status strong, .yui-resize-status em { - font-weight: normal; - font-style: normal; - padding: 1px; - zoom: 1; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/layout_sprite.png b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/layout_sprite.png deleted file mode 100644 index d6fce3c7a5bec2e266531e2b921f6a3bc3572bcb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize-skin.css deleted file mode 100644 index 79f2509dc6..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize-skin.css +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* Give the handle a background color */ -.yui-skin-sam .yui-resize .yui-resize-handle { - background-color: #F2F2F2; - zoom: 1; -} -/* Give the active handle a different color */ -.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%; - zoom: 1; -} -/* Give a border to the 8-way knob style handles */ -.yui-skin-sam .yui-resize-knob .yui-resize-handle { - border: 1px solid #808080; -} -/* Show the active handle when hovered */ -.yui-skin-sam .yui-resize-hover .yui-resize-handle-active { - opacity: 1; - filter: alpha(opacity=100); -} - -/* Style the resize proxy */ -.yui-skin-sam .yui-resize-proxy { - border: 1px dashed #426FD9; -} - -/* Style the status box similar to a tooltip */ -.yui-skin-sam .yui-resize-status { - border: 1px solid #A6982B; - border-top: 1px solid #D4C237; - background-color: #FFEE69; - color: #000; -} - - -/* Style the content of the status box */ -.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; -} - -/* Setup the gripper */ -.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%; -} - -/* Setup the gripper */ -.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%; -} - -/* Bottom Right Gripper */ -.yui-skin-sam .yui-resize .yui-resize-handle-br { - background-image: url( layout_sprite.png ); - background-repeat: no-repeat; - background-position: -22px -62px; -} - -/* Top Right Gripper */ -.yui-skin-sam .yui-resize .yui-resize-handle-tr { - background-image: url( layout_sprite.png ); - background-repeat: no-repeat; - background-position: -22px -42px; -} - -/* Top Left Gripper */ -.yui-skin-sam .yui-resize .yui-resize-handle-tl { - background-image: url( layout_sprite.png ); - background-repeat: no-repeat; - background-position: -22px -82px; -} - -/* Bottom Left Gripper */ -.yui-skin-sam .yui-resize .yui-resize-handle-bl { - background-image: url( layout_sprite.png ); - background-repeat: no-repeat; - background-position: -22px -23px; -} - -/* Remove the background image from the 8-way knobs */ -.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-skin-sam .yui-resize-textarea .yui-resize-handle-r { - right: -8px; -} -.yui-skin-sam .yui-resize-textarea .yui-resize-handle-b { - bottom: -8px; -} -.yui-skin-sam .yui-resize-textarea .yui-resize-handle-br { - right: -8px; - bottom: -8px; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize.css deleted file mode 100644 index 941361c7d8..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/assets/skins/sam/resize.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.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;zoom:1;}.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%;zoom:1;}.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-skin-sam .yui-resize-textarea .yui-resize-handle-r{right:-8px;}.yui-skin-sam .yui-resize-textarea .yui-resize-handle-b{bottom:-8px;}.yui-skin-sam .yui-resize-textarea .yui-resize-handle-br{right:-8px;bottom:-8px;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-debug.js deleted file mode 100644 index b70ec5077c..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-debug.js +++ /dev/null @@ -1,1749 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * @description

                    Makes an element resizable

                    - * @namespace YAHOO.util - * @requires yahoo, dom, dragdrop, element, event - * @optional animation - * @module resize - */ -(function() { -var D = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class Resize - * @extends YAHOO.util.Element - * @description

                    Makes an element resizable

                    - * @param {String/HTMLElement} el The element to make resizable. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - var Resize = function(el, config) { - YAHOO.log('Creating Resize Object', 'info', 'Resize'); - var oConfig = { - element: el, - attributes: config || {} - }; - - Resize.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all resize instances - * @type Object - */ - Resize._instances = {}; - /** - * @static - * @method getResizeById - * @description Get's a resize object by the HTML id of the element associated with the Resize object. - * @return {Object} The Resize Object - */ - Resize.getResizeById = function(id) { - if (Resize._instances[id]) { - return Resize._instances[id]; - } - YAHOO.log('No Instance Found', 'error', 'Resize'); - return false; - }; - - YAHOO.extend(Resize, YAHOO.util.Element, { - /** - * @private - * @property CSS_RESIZE - * @description Base CSS class name - * @type String - */ - CSS_RESIZE: 'yui-resize', - /** - * @private - * @property CSS_DRAG - * @description Class name added when dragging is enabled - * @type String - */ - CSS_DRAG: 'yui-draggable', - /** - * @private - * @property CSS_HOVER - * @description Class name used for hover only handles - * @type String - */ - CSS_HOVER: 'yui-resize-hover', - /** - * @private - * @property CSS_PROXY - * @description Class name given to the proxy element - * @type String - */ - CSS_PROXY: 'yui-resize-proxy', - /** - * @private - * @property CSS_WRAP - * @description Class name given to the wrap element - * @type String - */ - CSS_WRAP: 'yui-resize-wrap', - /** - * @private - * @property CSS_KNOB - * @description Class name used to make the knob style handles - * @type String - */ - CSS_KNOB: 'yui-resize-knob', - /** - * @private - * @property CSS_HIDDEN - * @description Class name given to the wrap element to make all handles hidden - * @type String - */ - CSS_HIDDEN: 'yui-resize-hidden', - /** - * @private - * @property CSS_HANDLE - * @description Class name given to all handles, used as a base for single handle names as well.. Handle "t" will get this.CSS_HANDLE + '-t' as well as this.CSS_HANDLE - * @type String - */ - CSS_HANDLE: 'yui-resize-handle', - /** - * @private - * @property CSS_STATUS - * @description Class name given to the status element - * @type String - */ - CSS_STATUS: 'yui-resize-status', - /** - * @private - * @property CSS_GHOST - * @description Class name given to the wrap element when the ghost property is active - * @type String - */ - CSS_GHOST: 'yui-resize-ghost', - /** - * @private - * @property CSS_RESIZING - * @description Class name given to the wrap element when a resize action is taking place. - * @type String - */ - CSS_RESIZING: 'yui-resize-resizing', - /** - * @private - * @property _resizeEvent - * @description The mouse event used to resize with - * @type Event - */ - _resizeEvent: null, - /** - * @private - * @property dd - * @description The YAHOO.util.DragDrop instance used if draggable is true - * @type Object - */ - dd: null, - /** - * @private - * @property browser - * @description A copy of the YAHOO.env.ua property - * @type Object - */ - browser: YAHOO.env.ua, - /** - * @private - * @property _locked - * @description A flag to show if the resize is locked - * @type Boolean - */ - _locked: null, - /** - * @private - * @property _positioned - * @description A flag to show if the element is absolutely positioned - * @type Boolean - */ - _positioned: null, - /** - * @private - * @property _dds - * @description An Object containing references to all of the YAHOO.util.DragDrop instances used for the resize handles - * @type Object - */ - _dds: null, - /** - * @private - * @property _wrap - * @description The HTML reference of the element wrapper - * @type HTMLElement - */ - _wrap: null, - /** - * @private - * @property _proxy - * @description The HTML reference of the element proxy - * @type HTMLElement - */ - _proxy: null, - /** - * @private - * @property _handles - * @description An object containing references to all of the resize handles. - * @type Object - */ - _handles: null, - /** - * @private - * @property _currentHandle - * @description The string identifier of the currently active handle. e.g. 'r', 'br', 'tl' - * @type String - */ - _currentHandle: null, - /** - * @private - * @property _currentDD - * @description A link to the currently active DD object - * @type Object - */ - _currentDD: null, - /** - * @private - * @property _cache - * @description An lookup table containing key information for the element being resized. e.g. height, width, x position, y position, etc.. - * @type Object - */ - _cache: null, - /** - * @private - * @property _active - * @description Flag to show if the resize is active. Used for events. - * @type Boolean - */ - _active: null, - /** - * @private - * @method _createProxy - * @description Creates the proxy element if the proxy config is true - */ - _createProxy: function() { - if (this.get('proxy')) { - YAHOO.log('Creating the Proxy Element', 'info', 'Resize'); - this._proxy = document.createElement('div'); - this._proxy.className = this.CSS_PROXY; - this._proxy.style.height = this.get('element').clientHeight + 'px'; - this._proxy.style.width = this.get('element').clientWidth + 'px'; - this._wrap.parentNode.appendChild(this._proxy); - } else { - YAHOO.log('No proxy element, turn off animate config option', 'info', 'Resize'); - this.set('animate', false); - } - }, - /** - * @private - * @method _createWrap - * @description Creates the wrap element if the wrap config is true. It will auto wrap the following element types: img, textarea, input, iframe, select - */ - _createWrap: function() { - YAHOO.log('Create the wrap element', 'info', 'Resize'); - this._positioned = false; - //Force wrap for elements that can't have children - if (this.get('wrap') === false) { - switch (this.get('element').tagName.toLowerCase()) { - case 'img': - case 'textarea': - case 'input': - case 'iframe': - case 'select': - YAHOO.log('Auto-wrapping the element (' + this.get('element').tagName.toLowerCase() + ')', 'warn', 'Resize'); - this.set('wrap', true); - break; - } - } - if (this.get('wrap') === true) { - YAHOO.log('Creating the wrap element', 'info', 'Resize'); - this._wrap = document.createElement('div'); - this._wrap.id = this.get('element').id + '_wrap'; - this._wrap.className = this.CSS_WRAP; - if (this.get('element').tagName.toLowerCase() == 'textarea') { - D.addClass(this._wrap, 'yui-resize-textarea'); - } - D.setStyle(this._wrap, 'width', this.get('width') + 'px'); - D.setStyle(this._wrap, 'height', this.get('height') + 'px'); - D.setStyle(this._wrap, 'z-index', this.getStyle('z-index')); - this.setStyle('z-index', 0); - var pos = D.getStyle(this.get('element'), 'position'); - D.setStyle(this._wrap, 'position', ((pos == 'static') ? 'relative' : pos)); - D.setStyle(this._wrap, 'top', D.getStyle(this.get('element'), 'top')); - D.setStyle(this._wrap, 'left', D.getStyle(this.get('element'), 'left')); - if (D.getStyle(this.get('element'), 'position') == 'absolute') { - this._positioned = true; - YAHOO.log('The element is positioned absolute', 'info', 'Resize'); - D.setStyle(this.get('element'), 'position', 'relative'); - D.setStyle(this.get('element'), 'top', '0'); - D.setStyle(this.get('element'), 'left', '0'); - } - var par = this.get('element').parentNode; - par.replaceChild(this._wrap, this.get('element')); - this._wrap.appendChild(this.get('element')); - } else { - this._wrap = this.get('element'); - if (D.getStyle(this._wrap, 'position') == 'absolute') { - this._positioned = true; - } - } - if (this.get('draggable')) { - this._setupDragDrop(); - } - if (this.get('hover')) { - D.addClass(this._wrap, this.CSS_HOVER); - } - if (this.get('knobHandles')) { - D.addClass(this._wrap, this.CSS_KNOB); - } - if (this.get('hiddenHandles')) { - D.addClass(this._wrap, this.CSS_HIDDEN); - } - D.addClass(this._wrap, this.CSS_RESIZE); - }, - /** - * @private - * @method _setupDragDrop - * @description Setup the YAHOO.util.DragDrop instance on the element - */ - _setupDragDrop: function() { - YAHOO.log('Setting up the dragdrop instance on the element', 'info', 'Resize'); - D.addClass(this._wrap, this.CSS_DRAG); - this.dd = new YAHOO.util.DD(this._wrap, this.get('id') + '-resize', { dragOnly: true, useShim: this.get('useShim') }); - this.dd.on('dragEvent', function() { - this.fireEvent('dragEvent', arguments); - }, this, true); - }, - /** - * @private - * @method _createHandles - * @description Creates the handles as specified in the config - */ - _createHandles: function() { - YAHOO.log('Creating the handles', 'info', 'Resize'); - this._handles = {}; - this._dds = {}; - var h = this.get('handles'); - for (var i = 0; i < h.length; i++) { - YAHOO.log('Creating handle position: ' + h[i], 'info', 'Resize'); - this._handles[h[i]] = document.createElement('div'); - this._handles[h[i]].id = D.generateId(this._handles[h[i]]); - this._handles[h[i]].className = this.CSS_HANDLE + ' ' + this.CSS_HANDLE + '-' + h[i]; - var k = document.createElement('div'); - k.className = this.CSS_HANDLE + '-inner-' + h[i]; - this._handles[h[i]].appendChild(k); - this._wrap.appendChild(this._handles[h[i]]); - Event.on(this._handles[h[i]], 'mouseover', this._handleMouseOver, this, true); - Event.on(this._handles[h[i]], 'mouseout', this._handleMouseOut, this, true); - this._dds[h[i]] = new YAHOO.util.DragDrop(this._handles[h[i]], this.get('id') + '-handle-' + h, { useShim: this.get('useShim') }); - this._dds[h[i]].setPadding(15, 15, 15, 15); - this._dds[h[i]].on('startDragEvent', this._handleStartDrag, this._dds[h[i]], this); - this._dds[h[i]].on('mouseDownEvent', this._handleMouseDown, this._dds[h[i]], this); - } - YAHOO.log('Creating the Status box', 'info', 'Resize'); - this._status = document.createElement('span'); - this._status.className = this.CSS_STATUS; - document.body.insertBefore(this._status, document.body.firstChild); - }, - /** - * @private - * @method _ieSelectFix - * @description The function we use as the onselectstart handler when we start a drag in Internet Explorer - */ - _ieSelectFix: function() { - return false; - }, - /** - * @private - * @property _ieSelectBack - * @description We will hold a copy of the current "onselectstart" method on this property, and reset it after we are done using it. - */ - _ieSelectBack: null, - /** - * @private - * @method _setAutoRatio - * @param {Event} ev A mouse event. - * @description This method checks to see if the "autoRatio" config is set. If it is, we will check to see if the "Shift Key" is pressed. If so, we will set the config ratio to true. - */ - _setAutoRatio: function(ev) { - if (this.get('autoRatio')) { - YAHOO.log('Setting up AutoRatio', 'info', 'Resize'); - if (ev && ev.shiftKey) { - //Shift Pressed - YAHOO.log('Shift key presses, turning on ratio', 'info', 'Resize'); - this.set('ratio', true); - } else { - YAHOO.log('Resetting ratio back to default', 'info', 'Resize'); - this.set('ratio', this._configs.ratio._initialConfig.value); - } - } - }, - /** - * @private - * @method _handleMouseDown - * @param {Event} ev A mouse event. - * @description This method preps the autoRatio on MouseDown. - */ - _handleMouseDown: function(ev) { - if (this._locked) { - YAHOO.log('Resize Locked', 'info', 'Resize'); - return false; - } - if (D.getStyle(this._wrap, 'position') == 'absolute') { - this._positioned = true; - } - if (ev) { - this._setAutoRatio(ev); - } - if (this.browser.ie) { - this._ieSelectBack = document.body.onselectstart; - document.body.onselectstart = this._ieSelectFix; - } - }, - /** - * @private - * @method _handleMouseOver - * @param {Event} ev A mouse event. - * @description Adds CSS class names to the handles - */ - _handleMouseOver: function(ev) { - if (this._locked) { - YAHOO.log('Resize Locked', 'info', 'Resize'); - return false; - } - D.removeClass(this._wrap, this.CSS_RESIZE); - - if (this.get('hover')) { - D.removeClass(this._wrap, this.CSS_HOVER); - } - var tar = Event.getTarget(ev); - if (!D.hasClass(tar, this.CSS_HANDLE)) { - tar = tar.parentNode; - } - if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) { - D.addClass(tar, this.CSS_HANDLE + '-active'); - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - if (this._handles[i] == tar) { - D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active'); - break; - } - } - } - } - - D.addClass(this._wrap, this.CSS_RESIZE); - }, - /** - * @private - * @method _handleMouseOut - * @param {Event} ev A mouse event. - * @description Removes CSS class names to the handles - */ - _handleMouseOut: function(ev) { - D.removeClass(this._wrap, this.CSS_RESIZE); - if (this.get('hover') && !this._active) { - D.addClass(this._wrap, this.CSS_HOVER); - } - var tar = Event.getTarget(ev); - if (!D.hasClass(tar, this.CSS_HANDLE)) { - tar = tar.parentNode; - } - if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) { - D.removeClass(tar, this.CSS_HANDLE + '-active'); - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - if (this._handles[i] == tar) { - D.removeClass(tar, this.CSS_HANDLE + '-' + i + '-active'); - break; - } - } - } - } - D.addClass(this._wrap, this.CSS_RESIZE); - }, - /** - * @private - * @method _handleStartDrag - * @param {Object} args The args passed from the CustomEvent. - * @param {Object} dd The YAHOO.util.DragDrop object we are working with. - * @description Resizes the proxy, sets up the YAHOO.util.DragDrop handlers, updates the status div and preps the cache - */ - _handleStartDrag: function(args, dd) { - YAHOO.log('startDrag', 'info', 'Resize'); - var tar = dd.getDragEl(); - if (D.hasClass(tar, this.CSS_HANDLE)) { - if (D.getStyle(this._wrap, 'position') == 'absolute') { - this._positioned = true; - } - this._active = true; - this._currentDD = dd; - if (this._proxy) { - YAHOO.log('Activate proxy element', 'info', 'Resize'); - this._proxy.style.visibility = 'visible'; - this._proxy.style.zIndex = '1000'; - this._proxy.style.height = this.get('element').clientHeight + 'px'; - this._proxy.style.width = this.get('element').clientWidth + 'px'; - } - - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - if (this._handles[i] == tar) { - this._currentHandle = i; - var handle = '_handle_for_' + i; - D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active'); - dd.on('dragEvent', this[handle], this, true); - dd.on('mouseUpEvent', this._handleMouseUp, this, true); - YAHOO.log('Adding DragEvents to: ' + i, 'info', 'Resize'); - break; - } - } - } - - - D.addClass(tar, this.CSS_HANDLE + '-active'); - - if (this.get('proxy')) { - YAHOO.log('Posiiton Proxy Element', 'info', 'Resize'); - var xy = D.getXY(this.get('element')); - D.setXY(this._proxy, xy); - if (this.get('ghost')) { - YAHOO.log('Add Ghost Class', 'info', 'Resize'); - this.addClass(this.CSS_GHOST); - } - } - D.addClass(this._wrap, this.CSS_RESIZING); - this._setCache(); - this._updateStatus(this._cache.height, this._cache.width, this._cache.top, this._cache.left); - YAHOO.log('Firing startResize Event', 'info', 'Resize'); - this.fireEvent('startResize', { type: 'startresize', target: this}); - } - }, - /** - * @private - * @method _setCache - * @description Sets up the this._cache hash table. - */ - _setCache: function() { - YAHOO.log('Setting up property cache', 'info', 'Resize'); - this._cache.xy = D.getXY(this._wrap); - D.setXY(this._wrap, this._cache.xy); - this._cache.height = this.get('clientHeight'); - this._cache.width = this.get('clientWidth'); - this._cache.start.height = this._cache.height; - this._cache.start.width = this._cache.width; - this._cache.start.top = this._cache.xy[1]; - this._cache.start.left = this._cache.xy[0]; - this._cache.top = this._cache.xy[1]; - this._cache.left = this._cache.xy[0]; - this.set('height', this._cache.height, true); - this.set('width', this._cache.width, true); - }, - /** - * @private - * @method _handleMouseUp - * @param {Event} ev A mouse event. - * @description Cleans up listeners, hides proxy element and removes class names. - */ - _handleMouseUp: function(ev) { - this._active = false; - - var handle = '_handle_for_' + this._currentHandle; - this._currentDD.unsubscribe('dragEvent', this[handle], this, true); - this._currentDD.unsubscribe('mouseUpEvent', this._handleMouseUp, this, true); - - if (this._proxy) { - YAHOO.log('Hide Proxy Element', 'info', 'Resize'); - this._proxy.style.visibility = 'hidden'; - this._proxy.style.zIndex = '-1'; - if (this.get('setSize')) { - YAHOO.log('Setting Size', 'info', 'Resize'); - this.resize(ev, this._cache.height, this._cache.width, this._cache.top, this._cache.left, true); - } else { - YAHOO.log('Firing Resize Event', 'info', 'Resize'); - this.fireEvent('resize', { ev: 'resize', target: this, height: this._cache.height, width: this._cache.width, top: this._cache.top, left: this._cache.left }); - } - - if (this.get('ghost')) { - YAHOO.log('Removing Ghost Class', 'info', 'Resize'); - this.removeClass(this.CSS_GHOST); - } - } - - if (this.get('hover')) { - D.addClass(this._wrap, this.CSS_HOVER); - } - if (this._status) { - D.setStyle(this._status, 'display', 'none'); - } - if (this.browser.ie) { - YAHOO.log('Resetting IE onselectstart function', 'info', 'Resize'); - document.body.onselectstart = this._ieSelectBack; - } - - if (this.browser.ie) { - D.removeClass(this._wrap, this.CSS_RESIZE); - } - - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - D.removeClass(this._handles[i], this.CSS_HANDLE + '-active'); - } - } - if (this.get('hover') && !this._active) { - D.addClass(this._wrap, this.CSS_HOVER); - } - D.removeClass(this._wrap, this.CSS_RESIZING); - - D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-' + this._currentHandle + '-active'); - D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-active'); - - if (this.browser.ie) { - D.addClass(this._wrap, this.CSS_RESIZE); - } - - this._resizeEvent = null; - this._currentHandle = null; - - if (!this.get('animate')) { - this.set('height', this._cache.height, true); - this.set('width', this._cache.width, true); - } - - YAHOO.log('Firing endResize Event', 'info', 'Resize'); - this.fireEvent('endResize', { ev: 'endResize', target: this, height: this._cache.height, width: this._cache.width, top: this._cache.top, left: this._cache.left }); - }, - /** - * @private - * @method _setRatio - * @param {Number} h The height offset. - * @param {Number} w The with offset. - * @param {Number} t The top offset. - * @param {Number} l The left offset. - * @description Using the Height, Width, Top & Left, it recalcuates them based on the original element size. - * @return {Array} The new Height, Width, Top & Left settings - */ - _setRatio: function(h, w, t, l) { - YAHOO.log('Setting Ratio', 'info', 'Resize'); - var oh = h, ow = w; - if (this.get('ratio')) { - var orgH = this._cache.height, - orgW = this._cache.width, - nh = parseInt(this.get('height'), 10), - nw = parseInt(this.get('width'), 10), - maxH = this.get('maxHeight'), - minH = this.get('minHeight'), - maxW = this.get('maxWidth'), - minW = this.get('minWidth'); - - switch (this._currentHandle) { - case 'l': - h = nh * (w / nw); - h = Math.min(Math.max(minH, h), maxH); - w = nw * (h / nh); - t = (this._cache.start.top - (-((nh - h) / 2))); - l = (this._cache.start.left - (-((nw - w)))); - break; - case 'r': - h = nh * (w / nw); - h = Math.min(Math.max(minH, h), maxH); - w = nw * (h / nh); - t = (this._cache.start.top - (-((nh - h) / 2))); - break; - case 't': - w = nw * (h / nh); - h = nh * (w / nw); - l = (this._cache.start.left - (-((nw - w) / 2))); - t = (this._cache.start.top - (-((nh - h)))); - break; - case 'b': - w = nw * (h / nh); - h = nh * (w / nw); - l = (this._cache.start.left - (-((nw - w) / 2))); - break; - case 'bl': - h = nh * (w / nw); - w = nw * (h / nh); - l = (this._cache.start.left - (-((nw - w)))); - break; - case 'br': - h = nh * (w / nw); - w = nw * (h / nh); - break; - case 'tl': - h = nh * (w / nw); - w = nw * (h / nh); - l = (this._cache.start.left - (-((nw - w)))); - t = (this._cache.start.top - (-((nh - h)))); - break; - case 'tr': - h = nh * (w / nw); - w = nw * (h / nh); - l = (this._cache.start.left); - t = (this._cache.start.top - (-((nh - h)))); - break; - } - oh = this._checkHeight(h); - ow = this._checkWidth(w); - if ((oh != h) || (ow != w)) { - t = 0; - l = 0; - if (oh != h) { - ow = this._cache.width; - } - if (ow != w) { - oh = this._cache.height; - } - } - } - return [oh, ow, t, l]; - }, - /** - * @private - * @method _updateStatus - * @param {Number} h The new height setting. - * @param {Number} w The new width setting. - * @param {Number} t The new top setting. - * @param {Number} l The new left setting. - * @description Using the Height, Width, Top & Left, it updates the status element with the elements sizes. - */ - _updateStatus: function(h, w, t, l) { - if (this._resizeEvent && (!Lang.isString(this._resizeEvent))) { - YAHOO.log('Updating Status Box', 'info', 'Resize'); - h = ((h === 0) ? this._cache.start.height : h); - w = ((w === 0) ? this._cache.start.width : w); - var h1 = parseInt(this.get('height'), 10), - w1 = parseInt(this.get('width'), 10); - - if (isNaN(h1)) { - h1 = parseInt(h, 10); - } - if (isNaN(w1)) { - w1 = parseInt(w, 10); - } - var diffH = (parseInt(h, 10) - h1); - var diffW = (parseInt(w, 10) - w1); - this._cache.offsetHeight = diffH; - this._cache.offsetWidth = diffW; - if (this.get('status')) { - YAHOO.log('Showing Status Box', 'info', 'Resize'); - D.setStyle(this._status, 'display', 'inline'); - //This will cause IE8 to crash if the status box is hidden.. - this._status.innerHTML = '' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + ''; - D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]); - } - } - }, - /** - * @method lock - * @description Lock the resize so it can't be resized - * @param {Boolean} dd If the draggable config is set, lock it too - * @return {YAHOO.util.Resize} The Resize instance - */ - lock: function(dd) { - this._locked = true; - if (dd && this.dd) { - D.removeClass(this._wrap, 'yui-draggable'); - this.dd.lock(); - } - return this; - }, - /** - * @method unlock - * @description Unlock the resize so it can be resized - * @param {Boolean} dd If the draggable config is set, unlock it too - * @return {YAHOO.util.Resize} The Resize instance - */ - unlock: function(dd) { - this._locked = false; - if (dd && this.dd) { - D.addClass(this._wrap, 'yui-draggable'); - this.dd.unlock(); - } - return this; - }, - /** - * @method isLocked - * @description Check the locked status of the resize instance - * @return {Boolean} - */ - isLocked: function() { - return this._locked; - }, - /** - * @method reset - * @description Resets the element to is start state. - * @return {YAHOO.util.Resize} The Resize instance - */ - reset: function() { - YAHOO.log('Resetting to cached sizes and position', 'info', 'Resize'); - this.resize(null, this._cache.start.height, this._cache.start.width, this._cache.start.top, this._cache.start.left, true); - return this; - }, - /** - * @private - * @method resize - * @param {Event} ev The mouse event. - * @param {Number} h The new height setting. - * @param {Number} w The new width setting. - * @param {Number} t The new top setting. - * @param {Number} l The new left setting. - * @param {Boolean} force Resize the element (used for proxy resize). - * @param {Boolean} silent Don't fire the beforeResize Event. - * @description Resizes the element, wrapper or proxy based on the data from the handlers. - * @return {YAHOO.util.Resize} The Resize instance - */ - resize: function(ev, h, w, t, l, force, silent) { - if (this._locked) { - YAHOO.log('Resize Locked', 'info', 'Resize'); - return false; - } - YAHOO.log('Resize: ' + h + ',' + w + ',' + t + ',' + l, 'info', 'Resize'); - this._resizeEvent = ev; - var el = this._wrap, anim = this.get('animate'), set = true; - if (this._proxy && !force) { - el = this._proxy; - anim = false; - } - this._setAutoRatio(ev); - if (this._positioned) { - if (this._proxy) { - t = this._cache.top - t; - l = this._cache.left - l; - } - } - - - var ratio = this._setRatio(h, w, t, l); - h = parseInt(ratio[0], 10); - w = parseInt(ratio[1], 10); - t = parseInt(ratio[2], 10); - l = parseInt(ratio[3], 10); - - if (t == 0) { - //No Offset, get from cache - t = D.getY(el); - } - if (l == 0) { - //No Offset, get from cache - l = D.getX(el); - } - - - - if (this._positioned) { - if (this._proxy && force) { - if (!anim) { - el.style.top = this._proxy.style.top; - el.style.left = this._proxy.style.left; - } else { - t = this._proxy.style.top; - l = this._proxy.style.left; - } - } else { - if (!this.get('ratio') && !this._proxy) { - t = this._cache.top + -(t); - l = this._cache.left + -(l); - } - if (t) { - if (this.get('minY')) { - if (t < this.get('minY')) { - t = this.get('minY'); - } - } - if (this.get('maxY')) { - if (t > this.get('maxY')) { - t = this.get('maxY'); - } - } - } - if (l) { - if (this.get('minX')) { - if (l < this.get('minX')) { - l = this.get('minX'); - } - } - if (this.get('maxX')) { - if ((l + w) > this.get('maxX')) { - l = (this.get('maxX') - w); - } - } - } - } - } - if (!silent) { - YAHOO.log('beforeResize', 'info', 'Resize'); - var beforeReturn = this.fireEvent('beforeResize', { ev: 'beforeResize', target: this, height: h, width: w, top: t, left: l }); - if (beforeReturn === false) { - YAHOO.log('Resized cancelled because befireResize returned false', 'info', 'Resize'); - return false; - } - } - - this._updateStatus(h, w, t, l); - - - if (this._positioned) { - if (this._proxy && force) { - //Do nothing - } else { - if (t) { - D.setY(el, t); - this._cache.top = t; - } - if (l) { - D.setX(el, l); - this._cache.left = l; - } - } - } - if (h) { - if (!anim) { - set = true; - if (this._proxy && force) { - if (!this.get('setSize')) { - set = false; - } - } - if (set) { - el.style.height = h + 'px'; - } - if ((this._proxy && force) || !this._proxy) { - if (this._wrap != this.get('element')) { - this.get('element').style.height = h + 'px'; - } - } - } - this._cache.height = h; - } - if (w) { - this._cache.width = w; - if (!anim) { - set = true; - if (this._proxy && force) { - if (!this.get('setSize')) { - set = false; - } - } - if (set) { - el.style.width = w + 'px'; - } - if ((this._proxy && force) || !this._proxy) { - if (this._wrap != this.get('element')) { - this.get('element').style.width = w + 'px'; - } - } - } - } - if (anim) { - if (YAHOO.util.Anim) { - var _anim = new YAHOO.util.Anim(el, { - height: { - to: this._cache.height - }, - width: { - to: this._cache.width - } - }, this.get('animateDuration'), this.get('animateEasing')); - if (this._positioned) { - if (t) { - _anim.attributes.top = { - to: parseInt(t, 10) - }; - } - if (l) { - _anim.attributes.left = { - to: parseInt(l, 10) - }; - } - } - - if (this._wrap != this.get('element')) { - _anim.onTween.subscribe(function() { - this.get('element').style.height = el.style.height; - this.get('element').style.width = el.style.width; - }, this, true); - } - - _anim.onComplete.subscribe(function() { - YAHOO.log('Animation onComplete fired', 'info', 'Resize'); - this.set('height', h); - this.set('width', w); - this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l }); - }, this, true); - _anim.animate(); - - } - } else { - if (this._proxy && !force) { - YAHOO.log('proxyResize', 'info', 'Resize'); - this.fireEvent('proxyResize', { ev: 'proxyresize', target: this, height: h, width: w, top: t, left: l }); - } else { - YAHOO.log('resize', 'info', 'Resize'); - this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l }); - } - } - return this; - }, - /** - * @private - * @method _handle_for_br - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Bottom Right handle. - */ - _handle_for_br: function(args) { - YAHOO.log('Handle BR', 'info', 'Resize'); - var newW = this._setWidth(args.e); - var newH = this._setHeight(args.e); - this.resize(args.e, newH, newW, 0, 0); - }, - /** - * @private - * @method _handle_for_bl - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Bottom Left handle. - */ - _handle_for_bl: function(args) { - YAHOO.log('Handle BL', 'info', 'Resize'); - var newW = this._setWidth(args.e, true); - var newH = this._setHeight(args.e); - var l = (newW - this._cache.width); - this.resize(args.e, newH, newW, 0, l); - }, - /** - * @private - * @method _handle_for_tl - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Top Left handle. - */ - _handle_for_tl: function(args) { - YAHOO.log('Handle TL', 'info', 'Resize'); - var newW = this._setWidth(args.e, true); - var newH = this._setHeight(args.e, true); - var t = (newH - this._cache.height); - var l = (newW - this._cache.width); - this.resize(args.e, newH, newW, t, l); - }, - /** - * @private - * @method _handle_for_tr - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Top Right handle. - */ - _handle_for_tr: function(args) { - YAHOO.log('Handle TR', 'info', 'Resize'); - var newW = this._setWidth(args.e); - var newH = this._setHeight(args.e, true); - var t = (newH - this._cache.height); - this.resize(args.e, newH, newW, t, 0); - }, - /** - * @private - * @method _handle_for_r - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Right handle. - */ - _handle_for_r: function(args) { - YAHOO.log('Handle R', 'info', 'Resize'); - this._dds.r.setYConstraint(0,0); - var newW = this._setWidth(args.e); - this.resize(args.e, 0, newW, 0, 0); - }, - /** - * @private - * @method _handle_for_l - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Left handle. - */ - _handle_for_l: function(args) { - YAHOO.log('Handle L', 'info', 'Resize'); - this._dds.l.setYConstraint(0,0); - var newW = this._setWidth(args.e, true); - var l = (newW - this._cache.width); - this.resize(args.e, 0, newW, 0, l); - }, - /** - * @private - * @method _handle_for_b - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Bottom handle. - */ - _handle_for_b: function(args) { - YAHOO.log('Handle B', 'info', 'Resize'); - this._dds.b.setXConstraint(0,0); - var newH = this._setHeight(args.e); - this.resize(args.e, newH, 0, 0, 0); - }, - /** - * @private - * @method _handle_for_t - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Top handle. - */ - _handle_for_t: function(args) { - YAHOO.log('Handle T', 'info', 'Resize'); - this._dds.t.setXConstraint(0,0); - var newH = this._setHeight(args.e, true); - var t = (newH - this._cache.height); - this.resize(args.e, newH, 0, t, 0); - }, - /** - * @private - * @method _setWidth - * @param {Event} ev The mouse event. - * @param {Boolean} flip Argument to determine the direction of the movement. - * @description Calculates the width based on the mouse event. - * @return {Number} The new value - */ - _setWidth: function(ev, flip) { - YAHOO.log('Set width based on Event', 'info', 'Resize'); - var xy = this._cache.xy[0], - w = this._cache.width, - x = Event.getPageX(ev), - nw = (x - xy); - - if (flip) { - nw = (xy - x) + parseInt(this.get('width'), 10); - } - - nw = this._snapTick(nw, this.get('xTicks')); - nw = this._checkWidth(nw); - return nw; - }, - /** - * @private - * @method _checkWidth - * @param {Number} w The width to check. - * @description Checks the value passed against the maxWidth and minWidth. - * @return {Number} the new value - */ - _checkWidth: function(w) { - YAHOO.log('Checking the min/max width', 'info', 'Resize'); - if (this.get('minWidth')) { - if (w <= this.get('minWidth')) { - YAHOO.log('Using minWidth', 'info', 'Resize'); - w = this.get('minWidth'); - } - } - if (this.get('maxWidth')) { - if (w >= this.get('maxWidth')) { - YAHOO.log('Using Max Width', 'info', 'Resize'); - w = this.get('maxWidth'); - } - } - return w; - }, - /** - * @private - * @method _checkHeight - * @param {Number} h The height to check. - * @description Checks the value passed against the maxHeight and minHeight. - * @return {Number} The new value - */ - _checkHeight: function(h) { - YAHOO.log('Checking the min/max height', 'info', 'Resize'); - if (this.get('minHeight')) { - if (h <= this.get('minHeight')) { - YAHOO.log('Using minHeight', 'info', 'Resize'); - h = this.get('minHeight'); - } - } - if (this.get('maxHeight')) { - if (h >= this.get('maxHeight')) { - YAHOO.log('using maxHeight', 'info', 'Resize'); - h = this.get('maxHeight'); - } - } - return h; - }, - /** - * @private - * @method _setHeight - * @param {Event} ev The mouse event. - * @param {Boolean} flip Argument to determine the direction of the movement. - * @description Calculated the height based on the mouse event. - * @return {Number} The new value - */ - _setHeight: function(ev, flip) { - YAHOO.log('Setting the height based on the Event', 'info', 'Resize'); - var xy = this._cache.xy[1], - h = this._cache.height, - y = Event.getPageY(ev), - nh = (y - xy); - - if (flip) { - nh = (xy - y) + parseInt(this.get('height'), 10); - } - nh = this._snapTick(nh, this.get('yTicks')); - nh = this._checkHeight(nh); - - return nh; - }, - /** - * @private - * @method _snapTick - * @param {Number} size The size to tick against. - * @param {Number} pix The tick pixels. - * @description Adjusts the number based on the ticks used. - * @return {Number} the new snapped position - */ - _snapTick: function(size, pix) { - YAHOO.log('Snapping to ticks', 'info', 'Resize'); - if (!size || !pix) { - return size; - } - var _s = size; - var _x = size % pix; - if (_x > 0) { - if (_x > (pix / 2)) { - _s = size + (pix - _x); - } else { - _s = size - _x; - } - } - return _s; - }, - /** - * @private - * @method init - * @description The Resize class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - YAHOO.log('init', 'info', 'Resize'); - this._locked = false; - this._cache = { - xy: [], - height: 0, - width: 0, - top: 0, - left: 0, - offsetHeight: 0, - offsetWidth: 0, - start: { - height: 0, - width: 0, - top: 0, - left: 0 - } - }; - - Resize.superclass.init.call(this, p_oElement, p_oAttributes); - - this.set('setSize', this.get('setSize')); - - if (p_oAttributes.height) { - this.set('height', parseInt(p_oAttributes.height, 10)); - } else { - var h = this.getStyle('height'); - if (h == 'auto') { - this.set('height', parseInt(this.get('element').offsetHeight, 10)); - } - } - if (p_oAttributes.width) { - this.set('width', parseInt(p_oAttributes.width, 10)); - } else { - var w = this.getStyle('width'); - if (w == 'auto') { - this.set('width', parseInt(this.get('element').offsetWidth, 10)); - } - } - - var id = p_oElement; - if (!Lang.isString(id)) { - id = D.generateId(id); - } - Resize._instances[id] = this; - - this._active = false; - - this._createWrap(); - this._createProxy(); - this._createHandles(); - - }, - /** - * @method getProxyEl - * @description Get the HTML reference for the proxy, returns null if no proxy. - * @return {HTMLElement} The proxy element - */ - getProxyEl: function() { - return this._proxy; - }, - /** - * @method getWrapEl - * @description Get the HTML reference for the wrap element, returns the current element if not wrapped. - * @return {HTMLElement} The wrap element - */ - getWrapEl: function() { - return this._wrap; - }, - /** - * @method getStatusEl - * @description Get the HTML reference for the status element. - * @return {HTMLElement} The status element - */ - getStatusEl: function() { - return this._status; - }, - /** - * @method getActiveHandleEl - * @description Get the HTML reference for the currently active resize handle. - * @return {HTMLElement} The handle element that is active - */ - getActiveHandleEl: function() { - return this._handles[this._currentHandle]; - }, - /** - * @method isActive - * @description Returns true or false if a resize operation is currently active on the element. - * @return {Boolean} - */ - isActive: function() { - return ((this._active) ? true : false); - }, - /** - * @private - * @method initAttributes - * @description Initializes all of the configuration attributes used to create a resizable element. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the utility. - */ - initAttributes: function(attr) { - Resize.superclass.initAttributes.call(this, attr); - - /** - * @attribute useShim - * @description This setting will be passed to the DragDrop instances on the resize handles and for the draggable property. - * This property should be used if you want the resize handles to work over iframe and other elements. - * @type Boolean - */ - this.setAttributeConfig('useShim', { - value: ((attr.useShim === true) ? true : false), - validator: YAHOO.lang.isBoolean, - method: function(u) { - for (var i in this._dds) { - if (Lang.hasOwnProperty(this._dds, i)) { - this._dds[i].useShim = u; - } - } - if (this.dd) { - this.dd.useShim = u; - } - } - }); - /** - * @attribute setSize - * @description Set the size of the resized element, if set to false the element will not be auto resized, - * the resize event will contain the dimensions so the end user can resize it on their own. - * This setting will only work with proxy set to true and animate set to false. - * @type Boolean - */ - this.setAttributeConfig('setSize', { - value: ((attr.setSize === false) ? false : true), - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute wrap - * @description Should we wrap the element - * @type Boolean - */ - this.setAttributeConfig('wrap', { - writeOnce: true, - validator: YAHOO.lang.isBoolean, - value: attr.wrap || false - }); - - /** - * @attribute handles - * @description The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'. Defaults to: ['r', 'b', 'br']. - * Can use a shortcut of All. Note: 8 way resizing should be done on an element that is absolutely positioned. - * @type Array - */ - this.setAttributeConfig('handles', { - writeOnce: true, - value: attr.handles || ['r', 'b', 'br'], - validator: function(handles) { - if (Lang.isString(handles) && handles.toLowerCase() == 'all') { - handles = ['t', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr']; - } - if (!Lang.isArray(handles)) { - handles = handles.replace(/, /g, ','); - handles = handles.split(','); - } - this._configs.handles.value = handles; - } - }); - - /** - * @attribute width - * @description The width of the element - * @type Number - */ - this.setAttributeConfig('width', { - value: attr.width || parseInt(this.getStyle('width'), 10), - validator: YAHOO.lang.isNumber, - method: function(width) { - width = parseInt(width, 10); - if (width > 0) { - if (this.get('setSize')) { - this.setStyle('width', width + 'px'); - } - this._cache.width = width; - this._configs.width.value = width; - } - } - }); - - /** - * @attribute height - * @description The height of the element - * @type Number - */ - this.setAttributeConfig('height', { - value: attr.height || parseInt(this.getStyle('height'), 10), - validator: YAHOO.lang.isNumber, - method: function(height) { - height = parseInt(height, 10); - if (height > 0) { - if (this.get('setSize')) { - this.setStyle('height', height + 'px'); - } - this._cache.height = height; - this._configs.height.value = height; - } - } - }); - - /** - * @attribute minWidth - * @description The minimum width of the element - * @type Number - */ - this.setAttributeConfig('minWidth', { - value: attr.minWidth || 15, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minHeight - * @description The minimum height of the element - * @type Number - */ - this.setAttributeConfig('minHeight', { - value: attr.minHeight || 15, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxWidth - * @description The maximum width of the element - * @type Number - */ - this.setAttributeConfig('maxWidth', { - value: attr.maxWidth || 10000, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxHeight - * @description The maximum height of the element - * @type Number - */ - this.setAttributeConfig('maxHeight', { - value: attr.maxHeight || 10000, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minY - * @description The minimum y coord of the element - * @type Number - */ - this.setAttributeConfig('minY', { - value: attr.minY || false - }); - - /** - * @attribute minX - * @description The minimum x coord of the element - * @type Number - */ - this.setAttributeConfig('minX', { - value: attr.minX || false - }); - /** - * @attribute maxY - * @description The max y coord of the element - * @type Number - */ - this.setAttributeConfig('maxY', { - value: attr.maxY || false - }); - - /** - * @attribute maxX - * @description The max x coord of the element - * @type Number - */ - this.setAttributeConfig('maxX', { - value: attr.maxX || false - }); - - /** - * @attribute animate - * @description Should be use animation to resize the element (can only be used if we use proxy). - * @type Boolean - */ - this.setAttributeConfig('animate', { - value: attr.animate || false, - validator: function(value) { - var ret = true; - if (!YAHOO.util.Anim) { - ret = false; - } - return ret; - } - }); - - /** - * @attribute animateEasing - * @description The Easing to apply to the animation. - * @type Object - */ - this.setAttributeConfig('animateEasing', { - value: attr.animateEasing || function() { - var easing = false; - if (YAHOO.util.Easing && YAHOO.util.Easing.easeOut) { - easing = YAHOO.util.Easing.easeOut; - } - return easing; - }() - }); - - /** - * @attribute animateDuration - * @description The Duration to apply to the animation. - * @type Number - */ - this.setAttributeConfig('animateDuration', { - value: attr.animateDuration || 0.5 - }); - - /** - * @attribute proxy - * @description Resize a proxy element instead of the real element. - * @type Boolean - */ - this.setAttributeConfig('proxy', { - value: attr.proxy || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute ratio - * @description Maintain the element's ratio when resizing. - * @type Boolean - */ - this.setAttributeConfig('ratio', { - value: attr.ratio || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute ghost - * @description Apply an opacity filter to the element being resized (only works with proxy). - * @type Boolean - */ - this.setAttributeConfig('ghost', { - value: attr.ghost || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute draggable - * @description A convienence method to make the element draggable - * @type Boolean - */ - this.setAttributeConfig('draggable', { - value: attr.draggable || false, - validator: YAHOO.lang.isBoolean, - method: function(dd) { - if (dd && this._wrap) { - this._setupDragDrop(); - } else { - if (this.dd) { - D.removeClass(this._wrap, this.CSS_DRAG); - this.dd.unreg(); - } - } - } - }); - - /** - * @attribute hover - * @description Only show the handles when they are being moused over. - * @type Boolean - */ - this.setAttributeConfig('hover', { - value: attr.hover || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute hiddenHandles - * @description Don't show the handles, just use the cursor to the user. - * @type Boolean - */ - this.setAttributeConfig('hiddenHandles', { - value: attr.hiddenHandles || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute knobHandles - * @description Use the smaller handles, instead if the full size handles. - * @type Boolean - */ - this.setAttributeConfig('knobHandles', { - value: attr.knobHandles || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute xTicks - * @description The number of x ticks to span the resize to. - * @type Number or False - */ - this.setAttributeConfig('xTicks', { - value: attr.xTicks || false - }); - - /** - * @attribute yTicks - * @description The number of y ticks to span the resize to. - * @type Number or False - */ - this.setAttributeConfig('yTicks', { - value: attr.yTicks || false - }); - - /** - * @attribute status - * @description Show the status (new size) of the resize. - * @type Boolean - */ - this.setAttributeConfig('status', { - value: attr.status || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute autoRatio - * @description Using the shift key during a resize will toggle the ratio config. - * @type Boolean - */ - this.setAttributeConfig('autoRatio', { - value: attr.autoRatio || false, - validator: YAHOO.lang.isBoolean - }); - - }, - /** - * @method destroy - * @description Destroys the resize object and all of it's elements & listeners. - */ - destroy: function() { - YAHOO.log('Destroying Resize', 'info', 'Resize'); - for (var h in this._handles) { - if (Lang.hasOwnProperty(this._handles, h)) { - Event.purgeElement(this._handles[h]); - this._handles[h].parentNode.removeChild(this._handles[h]); - } - } - if (this._proxy) { - this._proxy.parentNode.removeChild(this._proxy); - } - if (this._status) { - this._status.parentNode.removeChild(this._status); - } - if (this.dd) { - this.dd.unreg(); - D.removeClass(this._wrap, this.CSS_DRAG); - } - if (this._wrap != this.get('element')) { - this.setStyle('position', ''); - this.setStyle('top', ''); - this.setStyle('left', ''); - this._wrap.parentNode.replaceChild(this.get('element'), this._wrap); - } - this.removeClass(this.CSS_RESIZE); - - delete YAHOO.util.Resize._instances[this.get('id')]; - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - delete this[i]; - } - } - }, - /** - * @method toString - * @description Returns a string representing the Resize Object. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'Resize (#' + this.get('id') + ')'; - } - return 'Resize Utility'; - } - }); - - YAHOO.util.Resize = Resize; - -/** -* @event dragEvent -* @description Fires when the YAHOO.util.DragDrop dragEvent is fired for the config option draggable. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event startResize -* @description Fires when a resize action is started. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event endResize -* @description Fires when the mouseUp event from the Drag Instance fires. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event resize -* @description Fires on every element resize (only fires once when used with proxy config setting). -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeResize -* @description Fires before every element resize after the size calculations, returning false will stop the resize. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event proxyResize -* @description Fires on every proxy resize (only fires when used with proxy config setting). -* @type YAHOO.util.CustomEvent -*/ - -})(); - -YAHOO.register("resize", YAHOO.util.Resize, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-min.js deleted file mode 100644 index d5ab386a69..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize-min.js +++ /dev/null @@ -1,10 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var E=YAHOO.util.Dom,A=YAHOO.util.Event,C=YAHOO.lang;var B=function(F,D){var G={element:F,attributes:D||{}};B.superclass.constructor.call(this,G.element,G.attributes);};B._instances={};B.getResizeById=function(D){if(B._instances[D]){return B._instances[D];}return false;};YAHOO.extend(B,YAHOO.util.Element,{CSS_RESIZE:"yui-resize",CSS_DRAG:"yui-draggable",CSS_HOVER:"yui-resize-hover",CSS_PROXY:"yui-resize-proxy",CSS_WRAP:"yui-resize-wrap",CSS_KNOB:"yui-resize-knob",CSS_HIDDEN:"yui-resize-hidden",CSS_HANDLE:"yui-resize-handle",CSS_STATUS:"yui-resize-status",CSS_GHOST:"yui-resize-ghost",CSS_RESIZING:"yui-resize-resizing",_resizeEvent:null,dd:null,browser:YAHOO.env.ua,_locked:null,_positioned:null,_dds:null,_wrap:null,_proxy:null,_handles:null,_currentHandle:null,_currentDD:null,_cache:null,_active:null,_createProxy:function(){if(this.get("proxy")){this._proxy=document.createElement("div");this._proxy.className=this.CSS_PROXY;this._proxy.style.height=this.get("element").clientHeight+"px";this._proxy.style.width=this.get("element").clientWidth+"px";this._wrap.parentNode.appendChild(this._proxy);}else{this.set("animate",false);}},_createWrap:function(){this._positioned=false;if(this.get("wrap")===false){switch(this.get("element").tagName.toLowerCase()){case"img":case"textarea":case"input":case"iframe":case"select":this.set("wrap",true);break;}}if(this.get("wrap")===true){this._wrap=document.createElement("div");this._wrap.id=this.get("element").id+"_wrap";this._wrap.className=this.CSS_WRAP;if(this.get("element").tagName.toLowerCase()=="textarea"){E.addClass(this._wrap,"yui-resize-textarea");}E.setStyle(this._wrap,"width",this.get("width")+"px");E.setStyle(this._wrap,"height",this.get("height")+"px");E.setStyle(this._wrap,"z-index",this.getStyle("z-index"));this.setStyle("z-index",0);var F=E.getStyle(this.get("element"),"position");E.setStyle(this._wrap,"position",((F=="static")?"relative":F));E.setStyle(this._wrap,"top",E.getStyle(this.get("element"),"top"));E.setStyle(this._wrap,"left",E.getStyle(this.get("element"),"left"));if(E.getStyle(this.get("element"),"position")=="absolute"){this._positioned=true;E.setStyle(this.get("element"),"position","relative");E.setStyle(this.get("element"),"top","0");E.setStyle(this.get("element"),"left","0");}var D=this.get("element").parentNode;D.replaceChild(this._wrap,this.get("element"));this._wrap.appendChild(this.get("element"));}else{this._wrap=this.get("element");if(E.getStyle(this._wrap,"position")=="absolute"){this._positioned=true;}}if(this.get("draggable")){this._setupDragDrop();}if(this.get("hover")){E.addClass(this._wrap,this.CSS_HOVER);}if(this.get("knobHandles")){E.addClass(this._wrap,this.CSS_KNOB);}if(this.get("hiddenHandles")){E.addClass(this._wrap,this.CSS_HIDDEN);}E.addClass(this._wrap,this.CSS_RESIZE);},_setupDragDrop:function(){E.addClass(this._wrap,this.CSS_DRAG);this.dd=new YAHOO.util.DD(this._wrap,this.get("id")+"-resize",{dragOnly:true,useShim:this.get("useShim")});this.dd.on("dragEvent",function(){this.fireEvent("dragEvent",arguments);},this,true);},_createHandles:function(){this._handles={};this._dds={};var G=this.get("handles");for(var F=0;F"+parseInt(K,10)+" x "+parseInt(G,10)+""+((L>0)?"+":"")+L+" x "+((H>0)?"+":"")+H+"";E.setXY(this._status,[A.getPageX(this._resizeEvent)+12,A.getPageY(this._resizeEvent)+12]);}}},lock:function(D){this._locked=true;if(D&&this.dd){E.removeClass(this._wrap,"yui-draggable");this.dd.lock();}return this;},unlock:function(D){this._locked=false;if(D&&this.dd){E.addClass(this._wrap,"yui-draggable");this.dd.unlock();}return this;},isLocked:function(){return this._locked;},reset:function(){this.resize(null,this._cache.start.height,this._cache.start.width,this._cache.start.top,this._cache.start.left,true);return this;},resize:function(M,J,P,Q,H,F,K){if(this._locked){return false;}this._resizeEvent=M;var G=this._wrap,I=this.get("animate"),O=true;if(this._proxy&&!F){G=this._proxy;I=false;}this._setAutoRatio(M);if(this._positioned){if(this._proxy){Q=this._cache.top-Q;H=this._cache.left-H;}}var L=this._setRatio(J,P,Q,H);J=parseInt(L[0],10);P=parseInt(L[1],10);Q=parseInt(L[2],10);H=parseInt(L[3],10);if(Q==0){Q=E.getY(G);}if(H==0){H=E.getX(G);}if(this._positioned){if(this._proxy&&F){if(!I){G.style.top=this._proxy.style.top;G.style.left=this._proxy.style.left;}else{Q=this._proxy.style.top;H=this._proxy.style.left;}}else{if(!this.get("ratio")&&!this._proxy){Q=this._cache.top+-(Q);H=this._cache.left+-(H);}if(Q){if(this.get("minY")){if(Qthis.get("maxY")){Q=this.get("maxY");}}}if(H){if(this.get("minX")){if(Hthis.get("maxX")){H=(this.get("maxX")-P);}}}}}if(!K){var N=this.fireEvent("beforeResize",{ev:"beforeResize",target:this,height:J,width:P,top:Q,left:H});if(N===false){return false;}}this._updateStatus(J,P,Q,H);if(this._positioned){if(this._proxy&&F){}else{if(Q){E.setY(G,Q);this._cache.top=Q;}if(H){E.setX(G,H);this._cache.left=H;}}}if(J){if(!I){O=true;if(this._proxy&&F){if(!this.get("setSize")){O=false;}}if(O){G.style.height=J+"px";}if((this._proxy&&F)||!this._proxy){if(this._wrap!=this.get("element")){this.get("element").style.height=J+"px";}}}this._cache.height=J;}if(P){this._cache.width=P;if(!I){O=true;if(this._proxy&&F){if(!this.get("setSize")){O=false;}}if(O){G.style.width=P+"px";}if((this._proxy&&F)||!this._proxy){if(this._wrap!=this.get("element")){this.get("element").style.width=P+"px";}}}}if(I){if(YAHOO.util.Anim){var D=new YAHOO.util.Anim(G,{height:{to:this._cache.height},width:{to:this._cache.width}},this.get("animateDuration"),this.get("animateEasing"));if(this._positioned){if(Q){D.attributes.top={to:parseInt(Q,10)};}if(H){D.attributes.left={to:parseInt(H,10)};}}if(this._wrap!=this.get("element")){D.onTween.subscribe(function(){this.get("element").style.height=G.style.height;this.get("element").style.width=G.style.width;},this,true);}D.onComplete.subscribe(function(){this.set("height",J);this.set("width",P);this.fireEvent("resize",{ev:"resize",target:this,height:J,width:P,top:Q,left:H});},this,true);D.animate();}}else{if(this._proxy&&!F){this.fireEvent("proxyResize",{ev:"proxyresize",target:this,height:J,width:P,top:Q,left:H});}else{this.fireEvent("resize",{ev:"resize",target:this,height:J,width:P,top:Q,left:H});}}return this;},_handle_for_br:function(F){var G=this._setWidth(F.e);var D=this._setHeight(F.e);this.resize(F.e,D,G,0,0);},_handle_for_bl:function(G){var H=this._setWidth(G.e,true);var F=this._setHeight(G.e);var D=(H-this._cache.width);this.resize(G.e,F,H,0,D);},_handle_for_tl:function(G){var I=this._setWidth(G.e,true);var F=this._setHeight(G.e,true);var H=(F-this._cache.height);var D=(I-this._cache.width);this.resize(G.e,F,I,H,D);},_handle_for_tr:function(F){var H=this._setWidth(F.e);var D=this._setHeight(F.e,true);var G=(D-this._cache.height);this.resize(F.e,D,H,G,0);},_handle_for_r:function(D){this._dds.r.setYConstraint(0,0);var F=this._setWidth(D.e);this.resize(D.e,0,F,0,0);},_handle_for_l:function(F){this._dds.l.setYConstraint(0,0);var G=this._setWidth(F.e,true);var D=(G-this._cache.width);this.resize(F.e,0,G,0,D);},_handle_for_b:function(F){this._dds.b.setXConstraint(0,0);var D=this._setHeight(F.e);this.resize(F.e,D,0,0,0);},_handle_for_t:function(F){this._dds.t.setXConstraint(0,0);var D=this._setHeight(F.e,true);var G=(D-this._cache.height);this.resize(F.e,D,0,G,0);},_setWidth:function(H,J){var I=this._cache.xy[0],G=this._cache.width,D=A.getPageX(H),F=(D-I);if(J){F=(I-D)+parseInt(this.get("width"),10);}F=this._snapTick(F,this.get("xTicks"));F=this._checkWidth(F);return F;},_checkWidth:function(D){if(this.get("minWidth")){if(D<=this.get("minWidth")){D=this.get("minWidth");}}if(this.get("maxWidth")){if(D>=this.get("maxWidth")){D=this.get("maxWidth");}}return D;},_checkHeight:function(D){if(this.get("minHeight")){if(D<=this.get("minHeight")){D=this.get("minHeight");}}if(this.get("maxHeight")){if(D>=this.get("maxHeight")){D=this.get("maxHeight");}}return D;},_setHeight:function(G,I){var H=this._cache.xy[1],F=this._cache.height,J=A.getPageY(G),D=(J-H);if(I){D=(H-J)+parseInt(this.get("height"),10);}D=this._snapTick(D,this.get("yTicks"));D=this._checkHeight(D);return D;},_snapTick:function(G,F){if(!G||!F){return G;}var H=G;var D=G%F;if(D>0){if(D>(F/2)){H=G+(F-D);}else{H=G-D;}}return H;},init:function(H,F){this._locked=false;this._cache={xy:[],height:0,width:0,top:0,left:0,offsetHeight:0,offsetWidth:0,start:{height:0,width:0,top:0,left:0}};B.superclass.init.call(this,H,F);this.set("setSize",this.get("setSize"));if(F.height){this.set("height",parseInt(F.height,10));}else{var G=this.getStyle("height");if(G=="auto"){this.set("height",parseInt(this.get("element").offsetHeight,10));}}if(F.width){this.set("width",parseInt(F.width,10));}else{var D=this.getStyle("width");if(D=="auto"){this.set("width",parseInt(this.get("element").offsetWidth,10));}}var I=H;if(!C.isString(I)){I=E.generateId(I);}B._instances[I]=this;this._active=false;this._createWrap();this._createProxy();this._createHandles();},getProxyEl:function(){return this._proxy;},getWrapEl:function(){return this._wrap;},getStatusEl:function(){return this._status;},getActiveHandleEl:function(){return this._handles[this._currentHandle];},isActive:function(){return((this._active)?true:false);},initAttributes:function(D){B.superclass.initAttributes.call(this,D);this.setAttributeConfig("useShim",{value:((D.useShim===true)?true:false),validator:YAHOO.lang.isBoolean,method:function(F){for(var G in this._dds){if(C.hasOwnProperty(this._dds,G)){this._dds[G].useShim=F;}}if(this.dd){this.dd.useShim=F;}}});this.setAttributeConfig("setSize",{value:((D.setSize===false)?false:true),validator:YAHOO.lang.isBoolean});this.setAttributeConfig("wrap",{writeOnce:true,validator:YAHOO.lang.isBoolean,value:D.wrap||false});this.setAttributeConfig("handles",{writeOnce:true,value:D.handles||["r","b","br"],validator:function(F){if(C.isString(F)&&F.toLowerCase()=="all"){F=["t","b","r","l","bl","br","tl","tr"];}if(!C.isArray(F)){F=F.replace(/, /g,",");F=F.split(",");}this._configs.handles.value=F;}});this.setAttributeConfig("width",{value:D.width||parseInt(this.getStyle("width"),10),validator:YAHOO.lang.isNumber,method:function(F){F=parseInt(F,10);if(F>0){if(this.get("setSize")){this.setStyle("width",F+"px");}this._cache.width=F;this._configs.width.value=F;}}});this.setAttributeConfig("height",{value:D.height||parseInt(this.getStyle("height"),10),validator:YAHOO.lang.isNumber,method:function(F){F=parseInt(F,10);if(F>0){if(this.get("setSize")){this.setStyle("height",F+"px");}this._cache.height=F;this._configs.height.value=F; -}}});this.setAttributeConfig("minWidth",{value:D.minWidth||15,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minHeight",{value:D.minHeight||15,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxWidth",{value:D.maxWidth||10000,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxHeight",{value:D.maxHeight||10000,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minY",{value:D.minY||false});this.setAttributeConfig("minX",{value:D.minX||false});this.setAttributeConfig("maxY",{value:D.maxY||false});this.setAttributeConfig("maxX",{value:D.maxX||false});this.setAttributeConfig("animate",{value:D.animate||false,validator:function(G){var F=true;if(!YAHOO.util.Anim){F=false;}return F;}});this.setAttributeConfig("animateEasing",{value:D.animateEasing||function(){var F=false;if(YAHOO.util.Easing&&YAHOO.util.Easing.easeOut){F=YAHOO.util.Easing.easeOut;}return F;}()});this.setAttributeConfig("animateDuration",{value:D.animateDuration||0.5});this.setAttributeConfig("proxy",{value:D.proxy||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("ratio",{value:D.ratio||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("ghost",{value:D.ghost||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("draggable",{value:D.draggable||false,validator:YAHOO.lang.isBoolean,method:function(F){if(F&&this._wrap){this._setupDragDrop();}else{if(this.dd){E.removeClass(this._wrap,this.CSS_DRAG);this.dd.unreg();}}}});this.setAttributeConfig("hover",{value:D.hover||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("hiddenHandles",{value:D.hiddenHandles||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("knobHandles",{value:D.knobHandles||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("xTicks",{value:D.xTicks||false});this.setAttributeConfig("yTicks",{value:D.yTicks||false});this.setAttributeConfig("status",{value:D.status||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("autoRatio",{value:D.autoRatio||false,validator:YAHOO.lang.isBoolean});},destroy:function(){for(var F in this._handles){if(C.hasOwnProperty(this._handles,F)){A.purgeElement(this._handles[F]);this._handles[F].parentNode.removeChild(this._handles[F]);}}if(this._proxy){this._proxy.parentNode.removeChild(this._proxy);}if(this._status){this._status.parentNode.removeChild(this._status);}if(this.dd){this.dd.unreg();E.removeClass(this._wrap,this.CSS_DRAG);}if(this._wrap!=this.get("element")){this.setStyle("position","");this.setStyle("top","");this.setStyle("left","");this._wrap.parentNode.replaceChild(this.get("element"),this._wrap);}this.removeClass(this.CSS_RESIZE);delete YAHOO.util.Resize._instances[this.get("id")];for(var D in this){if(C.hasOwnProperty(this,D)){this[D]=null;delete this[D];}}},toString:function(){if(this.get){return"Resize (#"+this.get("id")+")";}return"Resize Utility";}});YAHOO.util.Resize=B;})();YAHOO.register("resize",YAHOO.util.Resize,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize.js deleted file mode 100644 index 9223f40e72..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/resize/resize.js +++ /dev/null @@ -1,1689 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * @description

                    Makes an element resizable

                    - * @namespace YAHOO.util - * @requires yahoo, dom, dragdrop, element, event - * @optional animation - * @module resize - */ -(function() { -var D = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang; - - /** - * @constructor - * @class Resize - * @extends YAHOO.util.Element - * @description

                    Makes an element resizable

                    - * @param {String/HTMLElement} el The element to make resizable. - * @param {Object} attrs Object liternal containing configuration parameters. - */ - - var Resize = function(el, config) { - var oConfig = { - element: el, - attributes: config || {} - }; - - Resize.superclass.constructor.call(this, oConfig.element, oConfig.attributes); - }; - - /** - * @private - * @static - * @property _instances - * @description Internal hash table for all resize instances - * @type Object - */ - Resize._instances = {}; - /** - * @static - * @method getResizeById - * @description Get's a resize object by the HTML id of the element associated with the Resize object. - * @return {Object} The Resize Object - */ - Resize.getResizeById = function(id) { - if (Resize._instances[id]) { - return Resize._instances[id]; - } - return false; - }; - - YAHOO.extend(Resize, YAHOO.util.Element, { - /** - * @private - * @property CSS_RESIZE - * @description Base CSS class name - * @type String - */ - CSS_RESIZE: 'yui-resize', - /** - * @private - * @property CSS_DRAG - * @description Class name added when dragging is enabled - * @type String - */ - CSS_DRAG: 'yui-draggable', - /** - * @private - * @property CSS_HOVER - * @description Class name used for hover only handles - * @type String - */ - CSS_HOVER: 'yui-resize-hover', - /** - * @private - * @property CSS_PROXY - * @description Class name given to the proxy element - * @type String - */ - CSS_PROXY: 'yui-resize-proxy', - /** - * @private - * @property CSS_WRAP - * @description Class name given to the wrap element - * @type String - */ - CSS_WRAP: 'yui-resize-wrap', - /** - * @private - * @property CSS_KNOB - * @description Class name used to make the knob style handles - * @type String - */ - CSS_KNOB: 'yui-resize-knob', - /** - * @private - * @property CSS_HIDDEN - * @description Class name given to the wrap element to make all handles hidden - * @type String - */ - CSS_HIDDEN: 'yui-resize-hidden', - /** - * @private - * @property CSS_HANDLE - * @description Class name given to all handles, used as a base for single handle names as well.. Handle "t" will get this.CSS_HANDLE + '-t' as well as this.CSS_HANDLE - * @type String - */ - CSS_HANDLE: 'yui-resize-handle', - /** - * @private - * @property CSS_STATUS - * @description Class name given to the status element - * @type String - */ - CSS_STATUS: 'yui-resize-status', - /** - * @private - * @property CSS_GHOST - * @description Class name given to the wrap element when the ghost property is active - * @type String - */ - CSS_GHOST: 'yui-resize-ghost', - /** - * @private - * @property CSS_RESIZING - * @description Class name given to the wrap element when a resize action is taking place. - * @type String - */ - CSS_RESIZING: 'yui-resize-resizing', - /** - * @private - * @property _resizeEvent - * @description The mouse event used to resize with - * @type Event - */ - _resizeEvent: null, - /** - * @private - * @property dd - * @description The YAHOO.util.DragDrop instance used if draggable is true - * @type Object - */ - dd: null, - /** - * @private - * @property browser - * @description A copy of the YAHOO.env.ua property - * @type Object - */ - browser: YAHOO.env.ua, - /** - * @private - * @property _locked - * @description A flag to show if the resize is locked - * @type Boolean - */ - _locked: null, - /** - * @private - * @property _positioned - * @description A flag to show if the element is absolutely positioned - * @type Boolean - */ - _positioned: null, - /** - * @private - * @property _dds - * @description An Object containing references to all of the YAHOO.util.DragDrop instances used for the resize handles - * @type Object - */ - _dds: null, - /** - * @private - * @property _wrap - * @description The HTML reference of the element wrapper - * @type HTMLElement - */ - _wrap: null, - /** - * @private - * @property _proxy - * @description The HTML reference of the element proxy - * @type HTMLElement - */ - _proxy: null, - /** - * @private - * @property _handles - * @description An object containing references to all of the resize handles. - * @type Object - */ - _handles: null, - /** - * @private - * @property _currentHandle - * @description The string identifier of the currently active handle. e.g. 'r', 'br', 'tl' - * @type String - */ - _currentHandle: null, - /** - * @private - * @property _currentDD - * @description A link to the currently active DD object - * @type Object - */ - _currentDD: null, - /** - * @private - * @property _cache - * @description An lookup table containing key information for the element being resized. e.g. height, width, x position, y position, etc.. - * @type Object - */ - _cache: null, - /** - * @private - * @property _active - * @description Flag to show if the resize is active. Used for events. - * @type Boolean - */ - _active: null, - /** - * @private - * @method _createProxy - * @description Creates the proxy element if the proxy config is true - */ - _createProxy: function() { - if (this.get('proxy')) { - this._proxy = document.createElement('div'); - this._proxy.className = this.CSS_PROXY; - this._proxy.style.height = this.get('element').clientHeight + 'px'; - this._proxy.style.width = this.get('element').clientWidth + 'px'; - this._wrap.parentNode.appendChild(this._proxy); - } else { - this.set('animate', false); - } - }, - /** - * @private - * @method _createWrap - * @description Creates the wrap element if the wrap config is true. It will auto wrap the following element types: img, textarea, input, iframe, select - */ - _createWrap: function() { - this._positioned = false; - //Force wrap for elements that can't have children - if (this.get('wrap') === false) { - switch (this.get('element').tagName.toLowerCase()) { - case 'img': - case 'textarea': - case 'input': - case 'iframe': - case 'select': - this.set('wrap', true); - break; - } - } - if (this.get('wrap') === true) { - this._wrap = document.createElement('div'); - this._wrap.id = this.get('element').id + '_wrap'; - this._wrap.className = this.CSS_WRAP; - if (this.get('element').tagName.toLowerCase() == 'textarea') { - D.addClass(this._wrap, 'yui-resize-textarea'); - } - D.setStyle(this._wrap, 'width', this.get('width') + 'px'); - D.setStyle(this._wrap, 'height', this.get('height') + 'px'); - D.setStyle(this._wrap, 'z-index', this.getStyle('z-index')); - this.setStyle('z-index', 0); - var pos = D.getStyle(this.get('element'), 'position'); - D.setStyle(this._wrap, 'position', ((pos == 'static') ? 'relative' : pos)); - D.setStyle(this._wrap, 'top', D.getStyle(this.get('element'), 'top')); - D.setStyle(this._wrap, 'left', D.getStyle(this.get('element'), 'left')); - if (D.getStyle(this.get('element'), 'position') == 'absolute') { - this._positioned = true; - D.setStyle(this.get('element'), 'position', 'relative'); - D.setStyle(this.get('element'), 'top', '0'); - D.setStyle(this.get('element'), 'left', '0'); - } - var par = this.get('element').parentNode; - par.replaceChild(this._wrap, this.get('element')); - this._wrap.appendChild(this.get('element')); - } else { - this._wrap = this.get('element'); - if (D.getStyle(this._wrap, 'position') == 'absolute') { - this._positioned = true; - } - } - if (this.get('draggable')) { - this._setupDragDrop(); - } - if (this.get('hover')) { - D.addClass(this._wrap, this.CSS_HOVER); - } - if (this.get('knobHandles')) { - D.addClass(this._wrap, this.CSS_KNOB); - } - if (this.get('hiddenHandles')) { - D.addClass(this._wrap, this.CSS_HIDDEN); - } - D.addClass(this._wrap, this.CSS_RESIZE); - }, - /** - * @private - * @method _setupDragDrop - * @description Setup the YAHOO.util.DragDrop instance on the element - */ - _setupDragDrop: function() { - D.addClass(this._wrap, this.CSS_DRAG); - this.dd = new YAHOO.util.DD(this._wrap, this.get('id') + '-resize', { dragOnly: true, useShim: this.get('useShim') }); - this.dd.on('dragEvent', function() { - this.fireEvent('dragEvent', arguments); - }, this, true); - }, - /** - * @private - * @method _createHandles - * @description Creates the handles as specified in the config - */ - _createHandles: function() { - this._handles = {}; - this._dds = {}; - var h = this.get('handles'); - for (var i = 0; i < h.length; i++) { - this._handles[h[i]] = document.createElement('div'); - this._handles[h[i]].id = D.generateId(this._handles[h[i]]); - this._handles[h[i]].className = this.CSS_HANDLE + ' ' + this.CSS_HANDLE + '-' + h[i]; - var k = document.createElement('div'); - k.className = this.CSS_HANDLE + '-inner-' + h[i]; - this._handles[h[i]].appendChild(k); - this._wrap.appendChild(this._handles[h[i]]); - Event.on(this._handles[h[i]], 'mouseover', this._handleMouseOver, this, true); - Event.on(this._handles[h[i]], 'mouseout', this._handleMouseOut, this, true); - this._dds[h[i]] = new YAHOO.util.DragDrop(this._handles[h[i]], this.get('id') + '-handle-' + h, { useShim: this.get('useShim') }); - this._dds[h[i]].setPadding(15, 15, 15, 15); - this._dds[h[i]].on('startDragEvent', this._handleStartDrag, this._dds[h[i]], this); - this._dds[h[i]].on('mouseDownEvent', this._handleMouseDown, this._dds[h[i]], this); - } - this._status = document.createElement('span'); - this._status.className = this.CSS_STATUS; - document.body.insertBefore(this._status, document.body.firstChild); - }, - /** - * @private - * @method _ieSelectFix - * @description The function we use as the onselectstart handler when we start a drag in Internet Explorer - */ - _ieSelectFix: function() { - return false; - }, - /** - * @private - * @property _ieSelectBack - * @description We will hold a copy of the current "onselectstart" method on this property, and reset it after we are done using it. - */ - _ieSelectBack: null, - /** - * @private - * @method _setAutoRatio - * @param {Event} ev A mouse event. - * @description This method checks to see if the "autoRatio" config is set. If it is, we will check to see if the "Shift Key" is pressed. If so, we will set the config ratio to true. - */ - _setAutoRatio: function(ev) { - if (this.get('autoRatio')) { - if (ev && ev.shiftKey) { - //Shift Pressed - this.set('ratio', true); - } else { - this.set('ratio', this._configs.ratio._initialConfig.value); - } - } - }, - /** - * @private - * @method _handleMouseDown - * @param {Event} ev A mouse event. - * @description This method preps the autoRatio on MouseDown. - */ - _handleMouseDown: function(ev) { - if (this._locked) { - return false; - } - if (D.getStyle(this._wrap, 'position') == 'absolute') { - this._positioned = true; - } - if (ev) { - this._setAutoRatio(ev); - } - if (this.browser.ie) { - this._ieSelectBack = document.body.onselectstart; - document.body.onselectstart = this._ieSelectFix; - } - }, - /** - * @private - * @method _handleMouseOver - * @param {Event} ev A mouse event. - * @description Adds CSS class names to the handles - */ - _handleMouseOver: function(ev) { - if (this._locked) { - return false; - } - D.removeClass(this._wrap, this.CSS_RESIZE); - - if (this.get('hover')) { - D.removeClass(this._wrap, this.CSS_HOVER); - } - var tar = Event.getTarget(ev); - if (!D.hasClass(tar, this.CSS_HANDLE)) { - tar = tar.parentNode; - } - if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) { - D.addClass(tar, this.CSS_HANDLE + '-active'); - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - if (this._handles[i] == tar) { - D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active'); - break; - } - } - } - } - - D.addClass(this._wrap, this.CSS_RESIZE); - }, - /** - * @private - * @method _handleMouseOut - * @param {Event} ev A mouse event. - * @description Removes CSS class names to the handles - */ - _handleMouseOut: function(ev) { - D.removeClass(this._wrap, this.CSS_RESIZE); - if (this.get('hover') && !this._active) { - D.addClass(this._wrap, this.CSS_HOVER); - } - var tar = Event.getTarget(ev); - if (!D.hasClass(tar, this.CSS_HANDLE)) { - tar = tar.parentNode; - } - if (D.hasClass(tar, this.CSS_HANDLE) && !this._active) { - D.removeClass(tar, this.CSS_HANDLE + '-active'); - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - if (this._handles[i] == tar) { - D.removeClass(tar, this.CSS_HANDLE + '-' + i + '-active'); - break; - } - } - } - } - D.addClass(this._wrap, this.CSS_RESIZE); - }, - /** - * @private - * @method _handleStartDrag - * @param {Object} args The args passed from the CustomEvent. - * @param {Object} dd The YAHOO.util.DragDrop object we are working with. - * @description Resizes the proxy, sets up the YAHOO.util.DragDrop handlers, updates the status div and preps the cache - */ - _handleStartDrag: function(args, dd) { - var tar = dd.getDragEl(); - if (D.hasClass(tar, this.CSS_HANDLE)) { - if (D.getStyle(this._wrap, 'position') == 'absolute') { - this._positioned = true; - } - this._active = true; - this._currentDD = dd; - if (this._proxy) { - this._proxy.style.visibility = 'visible'; - this._proxy.style.zIndex = '1000'; - this._proxy.style.height = this.get('element').clientHeight + 'px'; - this._proxy.style.width = this.get('element').clientWidth + 'px'; - } - - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - if (this._handles[i] == tar) { - this._currentHandle = i; - var handle = '_handle_for_' + i; - D.addClass(tar, this.CSS_HANDLE + '-' + i + '-active'); - dd.on('dragEvent', this[handle], this, true); - dd.on('mouseUpEvent', this._handleMouseUp, this, true); - break; - } - } - } - - - D.addClass(tar, this.CSS_HANDLE + '-active'); - - if (this.get('proxy')) { - var xy = D.getXY(this.get('element')); - D.setXY(this._proxy, xy); - if (this.get('ghost')) { - this.addClass(this.CSS_GHOST); - } - } - D.addClass(this._wrap, this.CSS_RESIZING); - this._setCache(); - this._updateStatus(this._cache.height, this._cache.width, this._cache.top, this._cache.left); - this.fireEvent('startResize', { type: 'startresize', target: this}); - } - }, - /** - * @private - * @method _setCache - * @description Sets up the this._cache hash table. - */ - _setCache: function() { - this._cache.xy = D.getXY(this._wrap); - D.setXY(this._wrap, this._cache.xy); - this._cache.height = this.get('clientHeight'); - this._cache.width = this.get('clientWidth'); - this._cache.start.height = this._cache.height; - this._cache.start.width = this._cache.width; - this._cache.start.top = this._cache.xy[1]; - this._cache.start.left = this._cache.xy[0]; - this._cache.top = this._cache.xy[1]; - this._cache.left = this._cache.xy[0]; - this.set('height', this._cache.height, true); - this.set('width', this._cache.width, true); - }, - /** - * @private - * @method _handleMouseUp - * @param {Event} ev A mouse event. - * @description Cleans up listeners, hides proxy element and removes class names. - */ - _handleMouseUp: function(ev) { - this._active = false; - - var handle = '_handle_for_' + this._currentHandle; - this._currentDD.unsubscribe('dragEvent', this[handle], this, true); - this._currentDD.unsubscribe('mouseUpEvent', this._handleMouseUp, this, true); - - if (this._proxy) { - this._proxy.style.visibility = 'hidden'; - this._proxy.style.zIndex = '-1'; - if (this.get('setSize')) { - this.resize(ev, this._cache.height, this._cache.width, this._cache.top, this._cache.left, true); - } else { - this.fireEvent('resize', { ev: 'resize', target: this, height: this._cache.height, width: this._cache.width, top: this._cache.top, left: this._cache.left }); - } - - if (this.get('ghost')) { - this.removeClass(this.CSS_GHOST); - } - } - - if (this.get('hover')) { - D.addClass(this._wrap, this.CSS_HOVER); - } - if (this._status) { - D.setStyle(this._status, 'display', 'none'); - } - if (this.browser.ie) { - document.body.onselectstart = this._ieSelectBack; - } - - if (this.browser.ie) { - D.removeClass(this._wrap, this.CSS_RESIZE); - } - - for (var i in this._handles) { - if (Lang.hasOwnProperty(this._handles, i)) { - D.removeClass(this._handles[i], this.CSS_HANDLE + '-active'); - } - } - if (this.get('hover') && !this._active) { - D.addClass(this._wrap, this.CSS_HOVER); - } - D.removeClass(this._wrap, this.CSS_RESIZING); - - D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-' + this._currentHandle + '-active'); - D.removeClass(this._handles[this._currentHandle], this.CSS_HANDLE + '-active'); - - if (this.browser.ie) { - D.addClass(this._wrap, this.CSS_RESIZE); - } - - this._resizeEvent = null; - this._currentHandle = null; - - if (!this.get('animate')) { - this.set('height', this._cache.height, true); - this.set('width', this._cache.width, true); - } - - this.fireEvent('endResize', { ev: 'endResize', target: this, height: this._cache.height, width: this._cache.width, top: this._cache.top, left: this._cache.left }); - }, - /** - * @private - * @method _setRatio - * @param {Number} h The height offset. - * @param {Number} w The with offset. - * @param {Number} t The top offset. - * @param {Number} l The left offset. - * @description Using the Height, Width, Top & Left, it recalcuates them based on the original element size. - * @return {Array} The new Height, Width, Top & Left settings - */ - _setRatio: function(h, w, t, l) { - var oh = h, ow = w; - if (this.get('ratio')) { - var orgH = this._cache.height, - orgW = this._cache.width, - nh = parseInt(this.get('height'), 10), - nw = parseInt(this.get('width'), 10), - maxH = this.get('maxHeight'), - minH = this.get('minHeight'), - maxW = this.get('maxWidth'), - minW = this.get('minWidth'); - - switch (this._currentHandle) { - case 'l': - h = nh * (w / nw); - h = Math.min(Math.max(minH, h), maxH); - w = nw * (h / nh); - t = (this._cache.start.top - (-((nh - h) / 2))); - l = (this._cache.start.left - (-((nw - w)))); - break; - case 'r': - h = nh * (w / nw); - h = Math.min(Math.max(minH, h), maxH); - w = nw * (h / nh); - t = (this._cache.start.top - (-((nh - h) / 2))); - break; - case 't': - w = nw * (h / nh); - h = nh * (w / nw); - l = (this._cache.start.left - (-((nw - w) / 2))); - t = (this._cache.start.top - (-((nh - h)))); - break; - case 'b': - w = nw * (h / nh); - h = nh * (w / nw); - l = (this._cache.start.left - (-((nw - w) / 2))); - break; - case 'bl': - h = nh * (w / nw); - w = nw * (h / nh); - l = (this._cache.start.left - (-((nw - w)))); - break; - case 'br': - h = nh * (w / nw); - w = nw * (h / nh); - break; - case 'tl': - h = nh * (w / nw); - w = nw * (h / nh); - l = (this._cache.start.left - (-((nw - w)))); - t = (this._cache.start.top - (-((nh - h)))); - break; - case 'tr': - h = nh * (w / nw); - w = nw * (h / nh); - l = (this._cache.start.left); - t = (this._cache.start.top - (-((nh - h)))); - break; - } - oh = this._checkHeight(h); - ow = this._checkWidth(w); - if ((oh != h) || (ow != w)) { - t = 0; - l = 0; - if (oh != h) { - ow = this._cache.width; - } - if (ow != w) { - oh = this._cache.height; - } - } - } - return [oh, ow, t, l]; - }, - /** - * @private - * @method _updateStatus - * @param {Number} h The new height setting. - * @param {Number} w The new width setting. - * @param {Number} t The new top setting. - * @param {Number} l The new left setting. - * @description Using the Height, Width, Top & Left, it updates the status element with the elements sizes. - */ - _updateStatus: function(h, w, t, l) { - if (this._resizeEvent && (!Lang.isString(this._resizeEvent))) { - h = ((h === 0) ? this._cache.start.height : h); - w = ((w === 0) ? this._cache.start.width : w); - var h1 = parseInt(this.get('height'), 10), - w1 = parseInt(this.get('width'), 10); - - if (isNaN(h1)) { - h1 = parseInt(h, 10); - } - if (isNaN(w1)) { - w1 = parseInt(w, 10); - } - var diffH = (parseInt(h, 10) - h1); - var diffW = (parseInt(w, 10) - w1); - this._cache.offsetHeight = diffH; - this._cache.offsetWidth = diffW; - if (this.get('status')) { - D.setStyle(this._status, 'display', 'inline'); - //This will cause IE8 to crash if the status box is hidden.. - this._status.innerHTML = '' + parseInt(h, 10) + ' x ' + parseInt(w, 10) + '' + ((diffH > 0) ? '+' : '') + diffH + ' x ' + ((diffW > 0) ? '+' : '') + diffW + ''; - D.setXY(this._status, [Event.getPageX(this._resizeEvent) + 12, Event.getPageY(this._resizeEvent) + 12]); - } - } - }, - /** - * @method lock - * @description Lock the resize so it can't be resized - * @param {Boolean} dd If the draggable config is set, lock it too - * @return {YAHOO.util.Resize} The Resize instance - */ - lock: function(dd) { - this._locked = true; - if (dd && this.dd) { - D.removeClass(this._wrap, 'yui-draggable'); - this.dd.lock(); - } - return this; - }, - /** - * @method unlock - * @description Unlock the resize so it can be resized - * @param {Boolean} dd If the draggable config is set, unlock it too - * @return {YAHOO.util.Resize} The Resize instance - */ - unlock: function(dd) { - this._locked = false; - if (dd && this.dd) { - D.addClass(this._wrap, 'yui-draggable'); - this.dd.unlock(); - } - return this; - }, - /** - * @method isLocked - * @description Check the locked status of the resize instance - * @return {Boolean} - */ - isLocked: function() { - return this._locked; - }, - /** - * @method reset - * @description Resets the element to is start state. - * @return {YAHOO.util.Resize} The Resize instance - */ - reset: function() { - this.resize(null, this._cache.start.height, this._cache.start.width, this._cache.start.top, this._cache.start.left, true); - return this; - }, - /** - * @private - * @method resize - * @param {Event} ev The mouse event. - * @param {Number} h The new height setting. - * @param {Number} w The new width setting. - * @param {Number} t The new top setting. - * @param {Number} l The new left setting. - * @param {Boolean} force Resize the element (used for proxy resize). - * @param {Boolean} silent Don't fire the beforeResize Event. - * @description Resizes the element, wrapper or proxy based on the data from the handlers. - * @return {YAHOO.util.Resize} The Resize instance - */ - resize: function(ev, h, w, t, l, force, silent) { - if (this._locked) { - return false; - } - this._resizeEvent = ev; - var el = this._wrap, anim = this.get('animate'), set = true; - if (this._proxy && !force) { - el = this._proxy; - anim = false; - } - this._setAutoRatio(ev); - if (this._positioned) { - if (this._proxy) { - t = this._cache.top - t; - l = this._cache.left - l; - } - } - - - var ratio = this._setRatio(h, w, t, l); - h = parseInt(ratio[0], 10); - w = parseInt(ratio[1], 10); - t = parseInt(ratio[2], 10); - l = parseInt(ratio[3], 10); - - if (t == 0) { - //No Offset, get from cache - t = D.getY(el); - } - if (l == 0) { - //No Offset, get from cache - l = D.getX(el); - } - - - - if (this._positioned) { - if (this._proxy && force) { - if (!anim) { - el.style.top = this._proxy.style.top; - el.style.left = this._proxy.style.left; - } else { - t = this._proxy.style.top; - l = this._proxy.style.left; - } - } else { - if (!this.get('ratio') && !this._proxy) { - t = this._cache.top + -(t); - l = this._cache.left + -(l); - } - if (t) { - if (this.get('minY')) { - if (t < this.get('minY')) { - t = this.get('minY'); - } - } - if (this.get('maxY')) { - if (t > this.get('maxY')) { - t = this.get('maxY'); - } - } - } - if (l) { - if (this.get('minX')) { - if (l < this.get('minX')) { - l = this.get('minX'); - } - } - if (this.get('maxX')) { - if ((l + w) > this.get('maxX')) { - l = (this.get('maxX') - w); - } - } - } - } - } - if (!silent) { - var beforeReturn = this.fireEvent('beforeResize', { ev: 'beforeResize', target: this, height: h, width: w, top: t, left: l }); - if (beforeReturn === false) { - return false; - } - } - - this._updateStatus(h, w, t, l); - - - if (this._positioned) { - if (this._proxy && force) { - //Do nothing - } else { - if (t) { - D.setY(el, t); - this._cache.top = t; - } - if (l) { - D.setX(el, l); - this._cache.left = l; - } - } - } - if (h) { - if (!anim) { - set = true; - if (this._proxy && force) { - if (!this.get('setSize')) { - set = false; - } - } - if (set) { - el.style.height = h + 'px'; - } - if ((this._proxy && force) || !this._proxy) { - if (this._wrap != this.get('element')) { - this.get('element').style.height = h + 'px'; - } - } - } - this._cache.height = h; - } - if (w) { - this._cache.width = w; - if (!anim) { - set = true; - if (this._proxy && force) { - if (!this.get('setSize')) { - set = false; - } - } - if (set) { - el.style.width = w + 'px'; - } - if ((this._proxy && force) || !this._proxy) { - if (this._wrap != this.get('element')) { - this.get('element').style.width = w + 'px'; - } - } - } - } - if (anim) { - if (YAHOO.util.Anim) { - var _anim = new YAHOO.util.Anim(el, { - height: { - to: this._cache.height - }, - width: { - to: this._cache.width - } - }, this.get('animateDuration'), this.get('animateEasing')); - if (this._positioned) { - if (t) { - _anim.attributes.top = { - to: parseInt(t, 10) - }; - } - if (l) { - _anim.attributes.left = { - to: parseInt(l, 10) - }; - } - } - - if (this._wrap != this.get('element')) { - _anim.onTween.subscribe(function() { - this.get('element').style.height = el.style.height; - this.get('element').style.width = el.style.width; - }, this, true); - } - - _anim.onComplete.subscribe(function() { - this.set('height', h); - this.set('width', w); - this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l }); - }, this, true); - _anim.animate(); - - } - } else { - if (this._proxy && !force) { - this.fireEvent('proxyResize', { ev: 'proxyresize', target: this, height: h, width: w, top: t, left: l }); - } else { - this.fireEvent('resize', { ev: 'resize', target: this, height: h, width: w, top: t, left: l }); - } - } - return this; - }, - /** - * @private - * @method _handle_for_br - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Bottom Right handle. - */ - _handle_for_br: function(args) { - var newW = this._setWidth(args.e); - var newH = this._setHeight(args.e); - this.resize(args.e, newH, newW, 0, 0); - }, - /** - * @private - * @method _handle_for_bl - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Bottom Left handle. - */ - _handle_for_bl: function(args) { - var newW = this._setWidth(args.e, true); - var newH = this._setHeight(args.e); - var l = (newW - this._cache.width); - this.resize(args.e, newH, newW, 0, l); - }, - /** - * @private - * @method _handle_for_tl - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Top Left handle. - */ - _handle_for_tl: function(args) { - var newW = this._setWidth(args.e, true); - var newH = this._setHeight(args.e, true); - var t = (newH - this._cache.height); - var l = (newW - this._cache.width); - this.resize(args.e, newH, newW, t, l); - }, - /** - * @private - * @method _handle_for_tr - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Top Right handle. - */ - _handle_for_tr: function(args) { - var newW = this._setWidth(args.e); - var newH = this._setHeight(args.e, true); - var t = (newH - this._cache.height); - this.resize(args.e, newH, newW, t, 0); - }, - /** - * @private - * @method _handle_for_r - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Right handle. - */ - _handle_for_r: function(args) { - this._dds.r.setYConstraint(0,0); - var newW = this._setWidth(args.e); - this.resize(args.e, 0, newW, 0, 0); - }, - /** - * @private - * @method _handle_for_l - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Left handle. - */ - _handle_for_l: function(args) { - this._dds.l.setYConstraint(0,0); - var newW = this._setWidth(args.e, true); - var l = (newW - this._cache.width); - this.resize(args.e, 0, newW, 0, l); - }, - /** - * @private - * @method _handle_for_b - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Bottom handle. - */ - _handle_for_b: function(args) { - this._dds.b.setXConstraint(0,0); - var newH = this._setHeight(args.e); - this.resize(args.e, newH, 0, 0, 0); - }, - /** - * @private - * @method _handle_for_t - * @param {Object} args The arguments from the CustomEvent. - * @description Handles the sizes for the Top handle. - */ - _handle_for_t: function(args) { - this._dds.t.setXConstraint(0,0); - var newH = this._setHeight(args.e, true); - var t = (newH - this._cache.height); - this.resize(args.e, newH, 0, t, 0); - }, - /** - * @private - * @method _setWidth - * @param {Event} ev The mouse event. - * @param {Boolean} flip Argument to determine the direction of the movement. - * @description Calculates the width based on the mouse event. - * @return {Number} The new value - */ - _setWidth: function(ev, flip) { - var xy = this._cache.xy[0], - w = this._cache.width, - x = Event.getPageX(ev), - nw = (x - xy); - - if (flip) { - nw = (xy - x) + parseInt(this.get('width'), 10); - } - - nw = this._snapTick(nw, this.get('xTicks')); - nw = this._checkWidth(nw); - return nw; - }, - /** - * @private - * @method _checkWidth - * @param {Number} w The width to check. - * @description Checks the value passed against the maxWidth and minWidth. - * @return {Number} the new value - */ - _checkWidth: function(w) { - if (this.get('minWidth')) { - if (w <= this.get('minWidth')) { - w = this.get('minWidth'); - } - } - if (this.get('maxWidth')) { - if (w >= this.get('maxWidth')) { - w = this.get('maxWidth'); - } - } - return w; - }, - /** - * @private - * @method _checkHeight - * @param {Number} h The height to check. - * @description Checks the value passed against the maxHeight and minHeight. - * @return {Number} The new value - */ - _checkHeight: function(h) { - if (this.get('minHeight')) { - if (h <= this.get('minHeight')) { - h = this.get('minHeight'); - } - } - if (this.get('maxHeight')) { - if (h >= this.get('maxHeight')) { - h = this.get('maxHeight'); - } - } - return h; - }, - /** - * @private - * @method _setHeight - * @param {Event} ev The mouse event. - * @param {Boolean} flip Argument to determine the direction of the movement. - * @description Calculated the height based on the mouse event. - * @return {Number} The new value - */ - _setHeight: function(ev, flip) { - var xy = this._cache.xy[1], - h = this._cache.height, - y = Event.getPageY(ev), - nh = (y - xy); - - if (flip) { - nh = (xy - y) + parseInt(this.get('height'), 10); - } - nh = this._snapTick(nh, this.get('yTicks')); - nh = this._checkHeight(nh); - - return nh; - }, - /** - * @private - * @method _snapTick - * @param {Number} size The size to tick against. - * @param {Number} pix The tick pixels. - * @description Adjusts the number based on the ticks used. - * @return {Number} the new snapped position - */ - _snapTick: function(size, pix) { - if (!size || !pix) { - return size; - } - var _s = size; - var _x = size % pix; - if (_x > 0) { - if (_x > (pix / 2)) { - _s = size + (pix - _x); - } else { - _s = size - _x; - } - } - return _s; - }, - /** - * @private - * @method init - * @description The Resize class's initialization method - */ - init: function(p_oElement, p_oAttributes) { - this._locked = false; - this._cache = { - xy: [], - height: 0, - width: 0, - top: 0, - left: 0, - offsetHeight: 0, - offsetWidth: 0, - start: { - height: 0, - width: 0, - top: 0, - left: 0 - } - }; - - Resize.superclass.init.call(this, p_oElement, p_oAttributes); - - this.set('setSize', this.get('setSize')); - - if (p_oAttributes.height) { - this.set('height', parseInt(p_oAttributes.height, 10)); - } else { - var h = this.getStyle('height'); - if (h == 'auto') { - this.set('height', parseInt(this.get('element').offsetHeight, 10)); - } - } - if (p_oAttributes.width) { - this.set('width', parseInt(p_oAttributes.width, 10)); - } else { - var w = this.getStyle('width'); - if (w == 'auto') { - this.set('width', parseInt(this.get('element').offsetWidth, 10)); - } - } - - var id = p_oElement; - if (!Lang.isString(id)) { - id = D.generateId(id); - } - Resize._instances[id] = this; - - this._active = false; - - this._createWrap(); - this._createProxy(); - this._createHandles(); - - }, - /** - * @method getProxyEl - * @description Get the HTML reference for the proxy, returns null if no proxy. - * @return {HTMLElement} The proxy element - */ - getProxyEl: function() { - return this._proxy; - }, - /** - * @method getWrapEl - * @description Get the HTML reference for the wrap element, returns the current element if not wrapped. - * @return {HTMLElement} The wrap element - */ - getWrapEl: function() { - return this._wrap; - }, - /** - * @method getStatusEl - * @description Get the HTML reference for the status element. - * @return {HTMLElement} The status element - */ - getStatusEl: function() { - return this._status; - }, - /** - * @method getActiveHandleEl - * @description Get the HTML reference for the currently active resize handle. - * @return {HTMLElement} The handle element that is active - */ - getActiveHandleEl: function() { - return this._handles[this._currentHandle]; - }, - /** - * @method isActive - * @description Returns true or false if a resize operation is currently active on the element. - * @return {Boolean} - */ - isActive: function() { - return ((this._active) ? true : false); - }, - /** - * @private - * @method initAttributes - * @description Initializes all of the configuration attributes used to create a resizable element. - * @param {Object} attr Object literal specifying a set of - * configuration attributes used to create the utility. - */ - initAttributes: function(attr) { - Resize.superclass.initAttributes.call(this, attr); - - /** - * @attribute useShim - * @description This setting will be passed to the DragDrop instances on the resize handles and for the draggable property. - * This property should be used if you want the resize handles to work over iframe and other elements. - * @type Boolean - */ - this.setAttributeConfig('useShim', { - value: ((attr.useShim === true) ? true : false), - validator: YAHOO.lang.isBoolean, - method: function(u) { - for (var i in this._dds) { - if (Lang.hasOwnProperty(this._dds, i)) { - this._dds[i].useShim = u; - } - } - if (this.dd) { - this.dd.useShim = u; - } - } - }); - /** - * @attribute setSize - * @description Set the size of the resized element, if set to false the element will not be auto resized, - * the resize event will contain the dimensions so the end user can resize it on their own. - * This setting will only work with proxy set to true and animate set to false. - * @type Boolean - */ - this.setAttributeConfig('setSize', { - value: ((attr.setSize === false) ? false : true), - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute wrap - * @description Should we wrap the element - * @type Boolean - */ - this.setAttributeConfig('wrap', { - writeOnce: true, - validator: YAHOO.lang.isBoolean, - value: attr.wrap || false - }); - - /** - * @attribute handles - * @description The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr'. Defaults to: ['r', 'b', 'br']. - * Can use a shortcut of All. Note: 8 way resizing should be done on an element that is absolutely positioned. - * @type Array - */ - this.setAttributeConfig('handles', { - writeOnce: true, - value: attr.handles || ['r', 'b', 'br'], - validator: function(handles) { - if (Lang.isString(handles) && handles.toLowerCase() == 'all') { - handles = ['t', 'b', 'r', 'l', 'bl', 'br', 'tl', 'tr']; - } - if (!Lang.isArray(handles)) { - handles = handles.replace(/, /g, ','); - handles = handles.split(','); - } - this._configs.handles.value = handles; - } - }); - - /** - * @attribute width - * @description The width of the element - * @type Number - */ - this.setAttributeConfig('width', { - value: attr.width || parseInt(this.getStyle('width'), 10), - validator: YAHOO.lang.isNumber, - method: function(width) { - width = parseInt(width, 10); - if (width > 0) { - if (this.get('setSize')) { - this.setStyle('width', width + 'px'); - } - this._cache.width = width; - this._configs.width.value = width; - } - } - }); - - /** - * @attribute height - * @description The height of the element - * @type Number - */ - this.setAttributeConfig('height', { - value: attr.height || parseInt(this.getStyle('height'), 10), - validator: YAHOO.lang.isNumber, - method: function(height) { - height = parseInt(height, 10); - if (height > 0) { - if (this.get('setSize')) { - this.setStyle('height', height + 'px'); - } - this._cache.height = height; - this._configs.height.value = height; - } - } - }); - - /** - * @attribute minWidth - * @description The minimum width of the element - * @type Number - */ - this.setAttributeConfig('minWidth', { - value: attr.minWidth || 15, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minHeight - * @description The minimum height of the element - * @type Number - */ - this.setAttributeConfig('minHeight', { - value: attr.minHeight || 15, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxWidth - * @description The maximum width of the element - * @type Number - */ - this.setAttributeConfig('maxWidth', { - value: attr.maxWidth || 10000, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute maxHeight - * @description The maximum height of the element - * @type Number - */ - this.setAttributeConfig('maxHeight', { - value: attr.maxHeight || 10000, - validator: YAHOO.lang.isNumber - }); - - /** - * @attribute minY - * @description The minimum y coord of the element - * @type Number - */ - this.setAttributeConfig('minY', { - value: attr.minY || false - }); - - /** - * @attribute minX - * @description The minimum x coord of the element - * @type Number - */ - this.setAttributeConfig('minX', { - value: attr.minX || false - }); - /** - * @attribute maxY - * @description The max y coord of the element - * @type Number - */ - this.setAttributeConfig('maxY', { - value: attr.maxY || false - }); - - /** - * @attribute maxX - * @description The max x coord of the element - * @type Number - */ - this.setAttributeConfig('maxX', { - value: attr.maxX || false - }); - - /** - * @attribute animate - * @description Should be use animation to resize the element (can only be used if we use proxy). - * @type Boolean - */ - this.setAttributeConfig('animate', { - value: attr.animate || false, - validator: function(value) { - var ret = true; - if (!YAHOO.util.Anim) { - ret = false; - } - return ret; - } - }); - - /** - * @attribute animateEasing - * @description The Easing to apply to the animation. - * @type Object - */ - this.setAttributeConfig('animateEasing', { - value: attr.animateEasing || function() { - var easing = false; - if (YAHOO.util.Easing && YAHOO.util.Easing.easeOut) { - easing = YAHOO.util.Easing.easeOut; - } - return easing; - }() - }); - - /** - * @attribute animateDuration - * @description The Duration to apply to the animation. - * @type Number - */ - this.setAttributeConfig('animateDuration', { - value: attr.animateDuration || 0.5 - }); - - /** - * @attribute proxy - * @description Resize a proxy element instead of the real element. - * @type Boolean - */ - this.setAttributeConfig('proxy', { - value: attr.proxy || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute ratio - * @description Maintain the element's ratio when resizing. - * @type Boolean - */ - this.setAttributeConfig('ratio', { - value: attr.ratio || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute ghost - * @description Apply an opacity filter to the element being resized (only works with proxy). - * @type Boolean - */ - this.setAttributeConfig('ghost', { - value: attr.ghost || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute draggable - * @description A convienence method to make the element draggable - * @type Boolean - */ - this.setAttributeConfig('draggable', { - value: attr.draggable || false, - validator: YAHOO.lang.isBoolean, - method: function(dd) { - if (dd && this._wrap) { - this._setupDragDrop(); - } else { - if (this.dd) { - D.removeClass(this._wrap, this.CSS_DRAG); - this.dd.unreg(); - } - } - } - }); - - /** - * @attribute hover - * @description Only show the handles when they are being moused over. - * @type Boolean - */ - this.setAttributeConfig('hover', { - value: attr.hover || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute hiddenHandles - * @description Don't show the handles, just use the cursor to the user. - * @type Boolean - */ - this.setAttributeConfig('hiddenHandles', { - value: attr.hiddenHandles || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute knobHandles - * @description Use the smaller handles, instead if the full size handles. - * @type Boolean - */ - this.setAttributeConfig('knobHandles', { - value: attr.knobHandles || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute xTicks - * @description The number of x ticks to span the resize to. - * @type Number or False - */ - this.setAttributeConfig('xTicks', { - value: attr.xTicks || false - }); - - /** - * @attribute yTicks - * @description The number of y ticks to span the resize to. - * @type Number or False - */ - this.setAttributeConfig('yTicks', { - value: attr.yTicks || false - }); - - /** - * @attribute status - * @description Show the status (new size) of the resize. - * @type Boolean - */ - this.setAttributeConfig('status', { - value: attr.status || false, - validator: YAHOO.lang.isBoolean - }); - - /** - * @attribute autoRatio - * @description Using the shift key during a resize will toggle the ratio config. - * @type Boolean - */ - this.setAttributeConfig('autoRatio', { - value: attr.autoRatio || false, - validator: YAHOO.lang.isBoolean - }); - - }, - /** - * @method destroy - * @description Destroys the resize object and all of it's elements & listeners. - */ - destroy: function() { - for (var h in this._handles) { - if (Lang.hasOwnProperty(this._handles, h)) { - Event.purgeElement(this._handles[h]); - this._handles[h].parentNode.removeChild(this._handles[h]); - } - } - if (this._proxy) { - this._proxy.parentNode.removeChild(this._proxy); - } - if (this._status) { - this._status.parentNode.removeChild(this._status); - } - if (this.dd) { - this.dd.unreg(); - D.removeClass(this._wrap, this.CSS_DRAG); - } - if (this._wrap != this.get('element')) { - this.setStyle('position', ''); - this.setStyle('top', ''); - this.setStyle('left', ''); - this._wrap.parentNode.replaceChild(this.get('element'), this._wrap); - } - this.removeClass(this.CSS_RESIZE); - - delete YAHOO.util.Resize._instances[this.get('id')]; - //Brutal Object Destroy - for (var i in this) { - if (Lang.hasOwnProperty(this, i)) { - this[i] = null; - delete this[i]; - } - } - }, - /** - * @method toString - * @description Returns a string representing the Resize Object. - * @return {String} - */ - toString: function() { - if (this.get) { - return 'Resize (#' + this.get('id') + ')'; - } - return 'Resize Utility'; - } - }); - - YAHOO.util.Resize = Resize; - -/** -* @event dragEvent -* @description Fires when the YAHOO.util.DragDrop dragEvent is fired for the config option draggable. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event startResize -* @description Fires when a resize action is started. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event endResize -* @description Fires when the mouseUp event from the Drag Instance fires. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event resize -* @description Fires on every element resize (only fires once when used with proxy config setting). -* @type YAHOO.util.CustomEvent -*/ -/** -* @event beforeResize -* @description Fires before every element resize after the size calculations, returning false will stop the resize. -* @type YAHOO.util.CustomEvent -*/ -/** -* @event proxyResize -* @description Fires on every proxy resize (only fires when used with proxy config setting). -* @type YAHOO.util.CustomEvent -*/ - -})(); - -YAHOO.register("resize", YAHOO.util.Resize, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-debug.js deleted file mode 100644 index 44398740c4..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-debug.js +++ /dev/null @@ -1,651 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The selector module provides helper methods allowing CSS3 Selectors to be used with DOM elements. - * @module selector - * @title Selector Utility - * @namespace YAHOO.util - * @requires yahoo, dom - */ - -(function() { -var Y = YAHOO.util; - -/** - * Provides helper methods for collecting and filtering DOM elements. - * @namespace YAHOO.util - * @class Selector - * @static - */ - -Y.Selector = { - _foundCache: [], - _regexCache: {}, - - _re: { - nth: /^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/, - attr: /(\[.*\])/g, - urls: /^(?:href|src)/ - }, - - /** - * Default document for use queries - * @property document - * @type object - * @default window.document - */ - document: window.document, - /** - * Mapping of attributes to aliases, normally to work around HTMLAttributes - * that conflict with JS reserved words. - * @property attrAliases - * @type object - */ - attrAliases: { - }, - - /** - * Mapping of shorthand tokens to corresponding attribute selector - * @property shorthand - * @type object - */ - shorthand: { - //'(?:(?:[^\\)\\]\\s*>+~,]+)(?:-?[_a-z]+[-\\w]))+#(-?[_a-z]+[-\\w]*)': '[id=$1]', - '\\#(-?[_a-z]+[-\\w]*)': '[id=$1]', - '\\.(-?[_a-z]+[-\\w]*)': '[class~=$1]' - }, - - /** - * List of operators and corresponding boolean functions. - * These functions are passed the attribute and the current node's value of the attribute. - * @property operators - * @type object - */ - operators: { - '=': function(attr, val) { return attr === val; }, // Equality - '!=': function(attr, val) { return attr !== val; }, // Inequality - '~=': function(attr, val) { // Match one of space seperated words - var s = ' '; - return (s + attr + s).indexOf((s + val + s)) > -1; - }, - '|=': function(attr, val) { return attr === val || attr.slice(0, val.length + 1) === val + '-'; }, // Matches value followed by optional hyphen - '^=': function(attr, val) { return attr.indexOf(val) === 0; }, // Match starts with value - '$=': function(attr, val) { return attr.slice(-val.length) === val; }, // Match ends with value - '*=': function(attr, val) { return attr.indexOf(val) > -1; }, // Match contains value as substring - '': function(attr, val) { return attr; } // Just test for existence of attribute - }, - - /** - * List of pseudo-classes and corresponding boolean functions. - * These functions are called with the current node, and any value that was parsed with the pseudo regex. - * @property pseudos - * @type object - */ - pseudos: { - 'root': function(node) { - return node === node.ownerDocument.documentElement; - }, - - 'nth-child': function(node, val) { - return Y.Selector._getNth(node, val); - }, - - 'nth-last-child': function(node, val) { - return Y.Selector._getNth(node, val, null, true); - }, - - 'nth-of-type': function(node, val) { - return Y.Selector._getNth(node, val, node.tagName); - }, - - 'nth-last-of-type': function(node, val) { - return Y.Selector._getNth(node, val, node.tagName, true); - }, - - 'first-child': function(node) { - return Y.Selector._getChildren(node.parentNode)[0] === node; - }, - - 'last-child': function(node) { - var children = Y.Selector._getChildren(node.parentNode); - return children[children.length - 1] === node; - }, - - 'first-of-type': function(node, val) { - return Y.Selector._getChildren(node.parentNode, node.tagName)[0]; - }, - - 'last-of-type': function(node, val) { - var children = Y.Selector._getChildren(node.parentNode, node.tagName); - return children[children.length - 1]; - }, - - 'only-child': function(node) { - var children = Y.Selector._getChildren(node.parentNode); - return children.length === 1 && children[0] === node; - }, - - 'only-of-type': function(node) { - return Y.Selector._getChildren(node.parentNode, node.tagName).length === 1; - }, - - 'empty': function(node) { - return node.childNodes.length === 0; - }, - - 'not': function(node, simple) { - return !Y.Selector.test(node, simple); - }, - - 'contains': function(node, str) { - var text = node.innerText || node.textContent || ''; - return text.indexOf(str) > -1; - }, - 'checked': function(node) { - return node.checked === true; - } - }, - - /** - * Test if the supplied node matches the supplied selector. - * @method test - * - * @param {HTMLElement | String} node An id or node reference to the HTMLElement being tested. - * @param {string} selector The CSS Selector to test the node against. - * @return{boolean} Whether or not the node matches the selector. - * @static - - */ - test: function(node, selector) { - node = Y.Selector.document.getElementById(node) || node; - - if (!node) { - return false; - } - - var groups = selector ? selector.split(',') : []; - if (groups.length) { - for (var i = 0, len = groups.length; i < len; ++i) { - if ( Y.Selector._test(node, groups[i]) ) { // passes if ANY group matches - return true; - } - } - return false; - } - return Y.Selector._test(node, selector); - }, - - _test: function(node, selector, token, deDupe) { - token = token || Y.Selector._tokenize(selector).pop() || {}; - - if (!node.tagName || - (token.tag !== '*' && node.tagName !== token.tag) || - (deDupe && node._found) ) { - return false; - } - - if (token.attributes.length) { - var val, - ieFlag, - re_urls = Y.Selector._re.urls; - - if (!node.attributes || !node.attributes.length) { - return false; - } - for (var i = 0, attr; attr = token.attributes[i++];) { - ieFlag = (re_urls.test(attr[0])) ? 2 : 0; - val = node.getAttribute(attr[0], ieFlag); - if (val === null || val === undefined) { - return false; - } - if ( Y.Selector.operators[attr[1]] && - !Y.Selector.operators[attr[1]](val, attr[2])) { - return false; - } - } - } - - if (token.pseudos.length) { - for (var i = 0, len = token.pseudos.length; i < len; ++i) { - if (Y.Selector.pseudos[token.pseudos[i][0]] && - !Y.Selector.pseudos[token.pseudos[i][0]](node, token.pseudos[i][1])) { - return false; - } - } - } - - return (token.previous && token.previous.combinator !== ',') ? - Y.Selector._combinators[token.previous.combinator](node, token) : - true; - }, - - /** - * Filters a set of nodes based on a given CSS selector. - * @method filter - * - * @param {array} nodes A set of nodes/ids to filter. - * @param {string} selector The selector used to test each node. - * @return{array} An array of nodes from the supplied array that match the given selector. - * @static - */ - filter: function(nodes, selector) { - nodes = nodes || []; - - var node, - result = [], - tokens = Y.Selector._tokenize(selector); - - if (!nodes.item) { // if not HTMLCollection, handle arrays of ids and/or nodes - YAHOO.log('filter: scanning input for HTMLElements/IDs', 'info', 'Selector'); - for (var i = 0, len = nodes.length; i < len; ++i) { - if (!nodes[i].tagName) { // tagName limits to HTMLElements - node = Y.Selector.document.getElementById(nodes[i]); - if (node) { // skip IDs that return null - nodes[i] = node; - } else { - YAHOO.log('filter: skipping invalid node', 'warn', 'Selector'); - } - } - } - } - result = Y.Selector._filter(nodes, Y.Selector._tokenize(selector)[0]); - YAHOO.log('filter: returning:' + result.length, 'info', 'Selector'); - return result; - }, - - _filter: function(nodes, token, firstOnly, deDupe) { - var result = firstOnly ? null : [], - foundCache = Y.Selector._foundCache; - - for (var i = 0, len = nodes.length; i < len; i++) { - if (! Y.Selector._test(nodes[i], '', token, deDupe)) { - continue; - } - - if (firstOnly) { - return nodes[i]; - } - if (deDupe) { - if (nodes[i]._found) { - continue; - } - nodes[i]._found = true; - foundCache[foundCache.length] = nodes[i]; - } - - result[result.length] = nodes[i]; - } - - return result; - }, - - /** - * Retrieves a set of nodes based on a given CSS selector. - * @method query - * - * @param {string} selector The CSS Selector to test the node against. - * @param {HTMLElement | String} root optional An id or HTMLElement to start the query from. Defaults to Selector.document. - * @param {Boolean} firstOnly optional Whether or not to return only the first match. - * @return {Array} An array of nodes that match the given selector. - * @static - */ - query: function(selector, root, firstOnly) { - var result = Y.Selector._query(selector, root, firstOnly); - YAHOO.log('query: returning ' + result, 'info', 'Selector'); - return result; - }, - - - _query: function(selector, root, firstOnly, deDupe) { - var result = (firstOnly) ? null : [], - node; - - if (!selector) { - return result; - } - - var groups = selector.split(','); // TODO: handle comma in attribute/pseudo - - if (groups.length > 1) { - var found; - for (var i = 0, len = groups.length; i < len; ++i) { - found = Y.Selector._query(groups[i], root, firstOnly, true); - result = firstOnly ? found : result.concat(found); - } - Y.Selector._clearFoundCache(); - return result; - } - - if (root && !root.nodeName) { // assume ID - root = Y.Selector.document.getElementById(root); - if (!root) { - YAHOO.log('invalid root node provided', 'warn', 'Selector'); - return result; - } - } - - root = root || Y.Selector.document; - - if (root.nodeName !== '#document') { // prepend with root selector - Y.Dom.generateId(root); // TODO: cleanup after? - selector = root.tagName + '#' + root.id + ' ' + selector; - node = root; - root = root.ownerDocument; - } - - var tokens = Y.Selector._tokenize(selector); - var idToken = tokens[Y.Selector._getIdTokenIndex(tokens)], - nodes = [], - id, - token = tokens.pop() || {}; - - if (idToken) { - id = Y.Selector._getId(idToken.attributes); - } - - // use id shortcut when possible - if (id) { - node = node || Y.Selector.document.getElementById(id); - - if (node && (root.nodeName === '#document' || Y.Dom.isAncestor(root, node))) { - if ( Y.Selector._test(node, null, idToken) ) { - if (idToken === token) { - nodes = [node]; // simple selector - } else if (idToken.combinator === ' ' || idToken.combinator === '>') { - root = node; // start from here - } - } - } else { - return result; - } - } - - if (root && !nodes.length) { - nodes = root.getElementsByTagName(token.tag); - } - - if (nodes.length) { - result = Y.Selector._filter(nodes, token, firstOnly, deDupe); - } - - return result; - }, - - - _clearFoundCache: function() { - var foundCache = Y.Selector._foundCache; - YAHOO.log('getBySelector: clearing found cache of ' + foundCache.length + ' elements'); - for (var i = 0, len = foundCache.length; i < len; ++i) { - try { // IE no like delete - delete foundCache[i]._found; - } catch(e) { - foundCache[i].removeAttribute('_found'); - } - } - foundCache = []; - YAHOO.log('getBySelector: done clearing foundCache'); - }, - - - _getRegExp: function(str, flags) { - var regexCache = Y.Selector._regexCache; - flags = flags || ''; - if (!regexCache[str + flags]) { - regexCache[str + flags] = new RegExp(str, flags); - } - return regexCache[str + flags]; - }, - - _getChildren: function() { - if (document.documentElement.children && document.documentElement.children.tags) { // document for capability test - return function(node, tag) { - return (tag) ? node.children.tags(tag) : node.children || []; - }; - } else { - return function(node, tag) { - var children = [], - childNodes = node.childNodes; - - for (var i = 0, len = childNodes.length; i < len; ++i) { - if (childNodes[i].tagName) { - if (!tag || childNodes[i].tagName === tag) { - children.push(childNodes[i]); - } - } - } - return children; - }; - } - }(), - - _combinators: { - ' ': function(node, token) { - while ( (node = node.parentNode) ) { - if (Y.Selector._test(node, '', token.previous)) { - return true; - } - } - return false; - }, - - '>': function(node, token) { - return Y.Selector._test(node.parentNode, null, token.previous); - }, - - '+': function(node, token) { - var sib = node.previousSibling; - while (sib && sib.nodeType !== 1) { - sib = sib.previousSibling; - } - - if (sib && Y.Selector._test(sib, null, token.previous)) { - return true; - } - return false; - }, - - '~': function(node, token) { - var sib = node.previousSibling; - while (sib) { - if (sib.nodeType === 1 && Y.Selector._test(sib, null, token.previous)) { - return true; - } - sib = sib.previousSibling; - } - - return false; - } - }, - - - /* - an+b = get every _a_th node starting at the _b_th - 0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element - 1n+b = get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n") - an+0 = get every _a_th element, "0" may be omitted - */ - _getNth: function(node, expr, tag, reverse) { - Y.Selector._re.nth.test(expr); - var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_) - n = RegExp.$2, // "n" - oddeven = RegExp.$3, // "odd" or "even" - b = parseInt(RegExp.$4, 10) || 0, // start scan from element _b_ - result = [], - op; - - var siblings = Y.Selector._getChildren(node.parentNode, tag); - - if (oddeven) { - a = 2; // always every other - op = '+'; - n = 'n'; - b = (oddeven === 'odd') ? 1 : 0; - } else if ( isNaN(a) ) { - a = (n) ? 1 : 0; // start from the first or no repeat - } - - if (a === 0) { // just the first - if (reverse) { - b = siblings.length - b + 1; - } - - if (siblings[b - 1] === node) { - return true; - } else { - return false; - } - - } else if (a < 0) { - reverse = !!reverse; - a = Math.abs(a); - } - - if (!reverse) { - for (var i = b - 1, len = siblings.length; i < len; i += a) { - if ( i >= 0 && siblings[i] === node ) { - return true; - } - } - } else { - for (var i = siblings.length - b, len = siblings.length; i >= 0; i -= a) { - if ( i < len && siblings[i] === node ) { - return true; - } - } - } - return false; - }, - - _getId: function(attr) { - for (var i = 0, len = attr.length; i < len; ++i) { - if (attr[i][0] == 'id' && attr[i][1] === '=') { - return attr[i][2]; - } - } - }, - - _getIdTokenIndex: function(tokens) { - for (var i = 0, len = tokens.length; i < len; ++i) { - if (Y.Selector._getId(tokens[i].attributes)) { - return i; - } - } - return -1; - }, - - _patterns: { - tag: /^((?:-?[_a-z]+[\w-]*)|\*)/i, - attributes: /^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i, - pseudos: /^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i, - combinator: /^\s*([>+~]|\s)\s*/ - }, - - /** - Break selector into token units per simple selector. - Combinator is attached to left-hand selector. - */ - _tokenize: function(selector) { - var token = {}, // one token per simple selector (left selector holds combinator) - tokens = [], // array of tokens - id, // unique id for the simple selector (if found) - found = false, // whether or not any matches were found this pass - patterns = Y.Selector._patterns, - match; // the regex match - - selector = Y.Selector._replaceShorthand(selector); // convert ID and CLASS shortcuts to attributes - - /* - Search for selector patterns, store, and strip them from the selector string - until no patterns match (invalid selector) or we run out of chars. - - Multiple attributes and pseudos are allowed, in any order. - for example: - 'form:first-child[type=button]:not(button)[lang|=en]' - */ - do { - found = false; // reset after full pass - for (var re in patterns) { - if (YAHOO.lang.hasOwnProperty(patterns, re)) { - if (re != 'tag' && re != 'combinator') { // only one allowed - token[re] = token[re] || []; - } - if ( (match = patterns[re].exec(selector)) ) { // note assignment - found = true; - if (re != 'tag' && re != 'combinator') { // only one allowed - // capture ID for fast path to element - if (re === 'attributes' && match[1] === 'id') { - token.id = match[3]; - } - - token[re].push(match.slice(1)); - } else { // single selector (tag, combinator) - token[re] = match[1]; - } - selector = selector.replace(match[0], ''); // strip current match from selector - if (re === 'combinator' || !selector.length) { // next token or done - token.attributes = Y.Selector._fixAttributes(token.attributes); - token.pseudos = token.pseudos || []; - token.tag = token.tag ? token.tag.toUpperCase() : '*'; - tokens.push(token); - - token = { // prep next token - previous: token - }; - } - } - } - } - } while (found); - - return tokens; - }, - - - _fixAttributes: function(attr) { - var aliases = Y.Selector.attrAliases; - attr = attr || []; - for (var i = 0, len = attr.length; i < len; ++i) { - if (aliases[attr[i][0]]) { // convert reserved words, etc - attr[i][0] = aliases[attr[i][0]]; - } - if (!attr[i][1]) { // use exists operator - attr[i][1] = ''; - } - } - return attr; - }, - - _replaceShorthand: function(selector) { - var shorthand = Y.Selector.shorthand; - - //var attrs = selector.match(Y.Selector._patterns.attributes); // pull attributes to avoid false pos on "." and "#" - var attrs = selector.match(Y.Selector._re.attr); // pull attributes to avoid false pos on "." and "#" - if (attrs) { - selector = selector.replace(Y.Selector._re.attr, 'REPLACED_ATTRIBUTE'); - } - for (var re in shorthand) { - if (YAHOO.lang.hasOwnProperty(shorthand, re)) { - selector = selector.replace(Y.Selector._getRegExp(re, 'gi'), shorthand[re]); - } - } - - if (attrs) { - for (var i = 0, len = attrs.length; i < len; ++i) { - selector = selector.replace('REPLACED_ATTRIBUTE', attrs[i]); - } - } - return selector; - } -}; - -if (YAHOO.env.ua.ie && YAHOO.env.ua.ie < 8) { // rewrite class for IE < 8 - Y.Selector.attrAliases['class'] = 'className'; - Y.Selector.attrAliases['for'] = 'htmlFor'; -} - -})(); -YAHOO.register("selector", YAHOO.util.Selector, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-min.js deleted file mode 100644 index 05ae7f1045..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/selector/selector-min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var A=YAHOO.util;A.Selector={_foundCache:[],_regexCache:{},_re:{nth:/^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/,attr:/(\[.*\])/g,urls:/^(?:href|src)/},document:window.document,attrAliases:{},shorthand:{"\\#(-?[_a-z]+[-\\w]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w]*)":"[class~=$1]"},operators:{"=":function(B,C){return B===C;},"!=":function(B,C){return B!==C;},"~=":function(B,D){var C=" ";return(C+B+C).indexOf((C+D+C))>-1;},"|=":function(B,C){return B===C||B.slice(0,C.length+1)===C+"-";},"^=":function(B,C){return B.indexOf(C)===0;},"$=":function(B,C){return B.slice(-C.length)===C;},"*=":function(B,C){return B.indexOf(C)>-1;},"":function(B,C){return B;}},pseudos:{"root":function(B){return B===B.ownerDocument.documentElement;},"nth-child":function(B,C){return A.Selector._getNth(B,C);},"nth-last-child":function(B,C){return A.Selector._getNth(B,C,null,true);},"nth-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName);},"nth-last-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName,true);},"first-child":function(B){return A.Selector._getChildren(B.parentNode)[0]===B;},"last-child":function(C){var B=A.Selector._getChildren(C.parentNode);return B[B.length-1]===C;},"first-of-type":function(B,C){return A.Selector._getChildren(B.parentNode,B.tagName)[0];},"last-of-type":function(C,D){var B=A.Selector._getChildren(C.parentNode,C.tagName);return B[B.length-1];},"only-child":function(C){var B=A.Selector._getChildren(C.parentNode);return B.length===1&&B[0]===C;},"only-of-type":function(B){return A.Selector._getChildren(B.parentNode,B.tagName).length===1;},"empty":function(B){return B.childNodes.length===0;},"not":function(B,C){return !A.Selector.test(B,C);},"contains":function(B,D){var C=B.innerText||B.textContent||"";return C.indexOf(D)>-1;},"checked":function(B){return B.checked===true;}},test:function(F,D){F=A.Selector.document.getElementById(F)||F;if(!F){return false;}var C=D?D.split(","):[];if(C.length){for(var E=0,B=C.length;E1){var O;for(var I=0,J=D.length;I"){M=E;}}}}else{return P;}}if(M&&!B.length){B=M.getElementsByTagName(G.tag);}if(B.length){P=A.Selector._filter(B,G,N,F);}return P;},_clearFoundCache:function(){var E=A.Selector._foundCache;for(var C=0,B=E.length;C":function(C,B){return A.Selector._test(C.parentNode,null,B.previous);},"+":function(D,C){var B=D.previousSibling;while(B&&B.nodeType!==1){B=B.previousSibling;}if(B&&A.Selector._test(B,null,C.previous)){return true;}return false;},"~":function(D,C){var B=D.previousSibling;while(B){if(B.nodeType===1&&A.Selector._test(B,null,C.previous)){return true;}B=B.previousSibling;}return false;}},_getNth:function(C,L,N,G){A.Selector._re.nth.test(L);var K=parseInt(RegExp.$1,10),B=RegExp.$2,H=RegExp.$3,I=parseInt(RegExp.$4,10)||0,M=[],E;var J=A.Selector._getChildren(C.parentNode,N);if(H){K=2;E="+";B="n";I=(H==="odd")?1:0;}else{if(isNaN(K)){K=(B)?1:0;}}if(K===0){if(G){I=J.length-I+1;}if(J[I-1]===C){return true;}else{return false;}}else{if(K<0){G=!!G;K=Math.abs(K);}}if(!G){for(var D=I-1,F=J.length;D=0&&J[D]===C){return true;}}}else{for(var D=J.length-I,F=J.length;D>=0;D-=K){if(D+~]|\s)\s*/},_tokenize:function(B){var D={},H=[],I,G=false,F=A.Selector._patterns,C;B=A.Selector._replaceShorthand(B);do{G=false;for(var E in F){if(YAHOO.lang.hasOwnProperty(F,E)){if(E!="tag"&&E!="combinator"){D[E]=D[E]||[];}if((C=F[E].exec(B))){G=true;if(E!="tag"&&E!="combinator"){if(E==="attributes"&&C[1]==="id"){D.id=C[3];}D[E].push(C.slice(1));}else{D[E]=C[1];}B=B.replace(C[0],"");if(E==="combinator"||!B.length){D.attributes=A.Selector._fixAttributes(D.attributes);D.pseudos=D.pseudos||[];D.tag=D.tag?D.tag.toUpperCase():"*";H.push(D);D={previous:D};}}}}}while(G);return H;},_fixAttributes:function(C){var D=A.Selector.attrAliases;C=C||[];for(var E=0,B=C.length;E+~,]+)(?:-?[_a-z]+[-\\w]))+#(-?[_a-z]+[-\\w]*)': '[id=$1]', - '\\#(-?[_a-z]+[-\\w]*)': '[id=$1]', - '\\.(-?[_a-z]+[-\\w]*)': '[class~=$1]' - }, - - /** - * List of operators and corresponding boolean functions. - * These functions are passed the attribute and the current node's value of the attribute. - * @property operators - * @type object - */ - operators: { - '=': function(attr, val) { return attr === val; }, // Equality - '!=': function(attr, val) { return attr !== val; }, // Inequality - '~=': function(attr, val) { // Match one of space seperated words - var s = ' '; - return (s + attr + s).indexOf((s + val + s)) > -1; - }, - '|=': function(attr, val) { return attr === val || attr.slice(0, val.length + 1) === val + '-'; }, // Matches value followed by optional hyphen - '^=': function(attr, val) { return attr.indexOf(val) === 0; }, // Match starts with value - '$=': function(attr, val) { return attr.slice(-val.length) === val; }, // Match ends with value - '*=': function(attr, val) { return attr.indexOf(val) > -1; }, // Match contains value as substring - '': function(attr, val) { return attr; } // Just test for existence of attribute - }, - - /** - * List of pseudo-classes and corresponding boolean functions. - * These functions are called with the current node, and any value that was parsed with the pseudo regex. - * @property pseudos - * @type object - */ - pseudos: { - 'root': function(node) { - return node === node.ownerDocument.documentElement; - }, - - 'nth-child': function(node, val) { - return Y.Selector._getNth(node, val); - }, - - 'nth-last-child': function(node, val) { - return Y.Selector._getNth(node, val, null, true); - }, - - 'nth-of-type': function(node, val) { - return Y.Selector._getNth(node, val, node.tagName); - }, - - 'nth-last-of-type': function(node, val) { - return Y.Selector._getNth(node, val, node.tagName, true); - }, - - 'first-child': function(node) { - return Y.Selector._getChildren(node.parentNode)[0] === node; - }, - - 'last-child': function(node) { - var children = Y.Selector._getChildren(node.parentNode); - return children[children.length - 1] === node; - }, - - 'first-of-type': function(node, val) { - return Y.Selector._getChildren(node.parentNode, node.tagName)[0]; - }, - - 'last-of-type': function(node, val) { - var children = Y.Selector._getChildren(node.parentNode, node.tagName); - return children[children.length - 1]; - }, - - 'only-child': function(node) { - var children = Y.Selector._getChildren(node.parentNode); - return children.length === 1 && children[0] === node; - }, - - 'only-of-type': function(node) { - return Y.Selector._getChildren(node.parentNode, node.tagName).length === 1; - }, - - 'empty': function(node) { - return node.childNodes.length === 0; - }, - - 'not': function(node, simple) { - return !Y.Selector.test(node, simple); - }, - - 'contains': function(node, str) { - var text = node.innerText || node.textContent || ''; - return text.indexOf(str) > -1; - }, - 'checked': function(node) { - return node.checked === true; - } - }, - - /** - * Test if the supplied node matches the supplied selector. - * @method test - * - * @param {HTMLElement | String} node An id or node reference to the HTMLElement being tested. - * @param {string} selector The CSS Selector to test the node against. - * @return{boolean} Whether or not the node matches the selector. - * @static - - */ - test: function(node, selector) { - node = Y.Selector.document.getElementById(node) || node; - - if (!node) { - return false; - } - - var groups = selector ? selector.split(',') : []; - if (groups.length) { - for (var i = 0, len = groups.length; i < len; ++i) { - if ( Y.Selector._test(node, groups[i]) ) { // passes if ANY group matches - return true; - } - } - return false; - } - return Y.Selector._test(node, selector); - }, - - _test: function(node, selector, token, deDupe) { - token = token || Y.Selector._tokenize(selector).pop() || {}; - - if (!node.tagName || - (token.tag !== '*' && node.tagName !== token.tag) || - (deDupe && node._found) ) { - return false; - } - - if (token.attributes.length) { - var val, - ieFlag, - re_urls = Y.Selector._re.urls; - - if (!node.attributes || !node.attributes.length) { - return false; - } - for (var i = 0, attr; attr = token.attributes[i++];) { - ieFlag = (re_urls.test(attr[0])) ? 2 : 0; - val = node.getAttribute(attr[0], ieFlag); - if (val === null || val === undefined) { - return false; - } - if ( Y.Selector.operators[attr[1]] && - !Y.Selector.operators[attr[1]](val, attr[2])) { - return false; - } - } - } - - if (token.pseudos.length) { - for (var i = 0, len = token.pseudos.length; i < len; ++i) { - if (Y.Selector.pseudos[token.pseudos[i][0]] && - !Y.Selector.pseudos[token.pseudos[i][0]](node, token.pseudos[i][1])) { - return false; - } - } - } - - return (token.previous && token.previous.combinator !== ',') ? - Y.Selector._combinators[token.previous.combinator](node, token) : - true; - }, - - /** - * Filters a set of nodes based on a given CSS selector. - * @method filter - * - * @param {array} nodes A set of nodes/ids to filter. - * @param {string} selector The selector used to test each node. - * @return{array} An array of nodes from the supplied array that match the given selector. - * @static - */ - filter: function(nodes, selector) { - nodes = nodes || []; - - var node, - result = [], - tokens = Y.Selector._tokenize(selector); - - if (!nodes.item) { // if not HTMLCollection, handle arrays of ids and/or nodes - for (var i = 0, len = nodes.length; i < len; ++i) { - if (!nodes[i].tagName) { // tagName limits to HTMLElements - node = Y.Selector.document.getElementById(nodes[i]); - if (node) { // skip IDs that return null - nodes[i] = node; - } else { - } - } - } - } - result = Y.Selector._filter(nodes, Y.Selector._tokenize(selector)[0]); - return result; - }, - - _filter: function(nodes, token, firstOnly, deDupe) { - var result = firstOnly ? null : [], - foundCache = Y.Selector._foundCache; - - for (var i = 0, len = nodes.length; i < len; i++) { - if (! Y.Selector._test(nodes[i], '', token, deDupe)) { - continue; - } - - if (firstOnly) { - return nodes[i]; - } - if (deDupe) { - if (nodes[i]._found) { - continue; - } - nodes[i]._found = true; - foundCache[foundCache.length] = nodes[i]; - } - - result[result.length] = nodes[i]; - } - - return result; - }, - - /** - * Retrieves a set of nodes based on a given CSS selector. - * @method query - * - * @param {string} selector The CSS Selector to test the node against. - * @param {HTMLElement | String} root optional An id or HTMLElement to start the query from. Defaults to Selector.document. - * @param {Boolean} firstOnly optional Whether or not to return only the first match. - * @return {Array} An array of nodes that match the given selector. - * @static - */ - query: function(selector, root, firstOnly) { - var result = Y.Selector._query(selector, root, firstOnly); - return result; - }, - - - _query: function(selector, root, firstOnly, deDupe) { - var result = (firstOnly) ? null : [], - node; - - if (!selector) { - return result; - } - - var groups = selector.split(','); // TODO: handle comma in attribute/pseudo - - if (groups.length > 1) { - var found; - for (var i = 0, len = groups.length; i < len; ++i) { - found = Y.Selector._query(groups[i], root, firstOnly, true); - result = firstOnly ? found : result.concat(found); - } - Y.Selector._clearFoundCache(); - return result; - } - - if (root && !root.nodeName) { // assume ID - root = Y.Selector.document.getElementById(root); - if (!root) { - return result; - } - } - - root = root || Y.Selector.document; - - if (root.nodeName !== '#document') { // prepend with root selector - Y.Dom.generateId(root); // TODO: cleanup after? - selector = root.tagName + '#' + root.id + ' ' + selector; - node = root; - root = root.ownerDocument; - } - - var tokens = Y.Selector._tokenize(selector); - var idToken = tokens[Y.Selector._getIdTokenIndex(tokens)], - nodes = [], - id, - token = tokens.pop() || {}; - - if (idToken) { - id = Y.Selector._getId(idToken.attributes); - } - - // use id shortcut when possible - if (id) { - node = node || Y.Selector.document.getElementById(id); - - if (node && (root.nodeName === '#document' || Y.Dom.isAncestor(root, node))) { - if ( Y.Selector._test(node, null, idToken) ) { - if (idToken === token) { - nodes = [node]; // simple selector - } else if (idToken.combinator === ' ' || idToken.combinator === '>') { - root = node; // start from here - } - } - } else { - return result; - } - } - - if (root && !nodes.length) { - nodes = root.getElementsByTagName(token.tag); - } - - if (nodes.length) { - result = Y.Selector._filter(nodes, token, firstOnly, deDupe); - } - - return result; - }, - - - _clearFoundCache: function() { - var foundCache = Y.Selector._foundCache; - for (var i = 0, len = foundCache.length; i < len; ++i) { - try { // IE no like delete - delete foundCache[i]._found; - } catch(e) { - foundCache[i].removeAttribute('_found'); - } - } - foundCache = []; - }, - - - _getRegExp: function(str, flags) { - var regexCache = Y.Selector._regexCache; - flags = flags || ''; - if (!regexCache[str + flags]) { - regexCache[str + flags] = new RegExp(str, flags); - } - return regexCache[str + flags]; - }, - - _getChildren: function() { - if (document.documentElement.children && document.documentElement.children.tags) { // document for capability test - return function(node, tag) { - return (tag) ? node.children.tags(tag) : node.children || []; - }; - } else { - return function(node, tag) { - var children = [], - childNodes = node.childNodes; - - for (var i = 0, len = childNodes.length; i < len; ++i) { - if (childNodes[i].tagName) { - if (!tag || childNodes[i].tagName === tag) { - children.push(childNodes[i]); - } - } - } - return children; - }; - } - }(), - - _combinators: { - ' ': function(node, token) { - while ( (node = node.parentNode) ) { - if (Y.Selector._test(node, '', token.previous)) { - return true; - } - } - return false; - }, - - '>': function(node, token) { - return Y.Selector._test(node.parentNode, null, token.previous); - }, - - '+': function(node, token) { - var sib = node.previousSibling; - while (sib && sib.nodeType !== 1) { - sib = sib.previousSibling; - } - - if (sib && Y.Selector._test(sib, null, token.previous)) { - return true; - } - return false; - }, - - '~': function(node, token) { - var sib = node.previousSibling; - while (sib) { - if (sib.nodeType === 1 && Y.Selector._test(sib, null, token.previous)) { - return true; - } - sib = sib.previousSibling; - } - - return false; - } - }, - - - /* - an+b = get every _a_th node starting at the _b_th - 0n+b = no repeat ("0" and "n" may both be omitted (together) , e.g. "0n+1" or "1", not "0+1"), return only the _b_th element - 1n+b = get every element starting from b ("1" may may be omitted, e.g. "1n+0" or "n+0" or "n") - an+0 = get every _a_th element, "0" may be omitted - */ - _getNth: function(node, expr, tag, reverse) { - Y.Selector._re.nth.test(expr); - var a = parseInt(RegExp.$1, 10), // include every _a_ elements (zero means no repeat, just first _a_) - n = RegExp.$2, // "n" - oddeven = RegExp.$3, // "odd" or "even" - b = parseInt(RegExp.$4, 10) || 0, // start scan from element _b_ - result = [], - op; - - var siblings = Y.Selector._getChildren(node.parentNode, tag); - - if (oddeven) { - a = 2; // always every other - op = '+'; - n = 'n'; - b = (oddeven === 'odd') ? 1 : 0; - } else if ( isNaN(a) ) { - a = (n) ? 1 : 0; // start from the first or no repeat - } - - if (a === 0) { // just the first - if (reverse) { - b = siblings.length - b + 1; - } - - if (siblings[b - 1] === node) { - return true; - } else { - return false; - } - - } else if (a < 0) { - reverse = !!reverse; - a = Math.abs(a); - } - - if (!reverse) { - for (var i = b - 1, len = siblings.length; i < len; i += a) { - if ( i >= 0 && siblings[i] === node ) { - return true; - } - } - } else { - for (var i = siblings.length - b, len = siblings.length; i >= 0; i -= a) { - if ( i < len && siblings[i] === node ) { - return true; - } - } - } - return false; - }, - - _getId: function(attr) { - for (var i = 0, len = attr.length; i < len; ++i) { - if (attr[i][0] == 'id' && attr[i][1] === '=') { - return attr[i][2]; - } - } - }, - - _getIdTokenIndex: function(tokens) { - for (var i = 0, len = tokens.length; i < len; ++i) { - if (Y.Selector._getId(tokens[i].attributes)) { - return i; - } - } - return -1; - }, - - _patterns: { - tag: /^((?:-?[_a-z]+[\w-]*)|\*)/i, - attributes: /^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i, - pseudos: /^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i, - combinator: /^\s*([>+~]|\s)\s*/ - }, - - /** - Break selector into token units per simple selector. - Combinator is attached to left-hand selector. - */ - _tokenize: function(selector) { - var token = {}, // one token per simple selector (left selector holds combinator) - tokens = [], // array of tokens - id, // unique id for the simple selector (if found) - found = false, // whether or not any matches were found this pass - patterns = Y.Selector._patterns, - match; // the regex match - - selector = Y.Selector._replaceShorthand(selector); // convert ID and CLASS shortcuts to attributes - - /* - Search for selector patterns, store, and strip them from the selector string - until no patterns match (invalid selector) or we run out of chars. - - Multiple attributes and pseudos are allowed, in any order. - for example: - 'form:first-child[type=button]:not(button)[lang|=en]' - */ - do { - found = false; // reset after full pass - for (var re in patterns) { - if (YAHOO.lang.hasOwnProperty(patterns, re)) { - if (re != 'tag' && re != 'combinator') { // only one allowed - token[re] = token[re] || []; - } - if ( (match = patterns[re].exec(selector)) ) { // note assignment - found = true; - if (re != 'tag' && re != 'combinator') { // only one allowed - // capture ID for fast path to element - if (re === 'attributes' && match[1] === 'id') { - token.id = match[3]; - } - - token[re].push(match.slice(1)); - } else { // single selector (tag, combinator) - token[re] = match[1]; - } - selector = selector.replace(match[0], ''); // strip current match from selector - if (re === 'combinator' || !selector.length) { // next token or done - token.attributes = Y.Selector._fixAttributes(token.attributes); - token.pseudos = token.pseudos || []; - token.tag = token.tag ? token.tag.toUpperCase() : '*'; - tokens.push(token); - - token = { // prep next token - previous: token - }; - } - } - } - } - } while (found); - - return tokens; - }, - - - _fixAttributes: function(attr) { - var aliases = Y.Selector.attrAliases; - attr = attr || []; - for (var i = 0, len = attr.length; i < len; ++i) { - if (aliases[attr[i][0]]) { // convert reserved words, etc - attr[i][0] = aliases[attr[i][0]]; - } - if (!attr[i][1]) { // use exists operator - attr[i][1] = ''; - } - } - return attr; - }, - - _replaceShorthand: function(selector) { - var shorthand = Y.Selector.shorthand; - - //var attrs = selector.match(Y.Selector._patterns.attributes); // pull attributes to avoid false pos on "." and "#" - var attrs = selector.match(Y.Selector._re.attr); // pull attributes to avoid false pos on "." and "#" - if (attrs) { - selector = selector.replace(Y.Selector._re.attr, 'REPLACED_ATTRIBUTE'); - } - for (var re in shorthand) { - if (YAHOO.lang.hasOwnProperty(shorthand, re)) { - selector = selector.replace(Y.Selector._getRegExp(re, 'gi'), shorthand[re]); - } - } - - if (attrs) { - for (var i = 0, len = attrs.length; i < len; ++i) { - selector = selector.replace('REPLACED_ATTRIBUTE', attrs[i]); - } - } - return selector; - } -}; - -if (YAHOO.env.ua.ie && YAHOO.env.ua.ie < 8) { // rewrite class for IE < 8 - Y.Selector.attrAliases['class'] = 'className'; - Y.Selector.attrAliases['for'] = 'htmlFor'; -} - -})(); -YAHOO.register("selector", YAHOO.util.Selector, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-fader.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-fader.gif deleted file mode 100644 index 7db8eb72ce5849c507d61c2bc0dd4f02f51f8178..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 433 zcmV;i0Z#r$Nk%w1VbK5_0J8`H>+9?F_4VQ5;mOI#r>CchiHWzjx7XL#|Ns9000000 z00000000000000000000A^8LW000O8EC2ui0MP&(000F45Xniay*TU5yZ>M)j$~<` zXsWJk>%MR-&%s!WcbJ3w*L%NCkTcvAHN(S5DPo44Am~Txp?0hs>_)4>ax-5{_%gPX zD`!f2vX-dFX%FDt8WCzgE z($mz{*4NnC+S}aS-rwNi*#c(b=I7|?>g(*=M3r#X%8geqYc2CJSxX%)4VR9919 bafuyEwyfE+Xw#})%eJlCw{YW@hyVaP!M@qB diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-h.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-h.gif deleted file mode 100644 index 996288916e82bf2972bb4b8097f1b4a0869955d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 212 zcmV;_04x7TNk%w1VbK5_0HOu};o;%Q$;qdur-_M)x3{;~*Vq65{{R30A^8LW000I6 zEC2ui0MP&(000A-Xu90~Fv>}*y*TU5yZ>M)j$~<`XsWJk>%MR-&vb3yc&_h!@BhG{ za7Zi~kI1BQ$!t1BgQ#>$ty-_xtai)odcWYXI4gJ*&gisy&2GEj@VIs;jK6uCK7M Ova__cwzs%A2>?48g>Yp6 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-v-e.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/bg-v-e.gif deleted file mode 100644 index d2a4216571d2323b95201cd13e07fc2b65934f7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 476 zcmV<20VDoLNk%w1VI%;;0J8}I_4W1Z>+9+1>Fw?9)6>)2+uOIdx2LD4*Voto|Nj60 z00000000000000000000A^8LW000R9EC2ui03-my000F4Fv&@)y*TU5yZ>M)0f6`k z2r`)6ks4Mi&q(RH2+VG{zGuCkCMd)Zi`%Mnvb-j+NE{-A zpfsAT^>S9sANZ~9p2*p`x}C1SbNoDfb$~;HZiGOFQHoQHRgPDXS(00dX)|kolwF%& zonfD2p=G0IrE#Zod3p(mMyYr{gRq*beYAnLv$}`4g}jTvmok~Tvc15K$&bsC&6CfS z(VWws)u7j+*`(X1-KgKH$HC*u<;>^K>CofDDaF6*((=^w*7n%=+WOr5-u~bKieuHv zSE6vS2)eqkFp0re2x|#U$O?@+cn2p+RQQl#M~4xKjd2VaZ=^<%6+gaF$%N$|k{M0P zObHX>$&wY^)d)EAR!xsTLEel>bEwUpyNm)=DikR)rYnO+h1ybTRjMzsKCyI>XHlo* zz?u__j;uPf?9k3rTaWEMxA|gp9r(4bPpt*5W`(+9?F_4V!T?c3Yi)6>)G>FKw(x2LD4*Voto|Nj60 z00000000000000000000A^8LW000R9EC2ui03-n5000F4Fv&@)y*TU5yZ>M)1%db# z2qKu>ks2)LB5`naUe$Rb%^?jF5?t^_yflh-^g;Ix9iB^kPjarXfkzSKvm137eG4lFF3Kmd=>a zn$n!qo;kDDqu96FtKO~LyW+j%zvjW{!|KKC$L`7S%ks_i&-T&y)B4r?*Pu#pof4P| zTr7Xv0HRt$kfFg^2){)Pr?BA>i=iIons~6H#(^J>3vz_$apcC5C`(}s7}B9hkS|51 zeAV(|&5SW!&diq6W>1_uyZvN2bfM3n20000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUy{z*hZRCwB~lEH0+Fc3xm3`q1q2~@G2 zC21jwvQg?t0b2zHusLLpT;fB(oB4oI7Ui;ozvcPX9G?Ezmgkq_BY+3w(-RDO&86=U zuHW&p`y!Y!0POIM4ly$5CRfpaS?A)gN|dI9%uVd$?p|;)A%AX z?K$DCd&buoN8}WFHvX73DS670Q{bgc}pyXbWXGwofuW#>%jMw_{E5HE18P=8$X_z(u000020000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUz21!IgRCwB~ltFHTFc3v&29`+k)|z+^s=-E>*o-|~D5$xnX<$^8EDc_yM0rPGBJ zy8IZkq!M@nH0uggUDtmc%2B$$4+562FLY~Ls;X-B&35;IYGTSV2~H{^-oXJce|*Ry zpqY1fPLPzn`=ltYh1mA7f1!zHDlVzDmW0Eh{N&((r%5ew1eDxeb#TDT=h^yU$Nng6 z@YeR3!=dgj9D5z7wKJs@c-sD)G%0w3l2YL1(-fKX$-x0np%Zob!i?ki|5vIkX&44F z#;ksA8UjyHLe(gwC<^Zoczk#}e(8CiaID{V0R{lEWzhkQ=J3G)0000}*y*TU5yZ>M)j$~<`XsWJk>%MR-&vb3yc&_h!@BhG{ za7Zi~kI1BQ$!t1BgQ#>$ty-_xtai)odcWYXI4gJ*&gisy&2GEj@VIs;jK6uCK7M Ova__cwzs%A2>?48g>Yp6 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/skins/sam/bg-v.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/skins/sam/bg-v.gif deleted file mode 100644 index 8e287cd52222c75c8f921cfdd4b4ae02b783c0e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 481 zcmV<70UrKGNk%w1VI%+9?F_4V!T?c3Yi)6>)G>FKw(x2LD4*Voto|Nj60 z00000000000000000000A^8LW000R9EC2ui03-n5000F4Fv&@)y*TU5yZ>M)1%db# z2qKu>ks2)LB5`naUe$Rb%^?jF5?t^_yflh-^g;Ix9iB^kPjarXfkzSKvm137eG4lFF3Kmd=>a zn$n!qo;kDDqu96FtKO~LyW+j%zvjW{!|KKC$L`7S%ks_i&-T&y)B4r?*Pu#pof4P| zTr7Xv0HRt$kfFg^2){)Pr?BA>i=iIons~6H#(^J>3vz_$apcC5C`(}s7}B9hkS|51 zeAV(|&5SW!&diq6W>1_uyZvN2bfM3nCcRdwspWzh-D^Z*g>be1BeGVr*`4mzbG*eSr4(_|W=$;!;Xz`(Jzwzjyt&(PA~;^V@?!lk9Bud%eY zx48KD`1$$y-rwNAz{2F@<@)>kxVyczx4HB5^z`-hT3cO!f`;|>_TJv!|Ns9000000 z00000A^8LW002AyEC2ui05AX=000L6K%Q_&EEG41Z}@bU8VzYVh*c{2L@{Qds_ z0Gnx;wIPpzg9sBUT*$EDuMM*@VHSiu1VV}&NwTELlOGO1m^DF% z2mvr-%A85Frp*-xCd^Wxg9M9VpFo2O9ZIxlhXV>`JX|ZaW?%oL ziIb}fZ&^V{_v9MC_0=MWy|d20{~avm%%RcJ+Sbm)?<}F#+t=UE$?PJaGHv>d o>5S5@f=crjES%3M;>N46V&y6YSt)<{4I4L!viNV??#N&b04j%$=>Px# diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-fader.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-fader.gif deleted file mode 100644 index 5eb6aab8b99cc227b05f45d1a2cd0843fd2f6764..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 645 zcmZ?wbhEHbv|^B8xN697@BaNmhYue(bZGCs{TnxK+`4W1hK(Dy@7S?-@7^?a z-27X&ZWWhS)-^OYG&Pr&S3h|4_|~1fZ{NLt|KY>uFJE51e)astiziQ?zJB{QDkiR> zsqN$E&mTU1yl~;dy?gimg8>84K=CIFBLjmWgAPas$WIJx{}0S4@X(R!Ke6PJMTF)2 z3oA;z*1EAD6U{mOwrc-_4L5cx?Tfo*Xu+7g`}T+JvuecVZC$jd?)-V_g!;yY=BC=V zN(1du!*l@yh6xiVO`gDIFm1;4Su>~1onRo)-D{w@blLJ1OIZz8uU)f#-O5c%7cA13 zGtk%t44Pf+1_uruJaTy7@m&UT+r$mj&tJHB={%po)$7-8-ne|{yn*;OAp^B1PoF)1 z!f){E&Fgn>UwnLGAhb=)K=bFX-+z8`82o2qlF`^O|6q-Q&W%$H$t{Q51(dC17@8Ly z?UK;XwFrrpE4&ESB>!R_ns@2?R*AmCH6;o+eM;m@s&2g6v!Cn$T*lbOlDe0qj{ z_Bo%O#wmQFIldo!c5TVLETeX#>w{zK>+2hmPtWt+{p~fsV9wl|XLoOZfB!%;_jcty SJ3c->I9((DoQ^fcHPGR|NrmUxo7*1-RCb{TD^9|$x~+zA31jJ{Dq&teyv=+ z?&z@-4<0@|d+x%62M-@TezI!K`o&9^uUNHa$IjjF-o3wc`O3B(yLRv0fAiMu=PzCy zJAU%*+jrNl-#Bpa@ZG!j9zA+|@zUiTyY`$sb$aXeofj@%x^eT?moHz>oISUB>-KFs zcCTK$e&gn?GiJ?MzH-f*H*b%hIJI`&hMzxwo;iDd`_A2)w`@Co=G@~aPrrZv@$TKb zt=o6)*}H$u+6_N`{M@#E*WbT?zkd7nU{Yi1 z?rG}tX7rvo*_xS?aULf#b33b;q381D7Oa}Bww5+4HcAVKH}i9u+wI!DTaQbmiJQ;m z$kAgiEDBAEX5PS<^yXD*GM0A$2EKzjOOvvfJuo8e**Kas zXLi#j4;d#0W-gIS2OAVbMf)^jPJHO-6K_&c&~Vzg=%|vg7)O($Q|Ix1g{c=T6jr#f dsAvSQayis=P(jr(>C_xamBUMBH!?6-0|0CW2iyPv diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-s.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-s.gif deleted file mode 100644 index a0670a42c9d12f8bd634fafa75f1e5a7083ca46d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 615 zcmZ?wbhEHb6l4%(c;>^fcHPGR|NrmUxo7*1-RCb{TD^9|$x~+zA31jJ{Dq&teyv=+ z?&z@-4<0@|d+x%62M-@TezI!K`o&9^uUNHa$IjjF-o3wc`O3B(yLRv0fAiMu=PzCy zJAU%*+jrNl-#Bpa@ZG!j9zA+|@zUiTyY`$sb$aXeofj@%x^eT?moHz>oISUB>-KFs zcCTK$e&gn?GiJ?MzH-f*H*b%hIJI`&hMzxwo;iDd`_A2)w`@Co=G@~aPrrZv@$TKb zt=o6)*}H$u+6_N`{M@#E*WbT?zkd7n<7hILcK}ADgE~u-qM7%bx9_}pRhqc@T)ut( z;liTO#Ls1J$HXP_!illf(YEM=$Ds|0lXwO6M6?nV+YYN(a4j)7l5)I(h0#e(!k}TX g0t3@DmIx(=hLesOzFTTMIUKmBn-p_#u`pNz0L6O<7ytkO diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-w.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/assets/thumb-w.gif deleted file mode 100644 index 79b3101a35daeb7281873a10fd3106341fee52c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 340 zcmZ?wbhEHb6lLINxT?)??fQ*9d-ttaxwfx=^44wJCr_QRXwkCcCr|hEPF%ZwX|ZaW?%oL ziIb@mD8~mrPaD#e2X_! z=$sRwKo)`rG2p-dX40{|**+=I7C9ZENq~aAD?D>+7E|LBdsQG8EL^le&|OMaVdbjT3cUU-qVk(IZ}H#e=Ez_T0N}!n(EtDd diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-debug.js deleted file mode 100644 index 5b1457c960..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-debug.js +++ /dev/null @@ -1,2114 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The Slider component is a UI control that enables the user to adjust - * values in a finite range along one or two axes. Typically, the Slider - * control is used in a web application as a rich, visual replacement - * for an input box that takes a number as input. The Slider control can - * also easily accommodate a second dimension, providing x,y output for - * a selection point chosen from a rectangular region. - * - * @module slider - * @title Slider Widget - * @namespace YAHOO.widget - * @requires yahoo,dom,dragdrop,event - * @optional animation - */ - (function () { - -var getXY = YAHOO.util.Dom.getXY, - Event = YAHOO.util.Event, - _AS = Array.prototype.slice; - -/** - * A DragDrop implementation that can be used as a background for a - * slider. It takes a reference to the thumb instance - * so it can delegate some of the events to it. The goal is to make the - * thumb jump to the location on the background when the background is - * clicked. - * - * @class Slider - * @extends YAHOO.util.DragDrop - * @uses YAHOO.util.EventProvider - * @constructor - * @param {String} id The id of the element linked to this instance - * @param {String} sGroup The group of related DragDrop items - * @param {SliderThumb} oThumb The thumb for this slider - * @param {String} sType The type of slider (horiz, vert, region) - */ -function Slider(sElementId, sGroup, oThumb, sType) { - - Slider.ANIM_AVAIL = (!YAHOO.lang.isUndefined(YAHOO.util.Anim)); - - if (sElementId) { - this.init(sElementId, sGroup, true); - this.initSlider(sType); - this.initThumb(oThumb); - } -} - -YAHOO.lang.augmentObject(Slider,{ - /** - * Factory method for creating a horizontal slider - * @method YAHOO.widget.Slider.getHorizSlider - * @static - * @param {String} sBGElId the id of the slider's background element - * @param {String} sHandleElId the id of the thumb element - * @param {int} iLeft the number of pixels the element can move left - * @param {int} iRight the number of pixels the element can move right - * @param {int} iTickSize optional parameter for specifying that the element - * should move a certain number pixels at a time. - * @return {Slider} a horizontal slider control - */ - getHorizSlider : - function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) { - return new Slider(sBGElId, sBGElId, - new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, - iLeft, iRight, 0, 0, iTickSize), "horiz"); - }, - - /** - * Factory method for creating a vertical slider - * @method YAHOO.widget.Slider.getVertSlider - * @static - * @param {String} sBGElId the id of the slider's background element - * @param {String} sHandleElId the id of the thumb element - * @param {int} iUp the number of pixels the element can move up - * @param {int} iDown the number of pixels the element can move down - * @param {int} iTickSize optional parameter for specifying that the element - * should move a certain number pixels at a time. - * @return {Slider} a vertical slider control - */ - getVertSlider : - function (sBGElId, sHandleElId, iUp, iDown, iTickSize) { - return new Slider(sBGElId, sBGElId, - new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0, - iUp, iDown, iTickSize), "vert"); - }, - - /** - * Factory method for creating a slider region like the one in the color - * picker example - * @method YAHOO.widget.Slider.getSliderRegion - * @static - * @param {String} sBGElId the id of the slider's background element - * @param {String} sHandleElId the id of the thumb element - * @param {int} iLeft the number of pixels the element can move left - * @param {int} iRight the number of pixels the element can move right - * @param {int} iUp the number of pixels the element can move up - * @param {int} iDown the number of pixels the element can move down - * @param {int} iTickSize optional parameter for specifying that the element - * should move a certain number pixels at a time. - * @return {Slider} a slider region control - */ - getSliderRegion : - function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) { - return new Slider(sBGElId, sBGElId, - new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight, - iUp, iDown, iTickSize), "region"); - }, - - /** - * Constant for valueChangeSource, indicating that the user clicked or - * dragged the slider to change the value. - * @property Slider.SOURCE_UI_EVENT - * @final - * @static - * @default 1 - */ - SOURCE_UI_EVENT : 1, - - /** - * Constant for valueChangeSource, indicating that the value was altered - * by a programmatic call to setValue/setRegionValue. - * @property Slider.SOURCE_SET_VALUE - * @final - * @static - * @default 2 - */ - SOURCE_SET_VALUE : 2, - - /** - * Constant for valueChangeSource, indicating that the value was altered - * by hitting any of the supported keyboard characters. - * @property Slider.SOURCE_KEY_EVENT - * @final - * @static - * @default 2 - */ - SOURCE_KEY_EVENT : 3, - - /** - * By default, animation is available if the animation utility is detected. - * @property Slider.ANIM_AVAIL - * @static - * @type boolean - */ - ANIM_AVAIL : false -},true); - -YAHOO.extend(Slider, YAHOO.util.DragDrop, { - - /** - * Tracks the state of the mouse button to aid in when events are fired. - * - * @property _mouseDown - * @type boolean - * @default false - * @private - */ - _mouseDown : false, - - /** - * Override the default setting of dragOnly to true. - * @property dragOnly - * @type boolean - * @default true - */ - dragOnly : true, - - /** - * Initializes the slider. Executed in the constructor - * @method initSlider - * @param {string} sType the type of slider (horiz, vert, region) - */ - initSlider: function(sType) { - - /** - * The type of the slider (horiz, vert, region) - * @property type - * @type string - */ - this.type = sType; - - //this.removeInvalidHandleType("A"); - - this.logger = new YAHOO.widget.LogWriter(this.toString()); - - /** - * Event the fires when the value of the control changes. If - * the control is animated the event will fire every point - * along the way. - * @event change - * @param {int} newOffset|x the new offset for normal sliders, or the new - * x offset for region sliders - * @param {int} y the number of pixels the thumb has moved on the y axis - * (region sliders only) - */ - this.createEvent("change", this); - - /** - * Event that fires at the beginning of a slider thumb move. - * @event slideStart - */ - this.createEvent("slideStart", this); - - /** - * Event that fires at the end of a slider thumb move - * @event slideEnd - */ - this.createEvent("slideEnd", this); - - /** - * Overrides the isTarget property in YAHOO.util.DragDrop - * @property isTarget - * @private - */ - this.isTarget = false; - - /** - * Flag that determines if the thumb will animate when moved - * @property animate - * @type boolean - */ - this.animate = Slider.ANIM_AVAIL; - - /** - * Set to false to disable a background click thumb move - * @property backgroundEnabled - * @type boolean - */ - this.backgroundEnabled = true; - - /** - * Adjustment factor for tick animation, the more ticks, the - * faster the animation (by default) - * @property tickPause - * @type int - */ - this.tickPause = 40; - - /** - * Enables the arrow, home and end keys, defaults to true. - * @property enableKeys - * @type boolean - */ - this.enableKeys = true; - - /** - * Specifies the number of pixels the arrow keys will move the slider. - * Default is 20. - * @property keyIncrement - * @type int - */ - this.keyIncrement = 20; - - /** - * moveComplete is set to true when the slider has moved to its final - * destination. For animated slider, this value can be checked in - * the onChange handler to make it possible to execute logic only - * when the move is complete rather than at all points along the way. - * Deprecated because this flag is only useful when the background is - * clicked and the slider is animated. If the user drags the thumb, - * the flag is updated when the drag is over ... the final onDrag event - * fires before the mouseup the ends the drag, so the implementer will - * never see it. - * - * @property moveComplete - * @type Boolean - * @deprecated use the slideEnd event instead - */ - this.moveComplete = true; - - /** - * If animation is configured, specifies the length of the animation - * in seconds. - * @property animationDuration - * @type int - * @default 0.2 - */ - this.animationDuration = 0.2; - - /** - * Constant for valueChangeSource, indicating that the user clicked or - * dragged the slider to change the value. - * @property SOURCE_UI_EVENT - * @final - * @default 1 - * @deprecated use static Slider.SOURCE_UI_EVENT - */ - this.SOURCE_UI_EVENT = 1; - - /** - * Constant for valueChangeSource, indicating that the value was altered - * by a programmatic call to setValue/setRegionValue. - * @property SOURCE_SET_VALUE - * @final - * @default 2 - * @deprecated use static Slider.SOURCE_SET_VALUE - */ - this.SOURCE_SET_VALUE = 2; - - /** - * When the slider value changes, this property is set to identify where - * the update came from. This will be either 1, meaning the slider was - * clicked or dragged, or 2, meaning that it was set via a setValue() call. - * This can be used within event handlers to apply some of the logic only - * when dealing with one source or another. - * @property valueChangeSource - * @type int - * @since 2.3.0 - */ - this.valueChangeSource = 0; - - /** - * Indicates whether or not events will be supressed for the current - * slide operation - * @property _silent - * @type boolean - * @private - */ - this._silent = false; - - /** - * Saved offset used to protect against NaN problems when slider is - * set to display:none - * @property lastOffset - * @type [int, int] - */ - this.lastOffset = [0,0]; - }, - - /** - * Initializes the slider's thumb. Executed in the constructor. - * @method initThumb - * @param {YAHOO.widget.SliderThumb} t the slider thumb - */ - initThumb: function(t) { - - var self = this; - - /** - * A YAHOO.widget.SliderThumb instance that we will use to - * reposition the thumb when the background is clicked - * @property thumb - * @type YAHOO.widget.SliderThumb - */ - this.thumb = t; - - t.cacheBetweenDrags = true; - - if (t._isHoriz && t.xTicks && t.xTicks.length) { - this.tickPause = Math.round(360 / t.xTicks.length); - } else if (t.yTicks && t.yTicks.length) { - this.tickPause = Math.round(360 / t.yTicks.length); - } - - this.logger.log("tickPause: " + this.tickPause); - - // delegate thumb methods - t.onAvailable = function() { - return self.setStartSliderState(); - }; - t.onMouseDown = function () { - self._mouseDown = true; - self.logger.log('thumb mousedown'); - return self.focus(); - }; - t.startDrag = function() { - self.logger.log('thumb startDrag'); - self._slideStart(); - }; - t.onDrag = function() { - self.logger.log('thumb drag'); - self.fireEvents(true); - }; - t.onMouseUp = function() { - self.thumbMouseUp(); - }; - - }, - - /** - * Executed when the slider element is available - * @method onAvailable - */ - onAvailable: function() { - this._bindKeyEvents(); - }, - - /** - * Sets up the listeners for keydown and key press events. - * - * @method _bindKeyEvents - * @protected - */ - _bindKeyEvents : function () { - Event.on(this.id, "keydown", this.handleKeyDown, this, true); - Event.on(this.id, "keypress", this.handleKeyPress, this, true); - }, - - /** - * Executed when a keypress event happens with the control focused. - * Prevents the default behavior for navigation keys. The actual - * logic for moving the slider thumb in response to a key event - * happens in handleKeyDown. - * @param {Event} e the keypress event - */ - handleKeyPress: function(e) { - if (this.enableKeys) { - var kc = Event.getCharCode(e); - - switch (kc) { - case 0x25: // left - case 0x26: // up - case 0x27: // right - case 0x28: // down - case 0x24: // home - case 0x23: // end - Event.preventDefault(e); - break; - default: - } - } - }, - - /** - * Executed when a keydown event happens with the control focused. - * Updates the slider value and display when the keypress is an - * arrow key, home, or end as long as enableKeys is set to true. - * @param {Event} e the keydown event - */ - handleKeyDown: function(e) { - if (this.enableKeys) { - var kc = Event.getCharCode(e), - t = this.thumb, - h = this.getXValue(), - v = this.getYValue(), - changeValue = true; - - switch (kc) { - - // left - case 0x25: h -= this.keyIncrement; break; - - // up - case 0x26: v -= this.keyIncrement; break; - - // right - case 0x27: h += this.keyIncrement; break; - - // down - case 0x28: v += this.keyIncrement; break; - - // home - case 0x24: h = t.leftConstraint; - v = t.topConstraint; - break; - - // end - case 0x23: h = t.rightConstraint; - v = t.bottomConstraint; - break; - - default: changeValue = false; - } - - if (changeValue) { - if (t._isRegion) { - this._setRegionValue(Slider.SOURCE_KEY_EVENT, h, v, true); - } else { - this._setValue(Slider.SOURCE_KEY_EVENT, - (t._isHoriz ? h : v), true); - } - Event.stopEvent(e); - } - - } - }, - - /** - * Initialization that sets up the value offsets once the elements are ready - * @method setStartSliderState - */ - setStartSliderState: function() { - - this.logger.log("Fixing state"); - - this.setThumbCenterPoint(); - - /** - * The basline position of the background element, used - * to determine if the background has moved since the last - * operation. - * @property baselinePos - * @type [int, int] - */ - this.baselinePos = getXY(this.getEl()); - - this.thumb.startOffset = this.thumb.getOffsetFromParent(this.baselinePos); - - if (this.thumb._isRegion) { - if (this.deferredSetRegionValue) { - this._setRegionValue.apply(this, this.deferredSetRegionValue); - this.deferredSetRegionValue = null; - } else { - this.setRegionValue(0, 0, true, true, true); - } - } else { - if (this.deferredSetValue) { - this._setValue.apply(this, this.deferredSetValue); - this.deferredSetValue = null; - } else { - this.setValue(0, true, true, true); - } - } - }, - - /** - * When the thumb is available, we cache the centerpoint of the element so - * we can position the element correctly when the background is clicked - * @method setThumbCenterPoint - */ - setThumbCenterPoint: function() { - - var el = this.thumb.getEl(); - - if (el) { - /** - * The center of the slider element is stored so we can - * place it in the correct position when the background is clicked. - * @property thumbCenterPoint - * @type {"x": int, "y": int} - */ - this.thumbCenterPoint = { - x: parseInt(el.offsetWidth/2, 10), - y: parseInt(el.offsetHeight/2, 10) - }; - } - - }, - - /** - * Locks the slider, overrides YAHOO.util.DragDrop - * @method lock - */ - lock: function() { - this.logger.log("locking"); - this.thumb.lock(); - this.locked = true; - }, - - /** - * Unlocks the slider, overrides YAHOO.util.DragDrop - * @method unlock - */ - unlock: function() { - this.logger.log("unlocking"); - this.thumb.unlock(); - this.locked = false; - }, - - /** - * Handles mouseup event on the thumb - * @method thumbMouseUp - * @private - */ - thumbMouseUp: function() { - this._mouseDown = false; - this.logger.log("thumb mouseup"); - if (!this.isLocked()) { - this.endMove(); - } - - }, - - onMouseUp: function() { - this._mouseDown = false; - this.logger.log("background mouseup"); - if (this.backgroundEnabled && !this.isLocked()) { - this.endMove(); - } - }, - - /** - * Returns a reference to this slider's thumb - * @method getThumb - * @return {SliderThumb} this slider's thumb - */ - getThumb: function() { - return this.thumb; - }, - - /** - * Try to focus the element when clicked so we can add - * accessibility features - * @method focus - * @private - */ - focus: function() { - this.logger.log("focus"); - this.valueChangeSource = Slider.SOURCE_UI_EVENT; - - // Focus the background element if possible - var el = this.getEl(); - - if (el.focus) { - try { - el.focus(); - } catch(e) { - // Prevent permission denied unhandled exception in FF that can - // happen when setting focus while another element is handling - // the blur. @TODO this is still writing to the error log - // (unhandled error) in FF1.5 with strict error checking on. - } - } - - this.verifyOffset(); - - return !this.isLocked(); - }, - - /** - * Event that fires when the value of the slider has changed - * @method onChange - * @param {int} firstOffset the number of pixels the thumb has moved - * from its start position. Normal horizontal and vertical sliders will only - * have the firstOffset. Regions will have both, the first is the horizontal - * offset, the second the vertical. - * @param {int} secondOffset the y offset for region sliders - * @deprecated use instance.subscribe("change") instead - */ - onChange: function (firstOffset, secondOffset) { - /* override me */ - this.logger.log("onChange: " + firstOffset + ", " + secondOffset); - }, - - /** - * Event that fires when the at the beginning of the slider thumb move - * @method onSlideStart - * @deprecated use instance.subscribe("slideStart") instead - */ - onSlideStart: function () { - /* override me */ - this.logger.log("onSlideStart"); - }, - - /** - * Event that fires at the end of a slider thumb move - * @method onSliderEnd - * @deprecated use instance.subscribe("slideEnd") instead - */ - onSlideEnd: function () { - /* override me */ - this.logger.log("onSlideEnd"); - }, - - /** - * Returns the slider's thumb offset from the start position - * @method getValue - * @return {int} the current value - */ - getValue: function () { - return this.thumb.getValue(); - }, - - /** - * Returns the slider's thumb X offset from the start position - * @method getXValue - * @return {int} the current horizontal offset - */ - getXValue: function () { - return this.thumb.getXValue(); - }, - - /** - * Returns the slider's thumb Y offset from the start position - * @method getYValue - * @return {int} the current vertical offset - */ - getYValue: function () { - return this.thumb.getYValue(); - }, - - /** - * Provides a way to set the value of the slider in code. - * - * @method setValue - * @param {int} newOffset the number of pixels the thumb should be - * positioned away from the initial start point - * @param {boolean} skipAnim set to true to disable the animation - * for this move action (but not others). - * @param {boolean} force ignore the locked setting and set value anyway - * @param {boolean} silent when true, do not fire events - * @return {boolean} true if the move was performed, false if it failed - */ - setValue: function() { - var args = _AS.call(arguments); - args.unshift(Slider.SOURCE_SET_VALUE); - return this._setValue.apply(this,args); - }, - - /** - * Worker function to execute the value set operation. Accepts type of - * set operation in addition to the usual setValue params. - * - * @method _setValue - * @param source {int} what triggered the set (e.g. Slider.SOURCE_SET_VALUE) - * @param {int} newOffset the number of pixels the thumb should be - * positioned away from the initial start point - * @param {boolean} skipAnim set to true to disable the animation - * for this move action (but not others). - * @param {boolean} force ignore the locked setting and set value anyway - * @param {boolean} silent when true, do not fire events - * @return {boolean} true if the move was performed, false if it failed - * @protected - */ - _setValue: function(source, newOffset, skipAnim, force, silent) { - var t = this.thumb, newX, newY; - - if (!t.available) { - this.logger.log("defer setValue until after onAvailble"); - this.deferredSetValue = arguments; - return false; - } - - if (this.isLocked() && !force) { - this.logger.log("Can't set the value, the control is locked"); - return false; - } - - if ( isNaN(newOffset) ) { - this.logger.log("setValue, Illegal argument: " + newOffset); - return false; - } - - if (t._isRegion) { - this.logger.log("Call to setValue for region Slider ignored. Use setRegionValue","warn"); - return false; - } - - this.logger.log("setValue " + newOffset); - - this._silent = silent; - this.valueChangeSource = source || Slider.SOURCE_SET_VALUE; - - t.lastOffset = [newOffset, newOffset]; - this.verifyOffset(); - - this._slideStart(); - - if (t._isHoriz) { - newX = t.initPageX + newOffset + this.thumbCenterPoint.x; - this.moveThumb(newX, t.initPageY, skipAnim); - } else { - newY = t.initPageY + newOffset + this.thumbCenterPoint.y; - this.moveThumb(t.initPageX, newY, skipAnim); - } - - return true; - }, - - /** - * Provides a way to set the value of the region slider in code. - * @method setRegionValue - * @param {int} newOffset the number of pixels the thumb should be - * positioned away from the initial start point (x axis for region) - * @param {int} newOffset2 the number of pixels the thumb should be - * positioned away from the initial start point (y axis for region) - * @param {boolean} skipAnim set to true to disable the animation - * for this move action (but not others). - * @param {boolean} force ignore the locked setting and set value anyway - * @param {boolean} silent when true, do not fire events - * @return {boolean} true if the move was performed, false if it failed - */ - setRegionValue : function () { - var args = _AS.call(arguments); - args.unshift(Slider.SOURCE_SET_VALUE); - return this._setRegionValue.apply(this,args); - }, - - /** - * Worker function to execute the value set operation. Accepts type of - * set operation in addition to the usual setValue params. - * - * @method _setRegionValue - * @param source {int} what triggered the set (e.g. Slider.SOURCE_SET_VALUE) - * @param {int} newOffset the number of pixels the thumb should be - * positioned away from the initial start point (x axis for region) - * @param {int} newOffset2 the number of pixels the thumb should be - * positioned away from the initial start point (y axis for region) - * @param {boolean} skipAnim set to true to disable the animation - * for this move action (but not others). - * @param {boolean} force ignore the locked setting and set value anyway - * @param {boolean} silent when true, do not fire events - * @return {boolean} true if the move was performed, false if it failed - * @protected - */ - _setRegionValue: function(source, newOffset, newOffset2, skipAnim, force, silent) { - var t = this.thumb, newX, newY; - - if (!t.available) { - this.logger.log("defer setRegionValue until after onAvailble"); - this.deferredSetRegionValue = arguments; - return false; - } - - if (this.isLocked() && !force) { - this.logger.log("Can't set the value, the control is locked"); - return false; - } - - if ( isNaN(newOffset) ) { - this.logger.log("setRegionValue, Illegal argument: " + newOffset); - return false; - } - - if (!t._isRegion) { - this.logger.log("Call to setRegionValue for non-region Slider ignored. Use setValue","warn"); - return false; - } - - this._silent = silent; - - this.valueChangeSource = source || Slider.SOURCE_SET_VALUE; - - t.lastOffset = [newOffset, newOffset2]; - this.verifyOffset(); - - this._slideStart(); - - newX = t.initPageX + newOffset + this.thumbCenterPoint.x; - newY = t.initPageY + newOffset2 + this.thumbCenterPoint.y; - this.moveThumb(newX, newY, skipAnim); - - return true; - }, - - /** - * Checks the background position element position. If it has moved from the - * baseline position, the constraints for the thumb are reset - * @method verifyOffset - * @return {boolean} True if the offset is the same as the baseline. - */ - verifyOffset: function() { - - var xy = getXY(this.getEl()), - t = this.thumb; - - if (!this.thumbCenterPoint || !this.thumbCenterPoint.x) { - this.setThumbCenterPoint(); - } - - if (xy) { - - this.logger.log("newPos: " + xy); - - if (xy[0] != this.baselinePos[0] || xy[1] != this.baselinePos[1]) { - this.logger.log("background moved, resetting constraints"); - - // Reset background - this.setInitPosition(); - this.baselinePos = xy; - - // Reset thumb - t.initPageX = this.initPageX + t.startOffset[0]; - t.initPageY = this.initPageY + t.startOffset[1]; - t.deltaSetXY = null; - this.resetThumbConstraints(); - - return false; - } - } - - return true; - }, - - /** - * Move the associated slider moved to a timeout to try to get around the - * mousedown stealing moz does when I move the slider element between the - * cursor and the background during the mouseup event - * @method moveThumb - * @param {int} x the X coordinate of the click - * @param {int} y the Y coordinate of the click - * @param {boolean} skipAnim don't animate if the move happend onDrag - * @param {boolean} midMove set to true if this is not terminating - * the slider movement - * @private - */ - moveThumb: function(x, y, skipAnim, midMove) { - - var t = this.thumb, - self = this, - p,_p,anim; - - if (!t.available) { - this.logger.log("thumb is not available yet, aborting move"); - return; - } - - this.logger.log("move thumb, x: " + x + ", y: " + y); - - t.setDelta(this.thumbCenterPoint.x, this.thumbCenterPoint.y); - - _p = t.getTargetCoord(x, y); - p = [Math.round(_p.x), Math.round(_p.y)]; - - if (this.animate && t._graduated && !skipAnim) { - this.logger.log("graduated"); - this.lock(); - - // cache the current thumb pos - this.curCoord = getXY(this.thumb.getEl()); - this.curCoord = [Math.round(this.curCoord[0]), Math.round(this.curCoord[1])]; - - setTimeout( function() { self.moveOneTick(p); }, this.tickPause ); - - } else if (this.animate && Slider.ANIM_AVAIL && !skipAnim) { - this.logger.log("animating to " + p); - - this.lock(); - - anim = new YAHOO.util.Motion( - t.id, { points: { to: p } }, - this.animationDuration, - YAHOO.util.Easing.easeOut ); - - anim.onComplete.subscribe( function() { - self.logger.log("Animation completed _mouseDown:" + self._mouseDown); - self.unlock(); - if (!self._mouseDown) { - self.endMove(); - } - }); - anim.animate(); - - } else { - t.setDragElPos(x, y); - if (!midMove && !this._mouseDown) { - this.endMove(); - } - } - }, - - _slideStart: function() { - if (!this._sliding) { - if (!this._silent) { - this.onSlideStart(); - this.fireEvent("slideStart"); - } - this._sliding = true; - this.moveComplete = false; // for backward compatibility. Deprecated - } - }, - - _slideEnd: function() { - if (this._sliding) { - // Reset state before firing slideEnd - var silent = this._silent; - this._sliding = false; - this.moveComplete = true; // for backward compatibility. Deprecated - this._silent = false; - if (!silent) { - this.onSlideEnd(); - this.fireEvent("slideEnd"); - } - } - }, - - /** - * Move the slider one tick mark towards its final coordinate. Used - * for the animation when tick marks are defined - * @method moveOneTick - * @param {int[]} the destination coordinate - * @private - */ - moveOneTick: function(finalCoord) { - - var t = this.thumb, - self = this, - nextCoord = null, - tmpX, tmpY; - - if (t._isRegion) { - nextCoord = this._getNextX(this.curCoord, finalCoord); - tmpX = (nextCoord !== null) ? nextCoord[0] : this.curCoord[0]; - nextCoord = this._getNextY(this.curCoord, finalCoord); - tmpY = (nextCoord !== null) ? nextCoord[1] : this.curCoord[1]; - - nextCoord = tmpX !== this.curCoord[0] || tmpY !== this.curCoord[1] ? - [ tmpX, tmpY ] : null; - } else if (t._isHoriz) { - nextCoord = this._getNextX(this.curCoord, finalCoord); - } else { - nextCoord = this._getNextY(this.curCoord, finalCoord); - } - - this.logger.log("moveOneTick: " + - " finalCoord: " + finalCoord + - " this.curCoord: " + this.curCoord + - " nextCoord: " + nextCoord); - - if (nextCoord) { - - // cache the position - this.curCoord = nextCoord; - - // move to the next coord - this.thumb.alignElWithMouse(t.getEl(), nextCoord[0] + this.thumbCenterPoint.x, nextCoord[1] + this.thumbCenterPoint.y); - - // check if we are in the final position, if not make a recursive call - if (!(nextCoord[0] == finalCoord[0] && nextCoord[1] == finalCoord[1])) { - setTimeout(function() { self.moveOneTick(finalCoord); }, - this.tickPause); - } else { - this.unlock(); - if (!this._mouseDown) { - this.endMove(); - } - } - } else { - this.unlock(); - if (!this._mouseDown) { - this.endMove(); - } - } - }, - - /** - * Returns the next X tick value based on the current coord and the target coord. - * @method _getNextX - * @private - */ - _getNextX: function(curCoord, finalCoord) { - this.logger.log("getNextX: " + curCoord + ", " + finalCoord); - var t = this.thumb, - thresh, - tmp = [], - nextCoord = null; - - if (curCoord[0] > finalCoord[0]) { - thresh = t.tickSize - this.thumbCenterPoint.x; - tmp = t.getTargetCoord( curCoord[0] - thresh, curCoord[1] ); - nextCoord = [tmp.x, tmp.y]; - } else if (curCoord[0] < finalCoord[0]) { - thresh = t.tickSize + this.thumbCenterPoint.x; - tmp = t.getTargetCoord( curCoord[0] + thresh, curCoord[1] ); - nextCoord = [tmp.x, tmp.y]; - } else { - // equal, do nothing - } - - return nextCoord; - }, - - /** - * Returns the next Y tick value based on the current coord and the target coord. - * @method _getNextY - * @private - */ - _getNextY: function(curCoord, finalCoord) { - var t = this.thumb, - thresh, - tmp = [], - nextCoord = null; - - if (curCoord[1] > finalCoord[1]) { - thresh = t.tickSize - this.thumbCenterPoint.y; - tmp = t.getTargetCoord( curCoord[0], curCoord[1] - thresh ); - nextCoord = [tmp.x, tmp.y]; - } else if (curCoord[1] < finalCoord[1]) { - thresh = t.tickSize + this.thumbCenterPoint.y; - tmp = t.getTargetCoord( curCoord[0], curCoord[1] + thresh ); - nextCoord = [tmp.x, tmp.y]; - } else { - // equal, do nothing - } - - return nextCoord; - }, - - /** - * Resets the constraints before moving the thumb. - * @method b4MouseDown - * @private - */ - b4MouseDown: function(e) { - if (!this.backgroundEnabled) { - return false; - } - - this.thumb.autoOffset(); - this.baselinePos = []; - }, - - /** - * Handles the mousedown event for the slider background - * @method onMouseDown - * @private - */ - onMouseDown: function(e) { - if (!this.backgroundEnabled || this.isLocked()) { - return false; - } - - this._mouseDown = true; - - var x = Event.getPageX(e), - y = Event.getPageY(e); - - this.logger.log("bg mousedown: " + x + "," + y); - - this.focus(); - this._slideStart(); - this.moveThumb(x, y); - }, - - /** - * Handles the onDrag event for the slider background - * @method onDrag - * @private - */ - onDrag: function(e) { - this.logger.log("background drag"); - if (this.backgroundEnabled && !this.isLocked()) { - var x = Event.getPageX(e), - y = Event.getPageY(e); - this.moveThumb(x, y, true, true); - this.fireEvents(); - } - }, - - /** - * Fired when the slider movement ends - * @method endMove - * @private - */ - endMove: function () { - this.logger.log("endMove"); - this.unlock(); - this.fireEvents(); - this._slideEnd(); - }, - - /** - * Resets the X and Y contraints for the thumb. Used in lieu of the thumb - * instance's inherited resetConstraints because some logic was not - * applicable. - * @method resetThumbConstraints - * @protected - */ - resetThumbConstraints: function () { - var t = this.thumb; - - t.setXConstraint(t.leftConstraint, t.rightConstraint, t.xTickSize); - t.setYConstraint(t.topConstraint, t.bottomConstraint, t.xTickSize); - }, - - /** - * Fires the change event if the value has been changed. Ignored if we are in - * the middle of an animation as the event will fire when the animation is - * complete - * @method fireEvents - * @param {boolean} thumbEvent set to true if this event is fired from an event - * that occurred on the thumb. If it is, the state of the - * thumb dd object should be correct. Otherwise, the event - * originated on the background, so the thumb state needs to - * be refreshed before proceeding. - * @private - */ - fireEvents: function (thumbEvent) { - - var t = this.thumb, newX, newY, newVal; - - if (!thumbEvent) { - t.cachePosition(); - } - - if (! this.isLocked()) { - if (t._isRegion) { - newX = t.getXValue(); - newY = t.getYValue(); - - if (newX != this.previousX || newY != this.previousY) { - if (!this._silent) { - this.onChange(newX, newY); - this.fireEvent("change", { x: newX, y: newY }); - } - } - - this.previousX = newX; - this.previousY = newY; - - } else { - newVal = t.getValue(); - if (newVal != this.previousVal) { - this.logger.log("Firing onchange: " + newVal); - if (!this._silent) { - this.onChange( newVal ); - this.fireEvent("change", newVal); - } - } - this.previousVal = newVal; - } - - } - }, - - /** - * Slider toString - * @method toString - * @return {string} string representation of the instance - */ - toString: function () { - return ("Slider (" + this.type +") " + this.id); - } - -}); - -YAHOO.lang.augmentProto(Slider, YAHOO.util.EventProvider); - -YAHOO.widget.Slider = Slider; -})(); -/** - * A drag and drop implementation to be used as the thumb of a slider. - * @class SliderThumb - * @extends YAHOO.util.DD - * @constructor - * @param {String} id the id of the slider html element - * @param {String} sGroup the group of related DragDrop items - * @param {int} iLeft the number of pixels the element can move left - * @param {int} iRight the number of pixels the element can move right - * @param {int} iUp the number of pixels the element can move up - * @param {int} iDown the number of pixels the element can move down - * @param {int} iTickSize optional parameter for specifying that the element - * should move a certain number pixels at a time. - */ -YAHOO.widget.SliderThumb = function(id, sGroup, iLeft, iRight, iUp, iDown, iTickSize) { - - if (id) { - YAHOO.widget.SliderThumb.superclass.constructor.call(this, id, sGroup); - - /** - * The id of the thumbs parent HTML element (the slider background - * element). - * @property parentElId - * @type string - */ - this.parentElId = sGroup; - } - - - this.logger = new YAHOO.widget.LogWriter(this.toString()); - - /** - * Overrides the isTarget property in YAHOO.util.DragDrop - * @property isTarget - * @private - */ - this.isTarget = false; - - /** - * The tick size for this slider - * @property tickSize - * @type int - * @private - */ - this.tickSize = iTickSize; - - /** - * Informs the drag and drop util that the offsets should remain when - * resetting the constraints. This preserves the slider value when - * the constraints are reset - * @property maintainOffset - * @type boolean - * @private - */ - this.maintainOffset = true; - - this.initSlider(iLeft, iRight, iUp, iDown, iTickSize); - - /** - * Turns off the autoscroll feature in drag and drop - * @property scroll - * @private - */ - this.scroll = false; - -}; - -YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, { - - /** - * The (X and Y) difference between the thumb location and its parent - * (the slider background) when the control is instantiated. - * @property startOffset - * @type [int, int] - */ - startOffset: null, - - /** - * Override the default setting of dragOnly to true. - * @property dragOnly - * @type boolean - * @default true - */ - dragOnly : true, - - /** - * Flag used to figure out if this is a horizontal or vertical slider - * @property _isHoriz - * @type boolean - * @private - */ - _isHoriz: false, - - /** - * Cache the last value so we can check for change - * @property _prevVal - * @type int - * @private - */ - _prevVal: 0, - - /** - * The slider is _graduated if there is a tick interval defined - * @property _graduated - * @type boolean - * @private - */ - _graduated: false, - - - /** - * Returns the difference between the location of the thumb and its parent. - * @method getOffsetFromParent - * @param {[int, int]} parentPos Optionally accepts the position of the parent - * @type [int, int] - */ - getOffsetFromParent0: function(parentPos) { - var myPos = YAHOO.util.Dom.getXY(this.getEl()), - ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId); - - return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ]; - }, - - getOffsetFromParent: function(parentPos) { - - var el = this.getEl(), newOffset, - myPos,ppos,l,t,deltaX,deltaY,newLeft,newTop; - - if (!this.deltaOffset) { - - myPos = YAHOO.util.Dom.getXY(el); - ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId); - - newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ]; - - l = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 ); - t = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 ); - - deltaX = l - newOffset[0]; - deltaY = t - newOffset[1]; - - if (isNaN(deltaX) || isNaN(deltaY)) { - this.logger.log("element does not have a position style def yet"); - } else { - this.deltaOffset = [deltaX, deltaY]; - } - - } else { - newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 ); - newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 ); - - newOffset = [newLeft + this.deltaOffset[0], newTop + this.deltaOffset[1]]; - } - - return newOffset; - }, - - /** - * Set up the slider, must be called in the constructor of all subclasses - * @method initSlider - * @param {int} iLeft the number of pixels the element can move left - * @param {int} iRight the number of pixels the element can move right - * @param {int} iUp the number of pixels the element can move up - * @param {int} iDown the number of pixels the element can move down - * @param {int} iTickSize the width of the tick interval. - */ - initSlider: function (iLeft, iRight, iUp, iDown, iTickSize) { - this.initLeft = iLeft; - this.initRight = iRight; - this.initUp = iUp; - this.initDown = iDown; - - this.setXConstraint(iLeft, iRight, iTickSize); - this.setYConstraint(iUp, iDown, iTickSize); - - if (iTickSize && iTickSize > 1) { - this._graduated = true; - } - - this._isHoriz = (iLeft || iRight); - this._isVert = (iUp || iDown); - this._isRegion = (this._isHoriz && this._isVert); - - }, - - /** - * Clear's the slider's ticks - * @method clearTicks - */ - clearTicks: function () { - YAHOO.widget.SliderThumb.superclass.clearTicks.call(this); - this.tickSize = 0; - this._graduated = false; - }, - - - /** - * Gets the current offset from the element's start position in - * pixels. - * @method getValue - * @return {int} the number of pixels (positive or negative) the - * slider has moved from the start position. - */ - getValue: function () { - return (this._isHoriz) ? this.getXValue() : this.getYValue(); - }, - - /** - * Gets the current X offset from the element's start position in - * pixels. - * @method getXValue - * @return {int} the number of pixels (positive or negative) the - * slider has moved horizontally from the start position. - */ - getXValue: function () { - if (!this.available) { - return 0; - } - var newOffset = this.getOffsetFromParent(); - if (YAHOO.lang.isNumber(newOffset[0])) { - this.lastOffset = newOffset; - return (newOffset[0] - this.startOffset[0]); - } else { - this.logger.log("can't get offset, using old value: " + - this.lastOffset[0]); - return (this.lastOffset[0] - this.startOffset[0]); - } - }, - - /** - * Gets the current Y offset from the element's start position in - * pixels. - * @method getYValue - * @return {int} the number of pixels (positive or negative) the - * slider has moved vertically from the start position. - */ - getYValue: function () { - if (!this.available) { - return 0; - } - var newOffset = this.getOffsetFromParent(); - if (YAHOO.lang.isNumber(newOffset[1])) { - this.lastOffset = newOffset; - return (newOffset[1] - this.startOffset[1]); - } else { - this.logger.log("can't get offset, using old value: " + - this.lastOffset[1]); - return (this.lastOffset[1] - this.startOffset[1]); - } - }, - - /** - * Thumb toString - * @method toString - * @return {string} string representation of the instance - */ - toString: function () { - return "SliderThumb " + this.id; - }, - - /** - * The onchange event for the handle/thumb is delegated to the YAHOO.widget.Slider - * instance it belongs to. - * @method onChange - * @private - */ - onChange: function (x, y) { - } - -}); -/** - * A slider with two thumbs, one that represents the min value and - * the other the max. Actually a composition of two sliders, both with - * the same background. The constraints for each slider are adjusted - * dynamically so that the min value of the max slider is equal or greater - * to the current value of the min slider, and the max value of the min - * slider is the current value of the max slider. - * Constructor assumes both thumbs are positioned absolutely at the 0 mark on - * the background. - * - * @namespace YAHOO.widget - * @class DualSlider - * @uses YAHOO.util.EventProvider - * @constructor - * @param {Slider} minSlider The Slider instance used for the min value thumb - * @param {Slider} maxSlider The Slider instance used for the max value thumb - * @param {int} range The number of pixels the thumbs may move within - * @param {Array} initVals (optional) [min,max] Initial thumb placement - */ -(function () { - -var Event = YAHOO.util.Event, - YW = YAHOO.widget; - -function DualSlider(minSlider, maxSlider, range, initVals) { - - var self = this, - ready = { min : false, max : false }, - minThumbOnMouseDown, maxThumbOnMouseDown; - - /** - * A slider instance that keeps track of the lower value of the range. - * read only - * @property minSlider - * @type Slider - */ - this.minSlider = minSlider; - - /** - * A slider instance that keeps track of the upper value of the range. - * read only - * @property maxSlider - * @type Slider - */ - this.maxSlider = maxSlider; - - /** - * The currently active slider (min or max). read only - * @property activeSlider - * @type Slider - */ - this.activeSlider = minSlider; - - /** - * Is the DualSlider oriented horizontally or vertically? - * read only - * @property isHoriz - * @type boolean - */ - this.isHoriz = minSlider.thumb._isHoriz; - - //FIXME: this is horrible - minThumbOnMouseDown = this.minSlider.thumb.onMouseDown; - maxThumbOnMouseDown = this.maxSlider.thumb.onMouseDown; - this.minSlider.thumb.onMouseDown = function() { - self.activeSlider = self.minSlider; - minThumbOnMouseDown.apply(this,arguments); - }; - this.maxSlider.thumb.onMouseDown = function () { - self.activeSlider = self.maxSlider; - maxThumbOnMouseDown.apply(this,arguments); - }; - - this.minSlider.thumb.onAvailable = function () { - minSlider.setStartSliderState(); - ready.min = true; - if (ready.max) { - self.fireEvent('ready',self); - } - }; - this.maxSlider.thumb.onAvailable = function () { - maxSlider.setStartSliderState(); - ready.max = true; - if (ready.min) { - self.fireEvent('ready',self); - } - }; - - // dispatch mousedowns to the active slider - minSlider.onMouseDown = - maxSlider.onMouseDown = function(e) { - return this.backgroundEnabled && self._handleMouseDown(e); - }; - - // Fix the drag behavior so that only the active slider - // follows the drag - minSlider.onDrag = - maxSlider.onDrag = function(e) { - self._handleDrag(e); - }; - - // Likely only the minSlider's onMouseUp will be executed, but both are - // overridden just to be safe - minSlider.onMouseUp = - maxSlider.onMouseUp = function (e) { - self._handleMouseUp(e); - }; - - // Replace the _bindKeyEvents for the minSlider and remove that for the - // maxSlider since they share the same bg element. - minSlider._bindKeyEvents = function () { - self._bindKeyEvents(this); - }; - maxSlider._bindKeyEvents = function () {}; - - // The core events for each slider are handled so we can expose a single - // event for when the event happens on either slider - minSlider.subscribe("change", this._handleMinChange, minSlider, this); - minSlider.subscribe("slideStart", this._handleSlideStart, minSlider, this); - minSlider.subscribe("slideEnd", this._handleSlideEnd, minSlider, this); - - maxSlider.subscribe("change", this._handleMaxChange, maxSlider, this); - maxSlider.subscribe("slideStart", this._handleSlideStart, maxSlider, this); - maxSlider.subscribe("slideEnd", this._handleSlideEnd, maxSlider, this); - - /** - * Event that fires when the slider is finished setting up - * @event ready - * @param {DualSlider} dualslider the DualSlider instance - */ - this.createEvent("ready", this); - - /** - * Event that fires when either the min or max value changes - * @event change - * @param {DualSlider} dualslider the DualSlider instance - */ - this.createEvent("change", this); - - /** - * Event that fires when one of the thumbs begins to move - * @event slideStart - * @param {Slider} activeSlider the moving slider - */ - this.createEvent("slideStart", this); - - /** - * Event that fires when one of the thumbs finishes moving - * @event slideEnd - * @param {Slider} activeSlider the moving slider - */ - this.createEvent("slideEnd", this); - - // Validate initial values - initVals = YAHOO.lang.isArray(initVals) ? initVals : [0,range]; - initVals[0] = Math.min(Math.max(parseInt(initVals[0],10)|0,0),range); - initVals[1] = Math.max(Math.min(parseInt(initVals[1],10)|0,range),0); - // Swap initVals if min > max - if (initVals[0] > initVals[1]) { - initVals.splice(0,2,initVals[1],initVals[0]); - } - this.minVal = initVals[0]; - this.maxVal = initVals[1]; - - // Set values so initial assignment when the slider thumbs are ready will - // use these values - this.minSlider.setValue(this.minVal,true,true,true); - this.maxSlider.setValue(this.maxVal,true,true,true); - - YAHOO.log("Setting initial values " + this.minVal + ", " + this.maxVal,"info","DualSlider"); -} - -DualSlider.prototype = { - - /** - * The current value of the min thumb. read only. - * @property minVal - * @type int - */ - minVal : -1, - - /** - * The current value of the max thumb. read only. - * @property maxVal - * @type int - */ - maxVal : -1, - - /** - * Pixel distance to maintain between thumbs. - * @property minRange - * @type int - * @default 0 - */ - minRange : 0, - - /** - * Executed when one of the sliders fires the slideStart event - * @method _handleSlideStart - * @private - */ - _handleSlideStart: function(data, slider) { - this.fireEvent("slideStart", slider); - }, - - /** - * Executed when one of the sliders fires the slideEnd event - * @method _handleSlideEnd - * @private - */ - _handleSlideEnd: function(data, slider) { - this.fireEvent("slideEnd", slider); - }, - - /** - * Overrides the onDrag method for both sliders - * @method _handleDrag - * @private - */ - _handleDrag: function(e) { - YW.Slider.prototype.onDrag.call(this.activeSlider, e); - }, - - /** - * Executed when the min slider fires the change event - * @method _handleMinChange - * @private - */ - _handleMinChange: function() { - this.activeSlider = this.minSlider; - this.updateValue(); - }, - - /** - * Executed when the max slider fires the change event - * @method _handleMaxChange - * @private - */ - _handleMaxChange: function() { - this.activeSlider = this.maxSlider; - this.updateValue(); - }, - - /** - * Set up the listeners for the keydown and keypress events. - * - * @method _bindKeyEvents - * @protected - */ - _bindKeyEvents : function (slider) { - Event.on(slider.id,'keydown', this._handleKeyDown, this,true); - Event.on(slider.id,'keypress',this._handleKeyPress,this,true); - }, - - /** - * Delegate event handling to the active Slider. See Slider.handleKeyDown. - * - * @method _handleKeyDown - * @param e {Event} the mousedown DOM event - * @protected - */ - _handleKeyDown : function (e) { - this.activeSlider.handleKeyDown.apply(this.activeSlider,arguments); - }, - - /** - * Delegate event handling to the active Slider. See Slider.handleKeyPress. - * - * @method _handleKeyPress - * @param e {Event} the mousedown DOM event - * @protected - */ - _handleKeyPress : function (e) { - this.activeSlider.handleKeyPress.apply(this.activeSlider,arguments); - }, - - /** - * Sets the min and max thumbs to new values. - * @method setValues - * @param min {int} Pixel offset to assign to the min thumb - * @param max {int} Pixel offset to assign to the max thumb - * @param skipAnim {boolean} (optional) Set to true to skip thumb animation. - * Default false - * @param force {boolean} (optional) ignore the locked setting and set - * value anyway. Default false - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - */ - setValues : function (min, max, skipAnim, force, silent) { - var mins = this.minSlider, - maxs = this.maxSlider, - mint = mins.thumb, - maxt = maxs.thumb, - self = this, - done = { min : false, max : false }; - - // Clear constraints to prevent animated thumbs from prematurely - // stopping when hitting a constraint that's moving with the other - // thumb. - if (mint._isHoriz) { - mint.setXConstraint(mint.leftConstraint,maxt.rightConstraint,mint.tickSize); - maxt.setXConstraint(mint.leftConstraint,maxt.rightConstraint,maxt.tickSize); - } else { - mint.setYConstraint(mint.topConstraint,maxt.bottomConstraint,mint.tickSize); - maxt.setYConstraint(mint.topConstraint,maxt.bottomConstraint,maxt.tickSize); - } - - // Set up one-time slideEnd callbacks to call updateValue when both - // thumbs have been set - this._oneTimeCallback(mins,'slideEnd',function () { - done.min = true; - if (done.max) { - self.updateValue(silent); - // Clean the slider's slideEnd events on a timeout since this - // will be executed from inside the event's fire - setTimeout(function () { - self._cleanEvent(mins,'slideEnd'); - self._cleanEvent(maxs,'slideEnd'); - },0); - } - }); - - this._oneTimeCallback(maxs,'slideEnd',function () { - done.max = true; - if (done.min) { - self.updateValue(silent); - // Clean both sliders' slideEnd events on a timeout since this - // will be executed from inside one of the event's fire - setTimeout(function () { - self._cleanEvent(mins,'slideEnd'); - self._cleanEvent(maxs,'slideEnd'); - },0); - } - }); - - // Must emit Slider slideEnd event to propagate to updateValue - mins.setValue(min,skipAnim,force,false); - maxs.setValue(max,skipAnim,force,false); - }, - - /** - * Set the min thumb position to a new value. - * @method setMinValue - * @param min {int} Pixel offset for min thumb - * @param skipAnim {boolean} (optional) Set to true to skip thumb animation. - * Default false - * @param force {boolean} (optional) ignore the locked setting and set - * value anyway. Default false - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - */ - setMinValue : function (min, skipAnim, force, silent) { - var mins = this.minSlider, - self = this; - - this.activeSlider = mins; - - // Use a one-time event callback to delay the updateValue call - // until after the slide operation is done - self = this; - this._oneTimeCallback(mins,'slideEnd',function () { - self.updateValue(silent); - // Clean the slideEnd event on a timeout since this - // will be executed from inside the event's fire - setTimeout(function () { self._cleanEvent(mins,'slideEnd'); }, 0); - }); - - mins.setValue(min, skipAnim, force); - }, - - /** - * Set the max thumb position to a new value. - * @method setMaxValue - * @param max {int} Pixel offset for max thumb - * @param skipAnim {boolean} (optional) Set to true to skip thumb animation. - * Default false - * @param force {boolean} (optional) ignore the locked setting and set - * value anyway. Default false - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - */ - setMaxValue : function (max, skipAnim, force, silent) { - var maxs = this.maxSlider, - self = this; - - this.activeSlider = maxs; - - // Use a one-time event callback to delay the updateValue call - // until after the slide operation is done - this._oneTimeCallback(maxs,'slideEnd',function () { - self.updateValue(silent); - // Clean the slideEnd event on a timeout since this - // will be executed from inside the event's fire - setTimeout(function () { self._cleanEvent(maxs,'slideEnd'); }, 0); - }); - - maxs.setValue(max, skipAnim, force); - }, - - /** - * Executed when one of the sliders is moved - * @method updateValue - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - * @private - */ - updateValue: function(silent) { - var min = this.minSlider.getValue(), - max = this.maxSlider.getValue(), - changed = false, - mint,maxt,dim,minConstraint,maxConstraint,thumbInnerWidth; - - if (min != this.minVal || max != this.maxVal) { - changed = true; - - mint = this.minSlider.thumb; - maxt = this.maxSlider.thumb; - dim = this.isHoriz ? 'x' : 'y'; - - thumbInnerWidth = this.minSlider.thumbCenterPoint[dim] + - this.maxSlider.thumbCenterPoint[dim]; - - // Establish barriers within the respective other thumb's edge, less - // the minRange. Limit to the Slider's range in the case of - // negative minRanges. - minConstraint = Math.max(max-thumbInnerWidth-this.minRange,0); - maxConstraint = Math.min(-min-thumbInnerWidth-this.minRange,0); - - if (this.isHoriz) { - minConstraint = Math.min(minConstraint,maxt.rightConstraint); - - mint.setXConstraint(mint.leftConstraint,minConstraint, mint.tickSize); - - maxt.setXConstraint(maxConstraint,maxt.rightConstraint, maxt.tickSize); - } else { - minConstraint = Math.min(minConstraint,maxt.bottomConstraint); - mint.setYConstraint(mint.leftConstraint,minConstraint, mint.tickSize); - - maxt.setYConstraint(maxConstraint,maxt.bottomConstraint, maxt.tickSize); - } - } - - this.minVal = min; - this.maxVal = max; - - if (changed && !silent) { - this.fireEvent("change", this); - } - }, - - /** - * A background click will move the slider thumb nearest to the click. - * Override if you need different behavior. - * @method selectActiveSlider - * @param e {Event} the mousedown event - * @private - */ - selectActiveSlider: function(e) { - var min = this.minSlider, - max = this.maxSlider, - minLocked = min.isLocked() || !min.backgroundEnabled, - maxLocked = max.isLocked() || !min.backgroundEnabled, - Ev = YAHOO.util.Event, - d; - - if (minLocked || maxLocked) { - this.activeSlider = minLocked ? max : min; - } else { - if (this.isHoriz) { - d = Ev.getPageX(e)-min.thumb.initPageX-min.thumbCenterPoint.x; - } else { - d = Ev.getPageY(e)-min.thumb.initPageY-min.thumbCenterPoint.y; - } - - this.activeSlider = d*2 > max.getValue()+min.getValue() ? max : min; - } - }, - - /** - * Delegates the onMouseDown to the appropriate Slider - * - * @method _handleMouseDown - * @param e {Event} mouseup event - * @protected - */ - _handleMouseDown: function(e) { - if (!e._handled && !this.minSlider._sliding && !this.maxSlider._sliding) { - e._handled = true; - this.selectActiveSlider(e); - return YW.Slider.prototype.onMouseDown.call(this.activeSlider, e); - } else { - return false; - } - }, - - /** - * Delegates the onMouseUp to the active Slider - * - * @method _handleMouseUp - * @param e {Event} mouseup event - * @protected - */ - _handleMouseUp : function (e) { - YW.Slider.prototype.onMouseUp.apply( - this.activeSlider, arguments); - }, - - /** - * Schedule an event callback that will execute once, then unsubscribe - * itself. - * @method _oneTimeCallback - * @param o {EventProvider} Object to attach the event to - * @param evt {string} Name of the event - * @param fn {Function} function to execute once - * @private - */ - _oneTimeCallback : function (o,evt,fn) { - var sub = function () { - // Unsubscribe myself - o.unsubscribe(evt, sub); - // Pass the event handler arguments to the one time callback - fn.apply({},arguments); - }; - o.subscribe(evt,sub); - }, - - /** - * Clean up the slideEnd event subscribers array, since each one-time - * callback will be replaced in the event's subscribers property with - * null. This will cause memory bloat and loss of performance. - * @method _cleanEvent - * @param o {EventProvider} object housing the CustomEvent - * @param evt {string} name of the CustomEvent - * @private - */ - _cleanEvent : function (o,evt) { - var ce,i,len,j,subs,newSubs; - - if (o.__yui_events && o.events[evt]) { - for (i = o.__yui_events.length; i >= 0; --i) { - if (o.__yui_events[i].type === evt) { - ce = o.__yui_events[i]; - break; - } - } - if (ce) { - subs = ce.subscribers; - newSubs = []; - j = 0; - for (i = 0, len = subs.length; i < len; ++i) { - if (subs[i]) { - newSubs[j++] = subs[i]; - } - } - ce.subscribers = newSubs; - } - } - } - -}; - -YAHOO.lang.augmentProto(DualSlider, YAHOO.util.EventProvider); - - -/** - * Factory method for creating a horizontal dual-thumb slider - * @for YAHOO.widget.Slider - * @method YAHOO.widget.Slider.getHorizDualSlider - * @static - * @param {String} bg the id of the slider's background element - * @param {String} minthumb the id of the min thumb - * @param {String} maxthumb the id of the thumb thumb - * @param {int} range the number of pixels the thumbs can move within - * @param {int} iTickSize (optional) the element should move this many pixels - * at a time - * @param {Array} initVals (optional) [min,max] Initial thumb placement - * @return {DualSlider} a horizontal dual-thumb slider control - */ -YW.Slider.getHorizDualSlider = - function (bg, minthumb, maxthumb, range, iTickSize, initVals) { - var mint = new YW.SliderThumb(minthumb, bg, 0, range, 0, 0, iTickSize), - maxt = new YW.SliderThumb(maxthumb, bg, 0, range, 0, 0, iTickSize); - - return new DualSlider( - new YW.Slider(bg, bg, mint, "horiz"), - new YW.Slider(bg, bg, maxt, "horiz"), - range, initVals); -}; - -/** - * Factory method for creating a vertical dual-thumb slider. - * @for YAHOO.widget.Slider - * @method YAHOO.widget.Slider.getVertDualSlider - * @static - * @param {String} bg the id of the slider's background element - * @param {String} minthumb the id of the min thumb - * @param {String} maxthumb the id of the thumb thumb - * @param {int} range the number of pixels the thumbs can move within - * @param {int} iTickSize (optional) the element should move this many pixels - * at a time - * @param {Array} initVals (optional) [min,max] Initial thumb placement - * @return {DualSlider} a vertical dual-thumb slider control - */ -YW.Slider.getVertDualSlider = - function (bg, minthumb, maxthumb, range, iTickSize, initVals) { - var mint = new YW.SliderThumb(minthumb, bg, 0, 0, 0, range, iTickSize), - maxt = new YW.SliderThumb(maxthumb, bg, 0, 0, 0, range, iTickSize); - - return new YW.DualSlider( - new YW.Slider(bg, bg, mint, "vert"), - new YW.Slider(bg, bg, maxt, "vert"), - range, initVals); -}; - -YAHOO.widget.DualSlider = DualSlider; - -})(); -YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-min.js deleted file mode 100644 index 26e3c5374d..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/slider/slider-min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var B=YAHOO.util.Dom.getXY,A=YAHOO.util.Event,D=Array.prototype.slice;function C(G,E,F,H){C.ANIM_AVAIL=(!YAHOO.lang.isUndefined(YAHOO.util.Anim));if(G){this.init(G,E,true);this.initSlider(H);this.initThumb(F);}}YAHOO.lang.augmentObject(C,{getHorizSlider:function(F,G,I,H,E){return new C(F,F,new YAHOO.widget.SliderThumb(G,F,I,H,0,0,E),"horiz");},getVertSlider:function(G,H,E,I,F){return new C(G,G,new YAHOO.widget.SliderThumb(H,G,0,0,E,I,F),"vert");},getSliderRegion:function(G,H,J,I,E,K,F){return new C(G,G,new YAHOO.widget.SliderThumb(H,G,J,I,E,K,F),"region");},SOURCE_UI_EVENT:1,SOURCE_SET_VALUE:2,SOURCE_KEY_EVENT:3,ANIM_AVAIL:false},true);YAHOO.extend(C,YAHOO.util.DragDrop,{_mouseDown:false,dragOnly:true,initSlider:function(E){this.type=E;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=C.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;this._silent=false;this.lastOffset=[0,0];},initThumb:function(F){var E=this;this.thumb=F;F.cacheBetweenDrags=true;if(F._isHoriz&&F.xTicks&&F.xTicks.length){this.tickPause=Math.round(360/F.xTicks.length);}else{if(F.yTicks&&F.yTicks.length){this.tickPause=Math.round(360/F.yTicks.length);}}F.onAvailable=function(){return E.setStartSliderState();};F.onMouseDown=function(){E._mouseDown=true;return E.focus();};F.startDrag=function(){E._slideStart();};F.onDrag=function(){E.fireEvents(true);};F.onMouseUp=function(){E.thumbMouseUp();};},onAvailable:function(){this._bindKeyEvents();},_bindKeyEvents:function(){A.on(this.id,"keydown",this.handleKeyDown,this,true);A.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(F){if(this.enableKeys){var E=A.getCharCode(F);switch(E){case 37:case 38:case 39:case 40:case 36:case 35:A.preventDefault(F);break;default:}}},handleKeyDown:function(J){if(this.enableKeys){var G=A.getCharCode(J),F=this.thumb,H=this.getXValue(),E=this.getYValue(),I=true;switch(G){case 37:H-=this.keyIncrement;break;case 38:E-=this.keyIncrement;break;case 39:H+=this.keyIncrement;break;case 40:E+=this.keyIncrement;break;case 36:H=F.leftConstraint;E=F.topConstraint;break;case 35:H=F.rightConstraint;E=F.bottomConstraint;break;default:I=false;}if(I){if(F._isRegion){this._setRegionValue(C.SOURCE_KEY_EVENT,H,E,true);}else{this._setValue(C.SOURCE_KEY_EVENT,(F._isHoriz?H:E),true);}A.stopEvent(J);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=B(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this._setRegionValue.apply(this,this.deferredSetRegionValue);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true,true);}}else{if(this.deferredSetValue){this._setValue.apply(this,this.deferredSetValue);this.deferredSetValue=null;}else{this.setValue(0,true,true,true);}}},setThumbCenterPoint:function(){var E=this.thumb.getEl();if(E){this.thumbCenterPoint={x:parseInt(E.offsetWidth/2,10),y:parseInt(E.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){this._mouseDown=false;if(!this.isLocked()){this.endMove();}},onMouseUp:function(){this._mouseDown=false;if(this.backgroundEnabled&&!this.isLocked()){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=C.SOURCE_UI_EVENT;var E=this.getEl();if(E.focus){try{E.focus();}catch(F){}}this.verifyOffset();return !this.isLocked();},onChange:function(E,F){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},setValue:function(){var E=D.call(arguments);E.unshift(C.SOURCE_SET_VALUE);return this._setValue.apply(this,E);},_setValue:function(I,L,G,H,E){var F=this.thumb,K,J;if(!F.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!H){return false;}if(isNaN(L)){return false;}if(F._isRegion){return false;}this._silent=E;this.valueChangeSource=I||C.SOURCE_SET_VALUE;F.lastOffset=[L,L];this.verifyOffset();this._slideStart();if(F._isHoriz){K=F.initPageX+L+this.thumbCenterPoint.x;this.moveThumb(K,F.initPageY,G);}else{J=F.initPageY+L+this.thumbCenterPoint.y;this.moveThumb(F.initPageX,J,G);}return true;},setRegionValue:function(){var E=D.call(arguments);E.unshift(C.SOURCE_SET_VALUE);return this._setRegionValue.apply(this,E);},_setRegionValue:function(F,J,H,I,G,K){var L=this.thumb,E,M;if(!L.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!G){return false;}if(isNaN(J)){return false;}if(!L._isRegion){return false;}this._silent=K;this.valueChangeSource=F||C.SOURCE_SET_VALUE;L.lastOffset=[J,H];this.verifyOffset();this._slideStart();E=L.initPageX+J+this.thumbCenterPoint.x;M=L.initPageY+H+this.thumbCenterPoint.y;this.moveThumb(E,M,I);return true;},verifyOffset:function(){var F=B(this.getEl()),E=this.thumb;if(!this.thumbCenterPoint||!this.thumbCenterPoint.x){this.setThumbCenterPoint();}if(F){if(F[0]!=this.baselinePos[0]||F[1]!=this.baselinePos[1]){this.setInitPosition();this.baselinePos=F;E.initPageX=this.initPageX+E.startOffset[0];E.initPageY=this.initPageY+E.startOffset[1];E.deltaSetXY=null;this.resetThumbConstraints();return false;}}return true;},moveThumb:function(K,J,I,G){var L=this.thumb,M=this,F,E,H;if(!L.available){return;}L.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);E=L.getTargetCoord(K,J);F=[Math.round(E.x),Math.round(E.y)];if(this.animate&&L._graduated&&!I){this.lock();this.curCoord=B(this.thumb.getEl());this.curCoord=[Math.round(this.curCoord[0]),Math.round(this.curCoord[1])];setTimeout(function(){M.moveOneTick(F);},this.tickPause);}else{if(this.animate&&C.ANIM_AVAIL&&!I){this.lock(); -H=new YAHOO.util.Motion(L.id,{points:{to:F}},this.animationDuration,YAHOO.util.Easing.easeOut);H.onComplete.subscribe(function(){M.unlock();if(!M._mouseDown){M.endMove();}});H.animate();}else{L.setDragElPos(K,J);if(!G&&!this._mouseDown){this.endMove();}}}},_slideStart:function(){if(!this._sliding){if(!this._silent){this.onSlideStart();this.fireEvent("slideStart");}this._sliding=true;this.moveComplete=false;}},_slideEnd:function(){if(this._sliding){var E=this._silent;this._sliding=false;this.moveComplete=true;this._silent=false;if(!E){this.onSlideEnd();this.fireEvent("slideEnd");}}},moveOneTick:function(F){var H=this.thumb,G=this,I=null,E,J;if(H._isRegion){I=this._getNextX(this.curCoord,F);E=(I!==null)?I[0]:this.curCoord[0];I=this._getNextY(this.curCoord,F);J=(I!==null)?I[1]:this.curCoord[1];I=E!==this.curCoord[0]||J!==this.curCoord[1]?[E,J]:null;}else{if(H._isHoriz){I=this._getNextX(this.curCoord,F);}else{I=this._getNextY(this.curCoord,F);}}if(I){this.curCoord=I;this.thumb.alignElWithMouse(H.getEl(),I[0]+this.thumbCenterPoint.x,I[1]+this.thumbCenterPoint.y);if(!(I[0]==F[0]&&I[1]==F[1])){setTimeout(function(){G.moveOneTick(F);},this.tickPause);}else{this.unlock();if(!this._mouseDown){this.endMove();}}}else{this.unlock();if(!this._mouseDown){this.endMove();}}},_getNextX:function(E,F){var H=this.thumb,J,G=[],I=null;if(E[0]>F[0]){J=H.tickSize-this.thumbCenterPoint.x;G=H.getTargetCoord(E[0]-J,E[1]);I=[G.x,G.y];}else{if(E[0]F[1]){J=H.tickSize-this.thumbCenterPoint.y;G=H.getTargetCoord(E[0],E[1]-J);I=[G.x,G.y];}else{if(E[1]1){this._graduated=true;}this._isHoriz=(D||C);this._isVert=(A||E);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){return(this._isHoriz)?this.getXValue():this.getYValue();},getXValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[0])){this.lastOffset=A;return(A[0]-this.startOffset[0]);}else{return(this.lastOffset[0]-this.startOffset[0]);}},getYValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[1])){this.lastOffset=A;return(A[1]-this.startOffset[1]);}else{return(this.lastOffset[1]-this.startOffset[1]);}},toString:function(){return"SliderThumb "+this.id;},onChange:function(A,B){}});(function(){var A=YAHOO.util.Event,B=YAHOO.widget;function C(I,F,H,D){var G=this,J={min:false,max:false},E,K;this.minSlider=I;this.maxSlider=F;this.activeSlider=I;this.isHoriz=I.thumb._isHoriz;E=this.minSlider.thumb.onMouseDown;K=this.maxSlider.thumb.onMouseDown;this.minSlider.thumb.onMouseDown=function(){G.activeSlider=G.minSlider;E.apply(this,arguments);};this.maxSlider.thumb.onMouseDown=function(){G.activeSlider=G.maxSlider;K.apply(this,arguments);};this.minSlider.thumb.onAvailable=function(){I.setStartSliderState();J.min=true;if(J.max){G.fireEvent("ready",G);}};this.maxSlider.thumb.onAvailable=function(){F.setStartSliderState();J.max=true;if(J.min){G.fireEvent("ready",G);}};I.onMouseDown=F.onMouseDown=function(L){return this.backgroundEnabled&&G._handleMouseDown(L);};I.onDrag=F.onDrag=function(L){G._handleDrag(L);};I.onMouseUp=F.onMouseUp=function(L){G._handleMouseUp(L); -};I._bindKeyEvents=function(){G._bindKeyEvents(this);};F._bindKeyEvents=function(){};I.subscribe("change",this._handleMinChange,I,this);I.subscribe("slideStart",this._handleSlideStart,I,this);I.subscribe("slideEnd",this._handleSlideEnd,I,this);F.subscribe("change",this._handleMaxChange,F,this);F.subscribe("slideStart",this._handleSlideStart,F,this);F.subscribe("slideEnd",this._handleSlideEnd,F,this);this.createEvent("ready",this);this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);D=YAHOO.lang.isArray(D)?D:[0,H];D[0]=Math.min(Math.max(parseInt(D[0],10)|0,0),H);D[1]=Math.max(Math.min(parseInt(D[1],10)|0,H),0);if(D[0]>D[1]){D.splice(0,2,D[1],D[0]);}this.minVal=D[0];this.maxVal=D[1];this.minSlider.setValue(this.minVal,true,true,true);this.maxSlider.setValue(this.maxVal,true,true,true);}C.prototype={minVal:-1,maxVal:-1,minRange:0,_handleSlideStart:function(E,D){this.fireEvent("slideStart",D);},_handleSlideEnd:function(E,D){this.fireEvent("slideEnd",D);},_handleDrag:function(D){B.Slider.prototype.onDrag.call(this.activeSlider,D);},_handleMinChange:function(){this.activeSlider=this.minSlider;this.updateValue();},_handleMaxChange:function(){this.activeSlider=this.maxSlider;this.updateValue();},_bindKeyEvents:function(D){A.on(D.id,"keydown",this._handleKeyDown,this,true);A.on(D.id,"keypress",this._handleKeyPress,this,true);},_handleKeyDown:function(D){this.activeSlider.handleKeyDown.apply(this.activeSlider,arguments);},_handleKeyPress:function(D){this.activeSlider.handleKeyPress.apply(this.activeSlider,arguments);},setValues:function(H,K,I,E,J){var F=this.minSlider,M=this.maxSlider,D=F.thumb,L=M.thumb,N=this,G={min:false,max:false};if(D._isHoriz){D.setXConstraint(D.leftConstraint,L.rightConstraint,D.tickSize);L.setXConstraint(D.leftConstraint,L.rightConstraint,L.tickSize);}else{D.setYConstraint(D.topConstraint,L.bottomConstraint,D.tickSize);L.setYConstraint(D.topConstraint,L.bottomConstraint,L.tickSize);}this._oneTimeCallback(F,"slideEnd",function(){G.min=true;if(G.max){N.updateValue(J);setTimeout(function(){N._cleanEvent(F,"slideEnd");N._cleanEvent(M,"slideEnd");},0);}});this._oneTimeCallback(M,"slideEnd",function(){G.max=true;if(G.min){N.updateValue(J);setTimeout(function(){N._cleanEvent(F,"slideEnd");N._cleanEvent(M,"slideEnd");},0);}});F.setValue(H,I,E,false);M.setValue(K,I,E,false);},setMinValue:function(F,H,I,E){var G=this.minSlider,D=this;this.activeSlider=G;D=this;this._oneTimeCallback(G,"slideEnd",function(){D.updateValue(E);setTimeout(function(){D._cleanEvent(G,"slideEnd");},0);});G.setValue(F,H,I);},setMaxValue:function(D,H,I,F){var G=this.maxSlider,E=this;this.activeSlider=G;this._oneTimeCallback(G,"slideEnd",function(){E.updateValue(F);setTimeout(function(){E._cleanEvent(G,"slideEnd");},0);});G.setValue(D,H,I);},updateValue:function(J){var E=this.minSlider.getValue(),K=this.maxSlider.getValue(),F=false,D,M,H,I,L,G;if(E!=this.minVal||K!=this.maxVal){F=true;D=this.minSlider.thumb;M=this.maxSlider.thumb;H=this.isHoriz?"x":"y";G=this.minSlider.thumbCenterPoint[H]+this.maxSlider.thumbCenterPoint[H];I=Math.max(K-G-this.minRange,0);L=Math.min(-E-G-this.minRange,0);if(this.isHoriz){I=Math.min(I,M.rightConstraint);D.setXConstraint(D.leftConstraint,I,D.tickSize);M.setXConstraint(L,M.rightConstraint,M.tickSize);}else{I=Math.min(I,M.bottomConstraint);D.setYConstraint(D.leftConstraint,I,D.tickSize);M.setYConstraint(L,M.bottomConstraint,M.tickSize);}}this.minVal=E;this.maxVal=K;if(F&&!J){this.fireEvent("change",this);}},selectActiveSlider:function(H){var E=this.minSlider,D=this.maxSlider,J=E.isLocked()||!E.backgroundEnabled,G=D.isLocked()||!E.backgroundEnabled,F=YAHOO.util.Event,I;if(J||G){this.activeSlider=J?D:E;}else{if(this.isHoriz){I=F.getPageX(H)-E.thumb.initPageX-E.thumbCenterPoint.x;}else{I=F.getPageY(H)-E.thumb.initPageY-E.thumbCenterPoint.y;}this.activeSlider=I*2>D.getValue()+E.getValue()?D:E;}},_handleMouseDown:function(D){if(!D._handled&&!this.minSlider._sliding&&!this.maxSlider._sliding){D._handled=true;this.selectActiveSlider(D);return B.Slider.prototype.onMouseDown.call(this.activeSlider,D);}else{return false;}},_handleMouseUp:function(D){B.Slider.prototype.onMouseUp.apply(this.activeSlider,arguments);},_oneTimeCallback:function(G,D,F){var E=function(){G.unsubscribe(D,E);F.apply({},arguments);};G.subscribe(D,E);},_cleanEvent:function(K,E){var J,I,D,G,H,F;if(K.__yui_events&&K.events[E]){for(I=K.__yui_events.length;I>=0;--I){if(K.__yui_events[I].type===E){J=K.__yui_events[I];break;}}if(J){H=J.subscribers;F=[];G=0;for(I=0,D=H.length;I finalCoord[0]) { - thresh = t.tickSize - this.thumbCenterPoint.x; - tmp = t.getTargetCoord( curCoord[0] - thresh, curCoord[1] ); - nextCoord = [tmp.x, tmp.y]; - } else if (curCoord[0] < finalCoord[0]) { - thresh = t.tickSize + this.thumbCenterPoint.x; - tmp = t.getTargetCoord( curCoord[0] + thresh, curCoord[1] ); - nextCoord = [tmp.x, tmp.y]; - } else { - // equal, do nothing - } - - return nextCoord; - }, - - /** - * Returns the next Y tick value based on the current coord and the target coord. - * @method _getNextY - * @private - */ - _getNextY: function(curCoord, finalCoord) { - var t = this.thumb, - thresh, - tmp = [], - nextCoord = null; - - if (curCoord[1] > finalCoord[1]) { - thresh = t.tickSize - this.thumbCenterPoint.y; - tmp = t.getTargetCoord( curCoord[0], curCoord[1] - thresh ); - nextCoord = [tmp.x, tmp.y]; - } else if (curCoord[1] < finalCoord[1]) { - thresh = t.tickSize + this.thumbCenterPoint.y; - tmp = t.getTargetCoord( curCoord[0], curCoord[1] + thresh ); - nextCoord = [tmp.x, tmp.y]; - } else { - // equal, do nothing - } - - return nextCoord; - }, - - /** - * Resets the constraints before moving the thumb. - * @method b4MouseDown - * @private - */ - b4MouseDown: function(e) { - if (!this.backgroundEnabled) { - return false; - } - - this.thumb.autoOffset(); - this.baselinePos = []; - }, - - /** - * Handles the mousedown event for the slider background - * @method onMouseDown - * @private - */ - onMouseDown: function(e) { - if (!this.backgroundEnabled || this.isLocked()) { - return false; - } - - this._mouseDown = true; - - var x = Event.getPageX(e), - y = Event.getPageY(e); - - - this.focus(); - this._slideStart(); - this.moveThumb(x, y); - }, - - /** - * Handles the onDrag event for the slider background - * @method onDrag - * @private - */ - onDrag: function(e) { - if (this.backgroundEnabled && !this.isLocked()) { - var x = Event.getPageX(e), - y = Event.getPageY(e); - this.moveThumb(x, y, true, true); - this.fireEvents(); - } - }, - - /** - * Fired when the slider movement ends - * @method endMove - * @private - */ - endMove: function () { - this.unlock(); - this.fireEvents(); - this._slideEnd(); - }, - - /** - * Resets the X and Y contraints for the thumb. Used in lieu of the thumb - * instance's inherited resetConstraints because some logic was not - * applicable. - * @method resetThumbConstraints - * @protected - */ - resetThumbConstraints: function () { - var t = this.thumb; - - t.setXConstraint(t.leftConstraint, t.rightConstraint, t.xTickSize); - t.setYConstraint(t.topConstraint, t.bottomConstraint, t.xTickSize); - }, - - /** - * Fires the change event if the value has been changed. Ignored if we are in - * the middle of an animation as the event will fire when the animation is - * complete - * @method fireEvents - * @param {boolean} thumbEvent set to true if this event is fired from an event - * that occurred on the thumb. If it is, the state of the - * thumb dd object should be correct. Otherwise, the event - * originated on the background, so the thumb state needs to - * be refreshed before proceeding. - * @private - */ - fireEvents: function (thumbEvent) { - - var t = this.thumb, newX, newY, newVal; - - if (!thumbEvent) { - t.cachePosition(); - } - - if (! this.isLocked()) { - if (t._isRegion) { - newX = t.getXValue(); - newY = t.getYValue(); - - if (newX != this.previousX || newY != this.previousY) { - if (!this._silent) { - this.onChange(newX, newY); - this.fireEvent("change", { x: newX, y: newY }); - } - } - - this.previousX = newX; - this.previousY = newY; - - } else { - newVal = t.getValue(); - if (newVal != this.previousVal) { - if (!this._silent) { - this.onChange( newVal ); - this.fireEvent("change", newVal); - } - } - this.previousVal = newVal; - } - - } - }, - - /** - * Slider toString - * @method toString - * @return {string} string representation of the instance - */ - toString: function () { - return ("Slider (" + this.type +") " + this.id); - } - -}); - -YAHOO.lang.augmentProto(Slider, YAHOO.util.EventProvider); - -YAHOO.widget.Slider = Slider; -})(); -/** - * A drag and drop implementation to be used as the thumb of a slider. - * @class SliderThumb - * @extends YAHOO.util.DD - * @constructor - * @param {String} id the id of the slider html element - * @param {String} sGroup the group of related DragDrop items - * @param {int} iLeft the number of pixels the element can move left - * @param {int} iRight the number of pixels the element can move right - * @param {int} iUp the number of pixels the element can move up - * @param {int} iDown the number of pixels the element can move down - * @param {int} iTickSize optional parameter for specifying that the element - * should move a certain number pixels at a time. - */ -YAHOO.widget.SliderThumb = function(id, sGroup, iLeft, iRight, iUp, iDown, iTickSize) { - - if (id) { - YAHOO.widget.SliderThumb.superclass.constructor.call(this, id, sGroup); - - /** - * The id of the thumbs parent HTML element (the slider background - * element). - * @property parentElId - * @type string - */ - this.parentElId = sGroup; - } - - - - /** - * Overrides the isTarget property in YAHOO.util.DragDrop - * @property isTarget - * @private - */ - this.isTarget = false; - - /** - * The tick size for this slider - * @property tickSize - * @type int - * @private - */ - this.tickSize = iTickSize; - - /** - * Informs the drag and drop util that the offsets should remain when - * resetting the constraints. This preserves the slider value when - * the constraints are reset - * @property maintainOffset - * @type boolean - * @private - */ - this.maintainOffset = true; - - this.initSlider(iLeft, iRight, iUp, iDown, iTickSize); - - /** - * Turns off the autoscroll feature in drag and drop - * @property scroll - * @private - */ - this.scroll = false; - -}; - -YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, { - - /** - * The (X and Y) difference between the thumb location and its parent - * (the slider background) when the control is instantiated. - * @property startOffset - * @type [int, int] - */ - startOffset: null, - - /** - * Override the default setting of dragOnly to true. - * @property dragOnly - * @type boolean - * @default true - */ - dragOnly : true, - - /** - * Flag used to figure out if this is a horizontal or vertical slider - * @property _isHoriz - * @type boolean - * @private - */ - _isHoriz: false, - - /** - * Cache the last value so we can check for change - * @property _prevVal - * @type int - * @private - */ - _prevVal: 0, - - /** - * The slider is _graduated if there is a tick interval defined - * @property _graduated - * @type boolean - * @private - */ - _graduated: false, - - - /** - * Returns the difference between the location of the thumb and its parent. - * @method getOffsetFromParent - * @param {[int, int]} parentPos Optionally accepts the position of the parent - * @type [int, int] - */ - getOffsetFromParent0: function(parentPos) { - var myPos = YAHOO.util.Dom.getXY(this.getEl()), - ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId); - - return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ]; - }, - - getOffsetFromParent: function(parentPos) { - - var el = this.getEl(), newOffset, - myPos,ppos,l,t,deltaX,deltaY,newLeft,newTop; - - if (!this.deltaOffset) { - - myPos = YAHOO.util.Dom.getXY(el); - ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId); - - newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ]; - - l = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 ); - t = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 ); - - deltaX = l - newOffset[0]; - deltaY = t - newOffset[1]; - - if (isNaN(deltaX) || isNaN(deltaY)) { - } else { - this.deltaOffset = [deltaX, deltaY]; - } - - } else { - newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 ); - newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 ); - - newOffset = [newLeft + this.deltaOffset[0], newTop + this.deltaOffset[1]]; - } - - return newOffset; - }, - - /** - * Set up the slider, must be called in the constructor of all subclasses - * @method initSlider - * @param {int} iLeft the number of pixels the element can move left - * @param {int} iRight the number of pixels the element can move right - * @param {int} iUp the number of pixels the element can move up - * @param {int} iDown the number of pixels the element can move down - * @param {int} iTickSize the width of the tick interval. - */ - initSlider: function (iLeft, iRight, iUp, iDown, iTickSize) { - this.initLeft = iLeft; - this.initRight = iRight; - this.initUp = iUp; - this.initDown = iDown; - - this.setXConstraint(iLeft, iRight, iTickSize); - this.setYConstraint(iUp, iDown, iTickSize); - - if (iTickSize && iTickSize > 1) { - this._graduated = true; - } - - this._isHoriz = (iLeft || iRight); - this._isVert = (iUp || iDown); - this._isRegion = (this._isHoriz && this._isVert); - - }, - - /** - * Clear's the slider's ticks - * @method clearTicks - */ - clearTicks: function () { - YAHOO.widget.SliderThumb.superclass.clearTicks.call(this); - this.tickSize = 0; - this._graduated = false; - }, - - - /** - * Gets the current offset from the element's start position in - * pixels. - * @method getValue - * @return {int} the number of pixels (positive or negative) the - * slider has moved from the start position. - */ - getValue: function () { - return (this._isHoriz) ? this.getXValue() : this.getYValue(); - }, - - /** - * Gets the current X offset from the element's start position in - * pixels. - * @method getXValue - * @return {int} the number of pixels (positive or negative) the - * slider has moved horizontally from the start position. - */ - getXValue: function () { - if (!this.available) { - return 0; - } - var newOffset = this.getOffsetFromParent(); - if (YAHOO.lang.isNumber(newOffset[0])) { - this.lastOffset = newOffset; - return (newOffset[0] - this.startOffset[0]); - } else { - return (this.lastOffset[0] - this.startOffset[0]); - } - }, - - /** - * Gets the current Y offset from the element's start position in - * pixels. - * @method getYValue - * @return {int} the number of pixels (positive or negative) the - * slider has moved vertically from the start position. - */ - getYValue: function () { - if (!this.available) { - return 0; - } - var newOffset = this.getOffsetFromParent(); - if (YAHOO.lang.isNumber(newOffset[1])) { - this.lastOffset = newOffset; - return (newOffset[1] - this.startOffset[1]); - } else { - return (this.lastOffset[1] - this.startOffset[1]); - } - }, - - /** - * Thumb toString - * @method toString - * @return {string} string representation of the instance - */ - toString: function () { - return "SliderThumb " + this.id; - }, - - /** - * The onchange event for the handle/thumb is delegated to the YAHOO.widget.Slider - * instance it belongs to. - * @method onChange - * @private - */ - onChange: function (x, y) { - } - -}); -/** - * A slider with two thumbs, one that represents the min value and - * the other the max. Actually a composition of two sliders, both with - * the same background. The constraints for each slider are adjusted - * dynamically so that the min value of the max slider is equal or greater - * to the current value of the min slider, and the max value of the min - * slider is the current value of the max slider. - * Constructor assumes both thumbs are positioned absolutely at the 0 mark on - * the background. - * - * @namespace YAHOO.widget - * @class DualSlider - * @uses YAHOO.util.EventProvider - * @constructor - * @param {Slider} minSlider The Slider instance used for the min value thumb - * @param {Slider} maxSlider The Slider instance used for the max value thumb - * @param {int} range The number of pixels the thumbs may move within - * @param {Array} initVals (optional) [min,max] Initial thumb placement - */ -(function () { - -var Event = YAHOO.util.Event, - YW = YAHOO.widget; - -function DualSlider(minSlider, maxSlider, range, initVals) { - - var self = this, - ready = { min : false, max : false }, - minThumbOnMouseDown, maxThumbOnMouseDown; - - /** - * A slider instance that keeps track of the lower value of the range. - * read only - * @property minSlider - * @type Slider - */ - this.minSlider = minSlider; - - /** - * A slider instance that keeps track of the upper value of the range. - * read only - * @property maxSlider - * @type Slider - */ - this.maxSlider = maxSlider; - - /** - * The currently active slider (min or max). read only - * @property activeSlider - * @type Slider - */ - this.activeSlider = minSlider; - - /** - * Is the DualSlider oriented horizontally or vertically? - * read only - * @property isHoriz - * @type boolean - */ - this.isHoriz = minSlider.thumb._isHoriz; - - //FIXME: this is horrible - minThumbOnMouseDown = this.minSlider.thumb.onMouseDown; - maxThumbOnMouseDown = this.maxSlider.thumb.onMouseDown; - this.minSlider.thumb.onMouseDown = function() { - self.activeSlider = self.minSlider; - minThumbOnMouseDown.apply(this,arguments); - }; - this.maxSlider.thumb.onMouseDown = function () { - self.activeSlider = self.maxSlider; - maxThumbOnMouseDown.apply(this,arguments); - }; - - this.minSlider.thumb.onAvailable = function () { - minSlider.setStartSliderState(); - ready.min = true; - if (ready.max) { - self.fireEvent('ready',self); - } - }; - this.maxSlider.thumb.onAvailable = function () { - maxSlider.setStartSliderState(); - ready.max = true; - if (ready.min) { - self.fireEvent('ready',self); - } - }; - - // dispatch mousedowns to the active slider - minSlider.onMouseDown = - maxSlider.onMouseDown = function(e) { - return this.backgroundEnabled && self._handleMouseDown(e); - }; - - // Fix the drag behavior so that only the active slider - // follows the drag - minSlider.onDrag = - maxSlider.onDrag = function(e) { - self._handleDrag(e); - }; - - // Likely only the minSlider's onMouseUp will be executed, but both are - // overridden just to be safe - minSlider.onMouseUp = - maxSlider.onMouseUp = function (e) { - self._handleMouseUp(e); - }; - - // Replace the _bindKeyEvents for the minSlider and remove that for the - // maxSlider since they share the same bg element. - minSlider._bindKeyEvents = function () { - self._bindKeyEvents(this); - }; - maxSlider._bindKeyEvents = function () {}; - - // The core events for each slider are handled so we can expose a single - // event for when the event happens on either slider - minSlider.subscribe("change", this._handleMinChange, minSlider, this); - minSlider.subscribe("slideStart", this._handleSlideStart, minSlider, this); - minSlider.subscribe("slideEnd", this._handleSlideEnd, minSlider, this); - - maxSlider.subscribe("change", this._handleMaxChange, maxSlider, this); - maxSlider.subscribe("slideStart", this._handleSlideStart, maxSlider, this); - maxSlider.subscribe("slideEnd", this._handleSlideEnd, maxSlider, this); - - /** - * Event that fires when the slider is finished setting up - * @event ready - * @param {DualSlider} dualslider the DualSlider instance - */ - this.createEvent("ready", this); - - /** - * Event that fires when either the min or max value changes - * @event change - * @param {DualSlider} dualslider the DualSlider instance - */ - this.createEvent("change", this); - - /** - * Event that fires when one of the thumbs begins to move - * @event slideStart - * @param {Slider} activeSlider the moving slider - */ - this.createEvent("slideStart", this); - - /** - * Event that fires when one of the thumbs finishes moving - * @event slideEnd - * @param {Slider} activeSlider the moving slider - */ - this.createEvent("slideEnd", this); - - // Validate initial values - initVals = YAHOO.lang.isArray(initVals) ? initVals : [0,range]; - initVals[0] = Math.min(Math.max(parseInt(initVals[0],10)|0,0),range); - initVals[1] = Math.max(Math.min(parseInt(initVals[1],10)|0,range),0); - // Swap initVals if min > max - if (initVals[0] > initVals[1]) { - initVals.splice(0,2,initVals[1],initVals[0]); - } - this.minVal = initVals[0]; - this.maxVal = initVals[1]; - - // Set values so initial assignment when the slider thumbs are ready will - // use these values - this.minSlider.setValue(this.minVal,true,true,true); - this.maxSlider.setValue(this.maxVal,true,true,true); - -} - -DualSlider.prototype = { - - /** - * The current value of the min thumb. read only. - * @property minVal - * @type int - */ - minVal : -1, - - /** - * The current value of the max thumb. read only. - * @property maxVal - * @type int - */ - maxVal : -1, - - /** - * Pixel distance to maintain between thumbs. - * @property minRange - * @type int - * @default 0 - */ - minRange : 0, - - /** - * Executed when one of the sliders fires the slideStart event - * @method _handleSlideStart - * @private - */ - _handleSlideStart: function(data, slider) { - this.fireEvent("slideStart", slider); - }, - - /** - * Executed when one of the sliders fires the slideEnd event - * @method _handleSlideEnd - * @private - */ - _handleSlideEnd: function(data, slider) { - this.fireEvent("slideEnd", slider); - }, - - /** - * Overrides the onDrag method for both sliders - * @method _handleDrag - * @private - */ - _handleDrag: function(e) { - YW.Slider.prototype.onDrag.call(this.activeSlider, e); - }, - - /** - * Executed when the min slider fires the change event - * @method _handleMinChange - * @private - */ - _handleMinChange: function() { - this.activeSlider = this.minSlider; - this.updateValue(); - }, - - /** - * Executed when the max slider fires the change event - * @method _handleMaxChange - * @private - */ - _handleMaxChange: function() { - this.activeSlider = this.maxSlider; - this.updateValue(); - }, - - /** - * Set up the listeners for the keydown and keypress events. - * - * @method _bindKeyEvents - * @protected - */ - _bindKeyEvents : function (slider) { - Event.on(slider.id,'keydown', this._handleKeyDown, this,true); - Event.on(slider.id,'keypress',this._handleKeyPress,this,true); - }, - - /** - * Delegate event handling to the active Slider. See Slider.handleKeyDown. - * - * @method _handleKeyDown - * @param e {Event} the mousedown DOM event - * @protected - */ - _handleKeyDown : function (e) { - this.activeSlider.handleKeyDown.apply(this.activeSlider,arguments); - }, - - /** - * Delegate event handling to the active Slider. See Slider.handleKeyPress. - * - * @method _handleKeyPress - * @param e {Event} the mousedown DOM event - * @protected - */ - _handleKeyPress : function (e) { - this.activeSlider.handleKeyPress.apply(this.activeSlider,arguments); - }, - - /** - * Sets the min and max thumbs to new values. - * @method setValues - * @param min {int} Pixel offset to assign to the min thumb - * @param max {int} Pixel offset to assign to the max thumb - * @param skipAnim {boolean} (optional) Set to true to skip thumb animation. - * Default false - * @param force {boolean} (optional) ignore the locked setting and set - * value anyway. Default false - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - */ - setValues : function (min, max, skipAnim, force, silent) { - var mins = this.minSlider, - maxs = this.maxSlider, - mint = mins.thumb, - maxt = maxs.thumb, - self = this, - done = { min : false, max : false }; - - // Clear constraints to prevent animated thumbs from prematurely - // stopping when hitting a constraint that's moving with the other - // thumb. - if (mint._isHoriz) { - mint.setXConstraint(mint.leftConstraint,maxt.rightConstraint,mint.tickSize); - maxt.setXConstraint(mint.leftConstraint,maxt.rightConstraint,maxt.tickSize); - } else { - mint.setYConstraint(mint.topConstraint,maxt.bottomConstraint,mint.tickSize); - maxt.setYConstraint(mint.topConstraint,maxt.bottomConstraint,maxt.tickSize); - } - - // Set up one-time slideEnd callbacks to call updateValue when both - // thumbs have been set - this._oneTimeCallback(mins,'slideEnd',function () { - done.min = true; - if (done.max) { - self.updateValue(silent); - // Clean the slider's slideEnd events on a timeout since this - // will be executed from inside the event's fire - setTimeout(function () { - self._cleanEvent(mins,'slideEnd'); - self._cleanEvent(maxs,'slideEnd'); - },0); - } - }); - - this._oneTimeCallback(maxs,'slideEnd',function () { - done.max = true; - if (done.min) { - self.updateValue(silent); - // Clean both sliders' slideEnd events on a timeout since this - // will be executed from inside one of the event's fire - setTimeout(function () { - self._cleanEvent(mins,'slideEnd'); - self._cleanEvent(maxs,'slideEnd'); - },0); - } - }); - - // Must emit Slider slideEnd event to propagate to updateValue - mins.setValue(min,skipAnim,force,false); - maxs.setValue(max,skipAnim,force,false); - }, - - /** - * Set the min thumb position to a new value. - * @method setMinValue - * @param min {int} Pixel offset for min thumb - * @param skipAnim {boolean} (optional) Set to true to skip thumb animation. - * Default false - * @param force {boolean} (optional) ignore the locked setting and set - * value anyway. Default false - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - */ - setMinValue : function (min, skipAnim, force, silent) { - var mins = this.minSlider, - self = this; - - this.activeSlider = mins; - - // Use a one-time event callback to delay the updateValue call - // until after the slide operation is done - self = this; - this._oneTimeCallback(mins,'slideEnd',function () { - self.updateValue(silent); - // Clean the slideEnd event on a timeout since this - // will be executed from inside the event's fire - setTimeout(function () { self._cleanEvent(mins,'slideEnd'); }, 0); - }); - - mins.setValue(min, skipAnim, force); - }, - - /** - * Set the max thumb position to a new value. - * @method setMaxValue - * @param max {int} Pixel offset for max thumb - * @param skipAnim {boolean} (optional) Set to true to skip thumb animation. - * Default false - * @param force {boolean} (optional) ignore the locked setting and set - * value anyway. Default false - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - */ - setMaxValue : function (max, skipAnim, force, silent) { - var maxs = this.maxSlider, - self = this; - - this.activeSlider = maxs; - - // Use a one-time event callback to delay the updateValue call - // until after the slide operation is done - this._oneTimeCallback(maxs,'slideEnd',function () { - self.updateValue(silent); - // Clean the slideEnd event on a timeout since this - // will be executed from inside the event's fire - setTimeout(function () { self._cleanEvent(maxs,'slideEnd'); }, 0); - }); - - maxs.setValue(max, skipAnim, force); - }, - - /** - * Executed when one of the sliders is moved - * @method updateValue - * @param silent {boolean} (optional) Set to true to skip firing change - * events. Default false - * @private - */ - updateValue: function(silent) { - var min = this.minSlider.getValue(), - max = this.maxSlider.getValue(), - changed = false, - mint,maxt,dim,minConstraint,maxConstraint,thumbInnerWidth; - - if (min != this.minVal || max != this.maxVal) { - changed = true; - - mint = this.minSlider.thumb; - maxt = this.maxSlider.thumb; - dim = this.isHoriz ? 'x' : 'y'; - - thumbInnerWidth = this.minSlider.thumbCenterPoint[dim] + - this.maxSlider.thumbCenterPoint[dim]; - - // Establish barriers within the respective other thumb's edge, less - // the minRange. Limit to the Slider's range in the case of - // negative minRanges. - minConstraint = Math.max(max-thumbInnerWidth-this.minRange,0); - maxConstraint = Math.min(-min-thumbInnerWidth-this.minRange,0); - - if (this.isHoriz) { - minConstraint = Math.min(minConstraint,maxt.rightConstraint); - - mint.setXConstraint(mint.leftConstraint,minConstraint, mint.tickSize); - - maxt.setXConstraint(maxConstraint,maxt.rightConstraint, maxt.tickSize); - } else { - minConstraint = Math.min(minConstraint,maxt.bottomConstraint); - mint.setYConstraint(mint.leftConstraint,minConstraint, mint.tickSize); - - maxt.setYConstraint(maxConstraint,maxt.bottomConstraint, maxt.tickSize); - } - } - - this.minVal = min; - this.maxVal = max; - - if (changed && !silent) { - this.fireEvent("change", this); - } - }, - - /** - * A background click will move the slider thumb nearest to the click. - * Override if you need different behavior. - * @method selectActiveSlider - * @param e {Event} the mousedown event - * @private - */ - selectActiveSlider: function(e) { - var min = this.minSlider, - max = this.maxSlider, - minLocked = min.isLocked() || !min.backgroundEnabled, - maxLocked = max.isLocked() || !min.backgroundEnabled, - Ev = YAHOO.util.Event, - d; - - if (minLocked || maxLocked) { - this.activeSlider = minLocked ? max : min; - } else { - if (this.isHoriz) { - d = Ev.getPageX(e)-min.thumb.initPageX-min.thumbCenterPoint.x; - } else { - d = Ev.getPageY(e)-min.thumb.initPageY-min.thumbCenterPoint.y; - } - - this.activeSlider = d*2 > max.getValue()+min.getValue() ? max : min; - } - }, - - /** - * Delegates the onMouseDown to the appropriate Slider - * - * @method _handleMouseDown - * @param e {Event} mouseup event - * @protected - */ - _handleMouseDown: function(e) { - if (!e._handled && !this.minSlider._sliding && !this.maxSlider._sliding) { - e._handled = true; - this.selectActiveSlider(e); - return YW.Slider.prototype.onMouseDown.call(this.activeSlider, e); - } else { - return false; - } - }, - - /** - * Delegates the onMouseUp to the active Slider - * - * @method _handleMouseUp - * @param e {Event} mouseup event - * @protected - */ - _handleMouseUp : function (e) { - YW.Slider.prototype.onMouseUp.apply( - this.activeSlider, arguments); - }, - - /** - * Schedule an event callback that will execute once, then unsubscribe - * itself. - * @method _oneTimeCallback - * @param o {EventProvider} Object to attach the event to - * @param evt {string} Name of the event - * @param fn {Function} function to execute once - * @private - */ - _oneTimeCallback : function (o,evt,fn) { - var sub = function () { - // Unsubscribe myself - o.unsubscribe(evt, sub); - // Pass the event handler arguments to the one time callback - fn.apply({},arguments); - }; - o.subscribe(evt,sub); - }, - - /** - * Clean up the slideEnd event subscribers array, since each one-time - * callback will be replaced in the event's subscribers property with - * null. This will cause memory bloat and loss of performance. - * @method _cleanEvent - * @param o {EventProvider} object housing the CustomEvent - * @param evt {string} name of the CustomEvent - * @private - */ - _cleanEvent : function (o,evt) { - var ce,i,len,j,subs,newSubs; - - if (o.__yui_events && o.events[evt]) { - for (i = o.__yui_events.length; i >= 0; --i) { - if (o.__yui_events[i].type === evt) { - ce = o.__yui_events[i]; - break; - } - } - if (ce) { - subs = ce.subscribers; - newSubs = []; - j = 0; - for (i = 0, len = subs.length; i < len; ++i) { - if (subs[i]) { - newSubs[j++] = subs[i]; - } - } - ce.subscribers = newSubs; - } - } - } - -}; - -YAHOO.lang.augmentProto(DualSlider, YAHOO.util.EventProvider); - - -/** - * Factory method for creating a horizontal dual-thumb slider - * @for YAHOO.widget.Slider - * @method YAHOO.widget.Slider.getHorizDualSlider - * @static - * @param {String} bg the id of the slider's background element - * @param {String} minthumb the id of the min thumb - * @param {String} maxthumb the id of the thumb thumb - * @param {int} range the number of pixels the thumbs can move within - * @param {int} iTickSize (optional) the element should move this many pixels - * at a time - * @param {Array} initVals (optional) [min,max] Initial thumb placement - * @return {DualSlider} a horizontal dual-thumb slider control - */ -YW.Slider.getHorizDualSlider = - function (bg, minthumb, maxthumb, range, iTickSize, initVals) { - var mint = new YW.SliderThumb(minthumb, bg, 0, range, 0, 0, iTickSize), - maxt = new YW.SliderThumb(maxthumb, bg, 0, range, 0, 0, iTickSize); - - return new DualSlider( - new YW.Slider(bg, bg, mint, "horiz"), - new YW.Slider(bg, bg, maxt, "horiz"), - range, initVals); -}; - -/** - * Factory method for creating a vertical dual-thumb slider. - * @for YAHOO.widget.Slider - * @method YAHOO.widget.Slider.getVertDualSlider - * @static - * @param {String} bg the id of the slider's background element - * @param {String} minthumb the id of the min thumb - * @param {String} maxthumb the id of the thumb thumb - * @param {int} range the number of pixels the thumbs can move within - * @param {int} iTickSize (optional) the element should move this many pixels - * at a time - * @param {Array} initVals (optional) [min,max] Initial thumb placement - * @return {DualSlider} a vertical dual-thumb slider control - */ -YW.Slider.getVertDualSlider = - function (bg, minthumb, maxthumb, range, iTickSize, initVals) { - var mint = new YW.SliderThumb(minthumb, bg, 0, 0, 0, range, iTickSize), - maxt = new YW.SliderThumb(maxthumb, bg, 0, 0, 0, range, iTickSize); - - return new YW.DualSlider( - new YW.Slider(bg, bg, mint, "vert"), - new YW.Slider(bg, bg, maxt, "vert"), - range, initVals); -}; - -YAHOO.widget.DualSlider = DualSlider; - -})(); -YAHOO.register("slider", YAHOO.widget.Slider, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-debug.js deleted file mode 100644 index 6ee930f487..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-debug.js +++ /dev/null @@ -1,1185 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The Storage module manages client-side data storage. - * @module Storage - */ - -(function() { - - // internal shorthand -var Y = YAHOO, - YU = Y.util, - YL = Y.lang, - _logOverwriteError; - -if (! YU.Storage) { - _logOverwriteError = function(fxName) { - Y.log('Exception in YAHOO.util.Storage.?? - must be extended by a storage engine'.replace('??', fxName).replace('??', this.getName ? this.getName() : 'Unknown'), 'error'); - }; - - /** - * The Storage class is an HTML 5 storage API clone, used to wrap individual storage implementations with a common API. - * @class Storage - * @namespace YAHOO.util - * @constructor - * @param location {String} Required. The storage location. - * @parm name {String} Required. The engine name. - * @param conf {Object} Required. A configuration object. - */ - YU.Storage = function(location, name, conf) { - var that = this; - Y.env._id_counter += 1; - - // protected variables - that._cfg = YL.isObject(conf) ? conf : {}; - that._location = location; - that._name = name; - that.isReady = false; - - // public variables - that.createEvent(that.CE_READY, {scope: that}); - that.createEvent(that.CE_CHANGE, {scope: that}); - - that.subscribe(that.CE_READY, function() { - that.isReady = true; - }); - }; - - YU.Storage.prototype = { - - /** - * The event name for when the storage item is ready. - * @property CE_READY - * @type {String} - * @public - */ - CE_READY: 'YUIStorageReady', - - /** - * The event name for when the storage item has changed. - * @property CE_CHANGE - * @type {String} - * @public - */ - CE_CHANGE: 'YUIStorageChange', - - /** - * The delimiter uesed between the data type and the data. - * @property DELIMITER - * @type {String} - * @public - */ - DELIMITER: '__', - - /** - * The configuration of the engine. - * @property _cfg - * @type {Object} - * @protected - */ - _cfg: '', - - /** - * The name of this engine. - * @property _name - * @type {String} - * @protected - */ - _name: '', - - /** - * The location for this instance. - * @property _location - * @type {String} - * @protected - */ - _location: '', - - /** - * The current length of the keys. - * @property length - * @type {Number} - * @public - */ - length: 0, - - /** - * This engine singleton has been initialized already. - * @property isReady - * @type {String} - * @protected - */ - isReady: false, - - /** - * Clears any existing key/value pairs. - * @method clear - * @public - */ - clear: function() { - this._clear(); - this.length = 0; - }, - - /** - * Fetches the data stored and the provided key. - * @method getItem - * @param key {String} Required. The key used to reference this value (DOMString in HTML 5 spec). - * @return {String|NULL} The value stored at the provided key (DOMString in HTML 5 spec). - * @public - */ - getItem: function(key) { - Y.log("Fetching item at " + key); - var item = this._getItem(key); - return YL.isValue(item) ? this._getValue(item) : null; // required by HTML 5 spec - }, - - /** - * Fetches the storage object's name; should be overwritten by storage engine. - * @method getName - * @return {String} The name of the data storage object. - * @public - */ - getName: function() {return this._name;}, - - /** - * Tests if the key has been set (not in HTML 5 spec); should be overwritten by storage engine. - * @method hasKey - * @param key {String} Required. The key to search for. - * @return {Boolean} True when key has been set. - * @public - */ - hasKey: function(key) { - return YL.isString(key) && this._hasKey(key); - }, - - /** - * Retrieve the key stored at the provided index; should be overwritten by storage engine. - * @method key - * @param index {Number} Required. The index to retrieve (unsigned long in HTML 5 spec). - * @return {String} Required. The key at the provided index (DOMString in HTML 5 spec). - * @public - */ - key: function(index) { - Y.log("Fetching key at " + index); - - if (YL.isNumber(index) && -1 < index && this.length > index) { - var value = this._key(index); - if (value) {return value;} - } - - // this is thrown according to the HTML5 spec - throw('INDEX_SIZE_ERR - Storage.setItem - The provided index (' + index + ') is not available'); - }, - - /** - * Remove an item from the data storage. - * @method setItem - * @param key {String} Required. The key to remove (DOMString in HTML 5 spec). - * @public - */ - removeItem: function(key) { - Y.log("removing " + key); - - if (this.hasKey(key)) { - var oldValue = this._getItem(key); - if (! oldValue) {oldValue = null;} - this._removeItem(key); - this.fireEvent(this.CE_CHANGE, new YU.StorageEvent(this, key, oldValue, null, YU.StorageEvent.TYPE_REMOVE_ITEM)); - } - else { - // HTML 5 spec says to do nothing - } - }, - - /** - * Adds an item to the data storage. - * @method setItem - * @param key {String} Required. The key used to reference this value (DOMString in HTML 5 spec). - * @param data {Object} Required. The data to store at key (DOMString in HTML 5 spec). - * @public - * @throws QUOTA_EXCEEDED_ERROR - */ - setItem: function(key, data) { - Y.log("SETTING " + data + " to " + key); - - if (YL.isString(key)) { - var eventType = this.hasKey(key) ? YU.StorageEvent.TYPE_UPDATE_ITEM : YU.StorageEvent.TYPE_ADD_ITEM, - oldValue = this._getItem(key); - if (! oldValue) {oldValue = null;} - - if (this._setItem(key, this._createValue(data))) { - this.fireEvent(this.CE_CHANGE, new YU.StorageEvent(this, key, oldValue, data, eventType)); - } - else { - // this is thrown according to the HTML5 spec - throw('QUOTA_EXCEEDED_ERROR - Storage.setItem - The choosen storage method (' + - this.getName() + ') has exceeded capacity'); - } - } - else { - // HTML 5 spec says to do nothing - } - }, - - /** - * Implementation of the clear login; should be overwritten by storage engine. - * @method _clear - * @protected - */ - _clear: function() { - _logOverwriteError('_clear'); - return ''; - }, - - /** - * Converts the object into a string, with meta data (type), so it can be restored later. - * @method _createValue - * @param s {Object} Required. An object to store. - * @protected - */ - _createValue: function(s) { - var type = (YL.isNull(s) || YL.isUndefined(s)) ? ('' + s) : typeof s; - return 'string' === type ? s : type + this.DELIMITER + s; - }, - - /** - * Implementation of the getItem login; should be overwritten by storage engine. - * @method _getItem - * @param key {String} Required. The key used to reference this value. - * @return {String|NULL} The value stored at the provided key. - * @protected - */ - _getItem: function(key) { - _logOverwriteError('_getItem'); - return ''; - }, - - /** - * Converts the stored value into its appropriate type. - * @method _getValue - * @param s {String} Required. The stored value. - * @protected - */ - _getValue: function(s) { - var a = s ? s.split(this.DELIMITER) : []; - if (1 == a.length) {return s;} - - switch (a[0]) { - case 'boolean': return 'true' === a[1]; - case 'number': return parseFloat(a[1]); - case 'null': return null; - default: return a[1]; - } - }, - - /** - * Implementation of the key logic; should be overwritten by storage engine. - * @method _key - * @param index {Number} Required. The index to retrieve (unsigned long in HTML 5 spec). - * @return {String|NULL} Required. The key at the provided index (DOMString in HTML 5 spec). - * @protected - */ - _key: function(index) { - _logOverwriteError('_key'); - return ''; - }, - - /* - * Implementation to fetch evaluate the existence of a key. - * @see YAHOO.util.Storage._hasKey - */ - _hasKey: function(key) { - return null !== this._getItem(key); - }, - - /** - * Implementation of the removeItem login; should be overwritten by storage engine. - * @method _removeItem - * @param key {String} Required. The key to remove. - * @protected - */ - _removeItem: function(key) { - _logOverwriteError('_removeItem'); - return ''; - }, - - /** - * Implementation of the setItem login; should be overwritten by storage engine. - * @method _setItem - * @param key {String} Required. The key used to reference this value. - * @param data {Object} Required. The data to storage at key. - * @return {Boolean} True when successful, false when size QUOTA exceeded. - * @protected - */ - _setItem: function(key, data) { - _logOverwriteError('_setItem'); - return ''; - } - }; - - YL.augmentProto(YU.Storage, YU.EventProvider); -} - -}()); -/** - * The StorageManager class is a singleton that registers DataStorage objects and returns instances of those objects. - * @class StorageManager - * @namespace YAHOO.util - * @static - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - - // private variables - _locationEngineMap = {}, // cached engines - _registeredEngineSet = [], // set of available engines - _registeredEngineMap = {}, // map of available engines - - /** - * Fetches a storage constructor if it is available, otherwise returns NULL. - * @method _getClass - * @param klass {Function} Required. The storage constructor to test. - * @return {Function} An available storage constructor or NULL. - * @private - */ - _getClass = function(klass) { - return (klass && klass.isAvailable()) ? klass : null; - }, - - /** - * Fetches the storage engine from the cache, or creates and caches it. - * @method _getStorageEngine - * @param location {String} Required. The location to store. - * @param klass {Function} Required. A pointer to the engineType Class. - * @param conf {Object} Optional. Additional configuration for the data source engine. - * @private - */ - _getStorageEngine = function(location, klass, conf) { - var engine = _locationEngineMap[location + klass.ENGINE_NAME]; - - if (! engine) { - engine = new klass(location, conf); - _locationEngineMap[location + klass.ENGINE_NAME] = engine; - } - - return engine; - }, - - /** - * Ensures that the location is valid before returning it or a default value. - * @method _getValidLocation - * @param location {String} Required. The location to evaluate. - * @private - */ - _getValidLocation = function(location) { - switch (location) { - case Y.StorageManager.LOCATION_LOCAL: - case Y.StorageManager.LOCATION_SESSION: - return location; - - default: return Y.StorageManager.LOCATION_SESSION; - } - }; - - // public namespace - Y.StorageManager = { - - /** - * The storage location - session; data cleared at the end of a user's session. - * @property LOCATION_SESSION - * @type {String} - * @static - */ - LOCATION_SESSION: 'sessionStorage', - - /** - * The storage location - local; data cleared on demand. - * @property LOCATION_LOCAL - * @type {String} - * @static - */ - LOCATION_LOCAL: 'localStorage', - - /** - * Fetches the desired engine type or first available engine type. - * @method get - * @param engineType {String} Optional. The engine type, see engines. - * @param location {String} Optional. The storage location - LOCATION_SESSION & LOCATION_LOCAL; default is LOCAL. - * @param conf {Object} Optional. Additional configuration for the getting the storage engine. - * { - * engine: {Object} configuration parameters for the desired engine - * order: {Array} an array of storage engine names; the desired order to try engines} - * } - * @static - */ - get: function(engineType, location, conf) { - var _cfg = YL.isObject(conf) ? conf : {}, - klass = _getClass(_registeredEngineMap[engineType]); - - if (! klass && ! _cfg.force) { - var i, j; - - if (_cfg.order) { - j = _cfg.order.length; - - for (i = 0; i < j && ! klass; i += 1) { - klass = _getClass(_cfg.order[i]); - } - } - - if (! klass) { - j = _registeredEngineSet.length; - - for (i = 0; i < j && ! klass; i += 1) { - klass = _getClass(_registeredEngineSet[i]); - } - } - } - - if (klass) { - return _getStorageEngine(_getValidLocation(location), klass, _cfg.engine); - } - - throw('YAHOO.util.StorageManager.get - No engine available, please include an engine before calling this function.'); - }, - - /* - * Estimates the size of the string using 1 byte for each alpha-numeric character and 3 for each non-alpha-numeric character. - * @method getByteSize - * @param s {String} Required. The string to evaulate. - * @return {Number} The estimated string size. - * @private - */ - getByteSize: function(s) { - return encodeURIComponent('' + s).length; - }, - - /** - * Registers a engineType Class with the StorageManager singleton; first in is the first out. - * @method register - * @param engineConstructor {Function} Required. The engine constructor function, see engines. - * @return {Boolean} When successfully registered. - * @static - */ - register: function(engineConstructor) { - if (YL.isFunction(engineConstructor) && YL.isFunction(engineConstructor.isAvailable) && YL.isString(engineConstructor.ENGINE_NAME)) { - _registeredEngineMap[engineConstructor.ENGINE_NAME] = engineConstructor; - _registeredEngineSet.push(engineConstructor); - return true; - } - - return false; - } - }; - - YAHOO.register("StorageManager", Y.SWFStore, {version: "2.8.0r4", build: "2449"}); -}()); -(function() { - -/** - * The StorageEvent class manages the storage events by emulating the HTML 5 implementation. - * @namespace YAHOO.util - * @class StorageEvent - * @constructor - * @param storageArea {Object} Required. The Storage object that was affected. - * @param key {String} Required. The key being changed; DOMString in HTML 5 spec. - * @param oldValue {String} Required. The old value of the key being changed; DOMString in HTML 5 spec. - * @param newValue {String} Required. The new value of the key being changed; DOMString in HTML 5 spec. - * @param type {String} Required. The storage event type. - */ -YAHOO.util.StorageEvent = function(storageArea, key, oldValue, newValue, type) { - this.key = key; - this.oldValue = oldValue; - this.newValue = newValue; - this.url = window.location.href; - this.window = window; // todo: think about the CAJA and innocent code - this.storageArea = storageArea; - this.type = type; -}; - -YAHOO.lang.augmentObject(YAHOO.util.StorageEvent, { - TYPE_ADD_ITEM: 'addItem', - TYPE_REMOVE_ITEM: 'removeItem', - TYPE_UPDATE_ITEM: 'updateItem' -}); - -YAHOO.util.StorageEvent.prototype = { - - /** - * The 'key' attribute represents the key being changed. - * @property key - * @type {String} - * @static - * @readonly - */ - key: null, - - /** - * The 'newValue' attribute represents the new value of the key being changed. - * @property newValue - * @type {String} - * @static - * @readonly - */ - newValue: null, - - /** - * The 'oldValue' attribute represents the old value of the key being changed. - * @property oldValue - * @type {String} - * @static - * @readonly - */ - oldValue: null, - - /** - * The 'source' attribute represents the WindowProxy object of the browsing context of the document whose key changed. - * @property source - * @type {Object} - * @static - * @readonly - */ - source: null, - - /** - * The 'storageArea' attribute represents the Storage object that was affected. - * @property storageArea - * @type {Object} - * @static - * @readonly - */ - storageArea: null, - - /** - * The 'type' attribute represents the Storage event type. - * @property type - * @type {Object} - * @static - * @readonly - */ - type: null, - - /** - * The 'url' attribute represents the address of the document whose key changed. - * @property url - * @type {String} - * @static - * @readonly - */ - url: null -}; - -}()); -(function() { -var Y = YAHOO.util, - YL = YAHOO.lang; - - /** - * The StorageEngineKeyed class implements the interface necessary for managing keys. - * @namespace YAHOO.util - * @class StorageEngineKeyed - * @constructor - * @extend YAHOO.util.Storage - */ - Y.StorageEngineKeyed = function() { - Y.StorageEngineKeyed.superclass.constructor.apply(this, arguments); - this._keys = []; - this._keyMap = {}; - }; - - YL.extend(Y.StorageEngineKeyed, Y.Storage, { - - /** - * A collection of keys applicable to the current location. This should never be edited by the developer. - * @property _keys - * @type {Array} - * @protected - */ - _keys: null, - - /** - * A map of keys to their applicable position in keys array. This should never be edited by the developer. - * @property _keyMap - * @type {Object} - * @protected - */ - _keyMap: null, - - /** - * Adds the key to the set. - * @method _addKey - * @param key {String} Required. The key to evaluate. - * @protected - */ - _addKey: function(key) { - this._keyMap[key] = this.length; - this._keys.push(key); - this.length = this._keys.length; - }, - - /** - * Evaluates if a key exists in the keys array; indexOf does not work in all flavors of IE. - * @method _indexOfKey - * @param key {String} Required. The key to evaluate. - * @protected - */ - _indexOfKey: function(key) { - var i = this._keyMap[key]; - return undefined === i ? -1 : i; - }, - - /** - * Removes a key from the keys array. - * @method _removeKey - * @param key {String} Required. The key to remove. - * @protected - */ - _removeKey: function(key) { - var j = this._indexOfKey(key), - rest = this._keys.slice(j + 1); - - delete this._keyMap[key]; - - for (var k in this._keyMap) { - if (j < this._keyMap[k]) { - this._keyMap[k] -= 1; - } - } - - this._keys.length = j; - this._keys = this._keys.concat(rest); - this.length = this._keys.length; - } - }); -}()); -/* - * HTML limitations: - * - 5MB in FF and Safari, 10MB in IE 8 - * - only FF 3.5 recovers session storage after a browser crash - * - * Thoughts: - * - how can we not use cookies to handle session - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - - /* - * Required for IE 8 to make synchronous. - */ - _beginTransaction = function(engine) { - if (engine.begin) {engine.begin();} - }, - - /* - * Required for IE 8 to make synchronous. - */ - _commitTransaction = function(engine) { - if (engine.commit) {engine.commit();} - }; - - /** - * The StorageEngineHTML5 class implements the HTML5 storage engine. - * @namespace YAHOO.util - * @class StorageEngineHTML5 - * @constructor - * @extend YAHOO.util.Storage - * @param location {String} Required. The storage location. - * @param conf {Object} Required. A configuration object. - */ - Y.StorageEngineHTML5 = function(location, conf) { - var _this = this; - Y.StorageEngineHTML5.superclass.constructor.call(_this, location, Y.StorageEngineHTML5.ENGINE_NAME, conf);// not set, are cookies available - _this._engine = window[location]; - _this.length = _this._engine.length; - YL.later(250, _this, function() { // temporary solution so that CE_READY can be subscribed to after this object is created - _this.fireEvent(_this.CE_READY); - }); - }; - - YAHOO.lang.extend(Y.StorageEngineHTML5, Y.Storage, { - - _engine: null, - - /* - * Implementation to clear the values from the storage engine. - * @see YAHOO.util.Storage._clear - */ - _clear: function() { - var _this = this; - if (_this._engine.clear) { - _this._engine.clear(); - } - // for FF 3, fixed in FF 3.5 - else { - for (var i = _this.length, key; 0 <= i; i -= 1) { - key = _this._key(i); - _this._removeItem(key); - } - } - }, - - /* - * Implementation to fetch an item from the storage engine. - * @see YAHOO.util.Storage._getItem - */ - _getItem: function(key) { - var o = this._engine.getItem(key); - return YL.isObject(o) ? o.value : o; // for FF 3, fixed in FF 3.5 - }, - - /* - * Implementation to fetch a key from the storage engine. - * @see YAHOO.util.Storage._key - */ - _key: function(index) {return this._engine.key(index);}, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._removeItem - */ - _removeItem: function(key) { - var _this = this; - _beginTransaction(_this._engine); - _this._engine.removeItem(key); - _commitTransaction(_this._engine); - _this.length = _this._engine.length; - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._setItem - */ - _setItem: function(key, value) { - var _this = this; - - try { - _beginTransaction(_this._engine); - _this._engine.setItem(key, value); - _commitTransaction(_this._engine); - _this.length = _this._engine.length; - return true; - } - catch (e) { - return false; - } - } - }, true); - - Y.StorageEngineHTML5.ENGINE_NAME = 'html5'; - Y.StorageEngineHTML5.isAvailable = function() { - return window.localStorage; - }; - Y.StorageManager.register(Y.StorageEngineHTML5); -}()); -/* - * Gears limitation: - * - SQLite limitations - http://www.sqlite.org/limits.html - * - DB Best Practices - http://code.google.com/apis/gears/gears_faq.html#bestPracticeDB - * - the user must approve before gears can be used - * - each SQL query has a limited number of characters (9948 bytes), data will need to be spread across rows - * - no query should insert or update more than 9948 bytes of data in a single statement or GEARs will throw: - * [Exception... "'Error: SQL statement is too long.' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "" data: no] - * - * Thoughts: - * - we may want to implement additional functions for the gears only implementation - * - how can we not use cookies to handle session location - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - _SQL_STMT_LIMIT = 9948, - _TABLE_NAME = 'YUIStorageEngine', - - // local variables - _engine = null, - - eURI = encodeURIComponent, - dURI = decodeURIComponent; - - /** - * The StorageEngineGears class implements the Google Gears storage engine. - * @namespace YAHOO.util - * @class StorageEngineGears - * @constructor - * @extend YAHOO.util.Storage - * @param location {String} Required. The storage location. - * @param conf {Object} Required. A configuration object. - */ - Y.StorageEngineGears = function(location, conf) { - var _this = this; - Y.StorageEngineGears.superclass.constructor.call(_this, location, Y.StorageEngineGears.ENGINE_NAME, conf); - - if (! _engine) { - // create the database - _engine = google.gears.factory.create(Y.StorageEngineGears.GEARS); - _engine.open(window.location.host + '-' + Y.StorageEngineGears.DATABASE); - _engine.execute('CREATE TABLE IF NOT EXISTS ' + _TABLE_NAME + ' (key TEXT, location TEXT, value TEXT)'); - } - - var isSessionStorage = Y.StorageManager.LOCATION_SESSION === _this._location, - sessionKey = Y.Cookie.get('sessionKey' + Y.StorageEngineGears.ENGINE_NAME); - - if (! sessionKey) { - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE location="' + eURI(Y.StorageManager.LOCATION_SESSION) + '"'); - _engine.execute('COMMIT'); - } - - var rs = _engine.execute('SELECT key FROM ' + _TABLE_NAME + ' WHERE location="' + eURI(_this._location) + '"'), - keyMap = {}; - - try { - // iterate on the rows and map the keys - while (rs.isValidRow()) { - var fld = dURI(rs.field(0)); - - if (! keyMap[fld]) { - keyMap[fld] = true; - _this._addKey(fld); - } - - rs.next(); - } - } - finally { - rs.close(); - } - - // this is session storage, ensure that the session key is set - if (isSessionStorage) { - Y.Cookie.set('sessionKey' + Y.StorageEngineGears.ENGINE_NAME, true); - } - - _this.length = _this._keys.length; - YL.later(250, _this, function() { // temporary solution so that CE_READY can be subscribed to after this object is created - _this.fireEvent(_this.CE_READY); - }); - }; - - YL.extend(Y.StorageEngineGears, Y.StorageEngineKeyed, { - - /* - * Implementation to clear the values from the storage engine. - * @see YAHOO.util.Storage._clear - */ - _clear: function() { - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE location="' + eURI(this._location) + '"'); - _engine.execute('COMMIT'); - this._keys = []; - this.length = 0; - }, - - /* - * Implementation to fetch an item from the storage engine. - * @see YAHOO.util.Storage._getItem - */ - _getItem: function(key) { - var rs = _engine.execute('SELECT value FROM ' + _TABLE_NAME + ' WHERE key="' + eURI(key) + '" AND location="' + eURI(this._location) + '"'), - value = ''; - - try { - while (rs.isValidRow()) { - var temp = rs.field(0); - value += rs.field(0); - rs.next(); - } - } - finally { - rs.close(); - } - - return value ? dURI(value) : null; - }, - - /* - * Implementation to fetch a key from the storage engine. - * @see YAHOO.util.Storage.key - */ - _key: function(index) {return this._keys[index];}, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._removeItem - */ - _removeItem: function(key) { - YAHOO.log("removing " + key); - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE key="' + eURI(key) + '" AND location="' + eURI(this._location) + '"'); - _engine.execute('COMMIT'); - this._removeKey(key); - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._setItem - */ - _setItem: function(key, data) { - YAHOO.log("SETTING " + data + " to " + key); - - if (! this.hasKey(key)) { - this._addKey(key); - } - - var _key = eURI(key), - _location = eURI(this._location), - _value = eURI(data), - _values = [], - _len = _SQL_STMT_LIMIT - (_key + _location).length; - - // the length of the value exceeds the available space - if (_len < _value.length) { - for (var i = 0, j = _value.length; i < j; i += _len) { - _values.push(_value.substr(i, _len)); - } - } - else { - _values.push(_value); - } - - // Google recommends using INSERT instead of update, because it is faster - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE key="' + eURI(key) + '" AND location="' + eURI(this._location) + '"'); - for (var m = 0, n = _values.length; m < n; m += 1) { - _engine.execute('INSERT INTO ' + _TABLE_NAME + ' VALUES ("' + _key + '", "' + _location + '", "' + _values[m] + '")'); - } - _engine.execute('COMMIT'); - - return true; - } - }); - - // releases the engine when the page unloads - Y.Event.on('unload', function() { - if (_engine) {_engine.close();} - }); - Y.StorageEngineGears.ENGINE_NAME = 'gears'; - Y.StorageEngineGears.GEARS = 'beta.database'; - Y.StorageEngineGears.DATABASE = 'yui.database'; - Y.StorageEngineGears.isAvailable = function() { - if (window.google && window.google.gears) { - try { - // this will throw an exception if the user denies gears - google.gears.factory.create(Y.StorageEngineGears.GEARS); - return true; - } - catch (e) { - // no need to do anything - } - } - - return false; - }; - Y.StorageManager.register(Y.StorageEngineGears); -}()); -/* - * SWF limitation: - * - only 100,000 bytes of data may be stored this way - * - data is publicly available on user machine - * - * Thoughts: - * - data can be shared across browsers - * - how can we not use cookies to handle session location - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - YD = Y.Dom, - - /* - * The minimum width required to be able to display the settings panel within the SWF. - */ - MINIMUM_WIDTH = 215, - - /* - * The minimum height required to be able to display the settings panel within the SWF. - */ - MINIMUM_HEIGHT = 138, - - // local variables - _engine = null, - - /* - * Creates a location bound key. - */ - _getKey = function(that, key) { - return that._location + that.DELIMITER + key; - }, - - /* - * Initializes the engine, if it isn't already initialized. - */ - _initEngine = function(cfg) { - if (! _engine) { - if (! YL.isString(cfg.swfURL)) {cfg.swfURL = Y.StorageEngineSWF.SWFURL;} - if (! cfg.containerID) { - var bd = document.getElementsByTagName('body')[0], - container = bd.appendChild(document.createElement('div')); - cfg.containerID = YD.generateId(container); - } - - if (! cfg.attributes) {cfg.attributes = {};} - if (! cfg.attributes.flashVars) {cfg.attributes.flashVars = {};} - cfg.attributes.flashVars.useCompression = 'true'; - cfg.attributes.version = 9.115; - _engine = new YAHOO.widget.SWF(cfg.containerID, cfg.swfURL, cfg.attributes); - } - }; - - /** - * The StorageEngineSWF class implements the SWF storage engine. - * @namespace YAHOO.util - * @class StorageEngineSWF - * @uses YAHOO.widget.SWF - * @constructor - * @extend YAHOO.util.Storage - * @param location {String} Required. The storage location. - * @param conf {Object} Required. A configuration object. - */ - Y.StorageEngineSWF = function(location, conf) { - var _this = this; - Y.StorageEngineSWF.superclass.constructor.call(_this, location, Y.StorageEngineSWF.ENGINE_NAME, conf); - - _initEngine(_this._cfg); - - // evaluates when the SWF is loaded - _engine.unsubscribe('contentReady'); // prevents local and session content ready callbacks from firing, when switching between context - _engine.addListener("contentReady", function() { - _this._swf = _engine._swf; - _engine.initialized = true; - - var isSessionStorage = Y.StorageManager.LOCATION_SESSION === _this._location, - sessionKey = Y.Cookie.get('sessionKey' + Y.StorageEngineSWF.ENGINE_NAME); - - for (var i = _engine.callSWF("getLength", []) - 1; 0 <= i; i -= 1) { - var key = _engine.callSWF("getNameAt", [i]), - isKeySessionStorage = -1 < key.indexOf(Y.StorageManager.LOCATION_SESSION + _this.DELIMITER); - - // this is session storage, but the session key is not set, so remove item - if (isSessionStorage && ! sessionKey) { - _engine.callSWF("removeItem", [key]); - } - // the key matches the storage type, add to key collection - else if (isSessionStorage === isKeySessionStorage) { - _this._addKey(key); - } - } - - // this is session storage, ensure that the session key is set - if (isSessionStorage) { - Y.Cookie.set('sessionKey' + Y.StorageEngineSWF.ENGINE_NAME, true); - } - - _this.length = _this._keys.length; - _this.fireEvent(_this.CE_READY); - }); - - // required for pages with both a session and local storage - if (_engine.initialized) {_engine.fireEvent('contentReady');} - }; - - YL.extend(Y.StorageEngineSWF, Y.StorageEngineKeyed, { - /** - * The underlying SWF of the engine, exposed so developers can modify the adapter behavior. - * @property _swf - * @type {Object} - * @protected - */ - _swf: null, - - /* - * Implementation to clear the values from the storage engine. - * @see YAHOO.util.Storage._clear - */ - _clear: function() { - for (var i = this._keys.length - 1; 0 <= i; i -= 1) { - var key = this._keys[i]; - _engine.callSWF("removeItem", [key]); - } - - this._keys = []; - this.length = 0; - }, - - /* - * Implementation to fetch an item from the storage engine. - * @see YAHOO.util.Storage._getItem - */ - _getItem: function(key) { - var _key = _getKey(this, key); - return _engine.callSWF("getValueOf", [_key]); - }, - - /* - * Implementation to fetch a key from the storage engine. - * @see YAHOO.util.Storage.key - */ - _key: function(index) { - return (this._keys[index] || '').replace(/^.*?__/, ''); - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._removeItem - */ - _removeItem: function(key) { - var _key = _getKey(this, key); - _engine.callSWF("removeItem", [_key]); - this._removeKey(_key); - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._setItem - */ - _setItem: function(key, data) { - var _key = _getKey(this, key), swfNode; - - // setting the value returns false if the value didn't change, - // so I changed this to clear the key if it exists so that the - // fork below works. - if (_engine.callSWF("getValueOf", [_key])) { - this._removeItem(key); - } - - this._addKey(_key); - - if (_engine.callSWF("setItem", [_key, data])) { - return true; - } else { - - // @TODO we should not assume that a false return means that - // the quota has been exceeded. this dialog should only be - // displayed if the quotaExceededError event fired. - swfNode = YD.get(_engine._id); - if (MINIMUM_WIDTH > YD.getStyle(swfNode, 'width').replace(/\D+/g, '')) { - YD.setStyle(swfNode, 'width', MINIMUM_WIDTH + 'px'); - } - if (MINIMUM_HEIGHT > YD.getStyle(swfNode, 'height').replace(/\D+/g, '')) { - YD.setStyle(swfNode, 'height', MINIMUM_HEIGHT + 'px'); - } - return _engine.callSWF("displaySettings", []); - } - } - }); - - Y.StorageEngineSWF.SWFURL = "swfstore.swf"; - Y.StorageEngineSWF.ENGINE_NAME = 'swf'; - Y.StorageEngineSWF.isAvailable = function() { - return (6 <= YAHOO.env.ua.flash && YAHOO.widget.SWF); - }; - Y.StorageManager.register(Y.StorageEngineSWF); -}()); -YAHOO.register("storage", YAHOO.util.Storage, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-min.js deleted file mode 100644 index 103553f300..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage-min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var D=YAHOO,B=D.util,A=D.lang,C;if(!B.Storage){C=function(E){D.log("Exception in YAHOO.util.Storage.?? - must be extended by a storage engine".replace("??",E).replace("??",this.getName?this.getName():"Unknown"),"error");};B.Storage=function(E,G,F){var H=this;D.env._id_counter+=1;H._cfg=A.isObject(F)?F:{};H._location=E;H._name=G;H.isReady=false;H.createEvent(H.CE_READY,{scope:H});H.createEvent(H.CE_CHANGE,{scope:H});H.subscribe(H.CE_READY,function(){H.isReady=true;});};B.Storage.prototype={CE_READY:"YUIStorageReady",CE_CHANGE:"YUIStorageChange",DELIMITER:"__",_cfg:"",_name:"",_location:"",length:0,isReady:false,clear:function(){this._clear();this.length=0;},getItem:function(E){D.log("Fetching item at "+E);var F=this._getItem(E);return A.isValue(F)?this._getValue(F):null;},getName:function(){return this._name;},hasKey:function(E){return A.isString(E)&&this._hasKey(E);},key:function(E){D.log("Fetching key at "+E);if(A.isNumber(E)&&-1E){var F=this._key(E);if(F){return F;}}throw ("INDEX_SIZE_ERR - Storage.setItem - The provided index ("+E+") is not available");},removeItem:function(F){D.log("removing "+F);if(this.hasKey(F)){var E=this._getItem(F);if(!E){E=null;}this._removeItem(F);this.fireEvent(this.CE_CHANGE,new B.StorageEvent(this,F,E,null,B.StorageEvent.TYPE_REMOVE_ITEM));}else{}},setItem:function(G,H){D.log("SETTING "+H+" to "+G);if(A.isString(G)){var F=this.hasKey(G)?B.StorageEvent.TYPE_UPDATE_ITEM:B.StorageEvent.TYPE_ADD_ITEM,E=this._getItem(G);if(!E){E=null;}if(this._setItem(G,this._createValue(H))){this.fireEvent(this.CE_CHANGE,new B.StorageEvent(this,G,E,H,F));}else{throw ("QUOTA_EXCEEDED_ERROR - Storage.setItem - The choosen storage method ("+this.getName()+") has exceeded capacity");}}else{}},_clear:function(){C("_clear");return"";},_createValue:function(F){var E=(A.isNull(F)||A.isUndefined(F))?(""+F):typeof F;return"string"===E?F:E+this.DELIMITER+F;},_getItem:function(E){C("_getItem");return"";},_getValue:function(F){var E=F?F.split(this.DELIMITER):[];if(1==E.length){return F;}switch(E[0]){case"boolean":return"true"===E[1];case"number":return parseFloat(E[1]);case"null":return null;default:return E[1];}},_key:function(E){C("_key");return"";},_hasKey:function(E){return null!==this._getItem(E);},_removeItem:function(E){C("_removeItem");return"";},_setItem:function(E,F){C("_setItem");return"";}};A.augmentProto(B.Storage,B.EventProvider);}}());(function(){var H=YAHOO.util,B=YAHOO.lang,E={},G=[],F={},C=function(I){return(I&&I.isAvailable())?I:null;},A=function(J,I,K){var L=E[J+I.ENGINE_NAME];if(!L){L=new I(J,K);E[J+I.ENGINE_NAME]=L;}return L;},D=function(I){switch(I){case H.StorageManager.LOCATION_LOCAL:case H.StorageManager.LOCATION_SESSION:return I;default:return H.StorageManager.LOCATION_SESSION;}};H.StorageManager={LOCATION_SESSION:"sessionStorage",LOCATION_LOCAL:"localStorage",get:function(O,J,M){var K=B.isObject(M)?M:{},I=C(F[O]);if(!I&&!K.force){var N,L;if(K.order){L=K.order.length;for(N=0;NH.getStyle(L,"width").replace(/\D+/g,"")){H.setStyle(L,"width",C+"px");}if(E>H.getStyle(L,"height").replace(/\D+/g,"")){H.setStyle(L,"height",E+"px");}return F.callSWF("displaySettings",[]);}}});G.StorageEngineSWF.SWFURL="swfstore.swf";G.StorageEngineSWF.ENGINE_NAME="swf";G.StorageEngineSWF.isAvailable=function(){return(6<=YAHOO.env.ua.flash&&YAHOO.widget.SWF);};G.StorageManager.register(G.StorageEngineSWF);}());YAHOO.register("storage",YAHOO.util.Storage,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage.js deleted file mode 100644 index bebcb8bfb8..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/storage/storage.js +++ /dev/null @@ -1,1183 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The Storage module manages client-side data storage. - * @module Storage - */ - -(function() { - - // internal shorthand -var Y = YAHOO, - YU = Y.util, - YL = Y.lang, - _logOverwriteError; - -if (! YU.Storage) { - _logOverwriteError = function(fxName) { - Y.log('Exception in YAHOO.util.Storage.?? - must be extended by a storage engine'.replace('??', fxName).replace('??', this.getName ? this.getName() : 'Unknown'), 'error'); - }; - - /** - * The Storage class is an HTML 5 storage API clone, used to wrap individual storage implementations with a common API. - * @class Storage - * @namespace YAHOO.util - * @constructor - * @param location {String} Required. The storage location. - * @parm name {String} Required. The engine name. - * @param conf {Object} Required. A configuration object. - */ - YU.Storage = function(location, name, conf) { - var that = this; - Y.env._id_counter += 1; - - // protected variables - that._cfg = YL.isObject(conf) ? conf : {}; - that._location = location; - that._name = name; - that.isReady = false; - - // public variables - that.createEvent(that.CE_READY, {scope: that}); - that.createEvent(that.CE_CHANGE, {scope: that}); - - that.subscribe(that.CE_READY, function() { - that.isReady = true; - }); - }; - - YU.Storage.prototype = { - - /** - * The event name for when the storage item is ready. - * @property CE_READY - * @type {String} - * @public - */ - CE_READY: 'YUIStorageReady', - - /** - * The event name for when the storage item has changed. - * @property CE_CHANGE - * @type {String} - * @public - */ - CE_CHANGE: 'YUIStorageChange', - - /** - * The delimiter uesed between the data type and the data. - * @property DELIMITER - * @type {String} - * @public - */ - DELIMITER: '__', - - /** - * The configuration of the engine. - * @property _cfg - * @type {Object} - * @protected - */ - _cfg: '', - - /** - * The name of this engine. - * @property _name - * @type {String} - * @protected - */ - _name: '', - - /** - * The location for this instance. - * @property _location - * @type {String} - * @protected - */ - _location: '', - - /** - * The current length of the keys. - * @property length - * @type {Number} - * @public - */ - length: 0, - - /** - * This engine singleton has been initialized already. - * @property isReady - * @type {String} - * @protected - */ - isReady: false, - - /** - * Clears any existing key/value pairs. - * @method clear - * @public - */ - clear: function() { - this._clear(); - this.length = 0; - }, - - /** - * Fetches the data stored and the provided key. - * @method getItem - * @param key {String} Required. The key used to reference this value (DOMString in HTML 5 spec). - * @return {String|NULL} The value stored at the provided key (DOMString in HTML 5 spec). - * @public - */ - getItem: function(key) { - Y.log("Fetching item at " + key); - var item = this._getItem(key); - return YL.isValue(item) ? this._getValue(item) : null; // required by HTML 5 spec - }, - - /** - * Fetches the storage object's name; should be overwritten by storage engine. - * @method getName - * @return {String} The name of the data storage object. - * @public - */ - getName: function() {return this._name;}, - - /** - * Tests if the key has been set (not in HTML 5 spec); should be overwritten by storage engine. - * @method hasKey - * @param key {String} Required. The key to search for. - * @return {Boolean} True when key has been set. - * @public - */ - hasKey: function(key) { - return YL.isString(key) && this._hasKey(key); - }, - - /** - * Retrieve the key stored at the provided index; should be overwritten by storage engine. - * @method key - * @param index {Number} Required. The index to retrieve (unsigned long in HTML 5 spec). - * @return {String} Required. The key at the provided index (DOMString in HTML 5 spec). - * @public - */ - key: function(index) { - Y.log("Fetching key at " + index); - - if (YL.isNumber(index) && -1 < index && this.length > index) { - var value = this._key(index); - if (value) {return value;} - } - - // this is thrown according to the HTML5 spec - throw('INDEX_SIZE_ERR - Storage.setItem - The provided index (' + index + ') is not available'); - }, - - /** - * Remove an item from the data storage. - * @method setItem - * @param key {String} Required. The key to remove (DOMString in HTML 5 spec). - * @public - */ - removeItem: function(key) { - Y.log("removing " + key); - - if (this.hasKey(key)) { - var oldValue = this._getItem(key); - if (! oldValue) {oldValue = null;} - this._removeItem(key); - this.fireEvent(this.CE_CHANGE, new YU.StorageEvent(this, key, oldValue, null, YU.StorageEvent.TYPE_REMOVE_ITEM)); - } - else { - // HTML 5 spec says to do nothing - } - }, - - /** - * Adds an item to the data storage. - * @method setItem - * @param key {String} Required. The key used to reference this value (DOMString in HTML 5 spec). - * @param data {Object} Required. The data to store at key (DOMString in HTML 5 spec). - * @public - * @throws QUOTA_EXCEEDED_ERROR - */ - setItem: function(key, data) { - Y.log("SETTING " + data + " to " + key); - - if (YL.isString(key)) { - var eventType = this.hasKey(key) ? YU.StorageEvent.TYPE_UPDATE_ITEM : YU.StorageEvent.TYPE_ADD_ITEM, - oldValue = this._getItem(key); - if (! oldValue) {oldValue = null;} - - if (this._setItem(key, this._createValue(data))) { - this.fireEvent(this.CE_CHANGE, new YU.StorageEvent(this, key, oldValue, data, eventType)); - } - else { - // this is thrown according to the HTML5 spec - throw('QUOTA_EXCEEDED_ERROR - Storage.setItem - The choosen storage method (' + - this.getName() + ') has exceeded capacity'); - } - } - else { - // HTML 5 spec says to do nothing - } - }, - - /** - * Implementation of the clear login; should be overwritten by storage engine. - * @method _clear - * @protected - */ - _clear: function() { - _logOverwriteError('_clear'); - return ''; - }, - - /** - * Converts the object into a string, with meta data (type), so it can be restored later. - * @method _createValue - * @param s {Object} Required. An object to store. - * @protected - */ - _createValue: function(s) { - var type = (YL.isNull(s) || YL.isUndefined(s)) ? ('' + s) : typeof s; - return 'string' === type ? s : type + this.DELIMITER + s; - }, - - /** - * Implementation of the getItem login; should be overwritten by storage engine. - * @method _getItem - * @param key {String} Required. The key used to reference this value. - * @return {String|NULL} The value stored at the provided key. - * @protected - */ - _getItem: function(key) { - _logOverwriteError('_getItem'); - return ''; - }, - - /** - * Converts the stored value into its appropriate type. - * @method _getValue - * @param s {String} Required. The stored value. - * @protected - */ - _getValue: function(s) { - var a = s ? s.split(this.DELIMITER) : []; - if (1 == a.length) {return s;} - - switch (a[0]) { - case 'boolean': return 'true' === a[1]; - case 'number': return parseFloat(a[1]); - case 'null': return null; - default: return a[1]; - } - }, - - /** - * Implementation of the key logic; should be overwritten by storage engine. - * @method _key - * @param index {Number} Required. The index to retrieve (unsigned long in HTML 5 spec). - * @return {String|NULL} Required. The key at the provided index (DOMString in HTML 5 spec). - * @protected - */ - _key: function(index) { - _logOverwriteError('_key'); - return ''; - }, - - /* - * Implementation to fetch evaluate the existence of a key. - * @see YAHOO.util.Storage._hasKey - */ - _hasKey: function(key) { - return null !== this._getItem(key); - }, - - /** - * Implementation of the removeItem login; should be overwritten by storage engine. - * @method _removeItem - * @param key {String} Required. The key to remove. - * @protected - */ - _removeItem: function(key) { - _logOverwriteError('_removeItem'); - return ''; - }, - - /** - * Implementation of the setItem login; should be overwritten by storage engine. - * @method _setItem - * @param key {String} Required. The key used to reference this value. - * @param data {Object} Required. The data to storage at key. - * @return {Boolean} True when successful, false when size QUOTA exceeded. - * @protected - */ - _setItem: function(key, data) { - _logOverwriteError('_setItem'); - return ''; - } - }; - - YL.augmentProto(YU.Storage, YU.EventProvider); -} - -}()); -/** - * The StorageManager class is a singleton that registers DataStorage objects and returns instances of those objects. - * @class StorageManager - * @namespace YAHOO.util - * @static - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - - // private variables - _locationEngineMap = {}, // cached engines - _registeredEngineSet = [], // set of available engines - _registeredEngineMap = {}, // map of available engines - - /** - * Fetches a storage constructor if it is available, otherwise returns NULL. - * @method _getClass - * @param klass {Function} Required. The storage constructor to test. - * @return {Function} An available storage constructor or NULL. - * @private - */ - _getClass = function(klass) { - return (klass && klass.isAvailable()) ? klass : null; - }, - - /** - * Fetches the storage engine from the cache, or creates and caches it. - * @method _getStorageEngine - * @param location {String} Required. The location to store. - * @param klass {Function} Required. A pointer to the engineType Class. - * @param conf {Object} Optional. Additional configuration for the data source engine. - * @private - */ - _getStorageEngine = function(location, klass, conf) { - var engine = _locationEngineMap[location + klass.ENGINE_NAME]; - - if (! engine) { - engine = new klass(location, conf); - _locationEngineMap[location + klass.ENGINE_NAME] = engine; - } - - return engine; - }, - - /** - * Ensures that the location is valid before returning it or a default value. - * @method _getValidLocation - * @param location {String} Required. The location to evaluate. - * @private - */ - _getValidLocation = function(location) { - switch (location) { - case Y.StorageManager.LOCATION_LOCAL: - case Y.StorageManager.LOCATION_SESSION: - return location; - - default: return Y.StorageManager.LOCATION_SESSION; - } - }; - - // public namespace - Y.StorageManager = { - - /** - * The storage location - session; data cleared at the end of a user's session. - * @property LOCATION_SESSION - * @type {String} - * @static - */ - LOCATION_SESSION: 'sessionStorage', - - /** - * The storage location - local; data cleared on demand. - * @property LOCATION_LOCAL - * @type {String} - * @static - */ - LOCATION_LOCAL: 'localStorage', - - /** - * Fetches the desired engine type or first available engine type. - * @method get - * @param engineType {String} Optional. The engine type, see engines. - * @param location {String} Optional. The storage location - LOCATION_SESSION & LOCATION_LOCAL; default is LOCAL. - * @param conf {Object} Optional. Additional configuration for the getting the storage engine. - * { - * engine: {Object} configuration parameters for the desired engine - * order: {Array} an array of storage engine names; the desired order to try engines} - * } - * @static - */ - get: function(engineType, location, conf) { - var _cfg = YL.isObject(conf) ? conf : {}, - klass = _getClass(_registeredEngineMap[engineType]); - - if (! klass && ! _cfg.force) { - var i, j; - - if (_cfg.order) { - j = _cfg.order.length; - - for (i = 0; i < j && ! klass; i += 1) { - klass = _getClass(_cfg.order[i]); - } - } - - if (! klass) { - j = _registeredEngineSet.length; - - for (i = 0; i < j && ! klass; i += 1) { - klass = _getClass(_registeredEngineSet[i]); - } - } - } - - if (klass) { - return _getStorageEngine(_getValidLocation(location), klass, _cfg.engine); - } - - throw('YAHOO.util.StorageManager.get - No engine available, please include an engine before calling this function.'); - }, - - /* - * Estimates the size of the string using 1 byte for each alpha-numeric character and 3 for each non-alpha-numeric character. - * @method getByteSize - * @param s {String} Required. The string to evaulate. - * @return {Number} The estimated string size. - * @private - */ - getByteSize: function(s) { - return encodeURIComponent('' + s).length; - }, - - /** - * Registers a engineType Class with the StorageManager singleton; first in is the first out. - * @method register - * @param engineConstructor {Function} Required. The engine constructor function, see engines. - * @return {Boolean} When successfully registered. - * @static - */ - register: function(engineConstructor) { - if (YL.isFunction(engineConstructor) && YL.isFunction(engineConstructor.isAvailable) && YL.isString(engineConstructor.ENGINE_NAME)) { - _registeredEngineMap[engineConstructor.ENGINE_NAME] = engineConstructor; - _registeredEngineSet.push(engineConstructor); - return true; - } - - return false; - } - }; - - YAHOO.register("StorageManager", Y.SWFStore, {version: "2.8.0r4", build: "2449"}); -}()); -(function() { - -/** - * The StorageEvent class manages the storage events by emulating the HTML 5 implementation. - * @namespace YAHOO.util - * @class StorageEvent - * @constructor - * @param storageArea {Object} Required. The Storage object that was affected. - * @param key {String} Required. The key being changed; DOMString in HTML 5 spec. - * @param oldValue {String} Required. The old value of the key being changed; DOMString in HTML 5 spec. - * @param newValue {String} Required. The new value of the key being changed; DOMString in HTML 5 spec. - * @param type {String} Required. The storage event type. - */ -YAHOO.util.StorageEvent = function(storageArea, key, oldValue, newValue, type) { - this.key = key; - this.oldValue = oldValue; - this.newValue = newValue; - this.url = window.location.href; - this.window = window; // todo: think about the CAJA and innocent code - this.storageArea = storageArea; - this.type = type; -}; - -YAHOO.lang.augmentObject(YAHOO.util.StorageEvent, { - TYPE_ADD_ITEM: 'addItem', - TYPE_REMOVE_ITEM: 'removeItem', - TYPE_UPDATE_ITEM: 'updateItem' -}); - -YAHOO.util.StorageEvent.prototype = { - - /** - * The 'key' attribute represents the key being changed. - * @property key - * @type {String} - * @static - * @readonly - */ - key: null, - - /** - * The 'newValue' attribute represents the new value of the key being changed. - * @property newValue - * @type {String} - * @static - * @readonly - */ - newValue: null, - - /** - * The 'oldValue' attribute represents the old value of the key being changed. - * @property oldValue - * @type {String} - * @static - * @readonly - */ - oldValue: null, - - /** - * The 'source' attribute represents the WindowProxy object of the browsing context of the document whose key changed. - * @property source - * @type {Object} - * @static - * @readonly - */ - source: null, - - /** - * The 'storageArea' attribute represents the Storage object that was affected. - * @property storageArea - * @type {Object} - * @static - * @readonly - */ - storageArea: null, - - /** - * The 'type' attribute represents the Storage event type. - * @property type - * @type {Object} - * @static - * @readonly - */ - type: null, - - /** - * The 'url' attribute represents the address of the document whose key changed. - * @property url - * @type {String} - * @static - * @readonly - */ - url: null -}; - -}()); -(function() { -var Y = YAHOO.util, - YL = YAHOO.lang; - - /** - * The StorageEngineKeyed class implements the interface necessary for managing keys. - * @namespace YAHOO.util - * @class StorageEngineKeyed - * @constructor - * @extend YAHOO.util.Storage - */ - Y.StorageEngineKeyed = function() { - Y.StorageEngineKeyed.superclass.constructor.apply(this, arguments); - this._keys = []; - this._keyMap = {}; - }; - - YL.extend(Y.StorageEngineKeyed, Y.Storage, { - - /** - * A collection of keys applicable to the current location. This should never be edited by the developer. - * @property _keys - * @type {Array} - * @protected - */ - _keys: null, - - /** - * A map of keys to their applicable position in keys array. This should never be edited by the developer. - * @property _keyMap - * @type {Object} - * @protected - */ - _keyMap: null, - - /** - * Adds the key to the set. - * @method _addKey - * @param key {String} Required. The key to evaluate. - * @protected - */ - _addKey: function(key) { - this._keyMap[key] = this.length; - this._keys.push(key); - this.length = this._keys.length; - }, - - /** - * Evaluates if a key exists in the keys array; indexOf does not work in all flavors of IE. - * @method _indexOfKey - * @param key {String} Required. The key to evaluate. - * @protected - */ - _indexOfKey: function(key) { - var i = this._keyMap[key]; - return undefined === i ? -1 : i; - }, - - /** - * Removes a key from the keys array. - * @method _removeKey - * @param key {String} Required. The key to remove. - * @protected - */ - _removeKey: function(key) { - var j = this._indexOfKey(key), - rest = this._keys.slice(j + 1); - - delete this._keyMap[key]; - - for (var k in this._keyMap) { - if (j < this._keyMap[k]) { - this._keyMap[k] -= 1; - } - } - - this._keys.length = j; - this._keys = this._keys.concat(rest); - this.length = this._keys.length; - } - }); -}()); -/* - * HTML limitations: - * - 5MB in FF and Safari, 10MB in IE 8 - * - only FF 3.5 recovers session storage after a browser crash - * - * Thoughts: - * - how can we not use cookies to handle session - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - - /* - * Required for IE 8 to make synchronous. - */ - _beginTransaction = function(engine) { - if (engine.begin) {engine.begin();} - }, - - /* - * Required for IE 8 to make synchronous. - */ - _commitTransaction = function(engine) { - if (engine.commit) {engine.commit();} - }; - - /** - * The StorageEngineHTML5 class implements the HTML5 storage engine. - * @namespace YAHOO.util - * @class StorageEngineHTML5 - * @constructor - * @extend YAHOO.util.Storage - * @param location {String} Required. The storage location. - * @param conf {Object} Required. A configuration object. - */ - Y.StorageEngineHTML5 = function(location, conf) { - var _this = this; - Y.StorageEngineHTML5.superclass.constructor.call(_this, location, Y.StorageEngineHTML5.ENGINE_NAME, conf);// not set, are cookies available - _this._engine = window[location]; - _this.length = _this._engine.length; - YL.later(250, _this, function() { // temporary solution so that CE_READY can be subscribed to after this object is created - _this.fireEvent(_this.CE_READY); - }); - }; - - YAHOO.lang.extend(Y.StorageEngineHTML5, Y.Storage, { - - _engine: null, - - /* - * Implementation to clear the values from the storage engine. - * @see YAHOO.util.Storage._clear - */ - _clear: function() { - var _this = this; - if (_this._engine.clear) { - _this._engine.clear(); - } - // for FF 3, fixed in FF 3.5 - else { - for (var i = _this.length, key; 0 <= i; i -= 1) { - key = _this._key(i); - _this._removeItem(key); - } - } - }, - - /* - * Implementation to fetch an item from the storage engine. - * @see YAHOO.util.Storage._getItem - */ - _getItem: function(key) { - var o = this._engine.getItem(key); - return YL.isObject(o) ? o.value : o; // for FF 3, fixed in FF 3.5 - }, - - /* - * Implementation to fetch a key from the storage engine. - * @see YAHOO.util.Storage._key - */ - _key: function(index) {return this._engine.key(index);}, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._removeItem - */ - _removeItem: function(key) { - var _this = this; - _beginTransaction(_this._engine); - _this._engine.removeItem(key); - _commitTransaction(_this._engine); - _this.length = _this._engine.length; - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._setItem - */ - _setItem: function(key, value) { - var _this = this; - - try { - _beginTransaction(_this._engine); - _this._engine.setItem(key, value); - _commitTransaction(_this._engine); - _this.length = _this._engine.length; - return true; - } - catch (e) { - return false; - } - } - }, true); - - Y.StorageEngineHTML5.ENGINE_NAME = 'html5'; - Y.StorageEngineHTML5.isAvailable = function() { - return window.localStorage; - }; - Y.StorageManager.register(Y.StorageEngineHTML5); -}()); -/* - * Gears limitation: - * - SQLite limitations - http://www.sqlite.org/limits.html - * - DB Best Practices - http://code.google.com/apis/gears/gears_faq.html#bestPracticeDB - * - the user must approve before gears can be used - * - each SQL query has a limited number of characters (9948 bytes), data will need to be spread across rows - * - no query should insert or update more than 9948 bytes of data in a single statement or GEARs will throw: - * [Exception... "'Error: SQL statement is too long.' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "" data: no] - * - * Thoughts: - * - we may want to implement additional functions for the gears only implementation - * - how can we not use cookies to handle session location - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - _SQL_STMT_LIMIT = 9948, - _TABLE_NAME = 'YUIStorageEngine', - - // local variables - _engine = null, - - eURI = encodeURIComponent, - dURI = decodeURIComponent; - - /** - * The StorageEngineGears class implements the Google Gears storage engine. - * @namespace YAHOO.util - * @class StorageEngineGears - * @constructor - * @extend YAHOO.util.Storage - * @param location {String} Required. The storage location. - * @param conf {Object} Required. A configuration object. - */ - Y.StorageEngineGears = function(location, conf) { - var _this = this; - Y.StorageEngineGears.superclass.constructor.call(_this, location, Y.StorageEngineGears.ENGINE_NAME, conf); - - if (! _engine) { - // create the database - _engine = google.gears.factory.create(Y.StorageEngineGears.GEARS); - _engine.open(window.location.host + '-' + Y.StorageEngineGears.DATABASE); - _engine.execute('CREATE TABLE IF NOT EXISTS ' + _TABLE_NAME + ' (key TEXT, location TEXT, value TEXT)'); - } - - var isSessionStorage = Y.StorageManager.LOCATION_SESSION === _this._location, - sessionKey = Y.Cookie.get('sessionKey' + Y.StorageEngineGears.ENGINE_NAME); - - if (! sessionKey) { - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE location="' + eURI(Y.StorageManager.LOCATION_SESSION) + '"'); - _engine.execute('COMMIT'); - } - - var rs = _engine.execute('SELECT key FROM ' + _TABLE_NAME + ' WHERE location="' + eURI(_this._location) + '"'), - keyMap = {}; - - try { - // iterate on the rows and map the keys - while (rs.isValidRow()) { - var fld = dURI(rs.field(0)); - - if (! keyMap[fld]) { - keyMap[fld] = true; - _this._addKey(fld); - } - - rs.next(); - } - } - finally { - rs.close(); - } - - // this is session storage, ensure that the session key is set - if (isSessionStorage) { - Y.Cookie.set('sessionKey' + Y.StorageEngineGears.ENGINE_NAME, true); - } - - _this.length = _this._keys.length; - YL.later(250, _this, function() { // temporary solution so that CE_READY can be subscribed to after this object is created - _this.fireEvent(_this.CE_READY); - }); - }; - - YL.extend(Y.StorageEngineGears, Y.StorageEngineKeyed, { - - /* - * Implementation to clear the values from the storage engine. - * @see YAHOO.util.Storage._clear - */ - _clear: function() { - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE location="' + eURI(this._location) + '"'); - _engine.execute('COMMIT'); - this._keys = []; - this.length = 0; - }, - - /* - * Implementation to fetch an item from the storage engine. - * @see YAHOO.util.Storage._getItem - */ - _getItem: function(key) { - var rs = _engine.execute('SELECT value FROM ' + _TABLE_NAME + ' WHERE key="' + eURI(key) + '" AND location="' + eURI(this._location) + '"'), - value = ''; - - try { - while (rs.isValidRow()) { - var temp = rs.field(0); - value += rs.field(0); - rs.next(); - } - } - finally { - rs.close(); - } - - return value ? dURI(value) : null; - }, - - /* - * Implementation to fetch a key from the storage engine. - * @see YAHOO.util.Storage.key - */ - _key: function(index) {return this._keys[index];}, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._removeItem - */ - _removeItem: function(key) { - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE key="' + eURI(key) + '" AND location="' + eURI(this._location) + '"'); - _engine.execute('COMMIT'); - this._removeKey(key); - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._setItem - */ - _setItem: function(key, data) { - - if (! this.hasKey(key)) { - this._addKey(key); - } - - var _key = eURI(key), - _location = eURI(this._location), - _value = eURI(data), - _values = [], - _len = _SQL_STMT_LIMIT - (_key + _location).length; - - // the length of the value exceeds the available space - if (_len < _value.length) { - for (var i = 0, j = _value.length; i < j; i += _len) { - _values.push(_value.substr(i, _len)); - } - } - else { - _values.push(_value); - } - - // Google recommends using INSERT instead of update, because it is faster - _engine.execute('BEGIN'); - _engine.execute('DELETE FROM ' + _TABLE_NAME + ' WHERE key="' + eURI(key) + '" AND location="' + eURI(this._location) + '"'); - for (var m = 0, n = _values.length; m < n; m += 1) { - _engine.execute('INSERT INTO ' + _TABLE_NAME + ' VALUES ("' + _key + '", "' + _location + '", "' + _values[m] + '")'); - } - _engine.execute('COMMIT'); - - return true; - } - }); - - // releases the engine when the page unloads - Y.Event.on('unload', function() { - if (_engine) {_engine.close();} - }); - Y.StorageEngineGears.ENGINE_NAME = 'gears'; - Y.StorageEngineGears.GEARS = 'beta.database'; - Y.StorageEngineGears.DATABASE = 'yui.database'; - Y.StorageEngineGears.isAvailable = function() { - if (window.google && window.google.gears) { - try { - // this will throw an exception if the user denies gears - google.gears.factory.create(Y.StorageEngineGears.GEARS); - return true; - } - catch (e) { - // no need to do anything - } - } - - return false; - }; - Y.StorageManager.register(Y.StorageEngineGears); -}()); -/* - * SWF limitation: - * - only 100,000 bytes of data may be stored this way - * - data is publicly available on user machine - * - * Thoughts: - * - data can be shared across browsers - * - how can we not use cookies to handle session location - */ -(function() { - // internal shorthand -var Y = YAHOO.util, - YL = YAHOO.lang, - YD = Y.Dom, - - /* - * The minimum width required to be able to display the settings panel within the SWF. - */ - MINIMUM_WIDTH = 215, - - /* - * The minimum height required to be able to display the settings panel within the SWF. - */ - MINIMUM_HEIGHT = 138, - - // local variables - _engine = null, - - /* - * Creates a location bound key. - */ - _getKey = function(that, key) { - return that._location + that.DELIMITER + key; - }, - - /* - * Initializes the engine, if it isn't already initialized. - */ - _initEngine = function(cfg) { - if (! _engine) { - if (! YL.isString(cfg.swfURL)) {cfg.swfURL = Y.StorageEngineSWF.SWFURL;} - if (! cfg.containerID) { - var bd = document.getElementsByTagName('body')[0], - container = bd.appendChild(document.createElement('div')); - cfg.containerID = YD.generateId(container); - } - - if (! cfg.attributes) {cfg.attributes = {};} - if (! cfg.attributes.flashVars) {cfg.attributes.flashVars = {};} - cfg.attributes.flashVars.useCompression = 'true'; - cfg.attributes.version = 9.115; - _engine = new YAHOO.widget.SWF(cfg.containerID, cfg.swfURL, cfg.attributes); - } - }; - - /** - * The StorageEngineSWF class implements the SWF storage engine. - * @namespace YAHOO.util - * @class StorageEngineSWF - * @uses YAHOO.widget.SWF - * @constructor - * @extend YAHOO.util.Storage - * @param location {String} Required. The storage location. - * @param conf {Object} Required. A configuration object. - */ - Y.StorageEngineSWF = function(location, conf) { - var _this = this; - Y.StorageEngineSWF.superclass.constructor.call(_this, location, Y.StorageEngineSWF.ENGINE_NAME, conf); - - _initEngine(_this._cfg); - - // evaluates when the SWF is loaded - _engine.unsubscribe('contentReady'); // prevents local and session content ready callbacks from firing, when switching between context - _engine.addListener("contentReady", function() { - _this._swf = _engine._swf; - _engine.initialized = true; - - var isSessionStorage = Y.StorageManager.LOCATION_SESSION === _this._location, - sessionKey = Y.Cookie.get('sessionKey' + Y.StorageEngineSWF.ENGINE_NAME); - - for (var i = _engine.callSWF("getLength", []) - 1; 0 <= i; i -= 1) { - var key = _engine.callSWF("getNameAt", [i]), - isKeySessionStorage = -1 < key.indexOf(Y.StorageManager.LOCATION_SESSION + _this.DELIMITER); - - // this is session storage, but the session key is not set, so remove item - if (isSessionStorage && ! sessionKey) { - _engine.callSWF("removeItem", [key]); - } - // the key matches the storage type, add to key collection - else if (isSessionStorage === isKeySessionStorage) { - _this._addKey(key); - } - } - - // this is session storage, ensure that the session key is set - if (isSessionStorage) { - Y.Cookie.set('sessionKey' + Y.StorageEngineSWF.ENGINE_NAME, true); - } - - _this.length = _this._keys.length; - _this.fireEvent(_this.CE_READY); - }); - - // required for pages with both a session and local storage - if (_engine.initialized) {_engine.fireEvent('contentReady');} - }; - - YL.extend(Y.StorageEngineSWF, Y.StorageEngineKeyed, { - /** - * The underlying SWF of the engine, exposed so developers can modify the adapter behavior. - * @property _swf - * @type {Object} - * @protected - */ - _swf: null, - - /* - * Implementation to clear the values from the storage engine. - * @see YAHOO.util.Storage._clear - */ - _clear: function() { - for (var i = this._keys.length - 1; 0 <= i; i -= 1) { - var key = this._keys[i]; - _engine.callSWF("removeItem", [key]); - } - - this._keys = []; - this.length = 0; - }, - - /* - * Implementation to fetch an item from the storage engine. - * @see YAHOO.util.Storage._getItem - */ - _getItem: function(key) { - var _key = _getKey(this, key); - return _engine.callSWF("getValueOf", [_key]); - }, - - /* - * Implementation to fetch a key from the storage engine. - * @see YAHOO.util.Storage.key - */ - _key: function(index) { - return (this._keys[index] || '').replace(/^.*?__/, ''); - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._removeItem - */ - _removeItem: function(key) { - var _key = _getKey(this, key); - _engine.callSWF("removeItem", [_key]); - this._removeKey(_key); - }, - - /* - * Implementation to remove an item from the storage engine. - * @see YAHOO.util.Storage._setItem - */ - _setItem: function(key, data) { - var _key = _getKey(this, key), swfNode; - - // setting the value returns false if the value didn't change, - // so I changed this to clear the key if it exists so that the - // fork below works. - if (_engine.callSWF("getValueOf", [_key])) { - this._removeItem(key); - } - - this._addKey(_key); - - if (_engine.callSWF("setItem", [_key, data])) { - return true; - } else { - - // @TODO we should not assume that a false return means that - // the quota has been exceeded. this dialog should only be - // displayed if the quotaExceededError event fired. - swfNode = YD.get(_engine._id); - if (MINIMUM_WIDTH > YD.getStyle(swfNode, 'width').replace(/\D+/g, '')) { - YD.setStyle(swfNode, 'width', MINIMUM_WIDTH + 'px'); - } - if (MINIMUM_HEIGHT > YD.getStyle(swfNode, 'height').replace(/\D+/g, '')) { - YD.setStyle(swfNode, 'height', MINIMUM_HEIGHT + 'px'); - } - return _engine.callSWF("displaySettings", []); - } - } - }); - - Y.StorageEngineSWF.SWFURL = "swfstore.swf"; - Y.StorageEngineSWF.ENGINE_NAME = 'swf'; - Y.StorageEngineSWF.isAvailable = function() { - return (6 <= YAHOO.env.ua.flash && YAHOO.widget.SWF); - }; - Y.StorageManager.register(Y.StorageEngineSWF); -}()); -YAHOO.register("storage", YAHOO.util.Storage, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-debug.js deleted file mode 100644 index a3c68ab742..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-debug.js +++ /dev/null @@ -1,648 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The StyleSheet component is a utility for managing css rules at the - * stylesheet level - * - * @module stylesheet - * @namespace YAHOO.util - * @requires yahoo - * @beta - */ -(function () { - -var d = document, - p = d.createElement('p'), // Have to hold the node (see notes) - workerStyle = p.style, // worker style collection - lang = YAHOO.lang, - selectors = {}, - sheets = {}, - ssId = 0, - floatAttr = ('cssFloat' in workerStyle) ? 'cssFloat' : 'styleFloat', - _toCssText, - _unsetOpacity, - _unsetProperty; - -/* - * Normalizes the removal of an assigned style for opacity. IE uses the filter property. - */ -_unsetOpacity = ('opacity' in workerStyle) ? - function (style) { style.opacity = ''; } : - function (style) { style.filter = ''; }; - -/* - * Normalizes the removal of an assigned style for a given property. Expands - * shortcut properties if necessary and handles the various names for the float property. - */ -workerStyle.border = "1px solid red"; -workerStyle.border = ''; // IE doesn't unset child properties -_unsetProperty = workerStyle.borderLeft ? - function (style,prop) { - var p; - if (prop !== floatAttr && prop.toLowerCase().indexOf('float') != -1) { - prop = floatAttr; - } - if (typeof style[prop] === 'string') { - switch (prop) { - case 'opacity': - case 'filter' : _unsetOpacity(style); break; - case 'font' : - style.font = style.fontStyle = style.fontVariant = - style.fontWeight = style.fontSize = style.lineHeight = - style.fontFamily = ''; - break; - default : - for (p in style) { - if (p.indexOf(prop) === 0) { - style[p] = ''; - } - } - } - } - } : - function (style,prop) { - if (prop !== floatAttr && prop.toLowerCase().indexOf('float') != -1) { - prop = floatAttr; - } - if (lang.isString(style[prop])) { - if (prop === 'opacity') { - _unsetOpacity(style); - } else { - style[prop] = ''; - } - } - }; - -/** - * Create an instance of YAHOO.util.StyleSheet to encapsulate a css stylesheet. - * The constructor can be called using function or constructor syntax. - *
                    var sheet = YAHOO.util.StyleSheet(..);
                    - * or - *
                    var sheet = new YAHOO.util.StyleSheet(..);
                    - * - * The first parameter passed can be any of the following things: - *
                      - *
                    • The desired string name to register a new empty sheet
                    • - *
                    • The string name of an existing YAHOO.util.StyleSheet instance
                    • - *
                    • The unique yuiSSID generated for an existing YAHOO.util.StyleSheet instance
                    • - *
                    • The id of an existing <link> or <style> node
                    • - *
                    • The node reference for an existing <link> or <style> node
                    • - *
                    • A chunk of css text to create a new stylesheet from
                    • - *
                    - * - *

                    If a string is passed, StyleSheet will first look in its static name - * registry for an existing sheet, then in the DOM for an element with that id. - * If neither are found and the string contains the { character, it will be - * used as a the initial cssText for a new StyleSheet. Otherwise, a new empty - * StyleSheet is created, assigned the string value as a name, and registered - * statically by that name.

                    - * - *

                    The optional second parameter is a string name to register the sheet as. - * This param is largely useful when providing a node id/ref or chunk of css - * text to create a populated instance.

                    - * - * @class StyleSheet - * @constructor - * @param seed {String|HTMLElement} a style or link node, its id, or a name or - * yuiSSID of a StyleSheet, or a string of css text (see above) - * @param name {String} OPTIONAL name to register instance for future static - * access - */ -function StyleSheet(seed, name) { - var head, - node, - sheet, - cssRules = {}, - _rules, - _insertRule, - _deleteRule, - i,r,sel; - - // Factory or constructor - if (!(this instanceof StyleSheet)) { - return new StyleSheet(seed,name); - } - - // capture the DOM node if the string is an id - node = seed && (seed.nodeName ? seed : d.getElementById(seed)); - - // Check for the StyleSheet in the static registry - if (seed && sheets[seed]) { - return sheets[seed]; - } else if (node && node.yuiSSID && sheets[node.yuiSSID]) { - return sheets[node.yuiSSID]; - } - - // Create a style node if necessary - if (!node || !/^(?:style|link)$/i.test(node.nodeName)) { - node = d.createElement('style'); - node.type = 'text/css'; - } - - if (lang.isString(seed)) { - // Create entire sheet from seed cssText - if (seed.indexOf('{') != -1) { - // Not a load-time fork because low run-time impact and IE fails - // test for s.styleSheet at page load time (oddly) - if (node.styleSheet) { - node.styleSheet.cssText = seed; - } else { - node.appendChild(d.createTextNode(seed)); - } - } else if (!name) { - name = seed; - } - } - - if (!node.parentNode || node.parentNode.nodeName.toLowerCase() !== 'head') { - head = (node.ownerDocument || d).getElementsByTagName('head')[0]; - // styleSheet isn't available on the style node in FF2 until appended - // to the head element. style nodes appended to body do not affect - // change in Safari. - head.appendChild(node); - } - - // Begin setting up private aliases to the important moving parts - // 1. The stylesheet object - // IE stores StyleSheet under the "styleSheet" property - // Safari doesn't populate sheet for xdomain link elements - sheet = node.sheet || node.styleSheet; - - // 2. The style rules collection - // IE stores the rules collection under the "rules" property - _rules = sheet && ('cssRules' in sheet) ? 'cssRules' : 'rules'; - - // 3. The method to remove a rule from the stylesheet - // IE supports removeRule - _deleteRule = ('deleteRule' in sheet) ? - function (i) { sheet.deleteRule(i); } : - function (i) { sheet.removeRule(i); }; - - // 4. The method to add a new rule to the stylesheet - // IE supports addRule with different signature - _insertRule = ('insertRule' in sheet) ? - function (sel,css,i) { sheet.insertRule(sel+' {'+css+'}',i); } : - function (sel,css,i) { sheet.addRule(sel,css,i); }; - - // 5. Initialize the cssRules map from the node - // xdomain link nodes forbid access to the cssRules collection, so this - // will throw an error. - // TODO: research alternate stylesheet, @media - for (i = sheet[_rules].length - 1; i >= 0; --i) { - r = sheet[_rules][i]; - sel = r.selectorText; - - if (cssRules[sel]) { - cssRules[sel].style.cssText += ';' + r.style.cssText; - _deleteRule(i); - } else { - cssRules[sel] = r; - } - } - - // Cache the instance by the generated Id - node.yuiSSID = 'yui-stylesheet-' + (ssId++); - StyleSheet.register(node.yuiSSID,this); - - // Register the instance by name if provided or defaulted from seed - if (name) { - StyleSheet.register(name,this); - } - - // Public API - lang.augmentObject(this,{ - /** - * Get the unique yuiSSID for this StyleSheet instance - * - * @method getId - * @return {Number} the static id - */ - getId : function () { return node.yuiSSID; }, - - /** - * The HTMLElement that this instance encapsulates - * - * @property node - * @type HTMLElement - */ - node : node, - - /** - * Enable all the rules in the sheet - * - * @method enable - * @return {StyleSheet} the instance - * @chainable - */ - // Enabling/disabling the stylesheet. Changes may be made to rules - // while disabled. - enable : function () { sheet.disabled = false; return this; }, - - /** - * Disable all the rules in the sheet. Rules may be changed while the - * StyleSheet is disabled. - * - * @method disable - * @return {StyleSheet} the instance - * @chainable - */ - disable : function () { sheet.disabled = true; return this; }, - - /** - * Returns boolean indicating whether the StyleSheet is enabled - * - * @method isEnabled - * @return {Boolean} is it enabled? - */ - isEnabled : function () { return !sheet.disabled; }, - - /** - *

                    Set style properties for a provided selector string. - * If the selector includes commas, it will be split into individual - * selectors and applied accordingly. If the selector string does not - * have a corresponding rule in the sheet, it will be added.

                    - * - *

                    The second parameter can be either a string of CSS text, - * formatted as CSS ("font-size: 10px;"), or an object collection of - * properties and their new values. Object properties must be in - * JavaScript format ({ fontSize: "10px" }).

                    - * - *

                    The float style property will be set by any of "float", - * "styleFloat", or "cssFloat" if passed in the - * object map. Use "float: left;" format when passing a CSS text - * string.

                    - * - * @method set - * @param sel {String} the selector string to apply the changes to - * @param css {Object|String} Object literal of style properties and - * new values, or a string of cssText - * @return {StyleSheet} the StyleSheet instance - * @chainable - */ - set : function (sel,css) { - var rule = cssRules[sel], - multi = sel.split(/\s*,\s*/),i, - idx; - - // IE's addRule doesn't support multiple comma delimited selectors - if (multi.length > 1) { - for (i = multi.length - 1; i >= 0; --i) { - this.set(multi[i], css); - } - return this; - } - - // Some selector values can cause IE to hang - if (!StyleSheet.isValidSelector(sel)) { - YAHOO.log("Invalid selector '"+sel+"' passed to set (ignoring).",'warn','StyleSheet'); - return this; - } - - // Opera throws an error if there's a syntax error in assigned - // cssText. Avoid this using a worker style collection, then - // assigning the resulting cssText. - if (rule) { - rule.style.cssText = StyleSheet.toCssText(css,rule.style.cssText); - } else { - idx = sheet[_rules].length; - css = StyleSheet.toCssText(css); - - // IE throws an error when attempting to addRule(sel,'',n) - // which would crop up if no, or only invalid values are used - if (css) { - _insertRule(sel, css, idx); - - // Safari replaces the rules collection, but maintains the - // rule instances in the new collection when rules are - // added/removed - cssRules[sel] = sheet[_rules][idx]; - } - } - return this; - }, - - /** - *

                    Unset style properties for a provided selector string, removing - * their effect from the style cascade.

                    - * - *

                    If the selector includes commas, it will be split into individual - * selectors and applied accordingly. If there are no properties - * remaining in the rule after unsetting, the rule is removed.

                    - * - *

                    The style property or properties in the second parameter must be the - *

                    JavaScript style property names. E.g. fontSize rather than font-size.

                    - * - *

                    The float style property will be unset by any of "float", - * "styleFloat", or "cssFloat".

                    - * - * @method unset - * @param sel {String} the selector string to apply the changes to - * @param css {String|Array} style property name or Array of names - * @return {StyleSheet} the StyleSheet instance - * @chainable - */ - unset : function (sel,css) { - var rule = cssRules[sel], - multi = sel.split(/\s*,\s*/), - remove = !css, - rules, i; - - // IE's addRule doesn't support multiple comma delimited selectors - // so rules are mapped internally by atomic selectors - if (multi.length > 1) { - for (i = multi.length - 1; i >= 0; --i) { - this.unset(multi[i], css); - } - return this; - } - - if (rule) { - if (!remove) { - if (!lang.isArray(css)) { - css = [css]; - } - - workerStyle.cssText = rule.style.cssText; - for (i = css.length - 1; i >= 0; --i) { - _unsetProperty(workerStyle,css[i]); - } - - if (workerStyle.cssText) { - rule.style.cssText = workerStyle.cssText; - } else { - remove = true; - } - } - - if (remove) { // remove the rule altogether - rules = sheet[_rules]; - for (i = rules.length - 1; i >= 0; --i) { - if (rules[i] === rule) { - delete cssRules[sel]; - _deleteRule(i); - break; - } - } - } - } - return this; - }, - - /** - * Get the current cssText for a rule or the entire sheet. If the - * selector param is supplied, only the cssText for that rule will be - * returned, if found. If the selector string targets multiple - * selectors separated by commas, the cssText of the first rule only - * will be returned. If no selector string, the stylesheet's full - * cssText will be returned. - * - * @method getCssText - * @param sel {String} Selector string - * @return {String} - */ - getCssText : function (sel) { - var rule,css; - - if (lang.isString(sel)) { - // IE's addRule doesn't support multiple comma delimited - // selectors so rules are mapped internally by atomic selectors - rule = cssRules[sel.split(/\s*,\s*/)[0]]; - - return rule ? rule.style.cssText : null; - } else { - css = []; - for (sel in cssRules) { - if (cssRules.hasOwnProperty(sel)) { - rule = cssRules[sel]; - css.push(rule.selectorText+" {"+rule.style.cssText+"}"); - } - } - return css.join("\n"); - } - } - },true); - -} - -_toCssText = function (css,base) { - var f = css.styleFloat || css.cssFloat || css['float'], - prop; - - workerStyle.cssText = base || ''; - - if (lang.isString(css)) { - // There is a danger here of incremental memory consumption in Opera - workerStyle.cssText += ';' + css; - } else { - if (f && !css[floatAttr]) { - css = lang.merge(css); - delete css.styleFloat; delete css.cssFloat; delete css['float']; - css[floatAttr] = f; - } - - for (prop in css) { - if (css.hasOwnProperty(prop)) { - try { - // IE throws Invalid Value errors and doesn't like whitespace - // in values ala ' red' or 'red ' - workerStyle[prop] = lang.trim(css[prop]); - } - catch (e) { - YAHOO.log('Error assigning property "'+prop+'" to "'+css[prop]+ - "\" (ignored):\n"+e.message,'warn','StyleSheet'); - } - } - } - } - - return workerStyle.cssText; -}; - -lang.augmentObject(StyleSheet, { - /** - *

                    Converts an object literal of style properties and values into a string - * of css text. This can then be assigned to el.style.cssText.

                    - * - *

                    The optional second parameter is a cssText string representing the - * starting state of the style prior to alterations. This is most often - * extracted from the eventual target's current el.style.cssText.

                    - * - * @method StyleSheet.toCssText - * @param css {Object} object literal of style properties and values - * @param cssText {String} OPTIONAL starting cssText value - * @return {String} the resulting cssText string - * @static - */ - toCssText : (('opacity' in workerStyle) ? _toCssText : - // Wrap IE's toCssText to catch opacity. The copy/merge is to preserve - // the input object's integrity, but if float and opacity are set, the - // input will be copied twice in IE. Is there a way to avoid this - // without increasing the byte count? - function (css, cssText) { - if (lang.isObject(css) && 'opacity' in css) { - css = lang.merge(css,{ - filter: 'alpha(opacity='+(css.opacity*100)+')' - }); - delete css.opacity; - } - return _toCssText(css,cssText); - }), - - /** - * Registers a StyleSheet instance in the static registry by the given name - * - * @method StyleSheet.register - * @param name {String} the name to assign the StyleSheet in the registry - * @param sheet {StyleSheet} The StyleSheet instance - * @return {Boolean} false if no name or sheet is not a StyleSheet - * instance. true otherwise. - * @static - */ - register : function (name,sheet) { - return !!(name && sheet instanceof StyleSheet && - !sheets[name] && (sheets[name] = sheet)); - }, - - /** - *

                    Determines if a selector string is safe to use. Used internally - * in set to prevent IE from locking up when attempting to add a rule for a - * "bad selector".

                    - * - *

                    Bad selectors are considered to be any string containing unescaped - * `~!@$%^&()+=|{}[];'"?< or space. Also forbidden are . or # followed by - * anything other than an alphanumeric. Additionally -abc or .-abc or - * #_abc or '# ' all fail. There are likely more failure cases, so - * please file a bug if you encounter one.

                    - * - * @method StyleSheet.isValidSelector - * @param sel {String} the selector string - * @return {Boolean} - * @static - */ - isValidSelector : function (sel) { - var valid = false; - - if (sel && lang.isString(sel)) { - - if (!selectors.hasOwnProperty(sel)) { - // TEST: there should be nothing but white-space left after - // these destructive regexs - selectors[sel] = !/\S/.test( - // combinators - sel.replace(/\s+|\s*[+~>]\s*/g,' '). - // attribute selectors (contents not validated) - replace(/([^ ])\[.*?\]/g,'$1'). - // pseudo-class|element selectors (contents of parens - // such as :nth-of-type(2) or :not(...) not validated) - replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,'$1'). - // element tags - replace(/(?:^| )[a-z0-6]+/ig,' '). - // escaped characters - replace(/\\./g,''). - // class and id identifiers - replace(/[.#]\w[\w\-]*/g,'')); - } - - valid = selectors[sel]; - } - - return valid; - } -},true); - -YAHOO.util.StyleSheet = StyleSheet; - -})(); - -/* - -NOTES - * Style node must be added to the head element. Safari does not honor styles - applied to StyleSheet objects on style nodes in the body. - * StyleSheet object is created on the style node when the style node is added - to the head element in Firefox 2 (and maybe 3?) - * The cssRules collection is replaced after insertRule/deleteRule calls in - Safari 3.1. Existing Rules are used in the new collection, so the collection - cannot be cached, but the rules can be. - * Opera requires that the index be passed with insertRule. - * Same-domain restrictions prevent modifying StyleSheet objects attached to - link elements with remote href (or "about:blank" or "javascript:false") - * Same-domain restrictions prevent reading StyleSheet cssRules/rules - collection of link elements with remote href (or "about:blank" or - "javascript:false") - * Same-domain restrictions result in Safari not populating node.sheet property - for link elements with remote href (et.al) - * IE names StyleSheet related properties and methods differently (see code) - * IE converts tag names to upper case in the Rule's selectorText - * IE converts empty string assignment to complex properties to value settings - for all child properties. E.g. style.background = '' sets non-'' values on - style.backgroundPosition, style.backgroundColor, etc. All else clear - style.background and all child properties. - * IE assignment style.filter = '' will result in style.cssText == 'FILTER:' - * All browsers support Rule.style.cssText as a read/write property, leaving - only opacity needing to be accounted for. - * Benchmarks of style.property = value vs style.cssText += 'property: value' - indicate cssText is slightly slower for single property assignment. For - multiple property assignment, cssText speed stays relatively the same where - style.property speed decreases linearly by the number of properties set. - Exception being Opera 9.27, where style.property is always faster than - style.cssText. - * Opera 9.5b throws a syntax error when assigning cssText with a syntax error. - * Opera 9.5 doesn't honor rule.style.cssText = ''. Previous style persists. - You have to remove the rule altogether. - * Stylesheet properties set with !important will trump inline style set on an - element or in el.style.property. - * Creating a worker style collection like document.createElement('p').style; - will fail after a time in FF (~5secs of inactivity). Property assignments - will not alter the property or cssText. It may be the generated node is - garbage collected and the style collection becomes inert (speculation). - * IE locks up when attempting to add a rule with a selector including at least - characters {[]}~`!@%^&*()+=|? (unescaped) and leading _ or - - such as addRule('-foo','{ color: red }') or addRule('._abc','{...}') - * IE's addRule doesn't support comma separated selectors such as - addRule('.foo, .bar','{..}') - * IE throws an error on valid values with leading/trailing white space. - * When creating an entire sheet at once, only FF2/3 & Opera allow creating a - style node, setting its innerHTML and appending to head. - * When creating an entire sheet at once, Safari requires the style node to be - created with content in innerHTML of another element. - * When creating an entire sheet at once, IE requires the style node content to - be set via node.styleSheet.cssText - * When creating an entire sheet at once in IE, styleSheet.cssText can't be - written until node.type = 'text/css'; is performed. - * When creating an entire sheet at once in IE, load-time fork on - var styleNode = d.createElement('style'); _method = styleNode.styleSheet ?.. - fails (falsey). During run-time, the test for .styleSheet works fine - * Setting complex properties in cssText will SOMETIMES allow child properties - to be unset - set unset FF2 FF3 S3.1 IE6 IE7 Op9.27 Op9.5 - ---------- ----------------- --- --- ---- --- --- ------ ----- - border -top NO NO YES YES YES YES YES - -top-color NO NO YES YES YES - -color NO NO NO NO NO - background -color NO NO YES YES YES - -position NO NO YES YES YES - -position-x NO NO NO NO NO - font line-height YES YES NO NO NO NO YES - -style YES YES NO YES YES - -size YES YES NO YES YES - -size-adjust ??? ??? n/a n/a n/a ??? ??? - padding -top NO NO YES YES YES - margin -top NO NO YES YES YES - list-style -type YES YES YES YES YES - -position YES YES YES YES YES - overflow -x NO NO YES n/a YES - - ??? - unsetting font-size-adjust has the same effect as unsetting font-size - * FireFox and WebKit populate rule.cssText as "SELECTOR { CSSTEXT }", but - Opera and IE do not. - * IE6 and IE7 silently ignore the { and } if passed into addRule('.foo','{ - color:#000}',0). IE8 does not and creates an empty rule. - * IE6-8 addRule('.foo','',n) throws an error. Must supply *some* cssText -*/ - -YAHOO.register("stylesheet", YAHOO.util.StyleSheet, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-min.js deleted file mode 100644 index 621e67bbef..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var I=document,B=I.createElement("p"),D=B.style,C=YAHOO.lang,L={},H={},E=0,J=("cssFloat" in D)?"cssFloat":"styleFloat",F,A,K;A=("opacity" in D)?function(M){M.opacity="";}:function(M){M.filter="";};D.border="1px solid red";D.border="";K=D.borderLeft?function(M,O){var N;if(O!==J&&O.toLowerCase().indexOf("float")!=-1){O=J;}if(typeof M[O]==="string"){switch(O){case"opacity":case"filter":A(M);break;case"font":M.font=M.fontStyle=M.fontVariant=M.fontWeight=M.fontSize=M.lineHeight=M.fontFamily="";break;default:for(N in M){if(N.indexOf(O)===0){M[N]="";}}}}}:function(M,N){if(N!==J&&N.toLowerCase().indexOf("float")!=-1){N=J;}if(C.isString(M[N])){if(N==="opacity"){A(M);}else{M[N]="";}}};function G(T,O){var W,R,V,U={},N,X,Q,S,M,P;if(!(this instanceof G)){return new G(T,O);}R=T&&(T.nodeName?T:I.getElementById(T));if(T&&H[T]){return H[T];}else{if(R&&R.yuiSSID&&H[R.yuiSSID]){return H[R.yuiSSID];}}if(!R||!/^(?:style|link)$/i.test(R.nodeName)){R=I.createElement("style");R.type="text/css";}if(C.isString(T)){if(T.indexOf("{")!=-1){if(R.styleSheet){R.styleSheet.cssText=T;}else{R.appendChild(I.createTextNode(T));}}else{if(!O){O=T;}}}if(!R.parentNode||R.parentNode.nodeName.toLowerCase()!=="head"){W=(R.ownerDocument||I).getElementsByTagName("head")[0];W.appendChild(R);}V=R.sheet||R.styleSheet;N=V&&("cssRules" in V)?"cssRules":"rules";Q=("deleteRule" in V)?function(Y){V.deleteRule(Y);}:function(Y){V.removeRule(Y);};X=("insertRule" in V)?function(a,Z,Y){V.insertRule(a+" {"+Z+"}",Y);}:function(a,Z,Y){V.addRule(a,Z,Y);};for(S=V[N].length-1;S>=0;--S){M=V[N][S];P=M.selectorText;if(U[P]){U[P].style.cssText+=";"+M.style.cssText;Q(S);}else{U[P]=M;}}R.yuiSSID="yui-stylesheet-"+(E++);G.register(R.yuiSSID,this);if(O){G.register(O,this);}C.augmentObject(this,{getId:function(){return R.yuiSSID;},node:R,enable:function(){V.disabled=false;return this;},disable:function(){V.disabled=true;return this;},isEnabled:function(){return !V.disabled;},set:function(b,a){var d=U[b],c=b.split(/\s*,\s*/),Z,Y;if(c.length>1){for(Z=c.length-1;Z>=0;--Z){this.set(c[Z],a);}return this;}if(!G.isValidSelector(b)){return this;}if(d){d.style.cssText=G.toCssText(a,d.style.cssText);}else{Y=V[N].length;a=G.toCssText(a);if(a){X(b,a,Y);U[b]=V[N][Y];}}return this;},unset:function(b,a){var d=U[b],c=b.split(/\s*,\s*/),Y=!a,e,Z;if(c.length>1){for(Z=c.length-1;Z>=0;--Z){this.unset(c[Z],a);}return this;}if(d){if(!Y){if(!C.isArray(a)){a=[a];}D.cssText=d.style.cssText;for(Z=a.length-1;Z>=0;--Z){K(D,a[Z]);}if(D.cssText){d.style.cssText=D.cssText;}else{Y=true;}}if(Y){e=V[N];for(Z=e.length-1;Z>=0;--Z){if(e[Z]===d){delete U[b];Q(Z);break;}}}}return this;},getCssText:function(Z){var a,Y;if(C.isString(Z)){a=U[Z.split(/\s*,\s*/)[0]];return a?a.style.cssText:null;}else{Y=[];for(Z in U){if(U.hasOwnProperty(Z)){a=U[Z];Y.push(a.selectorText+" {"+a.style.cssText+"}");}}return Y.join("\n");}}},true);}F=function(M,O){var N=M.styleFloat||M.cssFloat||M["float"],Q;D.cssText=O||"";if(C.isString(M)){D.cssText+=";"+M;}else{if(N&&!M[J]){M=C.merge(M);delete M.styleFloat;delete M.cssFloat;delete M["float"];M[J]=N;}for(Q in M){if(M.hasOwnProperty(Q)){try{D[Q]=C.trim(M[Q]);}catch(P){}}}}return D.cssText;};C.augmentObject(G,{toCssText:(("opacity" in D)?F:function(M,N){if(C.isObject(M)&&"opacity" in M){M=C.merge(M,{filter:"alpha(opacity="+(M.opacity*100)+")"});delete M.opacity;}return F(M,N);}),register:function(M,N){return !!(M&&N instanceof G&&!H[M]&&(H[M]=N));},isValidSelector:function(N){var M=false;if(N&&C.isString(N)){if(!L.hasOwnProperty(N)){L[N]=!/\S/.test(N.replace(/\s+|\s*[+~>]\s*/g," ").replace(/([^ ])\[.*?\]/g,"$1").replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,"$1").replace(/(?:^| )[a-z0-6]+/ig," ").replace(/\\./g,"").replace(/[.#]\w[\w\-]*/g,""));}M=L[N];}return M;}},true);YAHOO.util.StyleSheet=G;})();YAHOO.register("stylesheet",YAHOO.util.StyleSheet,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet.js deleted file mode 100644 index 5a2de206ea..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/stylesheet/stylesheet.js +++ /dev/null @@ -1,645 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * The StyleSheet component is a utility for managing css rules at the - * stylesheet level - * - * @module stylesheet - * @namespace YAHOO.util - * @requires yahoo - * @beta - */ -(function () { - -var d = document, - p = d.createElement('p'), // Have to hold the node (see notes) - workerStyle = p.style, // worker style collection - lang = YAHOO.lang, - selectors = {}, - sheets = {}, - ssId = 0, - floatAttr = ('cssFloat' in workerStyle) ? 'cssFloat' : 'styleFloat', - _toCssText, - _unsetOpacity, - _unsetProperty; - -/* - * Normalizes the removal of an assigned style for opacity. IE uses the filter property. - */ -_unsetOpacity = ('opacity' in workerStyle) ? - function (style) { style.opacity = ''; } : - function (style) { style.filter = ''; }; - -/* - * Normalizes the removal of an assigned style for a given property. Expands - * shortcut properties if necessary and handles the various names for the float property. - */ -workerStyle.border = "1px solid red"; -workerStyle.border = ''; // IE doesn't unset child properties -_unsetProperty = workerStyle.borderLeft ? - function (style,prop) { - var p; - if (prop !== floatAttr && prop.toLowerCase().indexOf('float') != -1) { - prop = floatAttr; - } - if (typeof style[prop] === 'string') { - switch (prop) { - case 'opacity': - case 'filter' : _unsetOpacity(style); break; - case 'font' : - style.font = style.fontStyle = style.fontVariant = - style.fontWeight = style.fontSize = style.lineHeight = - style.fontFamily = ''; - break; - default : - for (p in style) { - if (p.indexOf(prop) === 0) { - style[p] = ''; - } - } - } - } - } : - function (style,prop) { - if (prop !== floatAttr && prop.toLowerCase().indexOf('float') != -1) { - prop = floatAttr; - } - if (lang.isString(style[prop])) { - if (prop === 'opacity') { - _unsetOpacity(style); - } else { - style[prop] = ''; - } - } - }; - -/** - * Create an instance of YAHOO.util.StyleSheet to encapsulate a css stylesheet. - * The constructor can be called using function or constructor syntax. - *
                    var sheet = YAHOO.util.StyleSheet(..);
                    - * or - *
                    var sheet = new YAHOO.util.StyleSheet(..);
                    - * - * The first parameter passed can be any of the following things: - *
                      - *
                    • The desired string name to register a new empty sheet
                    • - *
                    • The string name of an existing YAHOO.util.StyleSheet instance
                    • - *
                    • The unique yuiSSID generated for an existing YAHOO.util.StyleSheet instance
                    • - *
                    • The id of an existing <link> or <style> node
                    • - *
                    • The node reference for an existing <link> or <style> node
                    • - *
                    • A chunk of css text to create a new stylesheet from
                    • - *
                    - * - *

                    If a string is passed, StyleSheet will first look in its static name - * registry for an existing sheet, then in the DOM for an element with that id. - * If neither are found and the string contains the { character, it will be - * used as a the initial cssText for a new StyleSheet. Otherwise, a new empty - * StyleSheet is created, assigned the string value as a name, and registered - * statically by that name.

                    - * - *

                    The optional second parameter is a string name to register the sheet as. - * This param is largely useful when providing a node id/ref or chunk of css - * text to create a populated instance.

                    - * - * @class StyleSheet - * @constructor - * @param seed {String|HTMLElement} a style or link node, its id, or a name or - * yuiSSID of a StyleSheet, or a string of css text (see above) - * @param name {String} OPTIONAL name to register instance for future static - * access - */ -function StyleSheet(seed, name) { - var head, - node, - sheet, - cssRules = {}, - _rules, - _insertRule, - _deleteRule, - i,r,sel; - - // Factory or constructor - if (!(this instanceof StyleSheet)) { - return new StyleSheet(seed,name); - } - - // capture the DOM node if the string is an id - node = seed && (seed.nodeName ? seed : d.getElementById(seed)); - - // Check for the StyleSheet in the static registry - if (seed && sheets[seed]) { - return sheets[seed]; - } else if (node && node.yuiSSID && sheets[node.yuiSSID]) { - return sheets[node.yuiSSID]; - } - - // Create a style node if necessary - if (!node || !/^(?:style|link)$/i.test(node.nodeName)) { - node = d.createElement('style'); - node.type = 'text/css'; - } - - if (lang.isString(seed)) { - // Create entire sheet from seed cssText - if (seed.indexOf('{') != -1) { - // Not a load-time fork because low run-time impact and IE fails - // test for s.styleSheet at page load time (oddly) - if (node.styleSheet) { - node.styleSheet.cssText = seed; - } else { - node.appendChild(d.createTextNode(seed)); - } - } else if (!name) { - name = seed; - } - } - - if (!node.parentNode || node.parentNode.nodeName.toLowerCase() !== 'head') { - head = (node.ownerDocument || d).getElementsByTagName('head')[0]; - // styleSheet isn't available on the style node in FF2 until appended - // to the head element. style nodes appended to body do not affect - // change in Safari. - head.appendChild(node); - } - - // Begin setting up private aliases to the important moving parts - // 1. The stylesheet object - // IE stores StyleSheet under the "styleSheet" property - // Safari doesn't populate sheet for xdomain link elements - sheet = node.sheet || node.styleSheet; - - // 2. The style rules collection - // IE stores the rules collection under the "rules" property - _rules = sheet && ('cssRules' in sheet) ? 'cssRules' : 'rules'; - - // 3. The method to remove a rule from the stylesheet - // IE supports removeRule - _deleteRule = ('deleteRule' in sheet) ? - function (i) { sheet.deleteRule(i); } : - function (i) { sheet.removeRule(i); }; - - // 4. The method to add a new rule to the stylesheet - // IE supports addRule with different signature - _insertRule = ('insertRule' in sheet) ? - function (sel,css,i) { sheet.insertRule(sel+' {'+css+'}',i); } : - function (sel,css,i) { sheet.addRule(sel,css,i); }; - - // 5. Initialize the cssRules map from the node - // xdomain link nodes forbid access to the cssRules collection, so this - // will throw an error. - // TODO: research alternate stylesheet, @media - for (i = sheet[_rules].length - 1; i >= 0; --i) { - r = sheet[_rules][i]; - sel = r.selectorText; - - if (cssRules[sel]) { - cssRules[sel].style.cssText += ';' + r.style.cssText; - _deleteRule(i); - } else { - cssRules[sel] = r; - } - } - - // Cache the instance by the generated Id - node.yuiSSID = 'yui-stylesheet-' + (ssId++); - StyleSheet.register(node.yuiSSID,this); - - // Register the instance by name if provided or defaulted from seed - if (name) { - StyleSheet.register(name,this); - } - - // Public API - lang.augmentObject(this,{ - /** - * Get the unique yuiSSID for this StyleSheet instance - * - * @method getId - * @return {Number} the static id - */ - getId : function () { return node.yuiSSID; }, - - /** - * The HTMLElement that this instance encapsulates - * - * @property node - * @type HTMLElement - */ - node : node, - - /** - * Enable all the rules in the sheet - * - * @method enable - * @return {StyleSheet} the instance - * @chainable - */ - // Enabling/disabling the stylesheet. Changes may be made to rules - // while disabled. - enable : function () { sheet.disabled = false; return this; }, - - /** - * Disable all the rules in the sheet. Rules may be changed while the - * StyleSheet is disabled. - * - * @method disable - * @return {StyleSheet} the instance - * @chainable - */ - disable : function () { sheet.disabled = true; return this; }, - - /** - * Returns boolean indicating whether the StyleSheet is enabled - * - * @method isEnabled - * @return {Boolean} is it enabled? - */ - isEnabled : function () { return !sheet.disabled; }, - - /** - *

                    Set style properties for a provided selector string. - * If the selector includes commas, it will be split into individual - * selectors and applied accordingly. If the selector string does not - * have a corresponding rule in the sheet, it will be added.

                    - * - *

                    The second parameter can be either a string of CSS text, - * formatted as CSS ("font-size: 10px;"), or an object collection of - * properties and their new values. Object properties must be in - * JavaScript format ({ fontSize: "10px" }).

                    - * - *

                    The float style property will be set by any of "float", - * "styleFloat", or "cssFloat" if passed in the - * object map. Use "float: left;" format when passing a CSS text - * string.

                    - * - * @method set - * @param sel {String} the selector string to apply the changes to - * @param css {Object|String} Object literal of style properties and - * new values, or a string of cssText - * @return {StyleSheet} the StyleSheet instance - * @chainable - */ - set : function (sel,css) { - var rule = cssRules[sel], - multi = sel.split(/\s*,\s*/),i, - idx; - - // IE's addRule doesn't support multiple comma delimited selectors - if (multi.length > 1) { - for (i = multi.length - 1; i >= 0; --i) { - this.set(multi[i], css); - } - return this; - } - - // Some selector values can cause IE to hang - if (!StyleSheet.isValidSelector(sel)) { - return this; - } - - // Opera throws an error if there's a syntax error in assigned - // cssText. Avoid this using a worker style collection, then - // assigning the resulting cssText. - if (rule) { - rule.style.cssText = StyleSheet.toCssText(css,rule.style.cssText); - } else { - idx = sheet[_rules].length; - css = StyleSheet.toCssText(css); - - // IE throws an error when attempting to addRule(sel,'',n) - // which would crop up if no, or only invalid values are used - if (css) { - _insertRule(sel, css, idx); - - // Safari replaces the rules collection, but maintains the - // rule instances in the new collection when rules are - // added/removed - cssRules[sel] = sheet[_rules][idx]; - } - } - return this; - }, - - /** - *

                    Unset style properties for a provided selector string, removing - * their effect from the style cascade.

                    - * - *

                    If the selector includes commas, it will be split into individual - * selectors and applied accordingly. If there are no properties - * remaining in the rule after unsetting, the rule is removed.

                    - * - *

                    The style property or properties in the second parameter must be the - *

                    JavaScript style property names. E.g. fontSize rather than font-size.

                    - * - *

                    The float style property will be unset by any of "float", - * "styleFloat", or "cssFloat".

                    - * - * @method unset - * @param sel {String} the selector string to apply the changes to - * @param css {String|Array} style property name or Array of names - * @return {StyleSheet} the StyleSheet instance - * @chainable - */ - unset : function (sel,css) { - var rule = cssRules[sel], - multi = sel.split(/\s*,\s*/), - remove = !css, - rules, i; - - // IE's addRule doesn't support multiple comma delimited selectors - // so rules are mapped internally by atomic selectors - if (multi.length > 1) { - for (i = multi.length - 1; i >= 0; --i) { - this.unset(multi[i], css); - } - return this; - } - - if (rule) { - if (!remove) { - if (!lang.isArray(css)) { - css = [css]; - } - - workerStyle.cssText = rule.style.cssText; - for (i = css.length - 1; i >= 0; --i) { - _unsetProperty(workerStyle,css[i]); - } - - if (workerStyle.cssText) { - rule.style.cssText = workerStyle.cssText; - } else { - remove = true; - } - } - - if (remove) { // remove the rule altogether - rules = sheet[_rules]; - for (i = rules.length - 1; i >= 0; --i) { - if (rules[i] === rule) { - delete cssRules[sel]; - _deleteRule(i); - break; - } - } - } - } - return this; - }, - - /** - * Get the current cssText for a rule or the entire sheet. If the - * selector param is supplied, only the cssText for that rule will be - * returned, if found. If the selector string targets multiple - * selectors separated by commas, the cssText of the first rule only - * will be returned. If no selector string, the stylesheet's full - * cssText will be returned. - * - * @method getCssText - * @param sel {String} Selector string - * @return {String} - */ - getCssText : function (sel) { - var rule,css; - - if (lang.isString(sel)) { - // IE's addRule doesn't support multiple comma delimited - // selectors so rules are mapped internally by atomic selectors - rule = cssRules[sel.split(/\s*,\s*/)[0]]; - - return rule ? rule.style.cssText : null; - } else { - css = []; - for (sel in cssRules) { - if (cssRules.hasOwnProperty(sel)) { - rule = cssRules[sel]; - css.push(rule.selectorText+" {"+rule.style.cssText+"}"); - } - } - return css.join("\n"); - } - } - },true); - -} - -_toCssText = function (css,base) { - var f = css.styleFloat || css.cssFloat || css['float'], - prop; - - workerStyle.cssText = base || ''; - - if (lang.isString(css)) { - // There is a danger here of incremental memory consumption in Opera - workerStyle.cssText += ';' + css; - } else { - if (f && !css[floatAttr]) { - css = lang.merge(css); - delete css.styleFloat; delete css.cssFloat; delete css['float']; - css[floatAttr] = f; - } - - for (prop in css) { - if (css.hasOwnProperty(prop)) { - try { - // IE throws Invalid Value errors and doesn't like whitespace - // in values ala ' red' or 'red ' - workerStyle[prop] = lang.trim(css[prop]); - } - catch (e) { - } - } - } - } - - return workerStyle.cssText; -}; - -lang.augmentObject(StyleSheet, { - /** - *

                    Converts an object literal of style properties and values into a string - * of css text. This can then be assigned to el.style.cssText.

                    - * - *

                    The optional second parameter is a cssText string representing the - * starting state of the style prior to alterations. This is most often - * extracted from the eventual target's current el.style.cssText.

                    - * - * @method StyleSheet.toCssText - * @param css {Object} object literal of style properties and values - * @param cssText {String} OPTIONAL starting cssText value - * @return {String} the resulting cssText string - * @static - */ - toCssText : (('opacity' in workerStyle) ? _toCssText : - // Wrap IE's toCssText to catch opacity. The copy/merge is to preserve - // the input object's integrity, but if float and opacity are set, the - // input will be copied twice in IE. Is there a way to avoid this - // without increasing the byte count? - function (css, cssText) { - if (lang.isObject(css) && 'opacity' in css) { - css = lang.merge(css,{ - filter: 'alpha(opacity='+(css.opacity*100)+')' - }); - delete css.opacity; - } - return _toCssText(css,cssText); - }), - - /** - * Registers a StyleSheet instance in the static registry by the given name - * - * @method StyleSheet.register - * @param name {String} the name to assign the StyleSheet in the registry - * @param sheet {StyleSheet} The StyleSheet instance - * @return {Boolean} false if no name or sheet is not a StyleSheet - * instance. true otherwise. - * @static - */ - register : function (name,sheet) { - return !!(name && sheet instanceof StyleSheet && - !sheets[name] && (sheets[name] = sheet)); - }, - - /** - *

                    Determines if a selector string is safe to use. Used internally - * in set to prevent IE from locking up when attempting to add a rule for a - * "bad selector".

                    - * - *

                    Bad selectors are considered to be any string containing unescaped - * `~!@$%^&()+=|{}[];'"?< or space. Also forbidden are . or # followed by - * anything other than an alphanumeric. Additionally -abc or .-abc or - * #_abc or '# ' all fail. There are likely more failure cases, so - * please file a bug if you encounter one.

                    - * - * @method StyleSheet.isValidSelector - * @param sel {String} the selector string - * @return {Boolean} - * @static - */ - isValidSelector : function (sel) { - var valid = false; - - if (sel && lang.isString(sel)) { - - if (!selectors.hasOwnProperty(sel)) { - // TEST: there should be nothing but white-space left after - // these destructive regexs - selectors[sel] = !/\S/.test( - // combinators - sel.replace(/\s+|\s*[+~>]\s*/g,' '). - // attribute selectors (contents not validated) - replace(/([^ ])\[.*?\]/g,'$1'). - // pseudo-class|element selectors (contents of parens - // such as :nth-of-type(2) or :not(...) not validated) - replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,'$1'). - // element tags - replace(/(?:^| )[a-z0-6]+/ig,' '). - // escaped characters - replace(/\\./g,''). - // class and id identifiers - replace(/[.#]\w[\w\-]*/g,'')); - } - - valid = selectors[sel]; - } - - return valid; - } -},true); - -YAHOO.util.StyleSheet = StyleSheet; - -})(); - -/* - -NOTES - * Style node must be added to the head element. Safari does not honor styles - applied to StyleSheet objects on style nodes in the body. - * StyleSheet object is created on the style node when the style node is added - to the head element in Firefox 2 (and maybe 3?) - * The cssRules collection is replaced after insertRule/deleteRule calls in - Safari 3.1. Existing Rules are used in the new collection, so the collection - cannot be cached, but the rules can be. - * Opera requires that the index be passed with insertRule. - * Same-domain restrictions prevent modifying StyleSheet objects attached to - link elements with remote href (or "about:blank" or "javascript:false") - * Same-domain restrictions prevent reading StyleSheet cssRules/rules - collection of link elements with remote href (or "about:blank" or - "javascript:false") - * Same-domain restrictions result in Safari not populating node.sheet property - for link elements with remote href (et.al) - * IE names StyleSheet related properties and methods differently (see code) - * IE converts tag names to upper case in the Rule's selectorText - * IE converts empty string assignment to complex properties to value settings - for all child properties. E.g. style.background = '' sets non-'' values on - style.backgroundPosition, style.backgroundColor, etc. All else clear - style.background and all child properties. - * IE assignment style.filter = '' will result in style.cssText == 'FILTER:' - * All browsers support Rule.style.cssText as a read/write property, leaving - only opacity needing to be accounted for. - * Benchmarks of style.property = value vs style.cssText += 'property: value' - indicate cssText is slightly slower for single property assignment. For - multiple property assignment, cssText speed stays relatively the same where - style.property speed decreases linearly by the number of properties set. - Exception being Opera 9.27, where style.property is always faster than - style.cssText. - * Opera 9.5b throws a syntax error when assigning cssText with a syntax error. - * Opera 9.5 doesn't honor rule.style.cssText = ''. Previous style persists. - You have to remove the rule altogether. - * Stylesheet properties set with !important will trump inline style set on an - element or in el.style.property. - * Creating a worker style collection like document.createElement('p').style; - will fail after a time in FF (~5secs of inactivity). Property assignments - will not alter the property or cssText. It may be the generated node is - garbage collected and the style collection becomes inert (speculation). - * IE locks up when attempting to add a rule with a selector including at least - characters {[]}~`!@%^&*()+=|? (unescaped) and leading _ or - - such as addRule('-foo','{ color: red }') or addRule('._abc','{...}') - * IE's addRule doesn't support comma separated selectors such as - addRule('.foo, .bar','{..}') - * IE throws an error on valid values with leading/trailing white space. - * When creating an entire sheet at once, only FF2/3 & Opera allow creating a - style node, setting its innerHTML and appending to head. - * When creating an entire sheet at once, Safari requires the style node to be - created with content in innerHTML of another element. - * When creating an entire sheet at once, IE requires the style node content to - be set via node.styleSheet.cssText - * When creating an entire sheet at once in IE, styleSheet.cssText can't be - written until node.type = 'text/css'; is performed. - * When creating an entire sheet at once in IE, load-time fork on - var styleNode = d.createElement('style'); _method = styleNode.styleSheet ?.. - fails (falsey). During run-time, the test for .styleSheet works fine - * Setting complex properties in cssText will SOMETIMES allow child properties - to be unset - set unset FF2 FF3 S3.1 IE6 IE7 Op9.27 Op9.5 - ---------- ----------------- --- --- ---- --- --- ------ ----- - border -top NO NO YES YES YES YES YES - -top-color NO NO YES YES YES - -color NO NO NO NO NO - background -color NO NO YES YES YES - -position NO NO YES YES YES - -position-x NO NO NO NO NO - font line-height YES YES NO NO NO NO YES - -style YES YES NO YES YES - -size YES YES NO YES YES - -size-adjust ??? ??? n/a n/a n/a ??? ??? - padding -top NO NO YES YES YES - margin -top NO NO YES YES YES - list-style -type YES YES YES YES YES - -position YES YES YES YES YES - overflow -x NO NO YES n/a YES - - ??? - unsetting font-size-adjust has the same effect as unsetting font-size - * FireFox and WebKit populate rule.cssText as "SELECTOR { CSSTEXT }", but - Opera and IE do not. - * IE6 and IE7 silently ignore the { and } if passed into addRule('.foo','{ - color:#000}',0). IE8 does not and creates an empty rule. - * IE6-8 addRule('.foo','',n) throws an error. Must supply *some* cssText -*/ - -YAHOO.register("stylesheet", YAHOO.util.StyleSheet, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-debug.js deleted file mode 100644 index b477a9ffd8..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-debug.js +++ /dev/null @@ -1,269 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("widget"); - -(function () { - - var version = 0; - var UA = YAHOO.env.ua; - var sF = "ShockwaveFlash"; - - if (UA.gecko || UA.webkit || UA.opera) { - if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) { - if ((eP = mF.enabledPlugin)) { - var vS = []; - vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.'); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - } - } - } - else if(UA.ie) { - try - { - var ax6 = new ActiveXObject(sF + "." + sF + ".6"); - ax6.AllowScriptAccess = "always"; - } - catch(e) - { - if(ax6 != null) - { - version = 6.0; - } - } - if (version == 0) { - try - { - var ax = new ActiveXObject(sF + "." + sF); - var vS = []; - vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(','); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - - } catch (e) {} - } - } - - UA.flash = version; - - YAHOO.util.SWFDetect = { - getFlashVersion : function () { - return version; - }, - - isFlashVersionAtLeast : function (ver) { - return version >= ver; - } - }; - - var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - SWFDetect = YAHOO.util.SWFDetect, - Lang = YAHOO.lang, - - // private - FLASH_CID = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", - FLASH_TYPE = "application/x-shockwave-flash", - FLASH_VER = "10.22", - EXPRESS_INSTALL_URL = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + Math.random(), - EVENT_HANDLER = "YAHOO.widget.SWF.eventHandler", - possibleAttributes = {align:"", allowNetworking:"", allowScriptAccess:"", base:"", bgcolor:"", menu:"", name:"", quality:"", salign:"", scale:"", tabindex:"", wmode:""}; - - /** - * The SWF utility is a tool for embedding Flash applications in HTMl pages. - * @module swf - * @title SWF Utility - * @requires yahoo, dom, event - * @namespace YAHOO.widget - */ - - /** - * Creates the SWF instance and keeps the configuration data - * - * @class SWF - * @extends YAHOO.util.Element - * @constructor - * @param {String|HTMLElement} id The id of the element, or the element itself that the SWF will be inserted into. - * The width and height of the SWF will be set to the width and height of this container element. - * @param {String} swfURL The URL of the SWF to be embedded into the page. - * @param {Object} p_oAttributes (optional) Configuration parameters for the Flash application and values for Flashvars - * to be passed to the SWF. - */ - -YAHOO.widget.SWF = function (p_oElement /*:String*/, swfURL /*:String*/, p_oAttributes /*:Object*/ ) { - - this._queue = this._queue || []; - this._events = this._events || {}; - this._configs = this._configs || {}; - - /** - * The DOM id of this instance of the element. Automatically generated. - * @property _id - * @type String - */ - this._id = Dom.generateId(null, "yuiswf"); - - if(p_oAttributes.host) this._host = p_oAttributes.host; - - var _id = this._id; - var oElement = Dom.get(p_oElement); - var flashVersion = (p_oAttributes["version"] || FLASH_VER); - var isFlashVersionRight = SWFDetect.isFlashVersionAtLeast(flashVersion); - var canExpressInstall = (UA.flash >= 8.0); - var shouldExpressInstall = canExpressInstall && !isFlashVersionRight && p_oAttributes["useExpressInstall"]; - var flashURL = (shouldExpressInstall)?EXPRESS_INSTALL_URL:swfURL; - var objstring = ''; - - if (UA.ie) { - objstring += ''; - } - - for (var attribute in p_oAttributes.fixedAttributes) { - if (possibleAttributes.hasOwnProperty(attribute)) { - objstring += ''; - } - } - - for (var flashvar in p_oAttributes.flashVars) { - var fvar = p_oAttributes.flashVars[flashvar]; - if (Lang.isString(fvar)) { - flashvarstring += "&" + flashvar + "=" + encodeURIComponent(fvar); - } - } - - if (flashvarstring) { - objstring += ''; - } - - objstring += ""; - - oElement.innerHTML = objstring; - } - - YAHOO.widget.SWF.superclass.constructor.call(this, Dom.get(_id)); - this._swf = Dom.get(_id); -}; - -/** - * The static collection of all instances of the SWFs on the page. - * @property _instances - * @private - * @type Object - */ - -YAHOO.widget.SWF._instances = YAHOO.widget.SWF._instances || {}; - -/** - * Handles an event coming from within the SWF and delegate it - * to a specific instance of SWF. - * @method eventHandler - * @param swfid {String} the id of the SWF dispatching the event - * @param event {Object} the event being transmitted. - * @private - */ -YAHOO.widget.SWF.eventHandler = function (swfid, event) { - YAHOO.widget.SWF._instances[swfid]._eventHandler(event); -}; - -YAHOO.extend(YAHOO.widget.SWF, YAHOO.util.Element, { - _eventHandler: function(event) - { - if (event.type == "swfReady") - { - this.createEvent("swfReady", {fireOnce:true}); - this.fireEvent("swfReady", event); - } - else if(event.type == "log") - { - YAHOO.log(event.message, event.category, this._host ? this._host.toString() : this.toString()); - } - else - { - if(this._host && this._host.fireEvent) - { - this._host.fireEvent(event.type, event); - } - else - { - this.fireEvent(event.type, event); - } - } - }, - - /** - * Calls a specific function exposed by the SWF's - * ExternalInterface. - * @method callSWF - * @param func {String} the name of the function to call - * @param args {Object} the set of arguments to pass to the function. - */ - callSWF: function (func, args) - { - if (!args) { - args= []; - }; - - if (this._swf[func]) { - return(this._swf[func].apply(this._swf, args)); - } else { - return null; - } - }, - - /** - * Public accessor to the unique name of the SWF instance. - * - * @method toString - * @return {String} Unique name of the SWF instance. - */ - toString: function() - { - return "SWF " + this._id; - } -}); - - -})(); -YAHOO.register("swf", YAHOO.widget.SWF, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-min.js deleted file mode 100644 index e249e34a2f..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("widget");(function(){var M=0;var L=YAHOO.env.ua;var P="ShockwaveFlash";if(L.gecko||L.webkit||L.opera){if((mF=navigator.mimeTypes["application/x-shockwave-flash"])){if((eP=mF.enabledPlugin)){var F=[];F=eP.description.replace(/\s[rd]/g,".").replace(/[A-Za-z\s]+/g,"").split(".");M=F[0]+".";switch((F[2].toString()).length){case 1:M+="00";break;case 2:M+="0";break;}M+=F[2];M=parseFloat(M);}}}else{if(L.ie){try{var Q=new ActiveXObject(P+"."+P+".6");Q.AllowScriptAccess="always";}catch(K){if(Q!=null){M=6;}}if(M==0){try{var B=new ActiveXObject(P+"."+P);var F=[];F=B.GetVariable("$version").replace(/[A-Za-z\s]+/g,"").split(",");M=F[0]+".";switch((F[2].toString()).length){case 1:M+="00";break;case 2:M+="0";break;}M+=F[2];M=parseFloat(M);}catch(K){}}}}L.flash=M;YAHOO.util.SWFDetect={getFlashVersion:function(){return M;},isFlashVersionAtLeast:function(R){return M>=R;}};var H=YAHOO.util.Dom,O=YAHOO.util.Event,I=YAHOO.util.SWFDetect,J=YAHOO.lang,G="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",E="application/x-shockwave-flash",D="10.22",A="http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+Math.random(),C="YAHOO.widget.SWF.eventHandler",N={align:"",allowNetworking:"",allowScriptAccess:"",base:"",bgcolor:"",menu:"",name:"",quality:"",salign:"",scale:"",tabindex:"",wmode:""};YAHOO.widget.SWF=function(R,i,c){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._id=H.generateId(null,"yuiswf");if(c.host){this._host=c.host;}var e=this._id;var U=H.get(R);var S=(c["version"]||D);var b=I.isFlashVersionAtLeast(S);var a=(L.flash>=8);var V=a&&!b&&c["useExpressInstall"];var Z=(V)?A:i;var Y="';if(L.ie){Y+='';}for(var T in c.fixedAttributes){if(N.hasOwnProperty(T)){Y+='';}}for(var d in c.flashVars){var W=c.flashVars[d];if(J.isString(W)){g+="&"+d+"="+encodeURIComponent(W);}}if(g){Y+='';}Y+="";U.innerHTML=Y;}YAHOO.widget.SWF.superclass.constructor.call(this,H.get(e));this._swf=H.get(e);};YAHOO.widget.SWF._instances=YAHOO.widget.SWF._instances||{};YAHOO.widget.SWF.eventHandler=function(R,S){YAHOO.widget.SWF._instances[R]._eventHandler(S);};YAHOO.extend(YAHOO.widget.SWF,YAHOO.util.Element,{_eventHandler:function(R){if(R.type=="swfReady"){this.createEvent("swfReady",{fireOnce:true});this.fireEvent("swfReady",R);}else{if(R.type=="log"){}else{if(this._host&&this._host.fireEvent){this._host.fireEvent(R.type,R);}else{this.fireEvent(R.type,R);}}}},callSWF:function(S,R){if(!R){R=[];}if(this._swf[S]){return(this._swf[S].apply(this._swf,R));}else{return null;}},toString:function(){return"SWF "+this._id;}});})();YAHOO.register("swf",YAHOO.widget.SWF,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf.js deleted file mode 100644 index 1dfeeec06e..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swf/swf.js +++ /dev/null @@ -1,268 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("widget"); - -(function () { - - var version = 0; - var UA = YAHOO.env.ua; - var sF = "ShockwaveFlash"; - - if (UA.gecko || UA.webkit || UA.opera) { - if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) { - if ((eP = mF.enabledPlugin)) { - var vS = []; - vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.'); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - } - } - } - else if(UA.ie) { - try - { - var ax6 = new ActiveXObject(sF + "." + sF + ".6"); - ax6.AllowScriptAccess = "always"; - } - catch(e) - { - if(ax6 != null) - { - version = 6.0; - } - } - if (version == 0) { - try - { - var ax = new ActiveXObject(sF + "." + sF); - var vS = []; - vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(','); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - - } catch (e) {} - } - } - - UA.flash = version; - - YAHOO.util.SWFDetect = { - getFlashVersion : function () { - return version; - }, - - isFlashVersionAtLeast : function (ver) { - return version >= ver; - } - }; - - var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - SWFDetect = YAHOO.util.SWFDetect, - Lang = YAHOO.lang, - - // private - FLASH_CID = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", - FLASH_TYPE = "application/x-shockwave-flash", - FLASH_VER = "10.22", - EXPRESS_INSTALL_URL = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + Math.random(), - EVENT_HANDLER = "YAHOO.widget.SWF.eventHandler", - possibleAttributes = {align:"", allowNetworking:"", allowScriptAccess:"", base:"", bgcolor:"", menu:"", name:"", quality:"", salign:"", scale:"", tabindex:"", wmode:""}; - - /** - * The SWF utility is a tool for embedding Flash applications in HTMl pages. - * @module swf - * @title SWF Utility - * @requires yahoo, dom, event - * @namespace YAHOO.widget - */ - - /** - * Creates the SWF instance and keeps the configuration data - * - * @class SWF - * @extends YAHOO.util.Element - * @constructor - * @param {String|HTMLElement} id The id of the element, or the element itself that the SWF will be inserted into. - * The width and height of the SWF will be set to the width and height of this container element. - * @param {String} swfURL The URL of the SWF to be embedded into the page. - * @param {Object} p_oAttributes (optional) Configuration parameters for the Flash application and values for Flashvars - * to be passed to the SWF. - */ - -YAHOO.widget.SWF = function (p_oElement /*:String*/, swfURL /*:String*/, p_oAttributes /*:Object*/ ) { - - this._queue = this._queue || []; - this._events = this._events || {}; - this._configs = this._configs || {}; - - /** - * The DOM id of this instance of the element. Automatically generated. - * @property _id - * @type String - */ - this._id = Dom.generateId(null, "yuiswf"); - - if(p_oAttributes.host) this._host = p_oAttributes.host; - - var _id = this._id; - var oElement = Dom.get(p_oElement); - var flashVersion = (p_oAttributes["version"] || FLASH_VER); - var isFlashVersionRight = SWFDetect.isFlashVersionAtLeast(flashVersion); - var canExpressInstall = (UA.flash >= 8.0); - var shouldExpressInstall = canExpressInstall && !isFlashVersionRight && p_oAttributes["useExpressInstall"]; - var flashURL = (shouldExpressInstall)?EXPRESS_INSTALL_URL:swfURL; - var objstring = ''; - - if (UA.ie) { - objstring += ''; - } - - for (var attribute in p_oAttributes.fixedAttributes) { - if (possibleAttributes.hasOwnProperty(attribute)) { - objstring += ''; - } - } - - for (var flashvar in p_oAttributes.flashVars) { - var fvar = p_oAttributes.flashVars[flashvar]; - if (Lang.isString(fvar)) { - flashvarstring += "&" + flashvar + "=" + encodeURIComponent(fvar); - } - } - - if (flashvarstring) { - objstring += ''; - } - - objstring += ""; - - oElement.innerHTML = objstring; - } - - YAHOO.widget.SWF.superclass.constructor.call(this, Dom.get(_id)); - this._swf = Dom.get(_id); -}; - -/** - * The static collection of all instances of the SWFs on the page. - * @property _instances - * @private - * @type Object - */ - -YAHOO.widget.SWF._instances = YAHOO.widget.SWF._instances || {}; - -/** - * Handles an event coming from within the SWF and delegate it - * to a specific instance of SWF. - * @method eventHandler - * @param swfid {String} the id of the SWF dispatching the event - * @param event {Object} the event being transmitted. - * @private - */ -YAHOO.widget.SWF.eventHandler = function (swfid, event) { - YAHOO.widget.SWF._instances[swfid]._eventHandler(event); -}; - -YAHOO.extend(YAHOO.widget.SWF, YAHOO.util.Element, { - _eventHandler: function(event) - { - if (event.type == "swfReady") - { - this.createEvent("swfReady", {fireOnce:true}); - this.fireEvent("swfReady", event); - } - else if(event.type == "log") - { - } - else - { - if(this._host && this._host.fireEvent) - { - this._host.fireEvent(event.type, event); - } - else - { - this.fireEvent(event.type, event); - } - } - }, - - /** - * Calls a specific function exposed by the SWF's - * ExternalInterface. - * @method callSWF - * @param func {String} the name of the function to call - * @param args {Object} the set of arguments to pass to the function. - */ - callSWF: function (func, args) - { - if (!args) { - args= []; - }; - - if (this._swf[func]) { - return(this._swf[func].apply(this._swf, args)); - } else { - return null; - } - }, - - /** - * Public accessor to the unique name of the SWF instance. - * - * @method toString - * @return {String} Unique name of the SWF instance. - */ - toString: function() - { - return "SWF " + this._id; - } -}); - - -})(); -YAHOO.register("swf", YAHOO.widget.SWF, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-debug.js deleted file mode 100644 index 84051eb06f..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-debug.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Utility for Flash version detection - * @namespace YAHOO.util - * @module swfdetect - */ -YAHOO.namespace("util"); - -/** - * Flafh detection utility. - * @class SWFDetect - * @static - */ -(function () { - -var version = 0; -var uA = YAHOO.env.ua; -var sF = "ShockwaveFlash"; - - if (uA.gecko || uA.webkit || uA.opera) { - if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) { - if ((eP = mF.enabledPlugin)) { - var vS = []; - vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.'); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - } - } - } - else if(uA.ie) { - try - { - var ax6 = new ActiveXObject(sF + "." + sF + ".6"); - ax6.AllowScriptAccess = "always"; - } - catch(e) - { - if(ax6 != null) - { - version = 6.0; - } - } - if (version == 0) { - try - { - var ax = new ActiveXObject(sF + "." + sF); - var vS = []; - vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(','); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - - } catch (e) {} - } - } - - uA.flash = version; - -YAHOO.util.SWFDetect = { - getFlashVersion : function () { - return version; - }, - - isFlashVersionAtLeast : function (ver) { - return version >= ver; - } - }; -})(); -YAHOO.register("swfdetect", YAHOO.util.SWFDetect, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-min.js deleted file mode 100644 index 209f0334f3..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("util");(function(){var A=0;var B=YAHOO.env.ua;var C="ShockwaveFlash";if(B.gecko||B.webkit||B.opera){if((mF=navigator.mimeTypes["application/x-shockwave-flash"])){if((eP=mF.enabledPlugin)){var G=[];G=eP.description.replace(/\s[rd]/g,".").replace(/[A-Za-z\s]+/g,"").split(".");A=G[0]+".";switch((G[2].toString()).length){case 1:A+="00";break;case 2:A+="0";break;}A+=G[2];A=parseFloat(A);}}}else{if(B.ie){try{var D=new ActiveXObject(C+"."+C+".6");D.AllowScriptAccess="always";}catch(F){if(D!=null){A=6;}}if(A==0){try{var E=new ActiveXObject(C+"."+C);var G=[];G=E.GetVariable("$version").replace(/[A-Za-z\s]+/g,"").split(",");A=G[0]+".";switch((G[2].toString()).length){case 1:A+="00";break;case 2:A+="0";break;}A+=G[2];A=parseFloat(A);}catch(F){}}}}B.flash=A;YAHOO.util.SWFDetect={getFlashVersion:function(){return A;},isFlashVersionAtLeast:function(H){return A>=H;}};})();YAHOO.register("swfdetect",YAHOO.util.SWFDetect,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect.js deleted file mode 100644 index 84051eb06f..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfdetect/swfdetect.js +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Utility for Flash version detection - * @namespace YAHOO.util - * @module swfdetect - */ -YAHOO.namespace("util"); - -/** - * Flafh detection utility. - * @class SWFDetect - * @static - */ -(function () { - -var version = 0; -var uA = YAHOO.env.ua; -var sF = "ShockwaveFlash"; - - if (uA.gecko || uA.webkit || uA.opera) { - if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) { - if ((eP = mF.enabledPlugin)) { - var vS = []; - vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.'); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - } - } - } - else if(uA.ie) { - try - { - var ax6 = new ActiveXObject(sF + "." + sF + ".6"); - ax6.AllowScriptAccess = "always"; - } - catch(e) - { - if(ax6 != null) - { - version = 6.0; - } - } - if (version == 0) { - try - { - var ax = new ActiveXObject(sF + "." + sF); - var vS = []; - vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(','); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - - } catch (e) {} - } - } - - uA.flash = version; - -YAHOO.util.SWFDetect = { - getFlashVersion : function () { - return version; - }, - - isFlashVersionAtLeast : function (ver) { - return version >= ver; - } - }; -})(); -YAHOO.register("swfdetect", YAHOO.util.SWFDetect, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swf.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swf.js deleted file mode 100644 index a6a90f6c02..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swf.js +++ /dev/null @@ -1,238 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.namespace("widget"); - -(function () { - - var version = 0; - var UA = YAHOO.env.ua; - var sF = "ShockwaveFlash"; - - if (UA.gecko || UA.webkit || UA.opera) { - if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) { - if ((eP = mF.enabledPlugin)) { - var vS = []; - vS = eP.description.replace(/\s[rd]/g, '.').replace(/[A-Za-z\s]+/g, '').split('.'); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - } - } - } - else if(UA.ie) { - try - { - var ax6 = new ActiveXObject(sF + "." + sF + ".6"); - ax6.AllowScriptAccess = "always"; - } - catch(e) - { - if(ax6 != null) - { - version = 6.0; - } - } - if (version == 0) { - try - { - var ax = new ActiveXObject(sF + "." + sF); - var vS = []; - vS = ax.GetVariable("$version").replace(/[A-Za-z\s]+/g, '').split(','); - version = vS[0] + '.'; - switch((vS[2].toString()).length) - { - case 1: - version += "00"; - break; - case 2: - version += "0"; - break; - } - version += vS[2]; - version = parseFloat(version); - - } catch (e) {} - } - } - - UA.flash = version; - - YAHOO.util.SWFDetect = { - getFlashVersion : function () { - return version; - }, - - isFlashVersionAtLeast : function (ver) { - return version >= ver; - } - }; - - var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - SWFDetect = YAHOO.util.SWFDetect, - Lang = YAHOO.lang, - - // private - FLASH_CID = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", - FLASH_TYPE = "application/x-shockwave-flash", - FLASH_VER = "10.22", - EXPRESS_INSTALL_URL = "http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + Math.random(), - EVENT_HANDLER = "YAHOO.widget.SWF.eventHandler", - possibleAttributes = {align:"", allowNetworking:"", allowScriptAccess:"", base:"", bgcolor:"", menu:"", name:"", quality:"", salign:"", scale:"", tabindex:"", wmode:""}; - - /** - * The SWF utility is a tool for embedding Flash applications in HTMl pages. - * @module swf - * @title SWF Utility - * @requires yahoo, dom, event - * @namespace YAHOO.widget - */ - - /** - * Creates the SWF instance and keeps the configuration data - * - * @class SWF - * @extends YAHOO.util.Element - * @constructor - * @param {String|HTMLElement} id The id of the element, or the element itself that the SWF will be inserted into. - * The width and height of the SWF will be set to the width and height of this container element. - * @param {String} swfURL The URL of the SWF to be embedded into the page. - * @param {Object} p_oAttributes (optional) Configuration parameters for the Flash application and values for Flashvars - * to be passed to the SWF. - */ - -YAHOO.widget.SWF = function (p_oElement /*:String*/, swfURL /*:String*/, p_oAttributes /*:Object*/ ) { - - this._queue = this._queue || []; - this._events = this._events || {}; - this._configs = this._configs || {}; - - /** - * The DOM id of this instance of the element. Automatically generated. - * @property _id - * @type String - */ - this._id = Dom.generateId(null, "yuiswf"); - - var _id = this._id; - var oElement = Dom.get(p_oElement); - var flashVersion = (p_oAttributes["version"] || FLASH_VER); - var isFlashVersionRight = SWFDetect.isFlashVersionAtLeast(flashVersion); - var canExpressInstall = (UA.flash >= 8.0); - var shouldExpressInstall = canExpressInstall && !isFlashVersionRight && p_oAttributes["useExpressInstall"]; - var flashURL = (shouldExpressInstall)?EXPRESS_INSTALL_URL:swfURL; - var objstring = ''; - - if (UA.ie) { - objstring += ''; - } - - for (var attribute in p_oAttributes.fixedAttributes) { - if (possibleAttributes.hasOwnProperty(attribute)) { - objstring += ''; - } - } - - for (var flashvar in p_oAttributes.flashVars) { - var fvar = p_oAttributes.flashVars[flashvar]; - if (Lang.isString(fvar)) { - flashvarstring += "&" + flashvar + "=" + encodeURIComponent(fvar); - } - } - - if (flashvarstring) { - objstring += ''; - } - - objstring += ""; - - oElement.innerHTML = objstring; - } - - YAHOO.widget.SWF.superclass.constructor.call(this, Dom.get(_id)); - this._swf = Dom.get(_id); -}; - -/** - * The static collection of all instances of the SWFs on the page. - * @property _instances - * @private - * @type Object - */ - -YAHOO.widget.SWF._instances = YAHOO.widget.SWF._instances || {}; - -/** - * Handles an event coming from within the SWF and delegate it - * to a specific instance of SWF. - * @method eventHandler - * @param swfid {String} the id of the SWF dispatching the event - * @param event {Object} the event being transmitted. - * @private - */ -YAHOO.widget.SWF.eventHandler = function (swfid, event) { - YAHOO.widget.SWF._instances[swfid]._eventHandler(event); -}; - -YAHOO.extend(YAHOO.widget.SWF, YAHOO.util.Element, { - _eventHandler: function(event) - { - if (event.type == "swfReady") { - this.createEvent("swfReady"); - this.fireEvent("swfReady", event); - } - else { - this.fireEvent(event.type, event); - } - }, - /** - * Calls a specific function exposed by the SWF's - * ExternalInterface. - * @method callSWF - * @param func {String} the name of the function to call - * @param args {Object} the set of arguments to pass to the function. - */ - callSWF: function (func, args) - { - if (this._swf[func]) { - return(this._swf[func].apply(this._swf, args)); - } else { - return null; - } - } -}); - - -})(); -YAHOO.register("swf", YAHOO.widget.SWF, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-debug.js deleted file mode 100644 index 7b1158c84a..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-debug.js +++ /dev/null @@ -1,470 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Provides a swf based storage implementation - * - * @module swfstore - */ - -/** - * Class for the YUI SWFStore util. - * - * @namespace YAHOO.util - * @class SWFStore - * @uses YAHOO.util.AttributeProvider - * @constructor - * @param containerId {HTMLElement} Container element for the Flash Player instance. - * @param shareData {Boolean} Whether or not data should be shared across browsers - * @param useCompression {Boolean} Container element for the Flash Player instance. - */ -YAHOO.util.SWFStore = function(containerID, shareData, useCompression) -{ - //browser detection - var browser; - var newValue; - //convert Booleans to strings for flashvars compatibility - shareData = shareData.toString(); - useCompression = useCompression.toString(); - - if (YAHOO.env.ua.ie) browser = "ie"; - else if (YAHOO.env.ua.gecko) browser = "gecko"; //Firefox - else if (YAHOO.env.ua.webkit) browser = "webkit"; // Safari, Webkit - else if (YAHOO.env.ua.caja) browser = "caja"; - else if (YAHOO.env.ua.opera) browser = "opera"; - else browser = "other"; - - if(YAHOO.util.Cookie.get("swfstore") == null || YAHOO.util.Cookie.get("swfstore") == "null" || YAHOO.util.Cookie.get("swfstore") == "") - { - - newValue = Math.round(Math.random() * Math.PI * 100000); - YAHOO.util.Cookie.set("swfstore", newValue); - - } - - else - { - newValue = YAHOO.util.Cookie.get("swfstore"); - } - - - var params = - { - version: 9.115, - useExpressInstall: false, - fixedAttributes: - {allowScriptAccess:"always", allowNetworking:"all", scale:"noScale"}, - flashVars: - {shareData: shareData, browser: newValue, useCompression: useCompression} - }; - - - - this.embeddedSWF = new YAHOO.widget.SWF(containerID, YAHOO.util.SWFStore.SWFURL, params); - - - /** - * Fires when an error occurs - * - * @event error - * @param event.type {String} The event type - * @param event.message {String} The data - * - */ - this.createEvent("error"); - - /** - * Fires when there is not enough space available to store the data - * - * @event quotaExceededError - * @param event.type {String} The event type - * @param event.message {String} The data - * - */ - this.createEvent("quotaExceededError"); - - /** - * Fires when the url matching for the security whitelist is invalid. - * If no whitelist is used, fires when page's url does not match the embedded swf's url - * - * @event securityError - * @param event.type {String} The event type - * @param event.message {String} The data - * - */ - this.createEvent("securityError"); - - /** - * Fires when a store is saved successfully - * - * @event save - * @param event.type {String} The event type - * - */ - this.createEvent("save"); - - /** - * Fires when a store is successfully cleared - * - * @event clear - * @param event.type {String} The event type - * - */ - this.createEvent("clear"); - - - /** - * Fires when the save is pending, due to a request for additional storage - * - * @event error - * @param event.type {String} The event type - * - */ - this.createEvent("pending"); - - - /** - * Fires as the settings dialog displays - * - * @event openingDialog - * @param event.type {String} The event type - * - */ - this.createEvent("openingDialog"); - - /** - * Fires when a settings dialog is not able to be displayed due to - * the SWF not being large enough to show it. In this case, the developer - * needs to resize the SWF to width of 215px and height of 138px or above, - * or display an external settings page. - * - * @event inadequateDimensions - * @param event.type {String} The event type - * - */ - this.createEvent("inadequateDimensions"); -}; - -YAHOO.extend(YAHOO.util.SWFStore, YAHOO.util.AttributeProvider, -{ - - - - /** - * Method to attach listeners to events - * @param type {String} The tyep of event to listen for - * @param listener {String} The function to call - */ - on: function(type, listener) - { - this.embeddedSWF.addListener(type, listener); - }, - - /** - * Method to attach listeners to events - * @param type {String} The tyep of event to listen for - * @param listener {String} The function to call - */ - addListener: function(type, listener) - { - YAHOO.log("adding '" + type + "' listener"); - this.embeddedSWF.addListener(type, listener); - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method toString - * @return {String} Unique name of the SWFStore instance. - */ - toString: function() - { - return "SWFStore " + this._id; - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method getShareData - * @return {Boolean} Whether or not data is being shared among browsers - */ - getShareData: function() - { - return this.embeddedSWF.callSWF("getShareData"); - }, - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method setShareData - * @param {Boolean} Whether or not to share among browsers - */ - setShareData: function(value) - { - YAHOO.log("Setting share data to " + value); - this.embeddedSWF.callSWF("setShareData", [value]); - }, - - /** - * Determines if SWF's visible area is large enough to fit the settings panel - * - * @method hasAdequateDimensions - * @return {Boolean} Whether or not to share among browsers - */ - hasAdequateDimensions: function() - { - YAHOO.log("dimensions adequate? " + this.embeddedSWF.callSWF("hasAdequateDimensions")); - return this.embeddedSWF.callSWF("hasAdequateDimensions"); - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method getUseCompression - * @return {Boolean} Whether or compression is being used - */ - getUseCompression: function() - { - return this.embeddedSWF.callSWF("getUseCompression"); - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method setUseCompression - * @param {Boolean} Whether or to compress stored data - */ - setUseCompression: function(value) - { - YAHOO.log("Setting compression to " + value); - this.embeddedSWF.callSWF("setUseCompression", [value]); - }, - - /** - * Saves data to local storage. It returns a String that can - * be one of three values: "true" if the storage succeeded; "false" if the user - * has denied storage on their machine or storage space allotted is not sufficient. - *

                    The size limit for the passed parameters is ~40Kb.

                    - * @method setItem - * @param data {Object} The data to store - * @param location {String} The name of the "cookie" or store - * @return {Boolean} Whether or not the save was successful - * - */ - setItem: function(location,data) - { - YAHOO.log("setting " + location + " to " + data); - return this.embeddedSWF.callSWF("setItem", [location, data]); - } , - - /** - * Returns the value of the store at the specified index, if any. - * @method getValueAt - * @param index {Number} The index of the stored item - * @return {Object} The value of the store at that index - * - */ - getValueAt: function(index) - { - YAHOO.log("value at " + index + " is " + this.embeddedSWF.callSWF("getValueAt", [index]) ); - return this.embeddedSWF.callSWF("getValueAt", [index]); - }, - - /** - * Returns the key name in storage, if any, at the specified index. - * - * @param index {Number} The index of the "cookie" or store - * @return {Object}The data - * @method setItem - * - */ - getNameAt: function(index) - { - YAHOO.log("name at " + index + " is " + this.embeddedSWF.callSWF("getNameAt", [index]) ); - return this.embeddedSWF.callSWF("getNameAt", [index]); - }, - - - /** - * Returns the value of the item in storage, if any. - * @method getValueOf - * @param location {String} The name of the "cookie" or store - * @return {Object} The data - * - */ - getValueOf: function(location) - { - YAHOO.log("value of " + location + " is " + this.embeddedSWF.callSWF("getValueOf", [location]) ); - return this.embeddedSWF.callSWF("getValueOf", [location]); - } , - - /** - * Returns the data type of of the storage. - *

                    May be one of the following types: - *

                      - *
                    • boolean
                    • - *
                    • function
                    • - *
                    • number
                    • - *
                    • object
                    • - *
                    • string
                    • - *
                    • number
                    • - *
                    • xml
                    • - *
                    - *

                    - * @method getTypeOf - * @param location {String} The name of the "cookie" or store - * @return {String} The type - * - */ - getTypeOf: function(location) - { - YAHOO.log("type of " + location + " is " + this.embeddedSWF.callSWF("getTypeOf", [location]) ); - return this.embeddedSWF.callSWF("getTypeOf", [location]); - } , - - /** - * Returns the data type of of the storage. - *

                    May be one of the following types: - *

                      - *
                    • boolean
                    • - *
                    • function
                    • - *
                    • number
                    • - *
                    • object
                    • - *
                    • string
                    • - *
                    • number
                    • - *
                    • xml
                    • - *
                    - *

                    - * @method getTypeAt - * @param location {Number} The index of the "cookie" or store - * @return {String} The type - * - */ - getTypeAt: function(index) - { - YAHOO.log("type at " + index + " is " + this.embeddedSWF.callSWF("getTypeAt", [index]) ); - return this.embeddedSWF.callSWF("getTypeAt", [index]); - } , - - /** - * Returns the items in storage as an array. - * @method getItems - * @return {Object} The data. - * @public - */ - getItems: function() - { - return this.embeddedSWF.callSWF("getItems", []); - }, - - /** - * Removes the item in storage, if any. - * @method removeItem - * @param location {String} The name of the "cookie" or store - * - */ - removeItem: function(location) - { - YAHOO.log("removing " + location); - return this.embeddedSWF.callSWF("removeItem", [location]); - } , - - /** - * Removes the item in storage at the specified index, if any. - * @method removeItem - * @param index {Number} The index of the "cookie" or store - * - */ - removeItemAt: function(index) - { - YAHOO.log("removing item at " + index); - return this.embeddedSWF.callSWF("removeItemAt", [index]); - } , - - /** - * Returns the number of items in storage, if any. - * @method getLength - * @return {Number} The number of items - * - */ - getLength: function() - { - return this.embeddedSWF.callSWF("getLength", []); - } , - - /** - * Removes all data in local storage for this domain. - *

                    Be careful when using this method, as it may - * remove stored information that is used by other applications - * in this domain

                    - * @method clear - */ - clear: function() - { - YAHOO.log("clearing all items"); - return this.embeddedSWF.callSWF("clear", []); - } , - - /** - * Gets the current size, in KB, of the amount of space taken by the current store. - * Note that this is calculated, and may take time depending on the number of items stored - * @method calculateCurrentSize - * @return {Number} The size of the store in KB - */ - calculateCurrentSize: function() - { - YAHOO.log("calculating size"); - return this.embeddedSWF.callSWF("calculateCurrentSize", []); - } , - - /** - * Gets the timestamp of the last store. This value is automatically set when - * data is stored. - * @method getModificationDate - * @return {Date} A Date object - */ - getModificationDate: function() - { - YAHOO.log("getting date"); - return this.embeddedSWF.callSWF("getModificationDate", []); - } , - - /** - * This method requests more storage (if the amount is above 100KB or the current setting). - * - * The request dialog has to be displayed within the Flash player itself - * so the SWF it is called from must be visible and at least 215px x 138px (w x h) in size. - * - * @method setSize - * @param value {Number} The size, in KB - * @return {String} - */ - setSize: function(value) - { - var result = this.embeddedSWF.callSWF("setSize", [value]); - YAHOO.log("attempt to set size to " + value*1024 + " bytes resulted in " + result); - return result; - } , - - /** - * Displays the settings dialog to allow the user to configure - * storage settings manually. If the SWF height and width are smaller than - * what is allowable to display the local settings panel, - * an openExternalDialog message will be sent to JavaScript. - * @method displaySettings - */ - displaySettings: function() - { - YAHOO.log("attempting to show settings. are dimensions adequate? " + this.embeddedSWF.callSWF("hasAdequateDimensions")); - this.embeddedSWF.callSWF("displaySettings", []); - } - -}); - - -YAHOO.util.SWFStore.SWFURL = "swfstore.swf"; - -YAHOO.register("swfstore", YAHOO.util.SWFStore, {version: "2.8.0r4", build: "2449"}); -YAHOO.register("swfstore", YAHOO.util.SWFStore, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-min.js deleted file mode 100644 index f4e12d2d5b..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore-min.js +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -YAHOO.util.SWFStore=function(A,C,D){var B;var E;C=C.toString();D=D.toString();if(YAHOO.env.ua.ie){B="ie";}else{if(YAHOO.env.ua.gecko){B="gecko";}else{if(YAHOO.env.ua.webkit){B="webkit";}else{if(YAHOO.env.ua.caja){B="caja";}else{if(YAHOO.env.ua.opera){B="opera";}else{B="other";}}}}}if(YAHOO.util.Cookie.get("swfstore")==null||YAHOO.util.Cookie.get("swfstore")=="null"||YAHOO.util.Cookie.get("swfstore")==""){E=Math.round(Math.random()*Math.PI*100000);YAHOO.util.Cookie.set("swfstore",E);}else{E=YAHOO.util.Cookie.get("swfstore");}var F={version:9.115,useExpressInstall:false,fixedAttributes:{allowScriptAccess:"always",allowNetworking:"all",scale:"noScale"},flashVars:{shareData:C,browser:E,useCompression:D}};this.embeddedSWF=new YAHOO.widget.SWF(A,YAHOO.util.SWFStore.SWFURL,F);this.createEvent("error");this.createEvent("quotaExceededError");this.createEvent("securityError");this.createEvent("save");this.createEvent("clear");this.createEvent("pending");this.createEvent("openingDialog");this.createEvent("inadequateDimensions");};YAHOO.extend(YAHOO.util.SWFStore,YAHOO.util.AttributeProvider,{on:function(A,B){this.embeddedSWF.addListener(A,B);},addListener:function(A,B){this.embeddedSWF.addListener(A,B);},toString:function(){return"SWFStore "+this._id;},getShareData:function(){return this.embeddedSWF.callSWF("getShareData");},setShareData:function(A){this.embeddedSWF.callSWF("setShareData",[A]);},hasAdequateDimensions:function(){return this.embeddedSWF.callSWF("hasAdequateDimensions");},getUseCompression:function(){return this.embeddedSWF.callSWF("getUseCompression");},setUseCompression:function(A){this.embeddedSWF.callSWF("setUseCompression",[A]);},setItem:function(A,B){return this.embeddedSWF.callSWF("setItem",[A,B]);},getValueAt:function(A){return this.embeddedSWF.callSWF("getValueAt",[A]);},getNameAt:function(A){return this.embeddedSWF.callSWF("getNameAt",[A]);},getValueOf:function(A){return this.embeddedSWF.callSWF("getValueOf",[A]);},getTypeOf:function(A){return this.embeddedSWF.callSWF("getTypeOf",[A]);},getTypeAt:function(A){return this.embeddedSWF.callSWF("getTypeAt",[A]);},getItems:function(){return this.embeddedSWF.callSWF("getItems",[]);},removeItem:function(A){return this.embeddedSWF.callSWF("removeItem",[A]);},removeItemAt:function(A){return this.embeddedSWF.callSWF("removeItemAt",[A]);},getLength:function(){return this.embeddedSWF.callSWF("getLength",[]);},clear:function(){return this.embeddedSWF.callSWF("clear",[]);},calculateCurrentSize:function(){return this.embeddedSWF.callSWF("calculateCurrentSize",[]);},getModificationDate:function(){return this.embeddedSWF.callSWF("getModificationDate",[]);},setSize:function(B){var A=this.embeddedSWF.callSWF("setSize",[B]);return A;},displaySettings:function(){this.embeddedSWF.callSWF("displaySettings",[]);}});YAHOO.util.SWFStore.SWFURL="swfstore.swf";YAHOO.register("swfstore",YAHOO.util.SWFStore,{version:"2.8.0r4",build:"2449"});YAHOO.register("swfstore",YAHOO.util.SWFStore,{version:"2.8.0r4",build:"2449"}); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore.js deleted file mode 100644 index 5a4a4d7b4e..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore.js +++ /dev/null @@ -1,453 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/** - * Provides a swf based storage implementation - * - * @module swfstore - */ - -/** - * Class for the YUI SWFStore util. - * - * @namespace YAHOO.util - * @class SWFStore - * @uses YAHOO.util.AttributeProvider - * @constructor - * @param containerId {HTMLElement} Container element for the Flash Player instance. - * @param shareData {Boolean} Whether or not data should be shared across browsers - * @param useCompression {Boolean} Container element for the Flash Player instance. - */ -YAHOO.util.SWFStore = function(containerID, shareData, useCompression) -{ - //browser detection - var browser; - var newValue; - //convert Booleans to strings for flashvars compatibility - shareData = shareData.toString(); - useCompression = useCompression.toString(); - - if (YAHOO.env.ua.ie) browser = "ie"; - else if (YAHOO.env.ua.gecko) browser = "gecko"; //Firefox - else if (YAHOO.env.ua.webkit) browser = "webkit"; // Safari, Webkit - else if (YAHOO.env.ua.caja) browser = "caja"; - else if (YAHOO.env.ua.opera) browser = "opera"; - else browser = "other"; - - if(YAHOO.util.Cookie.get("swfstore") == null || YAHOO.util.Cookie.get("swfstore") == "null" || YAHOO.util.Cookie.get("swfstore") == "") - { - - newValue = Math.round(Math.random() * Math.PI * 100000); - YAHOO.util.Cookie.set("swfstore", newValue); - - } - - else - { - newValue = YAHOO.util.Cookie.get("swfstore"); - } - - - var params = - { - version: 9.115, - useExpressInstall: false, - fixedAttributes: - {allowScriptAccess:"always", allowNetworking:"all", scale:"noScale"}, - flashVars: - {shareData: shareData, browser: newValue, useCompression: useCompression} - }; - - - - this.embeddedSWF = new YAHOO.widget.SWF(containerID, YAHOO.util.SWFStore.SWFURL, params); - - - /** - * Fires when an error occurs - * - * @event error - * @param event.type {String} The event type - * @param event.message {String} The data - * - */ - this.createEvent("error"); - - /** - * Fires when there is not enough space available to store the data - * - * @event quotaExceededError - * @param event.type {String} The event type - * @param event.message {String} The data - * - */ - this.createEvent("quotaExceededError"); - - /** - * Fires when the url matching for the security whitelist is invalid. - * If no whitelist is used, fires when page's url does not match the embedded swf's url - * - * @event securityError - * @param event.type {String} The event type - * @param event.message {String} The data - * - */ - this.createEvent("securityError"); - - /** - * Fires when a store is saved successfully - * - * @event save - * @param event.type {String} The event type - * - */ - this.createEvent("save"); - - /** - * Fires when a store is successfully cleared - * - * @event clear - * @param event.type {String} The event type - * - */ - this.createEvent("clear"); - - - /** - * Fires when the save is pending, due to a request for additional storage - * - * @event error - * @param event.type {String} The event type - * - */ - this.createEvent("pending"); - - - /** - * Fires as the settings dialog displays - * - * @event openingDialog - * @param event.type {String} The event type - * - */ - this.createEvent("openingDialog"); - - /** - * Fires when a settings dialog is not able to be displayed due to - * the SWF not being large enough to show it. In this case, the developer - * needs to resize the SWF to width of 215px and height of 138px or above, - * or display an external settings page. - * - * @event inadequateDimensions - * @param event.type {String} The event type - * - */ - this.createEvent("inadequateDimensions"); -}; - -YAHOO.extend(YAHOO.util.SWFStore, YAHOO.util.AttributeProvider, -{ - - - - /** - * Method to attach listeners to events - * @param type {String} The tyep of event to listen for - * @param listener {String} The function to call - */ - on: function(type, listener) - { - this.embeddedSWF.addListener(type, listener); - }, - - /** - * Method to attach listeners to events - * @param type {String} The tyep of event to listen for - * @param listener {String} The function to call - */ - addListener: function(type, listener) - { - this.embeddedSWF.addListener(type, listener); - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method toString - * @return {String} Unique name of the SWFStore instance. - */ - toString: function() - { - return "SWFStore " + this._id; - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method getShareData - * @return {Boolean} Whether or not data is being shared among browsers - */ - getShareData: function() - { - return this.embeddedSWF.callSWF("getShareData"); - }, - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method setShareData - * @param {Boolean} Whether or not to share among browsers - */ - setShareData: function(value) - { - this.embeddedSWF.callSWF("setShareData", [value]); - }, - - /** - * Determines if SWF's visible area is large enough to fit the settings panel - * - * @method hasAdequateDimensions - * @return {Boolean} Whether or not to share among browsers - */ - hasAdequateDimensions: function() - { - return this.embeddedSWF.callSWF("hasAdequateDimensions"); - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method getUseCompression - * @return {Boolean} Whether or compression is being used - */ - getUseCompression: function() - { - return this.embeddedSWF.callSWF("getUseCompression"); - }, - - /** - * Public accessor to the unique name of the SWFStore instance. - * - * @method setUseCompression - * @param {Boolean} Whether or to compress stored data - */ - setUseCompression: function(value) - { - this.embeddedSWF.callSWF("setUseCompression", [value]); - }, - - /** - * Saves data to local storage. It returns a String that can - * be one of three values: "true" if the storage succeeded; "false" if the user - * has denied storage on their machine or storage space allotted is not sufficient. - *

                    The size limit for the passed parameters is ~40Kb.

                    - * @method setItem - * @param data {Object} The data to store - * @param location {String} The name of the "cookie" or store - * @return {Boolean} Whether or not the save was successful - * - */ - setItem: function(location,data) - { - return this.embeddedSWF.callSWF("setItem", [location, data]); - } , - - /** - * Returns the value of the store at the specified index, if any. - * @method getValueAt - * @param index {Number} The index of the stored item - * @return {Object} The value of the store at that index - * - */ - getValueAt: function(index) - { - return this.embeddedSWF.callSWF("getValueAt", [index]); - }, - - /** - * Returns the key name in storage, if any, at the specified index. - * - * @param index {Number} The index of the "cookie" or store - * @return {Object}The data - * @method setItem - * - */ - getNameAt: function(index) - { - return this.embeddedSWF.callSWF("getNameAt", [index]); - }, - - - /** - * Returns the value of the item in storage, if any. - * @method getValueOf - * @param location {String} The name of the "cookie" or store - * @return {Object} The data - * - */ - getValueOf: function(location) - { - return this.embeddedSWF.callSWF("getValueOf", [location]); - } , - - /** - * Returns the data type of of the storage. - *

                    May be one of the following types: - *

                      - *
                    • boolean
                    • - *
                    • function
                    • - *
                    • number
                    • - *
                    • object
                    • - *
                    • string
                    • - *
                    • number
                    • - *
                    • xml
                    • - *
                    - *

                    - * @method getTypeOf - * @param location {String} The name of the "cookie" or store - * @return {String} The type - * - */ - getTypeOf: function(location) - { - return this.embeddedSWF.callSWF("getTypeOf", [location]); - } , - - /** - * Returns the data type of of the storage. - *

                    May be one of the following types: - *

                      - *
                    • boolean
                    • - *
                    • function
                    • - *
                    • number
                    • - *
                    • object
                    • - *
                    • string
                    • - *
                    • number
                    • - *
                    • xml
                    • - *
                    - *

                    - * @method getTypeAt - * @param location {Number} The index of the "cookie" or store - * @return {String} The type - * - */ - getTypeAt: function(index) - { - return this.embeddedSWF.callSWF("getTypeAt", [index]); - } , - - /** - * Returns the items in storage as an array. - * @method getItems - * @return {Object} The data. - * @public - */ - getItems: function() - { - return this.embeddedSWF.callSWF("getItems", []); - }, - - /** - * Removes the item in storage, if any. - * @method removeItem - * @param location {String} The name of the "cookie" or store - * - */ - removeItem: function(location) - { - return this.embeddedSWF.callSWF("removeItem", [location]); - } , - - /** - * Removes the item in storage at the specified index, if any. - * @method removeItem - * @param index {Number} The index of the "cookie" or store - * - */ - removeItemAt: function(index) - { - return this.embeddedSWF.callSWF("removeItemAt", [index]); - } , - - /** - * Returns the number of items in storage, if any. - * @method getLength - * @return {Number} The number of items - * - */ - getLength: function() - { - return this.embeddedSWF.callSWF("getLength", []); - } , - - /** - * Removes all data in local storage for this domain. - *

                    Be careful when using this method, as it may - * remove stored information that is used by other applications - * in this domain

                    - * @method clear - */ - clear: function() - { - return this.embeddedSWF.callSWF("clear", []); - } , - - /** - * Gets the current size, in KB, of the amount of space taken by the current store. - * Note that this is calculated, and may take time depending on the number of items stored - * @method calculateCurrentSize - * @return {Number} The size of the store in KB - */ - calculateCurrentSize: function() - { - return this.embeddedSWF.callSWF("calculateCurrentSize", []); - } , - - /** - * Gets the timestamp of the last store. This value is automatically set when - * data is stored. - * @method getModificationDate - * @return {Date} A Date object - */ - getModificationDate: function() - { - return this.embeddedSWF.callSWF("getModificationDate", []); - } , - - /** - * This method requests more storage (if the amount is above 100KB or the current setting). - * - * The request dialog has to be displayed within the Flash player itself - * so the SWF it is called from must be visible and at least 215px x 138px (w x h) in size. - * - * @method setSize - * @param value {Number} The size, in KB - * @return {String} - */ - setSize: function(value) - { - var result = this.embeddedSWF.callSWF("setSize", [value]); - return result; - } , - - /** - * Displays the settings dialog to allow the user to configure - * storage settings manually. If the SWF height and width are smaller than - * what is allowable to display the local settings panel, - * an openExternalDialog message will be sent to JavaScript. - * @method displaySettings - */ - displaySettings: function() - { - this.embeddedSWF.callSWF("displaySettings", []); - } - -}); - - -YAHOO.util.SWFStore.SWFURL = "swfstore.swf"; - -YAHOO.register("swfstore", YAHOO.util.SWFStore, {version: "2.8.0r4", build: "2449"}); -YAHOO.register("swfstore", YAHOO.util.SWFStore, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore.swf b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/swfstore/swfstore.swf deleted file mode 100644 index 1d2f5012985047b0d7b644b380ebfb57ce3a9123..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4819 zcmV;^5-jaQS5pd99smG%+I?ABcpJx&?wSLQ0YDM}DT<`7kwuD!z(a=*(K0QHBt*)T zAoGwY*)%Z#W(ZgS2F46{SV_b>rkt5y6(QPefZEdML zYaM7G-~xtqE1pl~?39^R*<6d61^d4C_OjGOyec$T$fvo;M7&o|>lr<3TfK*S4x^w% zyx%bM8OOW4n9eW~MinHxq?8>SUlOzIp2wCL&jerBhZ?&kq!`SF+}! zbHpZ<@x=4GW}DkNDm1p9*0S>jZC)Q3Img$kbFQOi<9!PA>XExb>XE*_ zYnLhLzyUJs|8MaG84@-&HZFTa^soz?M9jT}|GoAf|2cC2J^qnr@?v-rHPOij4SRPJ zf;3{}wTyn4_(>0uaQ{Z#EqDs)MIiK)X{L28D=nC*glp2yr?T^6Dr?Jw`MkC)6>umG zqi#O#oF09Fc~l-@AKzGHB%e3)d=i}0tiItHGvB}$~K<4N73W|rfj&dhGZ2SqvOk*zML=UJ>zPmJ>&jhjB& z>fahL!qA@n?L+lP|>2yqsU$GQR&n6t;o*g?kc6R#g+{LlssnOcX zY;WvjrX|!#_Hr)3+KyTen9Cp6W{fA6U$f>NJ-?yD< zENkm|Ep8+79mZY%kC5G4Be4KG{#l^(kR#a$ zaLGdF*WlJHf^ZnIV9u9wkF{(emfaN~)l>%OwXB}58IKGNj?Ya_MJ5JMkNB{tELMQr zkjiQwLj}#C-l*)csidyPooG$-N9WbNZWr=dyni-fF7~8N=T<$*yl&k4 zNeL5DI)Kew?AGFObV;|7H#0TX)@1Qu#nCFC_H)Ztv$UEpbxX~fw#vn*ju>X%G8|PV z5%-`oE2k?glX77)4+l>i0}Q`-QF#HgPlD!fBbq^CxlGg-Y{|ykx+e7bk)@ogt)r)_ zvyJ9;1Vdbh``v{smTWDjpJZT4m>G=K3XGT_HB&%6Gc3|7&}z5Jd_A7?$bnNltzQL? z*IDE@vU-<^{fD}^u2Rynh&!q;-qpK9-p2Z9T}EV46j%8Ww)75@ci%2>Wh3J z^Pr&TN6rn8ojXl2VI(jdpN8oy4>$$@tP?%zP&$P=bz7-~UWEkaA~mM#Sr*ZZJE39~ zaxhYMi#lbhI+qlxhCTCLm_h%x*ymx5Bvq>(pk>TL*6wjv5a&Wu71FkxM!cnij}=T? z8(E6$I=YNIIZ!QP6_87DGoc@wEXzZ5X>k?;c_%PYW1a7}w&a-dq0}ny81V9(KFZUL zhmS9^Bvf}>>aW>WB?2F-DUJWQ6a}hvv{E45NSVZ{nNX@KdAHP0*+#K?{a^y`tj5bk zZg;9?5v&Q-jWw5Jr*_hDrplvJZE1u?r7_S{FO$Z`#(hnvWFnKD;C`T`zGb}SY|FWp zNXz+_n#PGny>SI_Xw*3gP!K4H6eJ2V1s4TM z!A%7Z6}(jNQK+F%M+H9>gB0qi*g)kS)U}h!O;m2CatoDrQF%9&_fo1-*iYdO3I`~( zQfQ-akU~3!4ho$Vx+ol?5Tejcp@%{*g+2<0DIB42l*-4bd?%IfqVnBTzK6=kDfCnM zUMiiS(tT7Kpwj(RI!R%WDnk^8sWL*9Fon|;Mk$O@IHMc{B?L-4C|#f&0_7+ueW0{~ z(hW)vD7~N@2IUAS9iViAatA2;L1_i$04RfKfd^^BB!wwu8pjtXT%<6gTmt1X>;mOs zP-a1S1e7_TzF8%TEOENSpgZO%Bq^knEGQ;WSB}DC6!H`-3O0oTg#`+8)VD}|%hdNc zbzPvAu)sT_)`p$oea6Z((~I+dJ6a#TKL9 zU*qyyp!^0|-)F3U!1f_f;g3MYKVd_(iT@0{5O5#i%D-a!3!Wn=s@O>?fA~`j1lTeV zK;$!#brNnjp9TSoe2nTA_$HUL1CSzEE8AxKk(u{ z8A)Cocx0ci7JT>zA_zXlUsFD!s&Fl%ddnUE6YBhmM4%%;NRZSM;w24?aR=)fS+|oA zaSt>R(o9-_2)polyYY5=fXI7+xc1?XQ5A@LKM({f@!*eHZz~XA8<3iVcwjq_x(*=z zP9T9UAi+aG>O(*py77!2Jfas*=mXMp7)bLGAT39M>^cTy_nkoY+y!Ls-9Yx;14KOz zWPd-9JDRLKS zs*PZOKnr8vs-4C@q>W;p={toRy z?00Ds*tckt*zeJ%u-~msSI7O@h2m^;^x~OjNH!IXrc&g7IL$x?ipPao8V#d(Ye7^z zL&ZLIW#(qFlx!#(0ppT!IXd(9i(NrPN@r;yxSx>OnKLs4S=Ne1edHlni#$v?=bCmI zzmZvjf~9SOWdW_>#aSu2qZql9F}P%^c-GKB>h-v!u6S>uFyoO@cn*Rcgg6r;y4HZu zZ67U`!uz1gv!+Eu55*-vA}UlHm#RcI&`OaQ6iYE_eJy;qw9plo11W-lAw+Tb*0rer zVs-Xtw3F|O#EE|pseVL3Op3cg55-(97)!0h-@;BQ&%lq7;AbPjFRH zyw(a4LnxL)+PaFqk@7Ka*F)NxTH4&}m+{{1>?VOo z2PuXwO_R{W7s#}btPjOP1Jfw)2FLnIIEd^4D5DU;I&a@7At@-Lp&A$nQSm^jZN>dc zc$Rqt*Xo&c9t|iZ+)sjg5DBqRVyoC_GMX|Tja&i$PQLhP=t?LZ%B)Tcn>+~i2Iipp zV&5!vLMnZR!V2XY>|jg2imSpIKw6{ZQalBw)vej=nJih!-Y7-ghFLUvBRQcIRgA}q z#$i7682O@c1cy<}uu<=vHMtD)cwN|ngS_&@#o84LuEv*)f zovYX5a%pxsCZAb`$m2}cowDqy`#T2a#jcxuI;bmGGlCB78POTb__>~Ov57ZBbtq*( zhuNz-q`~-v@yRn+fo<>~K#caS^<5@ix4QZcWgyyw*0~nCq6^6Psc8Z2vd4`gqt`-D zKzIe*^`T_s<@8YPmauu6GJ6N|B6v9Gii{vtr@MlA-|!O?bfUo*oQ zMVCg7u}s$@i98*Yk1rWd^YamKO=}K3b}>)GnDukx*{p%<{d2&-%#53!8w z_)tbW`kNW#N(^#0%aCJW<3JNmL))tGs_-m42l7|Y#UgngT`ZEXqKifH0(UXGRrZoS zGFto3o7P^Laf~}tM!sW{7s2=%T<;3ti>Wj89lU^0G#UeYQ3Gf3>k#@byn)5enZD#q z8}LToL+9=YB2+{0gkL7yPEV|&MT*g2*$5E+1_;Rjriy5d@lE7Ej`7VCM`$|yEr0+% zueK#S|8+t(YjrTgq*muoIyWd6ZFUPDIx=^WWE3Lb29cZaWqep2_?QjKvE4gWnf{0w;&4L?Kn zvP8(rQn-zeDJx!4!I zX#5JIr{3&h`MwipzlP}Gn~0JF_=a`kBS0rnZ(sB`&=>tJw%=iUADbWln<0DnU$X8r zd&A-HBeB?r!!}Wn=@u`q-Vg)$iTp$_>+Z`gMptx2gn8*D!{ui!K?FQ=} zH?Xd{pt$&AAhW_8|9KxoF0L)FVBuPK^2Fx|Eyj5b!A2T$_)fYrI-Fn;YEaSX(VW82 zk<8BB^ zyg~ZU!^v%pW2>hJf)$GceOB@lW%IqbM+#%`yV*4 zSpoDBFs3Ycm>47vZsmyO|lq3pQPK+9JJ1v_kOAB<7PPOi?B$_+<{i4+h5@D_X*USQo*^ zaDpSuK*RrF;UPy+wgi?0O$Mhka~zylKP%{ViMg8^3Tnt4Ind5xl01vC$yt$sYs%r1 o3nDTyF1RxtpYS1rRbWl(0YARY!rMM@@~&Y>OFO^ag@M5u0Ak7h$N&HU diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skin-sam.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skin-sam.css deleted file mode 100644 index b6e917b230..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skin-sam.css +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-navset .yui-nav li { - margin-right:0.16em; /* space between tabs */ - padding-top:1px; /* gecko: make room for overflow */ - zoom:1; -} - -.yui-navset .yui-nav .selected { - margin-bottom:-1px; /* for overlap */ -} - -.yui-navset .yui-nav a { - background:#dadbdb url(../../assets/skins/sam/sprite.png) repeat-x; /* sprite position for normal gradient */ - border:solid #a3a3a3; - border-width:0 1px; - color:#000; - text-decoration:none; -} - -.yui-navset .yui-nav li a em { - border-top:solid 1px #a3a3a3; - border-bottom:0; - cursor:hand; - padding:0.2em 0.5em; - top:-1px; /* for 1px rounded corners */ - position:relative; -} - -.yui-navset .yui-nav .selected a, -.yui-navset .yui-nav a:focus, -.yui-navset .yui-nav a:hover { - background:#214197 url(../../assets/skins/sam/sprite.png) repeat-x left -1400px; - color:#fff; -} - -.yui-navset .yui-nav .selected a em { - padding:0.3em 0.5em; /* raise selected tab */ -} - -.yui-navset .yui-nav .selected a, -.yui-navset .yui-nav a:hover, -.yui-navset .yui-nav a:focus { - border-color:#243356; -} - -.yui-navset .yui-nav a:hover em, -.yui-navset .yui-nav a:focus em, -.yui-navset .yui-nav .selected a em { - border-color:#233356 #406ed9; -} - -.yui-navset .yui-nav { - border-bottom:1px solid #243356; - position:relative; - zoom:1; -} - -.yui-navset .yui-content { - background:#abceff; - border-top:5px solid #214095; -} - -.yui-navset .yui-content div { - border:1px solid #808080; - border-top-color:#243356; - padding:0.25em 0.5em; -} - -.yui-navset .yui-content div div { /* kill inheritance */ - border:0; - padding:0; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview-skin.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview-skin.css deleted file mode 100644 index e10bbf3928..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview-skin.css +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* .yui-navset defaults to .yui-navset-top */ -.yui-skin-sam .yui-navset .yui-nav, -.yui-skin-sam .yui-navset .yui-navset-top .yui-nav { /* protect nested tabviews from other orientations */ - border:solid #2647a0; /* color between tab list and content */ - border-width:0 0 5px; - 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; /* space between tabs */ - padding:1px 0 0; /* gecko: make room for overflow */ - 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; /* for overlap */ -} - -.yui-skin-sam .yui-navset .yui-nav a, -.yui-skin-sam .yui-navset .yui-navset-top .yui-nav a { - background:#d8d8d8 url(../../../../assets/skins/sam/sprite.png) repeat-x; /* tab background */ - 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; /* protect from other orientations */ - top:-1px; /* for 1px rounded corners */ - position:relative; -} - -.yui-skin-sam .yui-navset .yui-nav .selected a, -.yui-skin-sam .yui-navset .yui-nav .selected a:focus, /* no focus effect for selected */ -.yui-skin-sam .yui-navset .yui-nav .selected a:hover { /* no hover effect for selected */ - background:#2647a0 url(../../../../assets/skins/sam/sprite.png) repeat-x left -1400px; /* selected tab background */ - color:#fff; -} - -.yui-skin-sam .yui-navset .yui-nav a:hover, -.yui-skin-sam .yui-navset .yui-nav a:focus { - background:#bfdaff url(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px; /* selected tab background */ - outline:0; -} - -.yui-skin-sam .yui-navset .yui-nav .selected a em { - padding:0.35em 0.75em; /* raise selected tab */ -} - -.yui-skin-sam .yui-navset .yui-nav .selected a, -.yui-skin-sam .yui-navset .yui-nav .selected a em { - border-color:#243356; /* selected tab border color */ -} - -.yui-skin-sam .yui-navset .yui-content { - background:#edf5ff; /* content background color */ -} - -.yui-skin-sam .yui-navset .yui-content, -.yui-skin-sam .yui-navset .yui-navset-top .yui-content { - border:1px solid #808080; /* content border */ - border-top-color:#243356; /* different border color */ - padding:0.25em 0.5em; /* content padding */ -} - -/* left and right orientations */ -.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; /* from tabview-core; have to reiterate for skin-sam due to pos:rel on skin-sam yui-nav */ - top:0; bottom:0; /* stretch to fill content height */ -} - -.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; /* space between tabs */ - padding:0 0 0 1px; /* gecko: make room for overflow */ -} - -.yui-skin-sam .yui-navset-right .yui-nav li { - padding:0 1px 0 0; /* gecko: make room for overflow */ -} - -.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; /* for 1px rounded corners */ -} - -.yui-skin-sam .yui-navset-right .yui-nav a em { - border-width:0 1px 0 0; - left:auto; - right:-1px; /* for 1px rounded corners */ -} - -.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; /* no left-right or bottom-top gradient */ -} - -.yui-skin-sam .yui-navset-left .yui-content { - border:1px solid #808080; /* content border */ - border-left-color:#243356; /* different border color */ -} - -/* bottom orientation */ -.yui-skin-sam .yui-navset-bottom .yui-nav, -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-nav { - border-width:5px 0 0; /* color between tab list and content */ -} - -.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; /* for overlap */ -} - -.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; /* gecko: make room for overflow */ - 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; /* for 1px rounded corners */ -} - -.yui-skin-sam .yui-navset-bottom .yui-content, -.yui-skin-sam .yui-navset .yui-navset-bottom .yui-content { - border:1px solid #808080; /* content border */ - border-bottom-color:#243356; /* different border color */ -} - diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview.css deleted file mode 100644 index 868e0e2441..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/skins/sam/tabview.css +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -.yui-navset .yui-nav li,.yui-navset .yui-navset-top .yui-nav li,.yui-navset .yui-navset-bottom .yui-nav li{margin:0 .5em 0 0;}.yui-navset-left .yui-nav li,.yui-navset-right .yui-nav li{margin:0 0 .5em;}.yui-navset .yui-content .yui-hidden{border:0;height:0;width:0;padding:0;position:absolute;left:-999999px;overflow:hidden;visibility:hidden;}.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,.yui-navset .yui-content div{zoom:1;}.yui-navset .yui-content:after{content:'';display:block;clear:both;}.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;zoom:1;}.yui-skin-sam .yui-navset .yui-nav li,.yui-skin-sam .yui-navset .yui-navset-top .yui-nav li{margin: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 .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(../../../../assets/skins/sam/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:.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(../../../../assets/skins/sam/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(../../../../assets/skins/sam/sprite.png) repeat-x left -1300px;outline:0;}.yui-skin-sam .yui-navset .yui-nav .selected a em{padding:.35em .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:.25em .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 .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 .16em 0;}.yui-skin-sam .yui-navset-right .yui-nav .selected{margin: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:.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 .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 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/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview-core.css deleted file mode 100644 index 88a18d8355..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview-core.css +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* default space between tabs */ -.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; /* horizontal tabs */ -} -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - margin:0 0 0.5em; /* vertical tabs */ -} - -.yui-navset .yui-content .yui-hidden { - /* absolute position off-screen and box collapsing used to - avoid display:none, which causes issues for some content (firefox - restarts flash movies) */ - border:0; - height:0; - width:0; - padding:0; - position:absolute; - left:-999999px; - overflow:hidden; - visibility:hidden; -} - -/* default width for side tabs */ -.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; } /* map to nav width */ -.yui-navset-right { padding:0 6em 0 0; } /* ditto */ - -.yui-navset-top, -.yui-navset-bottom { - padding:auto; -} -/* core */ - -.yui-nav, -.yui-nav li { - margin:0; - padding:0; - list-style:none; -} -.yui-navset li em { font-style:normal; } - -.yui-navset { - position:relative; /* contain absolute positioned tabs (left/right) */ - zoom:1; -} - -.yui-navset .yui-content, -.yui-navset .yui-content div { - zoom:1; -} - -.yui-navset .yui-content:after { - content:''; - display:block; - clear:both; -} - -.yui-navset .yui-nav li, -.yui-navset .yui-navset-top .yui-nav li, /* in case nested */ -.yui-navset .yui-navset-bottom .yui-nav li { - display:inline-block; - display:-moz-inline-stack; - *display:inline; /* IE */ - vertical-align:bottom; /* safari: for overlap */ - cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */ - zoom:1; /* IE: kill space between horizontal tabs */ -} - -.yui-navset-left .yui-nav li, -.yui-navset-right .yui-nav li { - display:block; -} - -.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */ - -.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; /* safari: for overlap */ - 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; /* for inline overlap (reverse for Opera border bug) */ -} - -.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; } - -/* position left and right oriented tabs */ -.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; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview.css deleted file mode 100644 index 43fb336b1c..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/assets/tabview.css +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -/* default space between tabs */ -.yui-navset .yui-nav li { - margin-right:0.5em; /* horizontal tabs */ -} -.yui-navset-left .yui-nav li, .yui-navset-right .yui-nav li { - margin:0 0 0.5em; /* vertical tabs */ -} - -/* default width for side tabs */ -.yui-navset-left .yui-nav, .yui-navset-right .yui-nav { width:6em; } -.yui-navset-left { padding-left:6em; } /* map to nav width */ -.yui-navset-right { padding-right:6em; } /* ditto */ - -/* core */ - -.yui-nav, .yui-nav li { - margin:0; - padding:0; - list-style:none; -} -.yui-navset li em { font-style:normal; } - -.yui-navset { - position:relative; /* contain absolute positioned tabs (left/right) */ - zoom:1; -} - -.yui-navset .yui-content { zoom:1; } - -.yui-navset .yui-hidden { display:none; } - -.yui-navset .yui-nav li { - display:inline-block; - display:-moz-inline-stack; - *display:inline; /* IE */ - vertical-align:bottom; /* safari: for overlap */ - cursor:pointer; /* gecko: due to -moz-inline-stack on anchor */ - zoom:1; /* IE: kill space between horizontal tabs */ -} - -.yui-navset-left .yui-nav li, .yui-navset-right .yui-nav li { - display:block; -} - -.yui-navset .yui-nav a { - outline:0; /* gecko: keep from shifting */ -} - -.yui-navset .yui-nav a { position:relative; } /* IE: to allow overlap */ - -.yui-navset .yui-nav li a { - display:block; - display:inline-block; - vertical-align:bottom; /* safari: for overlap */ - 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; /* for inline overlap (reverse for Op border bug) */ -} - -.yui-navset .yui-nav li a em { display:block; } - -/* position left and right oriented tabs */ -.yui-navset-left .yui-nav, .yui-navset-right .yui-nav { position:absolute; z-index:1; } -.yui-navset-left .yui-nav { left:0; } -.yui-navset-right .yui-nav { right:0; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-debug.js deleted file mode 100644 index c758a07aee..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-debug.js +++ /dev/null @@ -1,995 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function() { - - /** - * The tabview module provides a widget for managing content bound to tabs. - * @module tabview - * @requires yahoo, dom, event, element - * - */ - - var Y = YAHOO.util, - Dom = Y.Dom, - Event = Y.Event, - document = window.document, - - // STRING CONSTANTS - ACTIVE = 'active', - ACTIVE_INDEX = 'activeIndex', - ACTIVE_TAB = 'activeTab', - CONTENT_EL = 'contentEl', - ELEMENT = 'element', - - /** - * A widget to control tabbed views. - * @namespace YAHOO.widget - * @class TabView - * @extends YAHOO.util.Element - * @constructor - * @param {HTMLElement | String | Object} el(optional) The html - * element that represents the TabView, or the attribute object to use. - * An element will be created if none provided. - * @param {Object} attr (optional) A key map of the tabView's - * initial attributes. Ignored if first arg is attributes object. - */ - TabView = function(el, attr) { - attr = attr || {}; - if (arguments.length == 1 && !YAHOO.lang.isString(el) && !el.nodeName) { - attr = el; // treat first arg as attr object - el = attr.element || null; - } - - if (!el && !attr.element) { // create if we dont have one - el = this._createTabViewElement(attr); - } - TabView.superclass.constructor.call(this, el, attr); - }; - - YAHOO.extend(TabView, Y.Element, { - /** - * The className to add when building from scratch. - * @property CLASSNAME - * @default "navset" - */ - CLASSNAME: 'yui-navset', - - /** - * The className of the HTMLElement containing the TabView's tab elements - * to look for when building from existing markup, or to add when building - * from scratch. - * All childNodes of the tab container are treated as Tabs when building - * from existing markup. - * @property TAB_PARENT_CLASSNAME - * @default "nav" - */ - TAB_PARENT_CLASSNAME: 'yui-nav', - - /** - * The className of the HTMLElement containing the TabView's label elements - * to look for when building from existing markup, or to add when building - * from scratch. - * All childNodes of the content container are treated as content elements when - * building from existing markup. - * @property CONTENT_PARENT_CLASSNAME - * @default "nav-content" - */ - CONTENT_PARENT_CLASSNAME: 'yui-content', - - _tabParent: null, - _contentParent: null, - - /** - * Adds a Tab to the TabView instance. - * If no index is specified, the tab is added to the end of the tab list. - * @method addTab - * @param {YAHOO.widget.Tab} tab A Tab instance to add. - * @param {Integer} index The position to add the tab. - * @return void - */ - addTab: function(tab, index) { - var tabs = this.get('tabs'), - before = this.getTab(index), - tabParent = this._tabParent, - contentParent = this._contentParent, - tabElement = tab.get(ELEMENT), - contentEl = tab.get(CONTENT_EL); - - if (!tabs) { // not ready yet - this._queue[this._queue.length] = ['addTab', arguments]; - return false; - } - - index = (index === undefined) ? tabs.length : index; - - tabs.splice(index, 0, tab); - - if ( before ) { - tabParent.insertBefore(tabElement, before.get(ELEMENT)); - } else { - tabParent.appendChild(tabElement); - } - - if ( contentEl && !Dom.isAncestor(contentParent, contentEl) ) { - contentParent.appendChild(contentEl); - } - - if ( !tab.get(ACTIVE) ) { - tab.set('contentVisible', false, true); /* hide if not active */ - } else { - this.set(ACTIVE_TAB, tab, true); - this.set('activeIndex', index, true); - } - - this._initTabEvents(tab); - }, - - _initTabEvents: function(tab) { - tab.addListener( tab.get('activationEvent'), tab._onActivate, this, tab); - tab.addListener( tab.get('activationEventChange'), tab._onActivationEventChange, this, tab); - }, - - _removeTabEvents: function(tab) { - tab.removeListener(tab.get('activationEvent'), tab._onActivate, this, tab); - tab.removeListener('activationEventChange', tab._onActivationEventChange, this, tab); - }, - - /** - * Routes childNode events. - * @method DOMEventHandler - * @param {event} e The Dom event that is being handled. - * @return void - */ - DOMEventHandler: function(e) { - var target = Event.getTarget(e), - tabParent = this._tabParent, - tabs = this.get('tabs'), - tab, - tabEl, - contentEl; - - - if (Dom.isAncestor(tabParent, target) ) { - for (var i = 0, len = tabs.length; i < len; i++) { - tabEl = tabs[i].get(ELEMENT); - contentEl = tabs[i].get(CONTENT_EL); - - if ( target == tabEl || Dom.isAncestor(tabEl, target) ) { - tab = tabs[i]; - break; // note break - } - } - - if (tab) { - tab.fireEvent(e.type, e); - } - } - }, - - /** - * Returns the Tab instance at the specified index. - * @method getTab - * @param {Integer} index The position of the Tab. - * @return YAHOO.widget.Tab - */ - getTab: function(index) { - return this.get('tabs')[index]; - }, - - /** - * Returns the index of given tab. - * @method getTabIndex - * @param {YAHOO.widget.Tab} tab The tab whose index will be returned. - * @return int - */ - getTabIndex: function(tab) { - var index = null, - tabs = this.get('tabs'); - for (var i = 0, len = tabs.length; i < len; ++i) { - if (tab == tabs[i]) { - index = i; - break; - } - } - - return index; - }, - - /** - * Removes the specified Tab from the TabView. - * @method removeTab - * @param {YAHOO.widget.Tab} item The Tab instance to be removed. - * @return void - */ - removeTab: function(tab) { - var tabCount = this.get('tabs').length, - index = this.getTabIndex(tab); - - if ( tab === this.get(ACTIVE_TAB) ) { - if (tabCount > 1) { // select another tab - if (index + 1 === tabCount) { // if last, activate previous - this.set(ACTIVE_INDEX, index - 1); - } else { // activate next tab - this.set(ACTIVE_INDEX, index + 1); - } - } else { // no more tabs - this.set(ACTIVE_TAB, null); - } - } - - this._removeTabEvents(tab); - this._tabParent.removeChild( tab.get(ELEMENT) ); - this._contentParent.removeChild( tab.get(CONTENT_EL) ); - this._configs.tabs.value.splice(index, 1); - - tab.fireEvent('remove', { type: 'remove', tabview: this }); - }, - - /** - * Provides a readable name for the TabView instance. - * @method toString - * @return String - */ - toString: function() { - var name = this.get('id') || this.get('tagName'); - return "TabView " + name; - }, - - /** - * The transiton to use when switching between tabs. - * @method contentTransition - */ - contentTransition: function(newTab, oldTab) { - if (newTab) { - newTab.set('contentVisible', true); - } - if (oldTab) { - oldTab.set('contentVisible', false); - } - }, - - /** - * setAttributeConfigs TabView specific properties. - * @method initAttributes - * @param {Object} attr Hash of initial attributes - */ - initAttributes: function(attr) { - TabView.superclass.initAttributes.call(this, attr); - - if (!attr.orientation) { - attr.orientation = 'top'; - } - - var el = this.get(ELEMENT); - - if (!Dom.hasClass(el, this.CLASSNAME)) { - Dom.addClass(el, this.CLASSNAME); - } - - /** - * The Tabs belonging to the TabView instance. - * @attribute tabs - * @type Array - */ - this.setAttributeConfig('tabs', { - value: [], - readOnly: true - }); - - /** - * The container of the tabView's label elements. - * @property _tabParent - * @private - * @type HTMLElement - */ - this._tabParent = - this.getElementsByClassName(this.TAB_PARENT_CLASSNAME, - 'ul' )[0] || this._createTabParent(); - - /** - * The container of the tabView's content elements. - * @property _contentParent - * @type HTMLElement - * @private - */ - this._contentParent = - this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME, - 'div')[0] || this._createContentParent(); - - /** - * How the Tabs should be oriented relative to the TabView. - * @attribute orientation - * @type String - * @default "top" - */ - this.setAttributeConfig('orientation', { - value: attr.orientation, - method: function(value) { - var current = this.get('orientation'); - this.addClass('yui-navset-' + value); - - if (current != value) { - this.removeClass('yui-navset-' + current); - } - - if (value === 'bottom') { - this.appendChild(this._tabParent); - } - } - }); - - /** - * The index of the tab currently active. - * @attribute activeIndex - * @type Int - */ - this.setAttributeConfig(ACTIVE_INDEX, { - value: attr.activeIndex, - validator: function(value) { - var ret = true; - if (value && this.getTab(value).get('disabled')) { // cannot activate if disabled - ret = false; - } - return ret; - } - }); - - /** - * The tab currently active. - * @attribute activeTab - * @type YAHOO.widget.Tab - */ - this.setAttributeConfig(ACTIVE_TAB, { - value: attr.activeTab, - method: function(tab) { - var activeTab = this.get(ACTIVE_TAB); - - if (tab) { - tab.set(ACTIVE, true); - } - - if (activeTab && activeTab !== tab) { - activeTab.set(ACTIVE, false); - } - - if (activeTab && tab !== activeTab) { // no transition if only 1 - this.contentTransition(tab, activeTab); - } else if (tab) { - tab.set('contentVisible', true); - } - }, - validator: function(value) { - var ret = true; - if (value && value.get('disabled')) { // cannot activate if disabled - ret = false; - } - return ret; - } - }); - - this.on('activeTabChange', this._onActiveTabChange); - this.on('activeIndexChange', this._onActiveIndexChange); - - YAHOO.log('attributes initialized', 'info', 'TabView'); - if ( this._tabParent ) { - this._initTabs(); - } - - // Due to delegation we add all DOM_EVENTS to the TabView container - // but IE will leak when unsupported events are added, so remove these - this.DOM_EVENTS.submit = false; - this.DOM_EVENTS.focus = false; - this.DOM_EVENTS.blur = false; - - for (var type in this.DOM_EVENTS) { - if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) { - this.addListener.call(this, type, this.DOMEventHandler); - } - } - }, - - /** - * Removes selected state from the given tab if it is the activeTab - * @method deselectTab - * @param {Int} index The tab index to deselect - */ - deselectTab: function(index) { - if (this.getTab(index) === this.get('activeTab')) { - this.set('activeTab', null); - } - }, - - /** - * Makes the tab at the given index the active tab - * @method selectTab - * @param {Int} index The tab index to be made active - */ - selectTab: function(index) { - this.set('activeTab', this.getTab(index)); - }, - - _onActiveTabChange: function(e) { - var activeIndex = this.get(ACTIVE_INDEX), - newIndex = this.getTabIndex(e.newValue); - - if (activeIndex !== newIndex) { - if (!(this.set(ACTIVE_INDEX, newIndex)) ) { // NOTE: setting - // revert if activeIndex update fails (cancelled via beforeChange) - this.set(ACTIVE_TAB, e.prevValue); - } - } - }, - - _onActiveIndexChange: function(e) { - // no set if called from ActiveTabChange event - if (e.newValue !== this.getTabIndex(this.get(ACTIVE_TAB))) { - if (!(this.set(ACTIVE_TAB, this.getTab(e.newValue))) ) { // NOTE: setting - // revert if activeTab update fails (cancelled via beforeChange) - this.set(ACTIVE_INDEX, e.prevValue); - } - } - }, - - /** - * Creates Tab instances from a collection of HTMLElements. - * @method _initTabs - * @private - * @return void - */ - _initTabs: function() { - var tabs = Dom.getChildren(this._tabParent), - contentElements = Dom.getChildren(this._contentParent), - activeIndex = this.get(ACTIVE_INDEX), - tab, - attr, - active; - - for (var i = 0, len = tabs.length; i < len; ++i) { - attr = {}; - - if (contentElements[i]) { - attr.contentEl = contentElements[i]; - } - - tab = new YAHOO.widget.Tab(tabs[i], attr); - this.addTab(tab); - - if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) { - active = tab; - } - } - if (activeIndex) { - this.set(ACTIVE_TAB, this.getTab(activeIndex)); - } else { - this._configs.activeTab.value = active; // dont invoke method - this._configs.activeIndex.value = this.getTabIndex(active); - } - }, - - _createTabViewElement: function(attr) { - var el = document.createElement('div'); - - if ( this.CLASSNAME ) { - el.className = this.CLASSNAME; - } - - YAHOO.log('TabView Dom created', 'info', 'TabView'); - return el; - }, - - _createTabParent: function(attr) { - var el = document.createElement('ul'); - - if ( this.TAB_PARENT_CLASSNAME ) { - el.className = this.TAB_PARENT_CLASSNAME; - } - - this.get(ELEMENT).appendChild(el); - - return el; - }, - - _createContentParent: function(attr) { - var el = document.createElement('div'); - - if ( this.CONTENT_PARENT_CLASSNAME ) { - el.className = this.CONTENT_PARENT_CLASSNAME; - } - - this.get(ELEMENT).appendChild(el); - - return el; - } - }); - - - YAHOO.widget.TabView = TabView; -})(); - -(function() { - var Y = YAHOO.util, - Dom = Y.Dom, - Lang = YAHOO.lang, - - - // STRING CONSTANTS - ACTIVE_TAB = 'activeTab', - LABEL = 'label', - LABEL_EL = 'labelEl', - CONTENT = 'content', - CONTENT_EL = 'contentEl', - ELEMENT = 'element', - CACHE_DATA = 'cacheData', - DATA_SRC = 'dataSrc', - DATA_LOADED = 'dataLoaded', - DATA_TIMEOUT = 'dataTimeout', - LOAD_METHOD = 'loadMethod', - POST_DATA = 'postData', - DISABLED = 'disabled', - - /** - * A representation of a Tab's label and content. - * @namespace YAHOO.widget - * @class Tab - * @extends YAHOO.util.Element - * @constructor - * @param element {HTMLElement | String} (optional) The html element that - * represents the Tab. An element will be created if none provided. - * @param {Object} properties A key map of initial properties - */ - Tab = function(el, attr) { - attr = attr || {}; - if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) { - attr = el; - el = attr.element; - } - - if (!el && !attr.element) { - el = this._createTabElement(attr); - } - - this.loadHandler = { - success: function(o) { - this.set(CONTENT, o.responseText); - }, - failure: function(o) { - } - }; - - Tab.superclass.constructor.call(this, el, attr); - - this.DOM_EVENTS = {}; // delegating to tabView - }; - - YAHOO.extend(Tab, YAHOO.util.Element, { - /** - * The default tag name for a Tab's inner element. - * @property LABEL_INNER_TAGNAME - * @type String - * @default "em" - */ - LABEL_TAGNAME: 'em', - - /** - * The class name applied to active tabs. - * @property ACTIVE_CLASSNAME - * @type String - * @default "selected" - */ - ACTIVE_CLASSNAME: 'selected', - - /** - * The class name applied to active tabs. - * @property HIDDEN_CLASSNAME - * @type String - * @default "yui-hidden" - */ - HIDDEN_CLASSNAME: 'yui-hidden', - - /** - * The title applied to active tabs. - * @property ACTIVE_TITLE - * @type String - * @default "active" - */ - ACTIVE_TITLE: 'active', - - /** - * The class name applied to disabled tabs. - * @property DISABLED_CLASSNAME - * @type String - * @default "disabled" - */ - DISABLED_CLASSNAME: DISABLED, - - /** - * The class name applied to dynamic tabs while loading. - * @property LOADING_CLASSNAME - * @type String - * @default "disabled" - */ - LOADING_CLASSNAME: 'loading', - - /** - * Provides a reference to the connection request object when data is - * loaded dynamically. - * @property dataConnection - * @type Object - */ - dataConnection: null, - - /** - * Object containing success and failure callbacks for loading data. - * @property loadHandler - * @type object - */ - loadHandler: null, - - _loading: false, - - /** - * Provides a readable name for the tab. - * @method toString - * @return String - */ - toString: function() { - var el = this.get(ELEMENT), - id = el.id || el.tagName; - return "Tab " + id; - }, - - /** - * setAttributeConfigs Tab specific properties. - * @method initAttributes - * @param {Object} attr Hash of initial attributes - */ - initAttributes: function(attr) { - attr = attr || {}; - Tab.superclass.initAttributes.call(this, attr); - - /** - * The event that triggers the tab's activation. - * @attribute activationEvent - * @type String - */ - this.setAttributeConfig('activationEvent', { - value: attr.activationEvent || 'click' - }); - - /** - * The element that contains the tab's label. - * @attribute labelEl - * @type HTMLElement - */ - this.setAttributeConfig(LABEL_EL, { - value: attr[LABEL_EL] || this._getLabelEl(), - method: function(value) { - value = Dom.get(value); - var current = this.get(LABEL_EL); - - if (current) { - if (current == value) { - return false; // already set - } - - current.parentNode.replaceChild(value, current); - this.set(LABEL, value.innerHTML); - } - } - }); - - /** - * The tab's label text (or innerHTML). - * @attribute label - * @type String - */ - this.setAttributeConfig(LABEL, { - value: attr.label || this._getLabel(), - method: function(value) { - var labelEl = this.get(LABEL_EL); - if (!labelEl) { // create if needed - this.set(LABEL_EL, this._createLabelEl()); - } - - labelEl.innerHTML = value; - } - }); - - /** - * The HTMLElement that contains the tab's content. - * @attribute contentEl - * @type HTMLElement - */ - this.setAttributeConfig(CONTENT_EL, { - value: attr[CONTENT_EL] || document.createElement('div'), - method: function(value) { - value = Dom.get(value); - var current = this.get(CONTENT_EL); - - if (current) { - if (current === value) { - return false; // already set - } - if (!this.get('selected')) { - Dom.addClass(value, this.HIDDEN_CLASSNAME); - } - current.parentNode.replaceChild(value, current); - this.set(CONTENT, value.innerHTML); - } - } - }); - - /** - * The tab's content. - * @attribute content - * @type String - */ - this.setAttributeConfig(CONTENT, { - value: attr[CONTENT], - method: function(value) { - this.get(CONTENT_EL).innerHTML = value; - } - }); - - /** - * The tab's data source, used for loading content dynamically. - * @attribute dataSrc - * @type String - */ - this.setAttributeConfig(DATA_SRC, { - value: attr.dataSrc - }); - - /** - * Whether or not content should be reloaded for every view. - * @attribute cacheData - * @type Boolean - * @default false - */ - this.setAttributeConfig(CACHE_DATA, { - value: attr.cacheData || false, - validator: Lang.isBoolean - }); - - /** - * The method to use for the data request. - * @attribute loadMethod - * @type String - * @default "GET" - */ - this.setAttributeConfig(LOAD_METHOD, { - value: attr.loadMethod || 'GET', - validator: Lang.isString - }); - - /** - * Whether or not any data has been loaded from the server. - * @attribute dataLoaded - * @type Boolean - */ - this.setAttributeConfig(DATA_LOADED, { - value: false, - validator: Lang.isBoolean, - writeOnce: true - }); - - /** - * Number if milliseconds before aborting and calling failure handler. - * @attribute dataTimeout - * @type Number - * @default null - */ - this.setAttributeConfig(DATA_TIMEOUT, { - value: attr.dataTimeout || null, - validator: Lang.isNumber - }); - - /** - * Arguments to pass when POST method is used - * @attribute postData - * @default null - */ - this.setAttributeConfig(POST_DATA, { - value: attr.postData || null - }); - - /** - * Whether or not the tab is currently active. - * If a dataSrc is set for the tab, the content will be loaded from - * the given source. - * @attribute active - * @type Boolean - */ - this.setAttributeConfig('active', { - value: attr.active || this.hasClass(this.ACTIVE_CLASSNAME), - method: function(value) { - if (value === true) { - this.addClass(this.ACTIVE_CLASSNAME); - this.set('title', this.ACTIVE_TITLE); - } else { - this.removeClass(this.ACTIVE_CLASSNAME); - this.set('title', ''); - } - }, - validator: function(value) { - return Lang.isBoolean(value) && !this.get(DISABLED) ; - } - }); - - /** - * Whether or not the tab is disabled. - * @attribute disabled - * @type Boolean - */ - this.setAttributeConfig(DISABLED, { - value: attr.disabled || this.hasClass(this.DISABLED_CLASSNAME), - method: function(value) { - if (value === true) { - Dom.addClass(this.get(ELEMENT), this.DISABLED_CLASSNAME); - } else { - Dom.removeClass(this.get(ELEMENT), this.DISABLED_CLASSNAME); - } - }, - validator: Lang.isBoolean - }); - - /** - * The href of the tab's anchor element. - * @attribute href - * @type String - * @default '#' - */ - this.setAttributeConfig('href', { - value: attr.href || - this.getElementsByTagName('a')[0].getAttribute('href', 2) || '#', - method: function(value) { - this.getElementsByTagName('a')[0].href = value; - }, - validator: Lang.isString - }); - - /** - * The Whether or not the tab's content is visible. - * @attribute contentVisible - * @type Boolean - * @default false - */ - this.setAttributeConfig('contentVisible', { - value: attr.contentVisible, - method: function(value) { - if (value) { - Dom.removeClass(this.get(CONTENT_EL), this.HIDDEN_CLASSNAME); - - if ( this.get(DATA_SRC) ) { - // load dynamic content unless already loading or loaded and caching - if ( !this._loading && !(this.get(DATA_LOADED) && this.get(CACHE_DATA)) ) { - this._dataConnect(); - } - } - } else { - Dom.addClass(this.get(CONTENT_EL), this.HIDDEN_CLASSNAME); - } - }, - validator: Lang.isBoolean - }); - YAHOO.log('attributes initialized', 'info', 'Tab'); - }, - - _dataConnect: function() { - if (!Y.Connect) { - YAHOO.log('YAHOO.util.Connect dependency not met', - 'error', 'Tab'); - return false; - } - - Dom.addClass(this.get(CONTENT_EL).parentNode, this.LOADING_CLASSNAME); - this._loading = true; - this.dataConnection = Y.Connect.asyncRequest( - this.get(LOAD_METHOD), - this.get(DATA_SRC), - { - success: function(o) { - YAHOO.log('content loaded successfully', 'info', 'Tab'); - this.loadHandler.success.call(this, o); - this.set(DATA_LOADED, true); - this.dataConnection = null; - Dom.removeClass(this.get(CONTENT_EL).parentNode, - this.LOADING_CLASSNAME); - this._loading = false; - }, - failure: function(o) { - YAHOO.log('loading failed: ' + o.statusText, 'error', 'Tab'); - this.loadHandler.failure.call(this, o); - this.dataConnection = null; - Dom.removeClass(this.get(CONTENT_EL).parentNode, - this.LOADING_CLASSNAME); - this._loading = false; - }, - scope: this, - timeout: this.get(DATA_TIMEOUT) - }, - - this.get(POST_DATA) - ); - }, - _createTabElement: function(attr) { - var el = document.createElement('li'), - a = document.createElement('a'), - label = attr.label || null, - labelEl = attr.labelEl || null; - - a.href = attr.href || '#'; // TODO: Use Dom.setAttribute? - el.appendChild(a); - - if (labelEl) { // user supplied labelEl - if (!label) { // user supplied label - label = this._getLabel(); - } - } else { - labelEl = this._createLabelEl(); - } - - a.appendChild(labelEl); - - YAHOO.log('creating Tab Dom', 'info', 'Tab'); - return el; - }, - - _getLabelEl: function() { - return this.getElementsByTagName(this.LABEL_TAGNAME)[0]; - }, - - _createLabelEl: function() { - var el = document.createElement(this.LABEL_TAGNAME); - return el; - }, - - - _getLabel: function() { - var el = this.get(LABEL_EL); - - if (!el) { - return undefined; - } - - return el.innerHTML; - }, - - _onActivate: function(e, tabview) { - var tab = this, - silent = false; - - Y.Event.preventDefault(e); - if (tab === tabview.get(ACTIVE_TAB)) { - silent = true; // dont fire activeTabChange if already active - } - tabview.set(ACTIVE_TAB, tab, silent); - }, - - _onActivationEventChange: function(e) { - var tab = this; - - if (e.prevValue != e.newValue) { - tab.removeListener(e.prevValue, tab._onActivate); - tab.addListener(e.newValue, tab._onActivate, this, tab); - } - } - }); - - - /** - * Fires when a tab is removed from the tabview - * @event remove - * @type CustomEvent - * @param {Event} An event object with fields for "type" ("remove") - * and "tabview" (the tabview instance it was removed from) - */ - - YAHOO.widget.Tab = Tab; -})(); - -YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-min.js deleted file mode 100644 index 8fb1e3eca4..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/tabview/tabview-min.js +++ /dev/null @@ -1,8 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function(){var B=YAHOO.util,C=B.Dom,H=B.Event,F=window.document,J="active",D="activeIndex",E="activeTab",A="contentEl",G="element",I=function(L,K){K=K||{};if(arguments.length==1&&!YAHOO.lang.isString(L)&&!L.nodeName){K=L;L=K.element||null;}if(!L&&!K.element){L=this._createTabViewElement(K);}I.superclass.constructor.call(this,L,K);};YAHOO.extend(I,B.Element,{CLASSNAME:"yui-navset",TAB_PARENT_CLASSNAME:"yui-nav",CONTENT_PARENT_CLASSNAME:"yui-content",_tabParent:null,_contentParent:null,addTab:function(P,L){var N=this.get("tabs"),Q=this.getTab(L),R=this._tabParent,K=this._contentParent,M=P.get(G),O=P.get(A);if(!N){this._queue[this._queue.length]=["addTab",arguments];return false;}L=(L===undefined)?N.length:L;N.splice(L,0,P);if(Q){R.insertBefore(M,Q.get(G));}else{R.appendChild(M);}if(O&&!C.isAncestor(K,O)){K.appendChild(O);}if(!P.get(J)){P.set("contentVisible",false,true);}else{this.set(E,P,true);this.set("activeIndex",L,true);}this._initTabEvents(P);},_initTabEvents:function(K){K.addListener(K.get("activationEvent"),K._onActivate,this,K);K.addListener(K.get("activationEventChange"),K._onActivationEventChange,this,K);},_removeTabEvents:function(K){K.removeListener(K.get("activationEvent"),K._onActivate,this,K);K.removeListener("activationEventChange",K._onActivationEventChange,this,K);},DOMEventHandler:function(P){var Q=H.getTarget(P),S=this._tabParent,R=this.get("tabs"),M,L,K;if(C.isAncestor(S,Q)){for(var N=0,O=R.length;N1){if(K+1===L){this.set(D,K-1);}else{this.set(D,K+1);}}else{this.set(E,null);}}this._removeTabEvents(M);this._tabParent.removeChild(M.get(G));this._contentParent.removeChild(M.get(A));this._configs.tabs.value.splice(K,1);M.fireEvent("remove",{type:"remove",tabview:this});},toString:function(){var K=this.get("id")||this.get("tagName");return"TabView "+K;},contentTransition:function(L,K){if(L){L.set("contentVisible",true);}if(K){K.set("contentVisible",false);}},initAttributes:function(K){I.superclass.initAttributes.call(this,K);if(!K.orientation){K.orientation="top";}var M=this.get(G);if(!C.hasClass(M,this.CLASSNAME)){C.addClass(M,this.CLASSNAME);}this.setAttributeConfig("tabs",{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,"ul")[0]||this._createTabParent();this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,"div")[0]||this._createContentParent();this.setAttributeConfig("orientation",{value:K.orientation,method:function(N){var O=this.get("orientation");this.addClass("yui-navset-"+N);if(O!=N){this.removeClass("yui-navset-"+O);}if(N==="bottom"){this.appendChild(this._tabParent);}}});this.setAttributeConfig(D,{value:K.activeIndex,validator:function(O){var N=true;if(O&&this.getTab(O).get("disabled")){N=false;}return N;}});this.setAttributeConfig(E,{value:K.activeTab,method:function(O){var N=this.get(E);if(O){O.set(J,true);}if(N&&N!==O){N.set(J,false);}if(N&&O!==N){this.contentTransition(O,N);}else{if(O){O.set("contentVisible",true);}}},validator:function(O){var N=true;if(O&&O.get("disabled")){N=false;}return N;}});this.on("activeTabChange",this._onActiveTabChange);this.on("activeIndexChange",this._onActiveIndexChange);if(this._tabParent){this._initTabs();}this.DOM_EVENTS.submit=false;this.DOM_EVENTS.focus=false;this.DOM_EVENTS.blur=false;for(var L in this.DOM_EVENTS){if(YAHOO.lang.hasOwnProperty(this.DOM_EVENTS,L)){this.addListener.call(this,L,this.DOMEventHandler);}}},deselectTab:function(K){if(this.getTab(K)===this.get("activeTab")){this.set("activeTab",null);}},selectTab:function(K){this.set("activeTab",this.getTab(K));},_onActiveTabChange:function(M){var K=this.get(D),L=this.getTabIndex(M.newValue);if(K!==L){if(!(this.set(D,L))){this.set(E,M.prevValue);}}},_onActiveIndexChange:function(K){if(K.newValue!==this.getTabIndex(this.get(E))){if(!(this.set(E,this.getTab(K.newValue)))){this.set(D,K.prevValue);}}},_initTabs:function(){var P=C.getChildren(this._tabParent),N=C.getChildren(this._contentParent),M=this.get(D),Q,L,R;for(var O=0,K=P.length;O 1) { // select another tab - if (index + 1 === tabCount) { // if last, activate previous - this.set(ACTIVE_INDEX, index - 1); - } else { // activate next tab - this.set(ACTIVE_INDEX, index + 1); - } - } else { // no more tabs - this.set(ACTIVE_TAB, null); - } - } - - this._removeTabEvents(tab); - this._tabParent.removeChild( tab.get(ELEMENT) ); - this._contentParent.removeChild( tab.get(CONTENT_EL) ); - this._configs.tabs.value.splice(index, 1); - - tab.fireEvent('remove', { type: 'remove', tabview: this }); - }, - - /** - * Provides a readable name for the TabView instance. - * @method toString - * @return String - */ - toString: function() { - var name = this.get('id') || this.get('tagName'); - return "TabView " + name; - }, - - /** - * The transiton to use when switching between tabs. - * @method contentTransition - */ - contentTransition: function(newTab, oldTab) { - if (newTab) { - newTab.set('contentVisible', true); - } - if (oldTab) { - oldTab.set('contentVisible', false); - } - }, - - /** - * setAttributeConfigs TabView specific properties. - * @method initAttributes - * @param {Object} attr Hash of initial attributes - */ - initAttributes: function(attr) { - TabView.superclass.initAttributes.call(this, attr); - - if (!attr.orientation) { - attr.orientation = 'top'; - } - - var el = this.get(ELEMENT); - - if (!Dom.hasClass(el, this.CLASSNAME)) { - Dom.addClass(el, this.CLASSNAME); - } - - /** - * The Tabs belonging to the TabView instance. - * @attribute tabs - * @type Array - */ - this.setAttributeConfig('tabs', { - value: [], - readOnly: true - }); - - /** - * The container of the tabView's label elements. - * @property _tabParent - * @private - * @type HTMLElement - */ - this._tabParent = - this.getElementsByClassName(this.TAB_PARENT_CLASSNAME, - 'ul' )[0] || this._createTabParent(); - - /** - * The container of the tabView's content elements. - * @property _contentParent - * @type HTMLElement - * @private - */ - this._contentParent = - this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME, - 'div')[0] || this._createContentParent(); - - /** - * How the Tabs should be oriented relative to the TabView. - * @attribute orientation - * @type String - * @default "top" - */ - this.setAttributeConfig('orientation', { - value: attr.orientation, - method: function(value) { - var current = this.get('orientation'); - this.addClass('yui-navset-' + value); - - if (current != value) { - this.removeClass('yui-navset-' + current); - } - - if (value === 'bottom') { - this.appendChild(this._tabParent); - } - } - }); - - /** - * The index of the tab currently active. - * @attribute activeIndex - * @type Int - */ - this.setAttributeConfig(ACTIVE_INDEX, { - value: attr.activeIndex, - validator: function(value) { - var ret = true; - if (value && this.getTab(value).get('disabled')) { // cannot activate if disabled - ret = false; - } - return ret; - } - }); - - /** - * The tab currently active. - * @attribute activeTab - * @type YAHOO.widget.Tab - */ - this.setAttributeConfig(ACTIVE_TAB, { - value: attr.activeTab, - method: function(tab) { - var activeTab = this.get(ACTIVE_TAB); - - if (tab) { - tab.set(ACTIVE, true); - } - - if (activeTab && activeTab !== tab) { - activeTab.set(ACTIVE, false); - } - - if (activeTab && tab !== activeTab) { // no transition if only 1 - this.contentTransition(tab, activeTab); - } else if (tab) { - tab.set('contentVisible', true); - } - }, - validator: function(value) { - var ret = true; - if (value && value.get('disabled')) { // cannot activate if disabled - ret = false; - } - return ret; - } - }); - - this.on('activeTabChange', this._onActiveTabChange); - this.on('activeIndexChange', this._onActiveIndexChange); - - if ( this._tabParent ) { - this._initTabs(); - } - - // Due to delegation we add all DOM_EVENTS to the TabView container - // but IE will leak when unsupported events are added, so remove these - this.DOM_EVENTS.submit = false; - this.DOM_EVENTS.focus = false; - this.DOM_EVENTS.blur = false; - - for (var type in this.DOM_EVENTS) { - if ( YAHOO.lang.hasOwnProperty(this.DOM_EVENTS, type) ) { - this.addListener.call(this, type, this.DOMEventHandler); - } - } - }, - - /** - * Removes selected state from the given tab if it is the activeTab - * @method deselectTab - * @param {Int} index The tab index to deselect - */ - deselectTab: function(index) { - if (this.getTab(index) === this.get('activeTab')) { - this.set('activeTab', null); - } - }, - - /** - * Makes the tab at the given index the active tab - * @method selectTab - * @param {Int} index The tab index to be made active - */ - selectTab: function(index) { - this.set('activeTab', this.getTab(index)); - }, - - _onActiveTabChange: function(e) { - var activeIndex = this.get(ACTIVE_INDEX), - newIndex = this.getTabIndex(e.newValue); - - if (activeIndex !== newIndex) { - if (!(this.set(ACTIVE_INDEX, newIndex)) ) { // NOTE: setting - // revert if activeIndex update fails (cancelled via beforeChange) - this.set(ACTIVE_TAB, e.prevValue); - } - } - }, - - _onActiveIndexChange: function(e) { - // no set if called from ActiveTabChange event - if (e.newValue !== this.getTabIndex(this.get(ACTIVE_TAB))) { - if (!(this.set(ACTIVE_TAB, this.getTab(e.newValue))) ) { // NOTE: setting - // revert if activeTab update fails (cancelled via beforeChange) - this.set(ACTIVE_INDEX, e.prevValue); - } - } - }, - - /** - * Creates Tab instances from a collection of HTMLElements. - * @method _initTabs - * @private - * @return void - */ - _initTabs: function() { - var tabs = Dom.getChildren(this._tabParent), - contentElements = Dom.getChildren(this._contentParent), - activeIndex = this.get(ACTIVE_INDEX), - tab, - attr, - active; - - for (var i = 0, len = tabs.length; i < len; ++i) { - attr = {}; - - if (contentElements[i]) { - attr.contentEl = contentElements[i]; - } - - tab = new YAHOO.widget.Tab(tabs[i], attr); - this.addTab(tab); - - if (tab.hasClass(tab.ACTIVE_CLASSNAME) ) { - active = tab; - } - } - if (activeIndex) { - this.set(ACTIVE_TAB, this.getTab(activeIndex)); - } else { - this._configs.activeTab.value = active; // dont invoke method - this._configs.activeIndex.value = this.getTabIndex(active); - } - }, - - _createTabViewElement: function(attr) { - var el = document.createElement('div'); - - if ( this.CLASSNAME ) { - el.className = this.CLASSNAME; - } - - return el; - }, - - _createTabParent: function(attr) { - var el = document.createElement('ul'); - - if ( this.TAB_PARENT_CLASSNAME ) { - el.className = this.TAB_PARENT_CLASSNAME; - } - - this.get(ELEMENT).appendChild(el); - - return el; - }, - - _createContentParent: function(attr) { - var el = document.createElement('div'); - - if ( this.CONTENT_PARENT_CLASSNAME ) { - el.className = this.CONTENT_PARENT_CLASSNAME; - } - - this.get(ELEMENT).appendChild(el); - - return el; - } - }); - - - YAHOO.widget.TabView = TabView; -})(); - -(function() { - var Y = YAHOO.util, - Dom = Y.Dom, - Lang = YAHOO.lang, - - - // STRING CONSTANTS - ACTIVE_TAB = 'activeTab', - LABEL = 'label', - LABEL_EL = 'labelEl', - CONTENT = 'content', - CONTENT_EL = 'contentEl', - ELEMENT = 'element', - CACHE_DATA = 'cacheData', - DATA_SRC = 'dataSrc', - DATA_LOADED = 'dataLoaded', - DATA_TIMEOUT = 'dataTimeout', - LOAD_METHOD = 'loadMethod', - POST_DATA = 'postData', - DISABLED = 'disabled', - - /** - * A representation of a Tab's label and content. - * @namespace YAHOO.widget - * @class Tab - * @extends YAHOO.util.Element - * @constructor - * @param element {HTMLElement | String} (optional) The html element that - * represents the Tab. An element will be created if none provided. - * @param {Object} properties A key map of initial properties - */ - Tab = function(el, attr) { - attr = attr || {}; - if (arguments.length == 1 && !Lang.isString(el) && !el.nodeName) { - attr = el; - el = attr.element; - } - - if (!el && !attr.element) { - el = this._createTabElement(attr); - } - - this.loadHandler = { - success: function(o) { - this.set(CONTENT, o.responseText); - }, - failure: function(o) { - } - }; - - Tab.superclass.constructor.call(this, el, attr); - - this.DOM_EVENTS = {}; // delegating to tabView - }; - - YAHOO.extend(Tab, YAHOO.util.Element, { - /** - * The default tag name for a Tab's inner element. - * @property LABEL_INNER_TAGNAME - * @type String - * @default "em" - */ - LABEL_TAGNAME: 'em', - - /** - * The class name applied to active tabs. - * @property ACTIVE_CLASSNAME - * @type String - * @default "selected" - */ - ACTIVE_CLASSNAME: 'selected', - - /** - * The class name applied to active tabs. - * @property HIDDEN_CLASSNAME - * @type String - * @default "yui-hidden" - */ - HIDDEN_CLASSNAME: 'yui-hidden', - - /** - * The title applied to active tabs. - * @property ACTIVE_TITLE - * @type String - * @default "active" - */ - ACTIVE_TITLE: 'active', - - /** - * The class name applied to disabled tabs. - * @property DISABLED_CLASSNAME - * @type String - * @default "disabled" - */ - DISABLED_CLASSNAME: DISABLED, - - /** - * The class name applied to dynamic tabs while loading. - * @property LOADING_CLASSNAME - * @type String - * @default "disabled" - */ - LOADING_CLASSNAME: 'loading', - - /** - * Provides a reference to the connection request object when data is - * loaded dynamically. - * @property dataConnection - * @type Object - */ - dataConnection: null, - - /** - * Object containing success and failure callbacks for loading data. - * @property loadHandler - * @type object - */ - loadHandler: null, - - _loading: false, - - /** - * Provides a readable name for the tab. - * @method toString - * @return String - */ - toString: function() { - var el = this.get(ELEMENT), - id = el.id || el.tagName; - return "Tab " + id; - }, - - /** - * setAttributeConfigs Tab specific properties. - * @method initAttributes - * @param {Object} attr Hash of initial attributes - */ - initAttributes: function(attr) { - attr = attr || {}; - Tab.superclass.initAttributes.call(this, attr); - - /** - * The event that triggers the tab's activation. - * @attribute activationEvent - * @type String - */ - this.setAttributeConfig('activationEvent', { - value: attr.activationEvent || 'click' - }); - - /** - * The element that contains the tab's label. - * @attribute labelEl - * @type HTMLElement - */ - this.setAttributeConfig(LABEL_EL, { - value: attr[LABEL_EL] || this._getLabelEl(), - method: function(value) { - value = Dom.get(value); - var current = this.get(LABEL_EL); - - if (current) { - if (current == value) { - return false; // already set - } - - current.parentNode.replaceChild(value, current); - this.set(LABEL, value.innerHTML); - } - } - }); - - /** - * The tab's label text (or innerHTML). - * @attribute label - * @type String - */ - this.setAttributeConfig(LABEL, { - value: attr.label || this._getLabel(), - method: function(value) { - var labelEl = this.get(LABEL_EL); - if (!labelEl) { // create if needed - this.set(LABEL_EL, this._createLabelEl()); - } - - labelEl.innerHTML = value; - } - }); - - /** - * The HTMLElement that contains the tab's content. - * @attribute contentEl - * @type HTMLElement - */ - this.setAttributeConfig(CONTENT_EL, { - value: attr[CONTENT_EL] || document.createElement('div'), - method: function(value) { - value = Dom.get(value); - var current = this.get(CONTENT_EL); - - if (current) { - if (current === value) { - return false; // already set - } - if (!this.get('selected')) { - Dom.addClass(value, this.HIDDEN_CLASSNAME); - } - current.parentNode.replaceChild(value, current); - this.set(CONTENT, value.innerHTML); - } - } - }); - - /** - * The tab's content. - * @attribute content - * @type String - */ - this.setAttributeConfig(CONTENT, { - value: attr[CONTENT], - method: function(value) { - this.get(CONTENT_EL).innerHTML = value; - } - }); - - /** - * The tab's data source, used for loading content dynamically. - * @attribute dataSrc - * @type String - */ - this.setAttributeConfig(DATA_SRC, { - value: attr.dataSrc - }); - - /** - * Whether or not content should be reloaded for every view. - * @attribute cacheData - * @type Boolean - * @default false - */ - this.setAttributeConfig(CACHE_DATA, { - value: attr.cacheData || false, - validator: Lang.isBoolean - }); - - /** - * The method to use for the data request. - * @attribute loadMethod - * @type String - * @default "GET" - */ - this.setAttributeConfig(LOAD_METHOD, { - value: attr.loadMethod || 'GET', - validator: Lang.isString - }); - - /** - * Whether or not any data has been loaded from the server. - * @attribute dataLoaded - * @type Boolean - */ - this.setAttributeConfig(DATA_LOADED, { - value: false, - validator: Lang.isBoolean, - writeOnce: true - }); - - /** - * Number if milliseconds before aborting and calling failure handler. - * @attribute dataTimeout - * @type Number - * @default null - */ - this.setAttributeConfig(DATA_TIMEOUT, { - value: attr.dataTimeout || null, - validator: Lang.isNumber - }); - - /** - * Arguments to pass when POST method is used - * @attribute postData - * @default null - */ - this.setAttributeConfig(POST_DATA, { - value: attr.postData || null - }); - - /** - * Whether or not the tab is currently active. - * If a dataSrc is set for the tab, the content will be loaded from - * the given source. - * @attribute active - * @type Boolean - */ - this.setAttributeConfig('active', { - value: attr.active || this.hasClass(this.ACTIVE_CLASSNAME), - method: function(value) { - if (value === true) { - this.addClass(this.ACTIVE_CLASSNAME); - this.set('title', this.ACTIVE_TITLE); - } else { - this.removeClass(this.ACTIVE_CLASSNAME); - this.set('title', ''); - } - }, - validator: function(value) { - return Lang.isBoolean(value) && !this.get(DISABLED) ; - } - }); - - /** - * Whether or not the tab is disabled. - * @attribute disabled - * @type Boolean - */ - this.setAttributeConfig(DISABLED, { - value: attr.disabled || this.hasClass(this.DISABLED_CLASSNAME), - method: function(value) { - if (value === true) { - Dom.addClass(this.get(ELEMENT), this.DISABLED_CLASSNAME); - } else { - Dom.removeClass(this.get(ELEMENT), this.DISABLED_CLASSNAME); - } - }, - validator: Lang.isBoolean - }); - - /** - * The href of the tab's anchor element. - * @attribute href - * @type String - * @default '#' - */ - this.setAttributeConfig('href', { - value: attr.href || - this.getElementsByTagName('a')[0].getAttribute('href', 2) || '#', - method: function(value) { - this.getElementsByTagName('a')[0].href = value; - }, - validator: Lang.isString - }); - - /** - * The Whether or not the tab's content is visible. - * @attribute contentVisible - * @type Boolean - * @default false - */ - this.setAttributeConfig('contentVisible', { - value: attr.contentVisible, - method: function(value) { - if (value) { - Dom.removeClass(this.get(CONTENT_EL), this.HIDDEN_CLASSNAME); - - if ( this.get(DATA_SRC) ) { - // load dynamic content unless already loading or loaded and caching - if ( !this._loading && !(this.get(DATA_LOADED) && this.get(CACHE_DATA)) ) { - this._dataConnect(); - } - } - } else { - Dom.addClass(this.get(CONTENT_EL), this.HIDDEN_CLASSNAME); - } - }, - validator: Lang.isBoolean - }); - }, - - _dataConnect: function() { - if (!Y.Connect) { - return false; - } - - Dom.addClass(this.get(CONTENT_EL).parentNode, this.LOADING_CLASSNAME); - this._loading = true; - this.dataConnection = Y.Connect.asyncRequest( - this.get(LOAD_METHOD), - this.get(DATA_SRC), - { - success: function(o) { - this.loadHandler.success.call(this, o); - this.set(DATA_LOADED, true); - this.dataConnection = null; - Dom.removeClass(this.get(CONTENT_EL).parentNode, - this.LOADING_CLASSNAME); - this._loading = false; - }, - failure: function(o) { - this.loadHandler.failure.call(this, o); - this.dataConnection = null; - Dom.removeClass(this.get(CONTENT_EL).parentNode, - this.LOADING_CLASSNAME); - this._loading = false; - }, - scope: this, - timeout: this.get(DATA_TIMEOUT) - }, - - this.get(POST_DATA) - ); - }, - _createTabElement: function(attr) { - var el = document.createElement('li'), - a = document.createElement('a'), - label = attr.label || null, - labelEl = attr.labelEl || null; - - a.href = attr.href || '#'; // TODO: Use Dom.setAttribute? - el.appendChild(a); - - if (labelEl) { // user supplied labelEl - if (!label) { // user supplied label - label = this._getLabel(); - } - } else { - labelEl = this._createLabelEl(); - } - - a.appendChild(labelEl); - - return el; - }, - - _getLabelEl: function() { - return this.getElementsByTagName(this.LABEL_TAGNAME)[0]; - }, - - _createLabelEl: function() { - var el = document.createElement(this.LABEL_TAGNAME); - return el; - }, - - - _getLabel: function() { - var el = this.get(LABEL_EL); - - if (!el) { - return undefined; - } - - return el.innerHTML; - }, - - _onActivate: function(e, tabview) { - var tab = this, - silent = false; - - Y.Event.preventDefault(e); - if (tab === tabview.get(ACTIVE_TAB)) { - silent = true; // dont fire activeTabChange if already active - } - tabview.set(ACTIVE_TAB, tab, silent); - }, - - _onActivationEventChange: function(e) { - var tab = this; - - if (e.prevValue != e.newValue) { - tab.removeListener(e.prevValue, tab._onActivate); - tab.addListener(e.newValue, tab._onActivate, this, tab); - } - } - }); - - - /** - * Fires when a tab is removed from the tabview - * @event remove - * @type CustomEvent - * @param {Event} An event object with fields for "type" ("remove") - * and "tabview" (the tabview instance it was removed from) - */ - - YAHOO.widget.Tab = Tab; -})(); - -YAHOO.register("tabview", YAHOO.widget.TabView, {version: "2.8.0r4", build: "2449"}); diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check0.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check0.gif deleted file mode 100644 index 193028b99361c6527f17a9056037f3d8729fada7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 608 zcmZ?wbhEHb6krfzc;>|L^y$-=FJFHD{{8v$=l}lwYiw-%_U+rNSFb*Q{ycHwL|t9o z4nyho27-Mo48_U+qq=FHi!VMBd=eR6X0+O=zU@7{g=`t?<-R$aV!QBO~=si|q# zu3gWbJ!@`mzI^%e$A3uKV-Me@C^y%BTZ(p%u#nr1TIw0qR;)H>HZ-Y})b4zPm zdq-zicTcmUtRf$uChJr_107k%CMHe`N0x;P`5omrrJC4T89CNEtasp8#oolg$!xcC z*G^_mh9((lImRPL*@bMRWts#ebZswOyr3>2&}6S{Yk&KWy@0BkeG`wFo;Jga7tBID z3Or5XCSs!Nxxa8b*r|v&i3p1^@tiSGSg@dh)kuRwD&VlggmwY>tRDsr6B@;pN)`kN kI5!@bwak+c_`=}P#wi$N7O_%^c>;TH(y2L>8UhT~0GYwkU;qFB diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check1.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check1.gif deleted file mode 100644 index 7d9ceba3847ffb41864626de755147cf2e0ccc41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 622 zcmZ?wbhEHb6krfzcoxU7ckkYV2M?Y-d-m9|V>@>2*tTt3LPEl(O`BR;T8=%(xpqq#l;5>99Xq#)&2YTYiepbIy&0g+AOW@ zckS9Guc-F@`}d~imPLyeZQs6~fsu`YfvK{pX2F65U0q$Rt*sL$O-@Ws1A@}h((LT) z?(XjO>(?(?vSiJgH4`UJK6B=bk&)5y`M-)|l9Y<;$0E z*|Mdlr)S-|b(NKs3l=PFZf@Sadv|qB-H{_lmMvRWUS2+J+H@9n9wt`q{DLAwL&J0D z&M`1B06hgHX$=&AvM@3*#4+fAECR&|1N-TQIAB<`wzYS3c6IkOiz~=+aJchM|1mCdzDLXw4hE#vxNR(VN@CJ{DPhF!b7VuM)OM4A+ZRauU+7{|s2 zcnd2w$tde{Md^hbMtE?UD9bddsdKr+>S#rp``L#2t2OayvU`dd#ftf`8raM6HSzlj zc(5=uIVZF*Fl5;XgfOzUFmkr3NH`Qau*iwBl%AN_(0#mLZsnU73LZ^-il>A0j5i(a fVsVr<>G*MA!L!EM+AbM4F05F7ettU>BZD;n{1fhr diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check2.gif b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/check2.gif deleted file mode 100644 index 181317599bfd45f03a7a69784b232509171d98e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 609 zcmZ?wbhEHb6krfzc;?HnW5@{Q2|Z;^P1R|37;4=+mc9 z2M!#ludjdl^y!^DcW&Oi`QX8Wd-v|GTD9u_{rlg(eY<=2?(*f!7cE+}Zr!@3rlz#C zw93lLty{Ntbad?6wX3|me9f9QU0q#_jEvpg-8D5erKP3o*RL-ssmjjIK6B=bk&#hr zYwM9CN4|dj+Sb-)XlVHT`}dxnp5w=lFIlo=!GZ+|z~IZE19BTEP8ittHTX6)x3spkcXW1j_cTk$%W!aLa!=*3 zc9)lEa$s@xW?Hz=(p!newn>g(hVaPYrXndu(oIuG-2?s&?!;%&%Yb2pGtyHpw{(Nw4Sq&g=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^`=~9EL;yL&>*dd5*+XG=_`^3=CG25PbLa+LJ%N(PW_s z=_-TaM{SB!w(n7k+dMDN2G6VPqUA$u7F4m@ABAZ1D`*UMfe}E6csJU}J1Trmp#~7hZ5QSGpNvd1Uz$!Rf3q28pgSj9o zx?zwoWa8GYK@TOz^)mp#V2_VR5WfJ0W9BSSbn+cKb z7B9l9)K#s!?PSt;g%c8u;y7rd?hkP%>vq5BY=N>c=98V=+T&RSPgSu|E(FAK>B?vNN1 zPszwcbxJ?Oh|1pGd!9?gxzSWOR8o=x5!rGh+6r3hBL-14aTaAQxvJ|Y-S_m4niV2S zK@?}-9Dkhg<+w{Ny!vjyp-QmjyGmIW1DFB{k>P2=8cm~9M^_P#8?JFDumGEPaqJvf zZ{f;B#CG;H7q8a_hQ$pR6%%6So8vKM+W+cNPE_TI46^dn9q@qBr@1bUgxcPGB*b-i z3Hx_0(Esy5KKx^Y0yfgB6~}t>@!ctk>J|!vgVRhE2CPQ;AOKY2y%5nM@YF^ZMS~q}%L-n>Lpor#4w48UHYViOt={{43LMRvkIp+rkbs*s; z14}4q0y6`s8DL?uo-~*R@5tnFsC1DR#BGxT8fA20u_o?`0iDNI6lf;^$@AkR1dPTz z>XF1ZAqNjU95c@Vn59Wo;Z6b(YG+L$xy3(?j2I*vQ>PmzMEdh`yw3=)E}JYMDG|*x mDkGVJ;D)fXhxDI?kcM(ish)=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^`=~9EL;yL&>*dd5*+XG=_`^3=CG25PbLa+LJ%N(PW_s z=_-TaM{SB!w(n7k+dMDN2G6VPqUA$u7F4m@ABAZ1D`*UMfe}E6csJU}J1Trmp#~7hZ5QSGpNvd1Uz$!Rf3q28pgSj9o zx?zwoWa8GYK@TOz^)mp#V2_VR5WfJ0W9BSSbn+cKb z7B9l9)K#s!?PSt;g%c8u;y7rd?hkP%>vq5BY=N>c=98V=+T&RSPgSu|E(FAK>B?vNN1 zPszwcbxJ?Oh|1pGd!9?gxzSWOR8o=x5!rGh+6r3hBL-14aTaAQxvJ|Y-S_m4niV2S zK@?}-9Dkhg<+w{Ny!vjyp-QmjyGmIW1DFB{k>P2=8cm~9M^_P#8?JFDumGEPaqJvf zZ{f;B#CG;H7q8a_hQ$pR6%%6So8vKM+W+cNPE_TI46^dn9q@qBr@1bUgxcPGB*b-i z3Hx_0(Esy5KKx^Y0yfgB6~}t>@!ctk>J|!vgVRhE2CPQ;AOKY2y%5nM@YF^ZMS~q}%L-n>Lpor#4w48UHYViOt={{43LMRvkIp+rkbs*s; z14}4q0y6`s8DL?uo-~*R@5tnFsC1DR#BGxT8fA20u_o?`0iDNI6lf;^$@AkR1dPTz z>XF1ZAqNjU95c@Vn59Wo;Z6b(YG+L$xy3(?j2I*vQ>PmzMEdh`yw3=)E}JYMDG|*x mDkGVJ;D)fXhxDI?kcM(ish)HppA z|KIKZ;^O4y=I80^>g(+6?eFj4?f>KM|K#xh=JEgV@$vHV^!4@i_V)Mp`T6?#`uqF) z|Ns900000000000A^8LW0012TEC2ui01^PWA^-*cU?+}bX_CaLu56dKMJ&&8S!{T& z;{|zVyNyP}^JR`lOa_A)YI>srb4tZrE>Kb7GQE1e*-pV?37F63OQkSyi7OQ}8g7Hw z?~lsk9xgl_4}pS%eGZ0)h<|+zjE#07FJR?dF`%c< zpFK+qpg^>!QKD@|3_Z#;sfeKxh(@I_HLBAN1EOlxI-%=?t63$8l@MX*~B&;C>oFt6t5zwd>cgW6PdRySDAyxO3~?&AYen-@t4~RHm#vzLM@W_}AL{iC_m#oNQiEOs%=9_TFDd(JY z)@kRRc;>0+o_zM{=bwNED(Iku7Ha6Bh$gD&qKr1`=%bKED(R$@R%+>`&!l*YrkioL z7*kDs3aU|HQ6-fbQX%!}R%S%y6+QGThAZy4+ZYo z#w+i<^ww+dz4+#<@4o!@>+ipGYHCUVo2WTMi!tT^V-7&P=mQQ&ED>=AJ62&akY8M3 z1sFb9aKVve^Z`K`bB$bpdj;50B?NllapfQ|2T}-_U4|J2nU9!xCM9VaT!VVD2waNL zq!2xd(V`$7iqfDk{fX0_K;4PdoKU@q)h%Gng4Qc=t%BDlfNg@ z(6$?Dr>&FRue@zH-Q?kIp5Ey34RqXq&mDN(ezR9Niie|e_uzRmzPICjL;knmloKww z;g=(xx#Ed$+PNwIi&x&b=#P^gx#^QzjymS6Yu-BNn|mHR=${W=d(pQaoqN)|FWr07 zzds#()Wc6*eAUNaoqX2IZ{2*?&wm|#*wc?)ec9KaJ-hAOY4<<2WzT>GblU+Hm_WD1rd2GO@c^>vVaA9P;`;WtA0m5_cXv|kGGw?h53kbf`qUkm}Lx*Cqo zhNZ*d>2#R78~QMZKipvudkDlL3eku}Jfael$VArh(1}BYA`+#zL@GAXbx*`%6ty@- zE>_WtSA_oE3=ud+2A0u*SrlU$1-M26o-uT7gkT&cI7bTB(SmoxU>-HNM-KMUgMS2J zAVoMx5*E^gheTl_Rk%nNHqwQUgkdCQI7u3AQH_^mV6WW)+ICLMP-(hq$71EIaRq*R<_iYFNI}HWjRw?*3_0a#br))xzll; zRHZ+)W>8JpQ(qPpm`4?6Qi-`#V>T6;LoH`iSvpmhRu!gKm1$OKx>cKY6{la-X;^tW zR-dL+sAnZ=S&h0@q_$P5Z)Iv+ojO;jrd6tUrD|TSx>v0BRjYsHYGA!OSg;mWtcN9Q zV$EvB#)8qYCS5FBCF@qo!qu{J#VlPlYgfpk)U!b4EHs}w+Paojw9+JPYE8RZ)QZ!! zaGYjrRr^}dqSdx)h3x`s``F$_7Poi>u3m-9SK|8BxPV2jV3kW)<{H+yh=s0V{-w)U z-+tD*p{4F*wOd*4Ue>#r1@C6X+ga@1*1WkT?`hTBTK4kxx9AOSe1|*V;@0=L_f2ko zm%HEQ_V>B}jc$OaJK*ZV_rTXhaCQs4T?Tj8!QX{&cqKeu3YS;G=f!Y(ExcY1x7Wk( zO|Xa;tYP_(CjI?wsTb;k3ZLmX!&_u0vRhH{{#JZLHx+RBH=I&UL)GqiUu~Lh3#l!L)zGqzO}ObjO!pzO}t?Zui^U{|0x! z#XWFx7u?(jM|Z;2y>NE(`{DkEIKU+?aEcS$;s(b!!ZogNjx*fj4v)CVCqD9um;B-< z&v?o=zVeQ@{NpbVImu^ka+;&u<|@ZI%XRK@p2OVdGOxMNZ$AF?oELrPNAG#kf4=mf z6aDE%hdR=wu5_w1-Re${y4I(@^{RLM>R-<~*T?R4vV-01VlTVe&%XAwv;FOEkNdkD zK6jAUJ?3`@dfuD9cdYk4?0-jl;M+cUxEEgT@uqv??Y?-tH(u|L=X>P+K6$`bUhtPE zeC7?mdBo3K@tA`CEx&rqw_fwF=X~rvUvJRYUi7yoeeO-ad(`({ z^}lC*@LfNA*cV^+$EW?hZNGfnH(&S9=Y8~jKYid=U-;K2e)f&OedKpv`T2H!_@O_3 z>6f4S=eK_PvA=%px1am(_kR4ruj*^pAK&+9{`?Qm|NhSRfA;^Ed;$1<1Gs6opeBO_XoC)jgW5xCC}e8x!-Fd1gDFUZr9dz+;4^8GFbeZ94C5jT zg9K(^BNXEUJQ4s^fH7XsBO6mBA2Syr10^K07I1JfOQJGT5&$dn056jzXt*U&kO*Ib z2#bI-jNkw|von@p14!sH~{iM*(bkLZh$2#k{`i=jx2qiBq!h>WMGjHyVAi^z<(2#vWYjk_p}y-1C} zh>gLhjl<}SpU92Z=#8r=j;%o+kTk2Sh?Rbpun2hnbjPuxx?0AoVh>vfi zkD*kL(dduU2$0nXj@DR^1bL7GnT-j#jSJb0{3u%wNm~sWjuFX+73qijn2#EnksR5N z7a52jIfx-yh$DH3C7Fl_d6Ko5k{jufEeVk?DUmAqj1y^)HOZ1436nV~lQC(LJ&BPn zxsyIAlt8JIL3xx$nUp+9lpy(&P05u0BI%S-36&%%l~qZVCTW#fiIpgMlU_NK-}seU z*_B{9j%8VnXL*iknT~6@j$^r!V#$?o*_Q4|m+)vgK*&Nu=uLXIO~%7&B^gp8r4;R? zDuh{>utEV7KoqEAD)U5`6W}Ula8F;6PiE07W)VG157#(#PAQe(WiIhvpo4cu$zuB9>S(L(AoWXgV#EG0w z>6^*foXa_!&uN^_IhD*Aoytj_(21SWX`Rz~mDQ=8*Xf{Y=Sh}tNt1RdkM&89_i6r*^BI=;`H%e>kpDT5ahaa(xt{VVm-M-xW~rcP$)IZK zplk`DZi%4$DWP>~p?8U)_Nk%x$)Wm5p$iJ44Jx7!N}>^Jq7zD>2dbiT>7oAVq5uk` z0vezSNuvyDqYf#fHL9aG%A+}oq8AFJ87ib3N~9fXq#w$n35ujI%A_&sq%-QH6e*=P ziK9~rr8|nHJ*uTYs-zXlrB~{uAu6ULN~R@hrYDM~DcYVZ%BC#}rd3L%IH{&VN~c3= zr$vgVM_Ng!22OwZgMC?l-E^mJx}Any0V2r?HBtt!k*V%BZ*MsJRNM zr5dKYDyqLqs=;ciwW_GY>Z`>{smW@o%ZjPZs;SS)sRrt*(Tb|os;bj!tJeyv+bXNw zN~_swtlx^OuMx|y6YH#_vvvDC`4CkwL(YqJWAvkWV<0IRbh>$4*Zv?WWk>e{PC z+pZ1Sr=|9%{_vBRF0_}&2nHL!OSV?)wP*{sZL0-VJGOEQwrX3od&{?O`?Yi1w}RUF7eEFUAToD=26qs;P;!Q(3ju2A1A%Y` zt*a$76NiQ{C3Yw#bO;GPfQLMzhlfiN0PwrO8@#_;0sx?dH~;`7P`phT1jsuA${R6C z5HZaw0svq!Q}DYOFuffB02!k(zk3DR3jmz^1-}cr;R^x3dk5)j2NrO?=nDYv8zm1A zzJdUAyfG8LhyVaJ;{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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/treeview.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/treeview.css deleted file mode 100644 index 3843d4bdb2..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/skins/sam/treeview.css +++ /dev/null @@ -1,7 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -table.ygtvtable{margin-bottom:0;border:none;border-collapse:collapse;}td.ygtvcell{border:none;padding:0;}a.ygtvspacer{text-decoration:none;outline-style:none;display:block;}.ygtvtn{width:18px;height:22px;background:url(treeview-sprite.gif) 0 -5600px no-repeat;cursor:pointer;}.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;cursor:pointer;}.ygtvlm{width:18px;height:22px;cursor:pointer;background:url(treeview-sprite.gif) 0 0 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;cursor:pointer;}.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;}* 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:18px;}.ygtvfocus{background-color:#c0e0e0;border:none;}.ygtvfocus .ygtvlabel,.ygtvfocus .ygtvlabel:link,.ygtvfocus .ygtvlabel:visited,.ygtvfocus .ygtvlabel:hover{background-color:#c0e0e0;}.ygtvfocus 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;}.ygtv-highlight .ygtv-highlight1,.ygtv-highlight .ygtv-highlight1 .ygtvlabel{background-color:blue;color:white;}.ygtv-highlight .ygtv-highlight2,.ygtv-highlight .ygtv-highlight2 .ygtvlabel{background-color:silver;}.ygtv-highlight .ygtv-highlight0 .ygtvfocus .ygtvlabel,.ygtv-highlight .ygtv-highlight1 .ygtvfocus .ygtvlabel,.ygtv-highlight .ygtv-highlight2 .ygtvfocus .ygtvlabel{background-color:#c0e0e0;}.ygtv-highlight .ygtvcontent{padding-right:1em;}.ygtv-checkbox .ygtv-highlight0 .ygtvcontent{padding-left:1em;background:url(check0.gif) no-repeat;}.ygtv-checkbox .ygtv-highlight0 .ygtvfocus.ygtvcontent,.ygtv-checkbox .ygtv-highlight1 .ygtvfocus.ygtvcontent,.ygtv-checkbox .ygtv-highlight2 .ygtvfocus.ygtvcontent{background-color:#c0e0e0;}.ygtv-checkbox .ygtv-highlight1 .ygtvcontent{padding-left:1em;background:url(check1.gif) no-repeat;}.ygtv-checkbox .ygtv-highlight2 .ygtvcontent{padding-left:1em;background:url(check2.gif) no-repeat;} diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/treeview-core.css b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/treeview-core.css deleted file mode 100644 index 62d05f6031..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/assets/treeview-core.css +++ /dev/null @@ -1,6 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/treeview-debug.js b/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/treeview-debug.js deleted file mode 100644 index 8e7587294a..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/yui/treeview/treeview-debug.js +++ /dev/null @@ -1,4058 +0,0 @@ -/* -Copyright (c) 2009, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.8.0r4 -*/ -(function () { - var Dom = YAHOO.util.Dom, - Event = YAHOO.util.Event, - Lang = YAHOO.lang, - Widget = YAHOO.widget; - - - -/** - * The treeview widget is a generic tree building tool. - * @module treeview - * @title TreeView Widget - * @requires yahoo, dom, event - * @optional animation, json, calendar - * @namespace YAHOO.widget - */ - -/** - * Contains the tree view state data and the root node. - * - * @class TreeView - * @uses YAHOO.util.EventProvider - * @constructor - * @param {string|HTMLElement} id The id of the element, or the element itself that the tree will be inserted into. - * Existing markup in this element, if valid, will be used to build the tree - * @param {Array|Object|String} oConfig (optional) If present, it will be used to build the tree via method buildTreeFromObject - * - */ -YAHOO.widget.TreeView = function(id, oConfig) { - if (id) { this.init(id); } - if (oConfig) { - this.buildTreeFromObject(oConfig); - } else if (Lang.trim(this._el.innerHTML)) { - this.buildTreeFromMarkup(id); - } -}; - -var TV = Widget.TreeView; - -TV.prototype = { - - /** - * The id of tree container element - * @property id - * @type String - */ - id: null, - - /** - * The host element for this tree - * @property _el - * @private - * @type HTMLelement - */ - _el: null, - - /** - * Flat collection of all nodes in this tree. This is a sparse - * array, so the length property can't be relied upon for a - * node count for the tree. - * @property _nodes - * @type Node[] - * @private - */ - _nodes: null, - - /** - * We lock the tree control while waiting for the dynamic loader to return - * @property locked - * @type boolean - */ - locked: false, - - /** - * The animation to use for expanding children, if any - * @property _expandAnim - * @type string - * @private - */ - _expandAnim: null, - - /** - * The animation to use for collapsing children, if any - * @property _collapseAnim - * @type string - * @private - */ - _collapseAnim: null, - - /** - * The current number of animations that are executing - * @property _animCount - * @type int - * @private - */ - _animCount: 0, - - /** - * The maximum number of animations to run at one time. - * @property maxAnim - * @type int - */ - maxAnim: 2, - - /** - * Whether there is any subscriber to dblClickEvent - * @property _hasDblClickSubscriber - * @type boolean - * @private - */ - _hasDblClickSubscriber: false, - - /** - * Stores the timer used to check for double clicks - * @property _dblClickTimer - * @type window.timer object - * @private - */ - _dblClickTimer: null, - - /** - * A reference to the Node currently having the focus or null if none. - * @property currentFocus - * @type YAHOO.widget.Node - */ - currentFocus: null, - - /** - * If true, only one Node can be highlighted at a time - * @property singleNodeHighlight - * @type boolean - * @default false - */ - - singleNodeHighlight: false, - - /** - * A reference to the Node that is currently highlighted. - * It is only meaningful if singleNodeHighlight is enabled - * @property _currentlyHighlighted - * @type YAHOO.widget.Node - * @default null - * @private - */ - - _currentlyHighlighted: null, - - /** - * Sets up the animation for expanding children - * @method setExpandAnim - * @param {string} type the type of animation (acceptable values defined - * in YAHOO.widget.TVAnim) - */ - setExpandAnim: function(type) { - this._expandAnim = (Widget.TVAnim.isValid(type)) ? type : null; - }, - - /** - * Sets up the animation for collapsing children - * @method setCollapseAnim - * @param {string} type of animation (acceptable values defined in - * YAHOO.widget.TVAnim) - */ - setCollapseAnim: function(type) { - this._collapseAnim = (Widget.TVAnim.isValid(type)) ? type : null; - }, - - /** - * Perform the expand animation if configured, or just show the - * element if not configured or too many animations are in progress - * @method animateExpand - * @param el {HTMLElement} the element to animate - * @param node {YAHOO.util.Node} the node that was expanded - * @return {boolean} true if animation could be invoked, false otherwise - */ - animateExpand: function(el, node) { - this.logger.log("animating expand"); - - if (this._expandAnim && this._animCount < this.maxAnim) { - // this.locked = true; - var tree = this; - var a = Widget.TVAnim.getAnim(this._expandAnim, el, - function() { tree.expandComplete(node); }); - if (a) { - ++this._animCount; - this.fireEvent("animStart", { - "node": node, - "type": "expand" - }); - a.animate(); - } - - return true; - } - - return false; - }, - - /** - * Perform the collapse animation if configured, or just show the - * element if not configured or too many animations are in progress - * @method animateCollapse - * @param el {HTMLElement} the element to animate - * @param node {YAHOO.util.Node} the node that was expanded - * @return {boolean} true if animation could be invoked, false otherwise - */ - animateCollapse: function(el, node) { - this.logger.log("animating collapse"); - - if (this._collapseAnim && this._animCount < this.maxAnim) { - // this.locked = true; - var tree = this; - var a = Widget.TVAnim.getAnim(this._collapseAnim, el, - function() { tree.collapseComplete(node); }); - if (a) { - ++this._animCount; - this.fireEvent("animStart", { - "node": node, - "type": "collapse" - }); - a.animate(); - } - - return true; - } - - return false; - }, - - /** - * Function executed when the expand animation completes - * @method expandComplete - */ - expandComplete: function(node) { - this.logger.log("expand complete: " + this.id); - --this._animCount; - this.fireEvent("animComplete", { - "node": node, - "type": "expand" - }); - // this.locked = false; - }, - - /** - * Function executed when the collapse animation completes - * @method collapseComplete - */ - collapseComplete: function(node) { - this.logger.log("collapse complete: " + this.id); - --this._animCount; - this.fireEvent("animComplete", { - "node": node, - "type": "collapse" - }); - // this.locked = false; - }, - - /** - * Initializes the tree - * @method init - * @parm {string|HTMLElement} id the id of the element that will hold the tree - * @private - */ - init: function(id) { - this._el = Dom.get(id); - this.id = Dom.generateId(this._el,"yui-tv-auto-id-"); - - /** - * When animation is enabled, this event fires when the animation - * starts - * @event animStart - * @type CustomEvent - * @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing - * @param {String} oArgs.type the type of animation ("expand" or "collapse") - */ - this.createEvent("animStart", this); - - /** - * When animation is enabled, this event fires when the animation - * completes - * @event animComplete - * @type CustomEvent - * @param {YAHOO.widget.Node} oArgs.node the node that is expanding/collapsing - * @param {String} oArgs.type the type of animation ("expand" or "collapse") - */ - this.createEvent("animComplete", this); - - /** - * Fires when a node is going to be collapsed. Return false to stop - * the collapse. - * @event collapse - * @type CustomEvent - * @param {YAHOO.widget.Node} node the node that is collapsing - */ - this.createEvent("collapse", this); - - /** - * Fires after a node is successfully collapsed. This event will not fire - * if the "collapse" event was cancelled. - * @event collapseComplete - * @type CustomEvent - * @param {YAHOO.widget.Node} node the node that was collapsed - */ - this.createEvent("collapseComplete", this); - - /** - * Fires when a node is going to be expanded. Return false to stop - * the collapse. - * @event expand - * @type CustomEvent - * @param {YAHOO.widget.Node} node the node that is expanding - */ - this.createEvent("expand", this); - - /** - * Fires after a node is successfully expanded. This event will not fire - * if the "expand" event was cancelled. - * @event expandComplete - * @type CustomEvent - * @param {YAHOO.widget.Node} node the node that was expanded - */ - this.createEvent("expandComplete", this); - - /** - * Fires when the Enter key is pressed on a node that has the focus - * @event enterKeyPressed - * @type CustomEvent - * @param {YAHOO.widget.Node} node the node that has the focus - */ - this.createEvent("enterKeyPressed", this); - - /** - * Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a Click. - * The listener may return false to cancel toggling and focusing on the node. - * @event clickEvent - * @type CustomEvent - * @param oArgs.event {HTMLEvent} The event object - * @param oArgs.node {YAHOO.widget.Node} node the node that was clicked - */ - this.createEvent("clickEvent", this); - - /** - * Fires when the focus receives the focus, when it changes from a Node - * to another Node or when it is completely lost (blurred) - * @event focusChanged - * @type CustomEvent - * @param oArgs.oldNode {YAHOO.widget.Node} Node that had the focus or null if none - * @param oArgs.newNode {YAHOO.widget.Node} Node that receives the focus or null if none - */ - - this.createEvent('focusChanged',this); - - /** - * Fires when the label in a TextNode or MenuNode or content in an HTMLNode receives a double Click - * @event dblClickEvent - * @type CustomEvent - * @param oArgs.event {HTMLEvent} The event object - * @param oArgs.node {YAHOO.widget.Node} node the node that was clicked - */ - var self = this; - this.createEvent("dblClickEvent", { - scope:this, - onSubscribeCallback: function() { - self._hasDblClickSubscriber = true; - } - }); - - /** - * Custom event that is fired when the text node label is clicked. - * The node clicked is provided as an argument - * - * @event labelClick - * @type CustomEvent - * @param {YAHOO.widget.Node} node the node clicked - * @deprecated use clickEvent or dblClickEvent - */ - this.createEvent("labelClick", this); - - /** - * Custom event fired when the highlight of a node changes. - * The node that triggered the change is provided as an argument: - * The status of the highlight can be checked in - * nodeRef.highlightState. - * Depending on nodeRef.propagateHighlight, other nodes might have changed - * @event highlightEvent - * @type CustomEvent - * @param node {YAHOO.widget.Node} the node that started the change in highlighting state - */ - this.createEvent("highlightEvent",this); - - - - this._nodes = []; - - // store a global reference - TV.trees[this.id] = this; - - // Set up the root node - this.root = new Widget.RootNode(this); - - var LW = Widget.LogWriter; - - this.logger = (LW) ? new LW(this.toString()) : YAHOO; - - this.logger.log("tree init: " + this.id); - - if (this._initEditor) { - this._initEditor(); - } - - // YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true); - // YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true); - }, - - //handleAvailable: function() { - //var Event = YAHOO.util.Event; - //Event.on(this.id, - //}, - /** - * Builds the TreeView from an object. - * This is the method called by the constructor to build the tree when it has a second argument. - * A tree can be described by an array of objects, each object corresponding to a node. - * Node descriptions may contain values for any property of a node plus the following extra properties:
                      - *
                    • type: can be one of the following:
                        - *
                      • A shortname for a node type ('text','menu','html')
                      • - *
                      • The name of a Node class under YAHOO.widget ('TextNode', 'MenuNode', 'DateNode', etc)
                      • - *
                      • a reference to an actual class: YAHOO.widget.DateNode
                      • - *
                    • - *
                    • children: an array containing further node definitions
                    - * A string instead of an object will produce a node of type 'text' with the given string as its label. - * @method buildTreeFromObject - * @param oConfig {Array|Object|String} array containing a full description of the tree. - * An object or a string will be turned into an array with the given object or string as its only element. - * - */ - buildTreeFromObject: function (oConfig) { - var logger = this.logger; - logger.log('Building tree from object'); - var build = function (parent, oConfig) { - var i, item, node, children, type, NodeType, ThisType; - for (i = 0; i < oConfig.length; i++) { - item = oConfig[i]; - if (Lang.isString(item)) { - node = new Widget.TextNode(item, parent); - } else if (Lang.isObject(item)) { - children = item.children; - delete item.children; - type = item.type || 'text'; - delete item.type; - switch (Lang.isString(type) && type.toLowerCase()) { - case 'text': - node = new Widget.TextNode(item, parent); - break; - case 'menu': - node = new Widget.MenuNode(item, parent); - break; - case 'html': - node = new Widget.HTMLNode(item, parent); - break; - default: - if (Lang.isString(type)) { - NodeType = Widget[type]; - } else { - NodeType = type; - } - if (Lang.isObject(NodeType)) { - for (ThisType = NodeType; ThisType && ThisType !== Widget.Node; ThisType = ThisType.superclass.constructor) {} - if (ThisType) { - node = new NodeType(item, parent); - } else { - logger.log('Invalid type in node definition: ' + type,'error'); - } - } else { - logger.log('Invalid type in node definition: ' + type,'error'); - } - } - if (children) { - build(node,children); - } - } else { - logger.log('Invalid node definition','error'); - } - } - }; - if (!Lang.isArray(oConfig)) { - oConfig = [oConfig]; - } - - - build(this.root,oConfig); - }, -/** - * Builds the TreeView from existing markup. Markup should consist of <UL> or <OL> elements containing <LI> elements. - * Each <LI> can have one element used as label and a second optional element which is to be a <UL> or <OL> - * containing nested nodes. - * Depending on what the first element of the <LI> element is, the following Nodes will be created:
                      - *
                    • plain text: a regular TextNode
                    • - *
                    • anchor <A>: a TextNode with its href and target taken from the anchor
                    • - *
                    • anything else: an HTMLNode
                    - * Only the first outermost (un-)ordered list in the markup and its children will be parsed. - * Nodes will be collapsed unless an <LI> tag has a className called 'expanded'. - * All other className attributes will be copied over to the Node className property. - * If the <LI> element contains an attribute called yuiConfig, its contents should be a JSON-encoded object - * as the one used in method buildTreeFromObject. - * @method buildTreeFromMarkup - * @param id {string|HTMLElement} The id of the element that contains the markup or a reference to it. - */ - buildTreeFromMarkup: function (id) { - this.logger.log('Building tree from existing markup'); - var build = function (markup) { - var el, child, branch = [], config = {}, label, yuiConfig; - // Dom's getFirstChild and getNextSibling skip over text elements - for (el = Dom.getFirstChild(markup); el; el = Dom.getNextSibling(el)) { - switch (el.tagName.toUpperCase()) { - case 'LI': - label = ''; - config = { - expanded: Dom.hasClass(el,'expanded'), - title: el.title || el.alt || null, - className: Lang.trim(el.className.replace(/\bexpanded\b/,'')) || null - }; - // I cannot skip over text elements here because I want them for labels - child = el.firstChild; - if (child.nodeType == 3) { - // nodes with only whitespace, tabs and new lines don't count, they are probably just formatting. - label = Lang.trim(child.nodeValue.replace(/[\n\t\r]*/g,'')); - if (label) { - config.type = 'text'; - config.label = label; - } else { - child = Dom.getNextSibling(child); - } - } - if (!label) { - if (child.tagName.toUpperCase() == 'A') { - config.type = 'text'; - config.label = child.innerHTML; - config.href = child.href; - config.target = child.target; - config.title = child.title || child.alt || config.title; - } else { - config.type = 'html'; - var d = document.createElement('div'); - d.appendChild(child.cloneNode(true)); - config.html = d.innerHTML; - config.hasIcon = true; - } - } - // see if after the label it has a further list which will become children of this node. - child = Dom.getNextSibling(child); - switch (child && child.tagName.toUpperCase()) { - case 'UL': - case 'OL': - config.children = build(child); - break; - } - // if there are further elements or text, it will be ignored. - - if (YAHOO.lang.JSON) { - yuiConfig = el.getAttribute('yuiConfig'); - if (yuiConfig) { - yuiConfig = YAHOO.lang.JSON.parse(yuiConfig); - config = YAHOO.lang.merge(config,yuiConfig); - } - } - - branch.push(config); - break; - case 'UL': - case 'OL': - this.logger.log('ULs or OLs can only contain LI elements, not other UL or OL. This will not work in some browsers','error'); - config = { - type: 'text', - label: '', - children: build(child) - }; - branch.push(config); - break; - } - } - return branch; - }; - - var markup = Dom.getChildrenBy(Dom.get(id),function (el) { - var tag = el.tagName.toUpperCase(); - return tag == 'UL' || tag == 'OL'; - }); - if (markup.length) { - this.buildTreeFromObject(build(markup[0])); - } else { - this.logger.log('Markup contains no UL or OL elements','warn'); - } - }, - /** - * Returns the TD element where the event has occurred - * @method _getEventTargetTdEl - * @private - */ - _getEventTargetTdEl: function (ev) { - var target = Event.getTarget(ev); - // go up looking for a TD with a className with a ygtv prefix - while (target && !(target.tagName.toUpperCase() == 'TD' && Dom.hasClass(target.parentNode,'ygtvrow'))) { - target = Dom.getAncestorByTagName(target,'td'); - } - if (Lang.isNull(target)) { return null; } - // If it is a spacer cell, do nothing - if (/\bygtv(blank)?depthcell/.test(target.className)) { return null;} - // If it has an id, search for the node number and see if it belongs to a node in this tree. - if (target.id) { - var m = target.id.match(/\bygtv([^\d]*)(.*)/); - if (m && m[2] && this._nodes[m[2]]) { - return target; - } - } - return null; - }, - /** - * Event listener for click events - * @method _onClickEvent - * @private - */ - _onClickEvent: function (ev) { - var self = this, - td = this._getEventTargetTdEl(ev), - node, - target, - toggle = function (force) { - node.focus(); - if (force || !node.href) { - node.toggle(); - try { - Event.preventDefault(ev); - } catch (e) { - // @TODO - // For some reason IE8 is providing an event object with - // most of the fields missing, but only when clicking on - // the node's label, and only when working with inline - // editing. This generates a "Member not found" error - // in that browser. Determine if this is a browser - // bug, or a problem with this code. Already checked to - // see if the problem has to do with access the event - // in the outer scope, and that isn't the problem. - // Maybe the markup for inline editing is broken. - } - } - }; - - if (!td) { - return; - } - - node = this.getNodeByElement(td); - if (!node) { - return; - } - - // exception to handle deprecated event labelClick - // @TODO take another look at this deprecation. It is common for people to - // only be interested in the label click, so why make them have to test - // the node type to figure out whether the click was on the label? - target = Event.getTarget(ev); - if (Dom.hasClass(target, node.labelStyle) || Dom.getAncestorByClassName(target,node.labelStyle)) { - this.logger.log("onLabelClick " + node.label); - this.fireEvent('labelClick',node); - } - - // If it is a toggle cell, toggle - if (/\bygtv[tl][mp]h?h?/.test(td.className)) { - toggle(true); - } else { - if (this._dblClickTimer) { - window.clearTimeout(this._dblClickTimer); - this._dblClickTimer = null; - } else { - if (this._hasDblClickSubscriber) { - this._dblClickTimer = window.setTimeout(function () { - self._dblClickTimer = null; - if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { - toggle(); - } - }, 200); - } else { - if (self.fireEvent('clickEvent', {event:ev,node:node}) !== false) { - toggle(); - } - } - } - } - }, - - /** - * Event listener for double-click events - * @method _onDblClickEvent - * @private - */ - _onDblClickEvent: function (ev) { - if (!this._hasDblClickSubscriber) { return; } - var td = this._getEventTargetTdEl(ev); - if (!td) {return;} - - if (!(/\bygtv[tl][mp]h?h?/.test(td.className))) { - this.fireEvent('dblClickEvent', {event:ev, node:this.getNodeByElement(td)}); - if (this._dblClickTimer) { - window.clearTimeout(this._dblClickTimer); - this._dblClickTimer = null; - } - } - }, - /** - * Event listener for mouse over events - * @method _onMouseOverEvent - * @private - */ - _onMouseOverEvent:function (ev) { - var target; - if ((target = this._getEventTargetTdEl(ev)) && (target = this.getNodeByElement(target)) && (target = target.getToggleEl())) { - target.className = target.className.replace(/\bygtv([lt])([mp])\b/gi,'ygtv$1$2h'); - } - }, - /** - * Event listener for mouse out events - * @method _onMouseOutEvent - * @private - */ - _onMouseOutEvent: function (ev) { - var target; - if ((target = this._getEventTargetTdEl(ev)) && (target = this.getNodeByElement(target)) && (target = target.getToggleEl())) { - target.className = target.className.replace(/\bygtv([lt])([mp])h\b/gi,'ygtv$1$2'); - } - }, - /** - * Event listener for key down events - * @method _onKeyDownEvent - * @private - */ - _onKeyDownEvent: function (ev) { - var target = Event.getTarget(ev), - node = this.getNodeByElement(target), - newNode = node, - KEY = YAHOO.util.KeyListener.KEY; - - switch(ev.keyCode) { - case KEY.UP: - this.logger.log('UP'); - do { - if (newNode.previousSibling) { - newNode = newNode.previousSibling; - } else { - newNode = newNode.parent; - } - } while (newNode && !newNode._canHaveFocus()); - if (newNode) { newNode.focus(); } - Event.preventDefault(ev); - break; - case KEY.DOWN: - this.logger.log('DOWN'); - do { - if (newNode.nextSibling) { - newNode = newNode.nextSibling; - } else { - newNode.expand(); - newNode = (newNode.children.length || null) && newNode.children[0]; - } - } while (newNode && !newNode._canHaveFocus); - if (newNode) { newNode.focus();} - Event.preventDefault(ev); - break; - case KEY.LEFT: - this.logger.log('LEFT'); - do { - if (newNode.parent) { - newNode = newNode.parent; - } else { - newNode = newNode.previousSibling; - } - } while (newNode && !newNode._canHaveFocus()); - if (newNode) { newNode.focus();} - Event.preventDefault(ev); - break; - case KEY.RIGHT: - this.logger.log('RIGHT'); - var self = this, - moveFocusRight, - focusOnExpand = function (newNode) { - self.unsubscribe('expandComplete',focusOnExpand); - moveFocusRight(newNode); - }; - moveFocusRight = function (newNode) { - do { - if (newNode.isDynamic() && !newNode.childrenRendered) { - self.subscribe('expandComplete',focusOnExpand); - newNode.expand(); - newNode = null; - break; - } else { - newNode.expand(); - if (newNode.children.length) { - newNode = newNode.children[0]; - } else { - newNode = newNode.nextSibling; - } - } - } while (newNode && !newNode._canHaveFocus()); - if (newNode) { newNode.focus();} - }; - - moveFocusRight(newNode); - Event.preventDefault(ev); - break; - case KEY.ENTER: - this.logger.log('ENTER: ' + newNode.href); - if (node.href) { - if (node.target) { - window.open(node.href,node.target); - } else { - window.location(node.href); - } - } else { - node.toggle(); - } - this.fireEvent('enterKeyPressed',node); - Event.preventDefault(ev); - break; - case KEY.HOME: - this.logger.log('HOME'); - newNode = this.getRoot(); - if (newNode.children.length) {newNode = newNode.children[0];} - if (newNode._canHaveFocus()) { newNode.focus(); } - Event.preventDefault(ev); - break; - case KEY.END: - this.logger.log('END'); - newNode = newNode.parent.children; - newNode = newNode[newNode.length -1]; - if (newNode._canHaveFocus()) { newNode.focus(); } - Event.preventDefault(ev); - break; - // case KEY.PAGE_UP: - // this.logger.log('PAGE_UP'); - // break; - // case KEY.PAGE_DOWN: - // this.logger.log('PAGE_DOWN'); - // break; - case 107: // plus key - if (ev.shiftKey) { - this.logger.log('Shift-PLUS'); - node.parent.expandAll(); - } else { - this.logger.log('PLUS'); - node.expand(); - } - break; - case 109: // minus key - if (ev.shiftKey) { - this.logger.log('Shift-MINUS'); - node.parent.collapseAll(); - } else { - this.logger.log('MINUS'); - node.collapse(); - } - break; - default: - break; - } - }, - /** - * Renders the tree boilerplate and visible nodes - * @method render - */ - render: function() { - var html = this.root.getHtml(), - el = this.getEl(); - el.innerHTML = html; - if (!this._hasEvents) { - Event.on(el, 'click', this._onClickEvent, this, true); - Event.on(el, 'dblclick', this._onDblClickEvent, this, true); - Event.on(el, 'mouseover', this._onMouseOverEvent, this, true); - Event.on(el, 'mouseout', this._onMouseOutEvent, this, true); - Event.on(el, 'keydown', this._onKeyDownEvent, this, true); - } - this._hasEvents = true; - }, - - /** - * Returns the tree's host element - * @method getEl - * @return {HTMLElement} the host element - */ - getEl: function() { - if (! this._el) { - this._el = Dom.get(this.id); - } - return this._el; - }, - - /** - * Nodes register themselves with the tree instance when they are created. - * @method regNode - * @param node {Node} the node to register - * @private - */ - regNode: function(node) { - this._nodes[node.index] = node; - }, - - /** - * Returns the root node of this tree - * @method getRoot - * @return {Node} the root node - */ - getRoot: function() { - return this.root; - }, - - /** - * Configures this tree to dynamically load all child data - * @method setDynamicLoad - * @param {function} fnDataLoader the function that will be called to get the data - * @param iconMode {int} configures the icon that is displayed when a dynamic - * load node is expanded the first time without children. By default, the - * "collapse" icon will be used. If set to 1, the leaf node icon will be - * displayed. - */ - setDynamicLoad: function(fnDataLoader, iconMode) { - this.root.setDynamicLoad(fnDataLoader, iconMode); - }, - - /** - * Expands all child nodes. Note: this conflicts with the "multiExpand" - * node property. If expand all is called in a tree with nodes that - * do not allow multiple siblings to be displayed, only the last sibling - * will be expanded. - * @method expandAll - */ - expandAll: function() { - if (!this.locked) { - this.root.expandAll(); - } - }, - - /** - * Collapses all expanded child nodes in the entire tree. - * @method collapseAll - */ - collapseAll: function() { - if (!this.locked) { - this.root.collapseAll(); - } - }, - - /** - * Returns a node in the tree that has the specified index (this index - * is created internally, so this function probably will only be used - * in html generated for a given node.) - * @method getNodeByIndex - * @param {int} nodeIndex the index of the node wanted - * @return {Node} the node with index=nodeIndex, null if no match - */ - getNodeByIndex: function(nodeIndex) { - var n = this._nodes[nodeIndex]; - return (n) ? n : null; - }, - - /** - * Returns a node that has a matching property and value in the data - * object that was passed into its constructor. - * @method getNodeByProperty - * @param {object} property the property to search (usually a string) - * @param {object} value the value we want to find (usuall an int or string) - * @return {Node} the matching node, null if no match - */ - getNodeByProperty: function(property, value) { - for (var i in this._nodes) { - if (this._nodes.hasOwnProperty(i)) { - var n = this._nodes[i]; - if ((property in n && n[property] == value) || (n.data && value == n.data[property])) { - return n; - } - } - } - - return null; - }, - - /** - * Returns a collection of nodes that have a matching property - * and value in the data object that was passed into its constructor. - * @method getNodesByProperty - * @param {object} property the property to search (usually a string) - * @param {object} value the value we want to find (usuall an int or string) - * @return {Array} the matching collection of nodes, null if no match - */ - getNodesByProperty: function(property, value) { - var values = []; - for (var i in this._nodes) { - if (this._nodes.hasOwnProperty(i)) { - var n = this._nodes[i]; - if ((property in n && n[property] == value) || (n.data && value == n.data[property])) { - values.push(n); - } - } - } - - return (values.length) ? values : null; - }, - - - /** - * Returns a collection of nodes that have passed the test function - * passed as its only argument. - * The function will receive a reference to each node to be tested. - * @method getNodesBy - * @param {function} a boolean function that receives a Node instance and returns true to add the node to the results list - * @return {Array} the matching collection of nodes, null if no match - */ - getNodesBy: function(fn) { - var values = []; - for (var i in this._nodes) { - if (this._nodes.hasOwnProperty(i)) { - var n = this._nodes[i]; - if (fn(n)) { - values.push(n); - } - } - } - return (values.length) ? values : null; - }, - /** - * Returns the treeview node reference for an ancestor element - * of the node, or null if it is not contained within any node - * in this tree. - * @method getNodeByElement - * @param el {HTMLElement} the element to test - * @return {YAHOO.widget.Node} a node reference or null - */ - getNodeByElement: function(el) { - - var p=el, m, re=/ygtv([^\d]*)(.*)/; - - do { - - if (p && p.id) { - m = p.id.match(re); - if (m && m[2]) { - return this.getNodeByIndex(m[2]); - } - } - - p = p.parentNode; - - if (!p || !p.tagName) { - break; - } - - } - while (p.id !== this.id && p.tagName.toLowerCase() !== "body"); - - return null; - }, - - /** - * When in singleNodeHighlight it returns the node highlighted - * or null if none. Returns null if singleNodeHighlight is false. - * @method getHighlightedNode - * @return {YAHOO.widget.Node} a node reference or null - */ - getHighlightedNode: function() { - return this._currentlyHighlighted; - }, - - - /** - * Removes the node and its children, and optionally refreshes the - * branch of the tree that was affected. - * @method removeNode - * @param {Node} node to remove - * @param {boolean} autoRefresh automatically refreshes branch if true - * @return {boolean} False is there was a problem, true otherwise. - */ - removeNode: function(node, autoRefresh) { - - // Don't delete the root node - if (node.isRoot()) { - return false; - } - - // Get the branch that we may need to refresh - var p = node.parent; - if (p.parent) { - p = p.parent; - } - - // Delete the node and its children - this._deleteNode(node); - - // Refresh the parent of the parent - if (autoRefresh && p && p.childrenRendered) { - p.refresh(); - } - - return true; - }, - - /** - * wait until the animation is complete before deleting - * to avoid javascript errors - * @method _removeChildren_animComplete - * @param o the custom event payload - * @private - */ - _removeChildren_animComplete: function(o) { - this.unsubscribe(this._removeChildren_animComplete); - this.removeChildren(o.node); - }, - - /** - * Deletes this nodes child collection, recursively. Also collapses - * the node, and resets the dynamic load flag. The primary use for - * this method is to purge a node and allow it to fetch its data - * dynamically again. - * @method removeChildren - * @param {Node} node the node to purge - */ - removeChildren: function(node) { - - if (node.expanded) { - // wait until the animation is complete before deleting to - // avoid javascript errors - if (this._collapseAnim) { - this.subscribe("animComplete", - this._removeChildren_animComplete, this, true); - Widget.Node.prototype.collapse.call(node); - return; - } - - node.collapse(); - } - - this.logger.log("Removing children for " + node); - while (node.children.length) { - this._deleteNode(node.children[0]); - } - - if (node.isRoot()) { - Widget.Node.prototype.expand.call(node); - } - - node.childrenRendered = false; - node.dynamicLoadComplete = false; - - node.updateIcon(); - }, - - /** - * Deletes the node and recurses children - * @method _deleteNode - * @private - */ - _deleteNode: function(node) { - // Remove all the child nodes first - this.removeChildren(node); - - // Remove the node from the tree - this.popNode(node); - }, - - /** - * Removes the node from the tree, preserving the child collection - * to make it possible to insert the branch into another part of the - * tree, or another tree. - * @method popNode - * @param {Node} node to remove - */ - popNode: function(node) { - var p = node.parent; - - // Update the parent's collection of children - var a = []; - - for (var i=0, len=p.children.length;i