yui-rails-asset 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +21 -0
- data/README +17 -0
- data/lib/yui/rails.rb +29 -0
- data/lib/yui/rails/engine.rb +10 -0
- data/lib/yui/rails/version.rb +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-debug.js +1396 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation-min.js +23 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/animation/animation.js +1392 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/ajax-loader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/asc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/autocomplete.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/back-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bar-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-h.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/bg-v.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/blankimage.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/button.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/calendar.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/carousel.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check0.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/check2.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/colorpicker.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/container.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/datatable.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/desc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-dn.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/dt-arrow-up.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-knob.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite-active.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/editor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/header_background.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/hue_bg.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/imagecropper.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/layout_sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/logger.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menu.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/paginator.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/picker_mask.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/profilerviewer.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/progressbar.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/resize.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/simpleeditor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/skin.css +36 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/slider.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-active.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-focus.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow-hover.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/split-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/sprite.psd +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/tabview.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/treeview.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/wait.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/assets/skins/sam/yuitest.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/autocomplete-core.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete-skin.css +57 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/assets/skins/sam/autocomplete.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-debug.js +3009 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/autocomplete/autocomplete.js +2966 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/base/base-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/base/base.css +131 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/button-core.css +44 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button-skin.css +219 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/button.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/menu-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-active.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-focus.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow-hover.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/assets/skins/sam/split-button-arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/button-debug.js +4694 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/button-min.js +11 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/button/button.js +4633 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar-core.css +132 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calendar.css +320 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calgrad.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/callt.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calrt.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/calx.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar-skin.css +361 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/assets/skins/sam/calendar.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-debug.js +7324 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar-min.js +18 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/calendar/calendar.js +7294 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/ajax-loader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/carousel-core.css +88 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/ajax-loader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel-skin.css +142 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/assets/skins/sam/carousel.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-debug.js +4390 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/carousel/carousel.js +4349 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/assets/charts.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-debug.js +2061 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/charts/charts.js +2060 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/colorpicker-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/hue_thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_mask.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/picker_thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker-skin.css +105 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/colorpicker.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/hue_bg.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/assets/skins/sam/picker_mask.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-debug.js +1783 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/colorpicker/colorpicker.js +1763 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-debug.js +1576 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.js +1546 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-debug.js +980 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/connection/connection_core.js +957 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/alrt16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/blck16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/close12_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container-core.css +176 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/container.css +324 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/hlp16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/info16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container-skin.css +242 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/skins/sam/container.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/tip16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/assets/warn16_1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container-debug.js +9076 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container-min.js +19 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container.js +9052 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-debug.js +5136 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core-min.js +14 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/container/container_core.js +5126 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-debug.js +482 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/cookie/cookie.js +482 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-debug.js +3067 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datasource/datasource.js +2996 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable-core.css +93 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/datatable.css +49 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable-skin.css +240 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/datatable.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-dn.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/assets/skins/sam/dt-arrow-up.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-debug.js +17360 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable-min.js +29 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datatable/datatable.js +17122 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-debug.js +408 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/datemath/datemath.js +408 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-debug.js +1872 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dom/dom.js +1832 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-debug.js +3710 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/dragdrop/dragdrop.js +3601 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/editor-core.css +602 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/simpleeditor-core.css +602 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/blankimage.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-knob.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-skin.css +711 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite-active.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/editor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor-skin.css +711 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/assets/skins/sam/simpleeditor.css +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-debug.js +9557 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor-min.js +30 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/editor.js +9447 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-debug.js +7493 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor-min.js +24 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/editor/simpleeditor.js +7406 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-debug.js +141 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element-delegate/element-delegate.js +138 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element/element-debug.js +1106 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element/element-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/element/element.js +1090 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-debug.js +283 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-delegate/event-delegate.js +281 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-debug.js +219 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-mouseenter/event-mouseenter.js +219 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-debug.js +622 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event-simulate/event-simulate.js +622 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event/event-debug.js +2524 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event/event-min.js +11 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/event/event.js +2500 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/fonts/fonts.css +56 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/get/get-debug.js +773 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/get/get-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/get/get.js +755 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/grids/grids.css +467 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/assets/blank.html +1 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/history-debug.js +808 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/history-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/history/history.js +808 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/imagecropper-core.css +33 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper-skin.css +16 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/assets/skins/sam/imagecropper.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-debug.js +907 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imagecropper/imagecropper.js +889 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-debug.js +487 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/imageloader/imageloader.js +481 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/json/json-debug.js +538 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/json/json-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/json/json.js +538 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/layout-core.css +158 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout-skin.css +207 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/assets/skins/sam/layout_sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-debug.js +2305 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout-min.js +11 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/layout/layout.js +2290 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger-core.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/logger.css +57 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger-skin.css +55 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/assets/skins/sam/logger.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-debug.js +2104 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/logger/logger.js +2104 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu-core.css +242 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu.css +503 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_down_arrow_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menu_up_arrow_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menubaritem_submenuindicator_selected.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_checkbox_selected.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/menuitem_submenuindicator_selected.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu-skin.css +339 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menu.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_checkbox_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-debug.js +9870 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu-min.js +16 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/menu/menu.js +9823 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/paginator-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator-skin.css +78 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/assets/skins/sam/paginator.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-debug.js +2393 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/paginator/paginator.js +2393 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-debug.js +557 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profiler/profiler.js +557 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/profilerviewer-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/asc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/desc.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/header_background.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer-skin.css +167 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/profilerviewer.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/assets/skins/sam/wait.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-debug.js +1229 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/profilerviewer/profilerviewer.js +1192 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/progressbar-core.css +85 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/back-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-h.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/bar-v.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar-skin.css +56 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/assets/skins/sam/progressbar.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-debug.js +691 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/progressbar/progressbar.js +677 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts-grids/reset-fonts-grids.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset-fonts/reset-fonts.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset-min.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/reset/reset.css +142 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/resize-core.css +173 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/layout_sprite.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize-skin.css +142 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/assets/skins/sam/resize.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-debug.js +1749 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/resize/resize.js +1689 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-debug.js +651 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/selector/selector.js +644 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-fader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-h.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v-e.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/bg-v.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/left-thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/right-thumb.png +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-h.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/bg-v.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider-skin.css +24 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/skins/sam/slider.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-core.css +17 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/slider-skin.css +20 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-bar.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-e.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-fader.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-n.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-s.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/assets/thumb-w.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-debug.js +2114 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/slider/slider.js +2068 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-debug.js +1185 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/storage/storage.js +1183 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-debug.js +648 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/stylesheet/stylesheet.js +645 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-debug.js +269 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swf/swf.js +268 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-debug.js +93 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfdetect/swfdetect.js +93 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swf.js +238 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-debug.js +470 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.js +453 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/swfstore/swfstore.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/border_tabs.css +54 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skin-sam.css +77 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview-skin.css +186 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/skins/sam/tabview.css +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview-core.css +133 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/assets/tabview.css +77 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-debug.js +995 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview-min.js +8 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/tabview/tabview.js +987 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check0.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check1.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/check2.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-loading.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-skin.css +249 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview-sprite.gif +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/skins/sam/treeview.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/assets/treeview-core.css +6 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-debug.js +4058 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview-min.js +12 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/treeview/treeview.js +3989 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/assets/uploader.swf +0 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-debug.js +1072 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader-min.js +15 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/uploader/uploader.js +1069 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/utilities/utilities.js +39 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo-dom-event/yahoo-dom-event.js +14 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-debug.js +1075 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo-min.js +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yahoo/yahoo.js +1075 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader-dom-event/yuiloader-dom-event.js +17 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-debug.js +3879 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuiloader/yuiloader.js +3879 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest-skin.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/skins/sam/yuitest.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/testlogger.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/assets/yuitest-core.css +7 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-debug.js +2741 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest-min.js +10 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest.js +2741 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-debug.js +1976 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core-min.js +9 -0
- data/vendor/assets/javascripts/yui-2.8.1/build/yuitest/yuitest_core.js +1976 -0
- metadata +470 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
+
Code licensed under the BSD License:
|
4
|
+
http://developer.yahoo.com/yui/license.html
|
5
|
+
version: 2.8.1
|
6
|
+
*/
|
7
|
+
(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='<div class="'+this.CSS_RESIZE_MASK+'"></div>';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.top<I.top)){G=(J.height+J.top)-I.top;C.setY(this._resize.getWrapEl(),I.top);this._resize.getWrapEl().style.height=G+"px";this._resize._cache.height=G;this._resize._cache.top=I.top;this._syncBackgroundPosition();return false;}if(F.left&&(F.left<I.left)){E=(J.width+J.left)-I.left;C.setX(this._resize.getWrapEl(),I.left);this._resize._cache.left=I.left;this._resize.getWrapEl().style.width=E+"px";this._resize._cache.width=E;this._syncBackgroundPosition();return false;}if(H!="tl"&&H!="l"&&H!="bl"){if(J.left&&F.width&&((J.left+F.width)>I.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)));
|
8
|
+
},_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.1",build:"19"});
|
@@ -0,0 +1,889 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
3
|
+
Code licensed under the BSD License:
|
4
|
+
http://developer.yahoo.com/yui/license.html
|
5
|
+
version: 2.8.1
|
6
|
+
*/
|
7
|
+
/**
|
8
|
+
* @description <p>Creates a Image Cropper control.</p>
|
9
|
+
* @namespace YAHOO.widget
|
10
|
+
* @requires yahoo, dom, dragdrop, element, event, resize
|
11
|
+
* @module imagecropper
|
12
|
+
* @beta
|
13
|
+
*/
|
14
|
+
(function() {
|
15
|
+
var Dom = YAHOO.util.Dom,
|
16
|
+
Event = YAHOO.util.Event,
|
17
|
+
Lang = YAHOO.lang;
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @constructor
|
21
|
+
* @class ImageCropper
|
22
|
+
* @description <p>Creates a Image Cropper control.</p>
|
23
|
+
* @extends YAHOO.util.Element
|
24
|
+
* @param {String/HTMLElement} el The image element to make croppable.
|
25
|
+
* @param {Object} attrs Object liternal containing configuration parameters.
|
26
|
+
*/
|
27
|
+
var Crop = function(el, config) {
|
28
|
+
var oConfig = {
|
29
|
+
element: el,
|
30
|
+
attributes: config || {}
|
31
|
+
};
|
32
|
+
|
33
|
+
Crop.superclass.constructor.call(this, oConfig.element, oConfig.attributes);
|
34
|
+
};
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @private
|
38
|
+
* @static
|
39
|
+
* @property _instances
|
40
|
+
* @description Internal hash table for all ImageCropper instances
|
41
|
+
* @type Object
|
42
|
+
*/
|
43
|
+
Crop._instances = {};
|
44
|
+
/**
|
45
|
+
* @static
|
46
|
+
* @method getCropperById
|
47
|
+
* @description Get's an ImageCropper object by the HTML id of the image associated with the ImageCropper object.
|
48
|
+
* @return {Object} The ImageCropper Object
|
49
|
+
*/
|
50
|
+
Crop.getCropperById = function(id) {
|
51
|
+
if (Crop._instances[id]) {
|
52
|
+
return Crop._instances[id];
|
53
|
+
}
|
54
|
+
return false;
|
55
|
+
};
|
56
|
+
|
57
|
+
YAHOO.extend(Crop, YAHOO.util.Element, {
|
58
|
+
/**
|
59
|
+
* @private
|
60
|
+
* @property CSS_MAIN
|
61
|
+
* @description The CSS class used to wrap the element
|
62
|
+
* @type String
|
63
|
+
*/
|
64
|
+
CSS_MAIN: 'yui-crop',
|
65
|
+
/**
|
66
|
+
* @private
|
67
|
+
* @property CSS_MASK
|
68
|
+
* @description The CSS class for the mask element
|
69
|
+
* @type String
|
70
|
+
*/
|
71
|
+
CSS_MASK: 'yui-crop-mask',
|
72
|
+
/**
|
73
|
+
* @private
|
74
|
+
* @property CSS_RESIZE_MASK
|
75
|
+
* @description The CSS class for the mask inside the resize element
|
76
|
+
* @type String
|
77
|
+
*/
|
78
|
+
CSS_RESIZE_MASK: 'yui-crop-resize-mask',
|
79
|
+
|
80
|
+
/**
|
81
|
+
* @private
|
82
|
+
* @property _image
|
83
|
+
* @description The url of the image we are cropping
|
84
|
+
* @type String
|
85
|
+
*/
|
86
|
+
_image: null,
|
87
|
+
/**
|
88
|
+
* @private
|
89
|
+
* @property _active
|
90
|
+
* @description Flag to determine if the crop region is active
|
91
|
+
* @type Boolean
|
92
|
+
*/
|
93
|
+
_active: null,
|
94
|
+
/**
|
95
|
+
* @private
|
96
|
+
* @property _resize
|
97
|
+
* @description A reference to the Resize Utility used in this Cropper Instance
|
98
|
+
* @type Object
|
99
|
+
*/
|
100
|
+
_resize: null,
|
101
|
+
/**
|
102
|
+
* @private
|
103
|
+
* @property _resizeEl
|
104
|
+
* @description The HTML Element used to create the Resize Oject
|
105
|
+
* @type HTMLElement
|
106
|
+
*/
|
107
|
+
_resizeEl: null,
|
108
|
+
/**
|
109
|
+
* @private
|
110
|
+
* @property _resizeMaskEl
|
111
|
+
* @description The HTML Element used to create the Resize mask
|
112
|
+
* @type HTMLElement
|
113
|
+
*/
|
114
|
+
_resizeMaskEl: null,
|
115
|
+
/**
|
116
|
+
* @private
|
117
|
+
* @property _wrap
|
118
|
+
* @description The HTML Element created to wrap the image
|
119
|
+
* @type HTMLElement
|
120
|
+
*/
|
121
|
+
_wrap: null,
|
122
|
+
/**
|
123
|
+
* @private
|
124
|
+
* @property _mask
|
125
|
+
* @description The HTML Element created to "mask" the image being cropped
|
126
|
+
* @type HTMLElement
|
127
|
+
*/
|
128
|
+
_mask: null,
|
129
|
+
/**
|
130
|
+
* @private
|
131
|
+
* @method _createWrap
|
132
|
+
* @description Creates the wrapper element used to wrap the image
|
133
|
+
*/
|
134
|
+
_createWrap: function() {
|
135
|
+
this._wrap = document.createElement('div');
|
136
|
+
this._wrap.id = this.get('element').id + '_wrap';
|
137
|
+
this._wrap.className = this.CSS_MAIN;
|
138
|
+
var el = this.get('element');
|
139
|
+
this._wrap.style.width = el.width ? el.width + 'px' : Dom.getStyle(el, 'width');
|
140
|
+
this._wrap.style.height = el.height ? el.height + 'px' : Dom.getStyle(el, 'height');
|
141
|
+
|
142
|
+
var par = this.get('element').parentNode;
|
143
|
+
par.replaceChild(this._wrap, this.get('element'));
|
144
|
+
this._wrap.appendChild(this.get('element'));
|
145
|
+
|
146
|
+
Event.on(this._wrap, 'mouseover', this._handleMouseOver, this, true);
|
147
|
+
Event.on(this._wrap, 'mouseout', this._handleMouseOut, this, true);
|
148
|
+
|
149
|
+
Event.on(this._wrap, 'click', function(ev) { Event.stopEvent(ev); }, this, true);
|
150
|
+
},
|
151
|
+
|
152
|
+
/**
|
153
|
+
* @private
|
154
|
+
* @method _createMask
|
155
|
+
* @description Creates the mask element used to mask the image
|
156
|
+
*/
|
157
|
+
_createMask: function() {
|
158
|
+
this._mask = document.createElement('div');
|
159
|
+
this._mask.className = this.CSS_MASK;
|
160
|
+
this._wrap.appendChild(this._mask);
|
161
|
+
},
|
162
|
+
|
163
|
+
/**
|
164
|
+
* @private
|
165
|
+
* @method _createResize
|
166
|
+
* @description Creates the resize element and the instance of the Resize Utility
|
167
|
+
*/
|
168
|
+
_createResize: function() {
|
169
|
+
this._resizeEl = document.createElement('div');
|
170
|
+
this._resizeEl.className = YAHOO.util.Resize.prototype.CSS_RESIZE;
|
171
|
+
this._resizeEl.style.position = 'absolute';
|
172
|
+
|
173
|
+
this._resizeEl.innerHTML = '<div class="' + this.CSS_RESIZE_MASK + '"></div>';
|
174
|
+
this._resizeMaskEl = this._resizeEl.firstChild;
|
175
|
+
this._wrap.appendChild(this._resizeEl);
|
176
|
+
this._resizeEl.style.top = this.get('initialXY')[1] + 'px';
|
177
|
+
this._resizeEl.style.left = this.get('initialXY')[0] + 'px';
|
178
|
+
this._resizeMaskEl.style.height = Math.floor(this.get('initHeight')) + 'px';
|
179
|
+
this._resizeMaskEl.style.width = Math.floor(this.get('initWidth')) + 'px';
|
180
|
+
|
181
|
+
this._resize = new YAHOO.util.Resize(this._resizeEl, {
|
182
|
+
knobHandles: true,
|
183
|
+
handles: 'all',
|
184
|
+
draggable: true,
|
185
|
+
status: this.get('status'),
|
186
|
+
minWidth: this.get('minWidth'),
|
187
|
+
minHeight: this.get('minHeight'),
|
188
|
+
ratio: this.get('ratio'),
|
189
|
+
autoRatio: this.get('autoRatio'),
|
190
|
+
height: this.get('initHeight'),
|
191
|
+
width: this.get('initWidth')
|
192
|
+
});
|
193
|
+
|
194
|
+
this._setBackgroundImage(this.get('element').getAttribute('src', 2));
|
195
|
+
this._setBackgroundPosition(-(this.get('initialXY')[0]), -(this.get('initialXY')[1]));
|
196
|
+
|
197
|
+
this._resize.on('startResize', this._handleStartResizeEvent, this, true);
|
198
|
+
this._resize.on('endResize', this._handleEndResizeEvent, this, true);
|
199
|
+
this._resize.on('dragEvent', this._handleDragEvent, this, true);
|
200
|
+
this._resize.on('beforeResize', this._handleBeforeResizeEvent, this, true);
|
201
|
+
this._resize.on('resize', this._handleResizeEvent, this, true);
|
202
|
+
this._resize.dd.on('b4StartDragEvent', this._handleB4DragEvent, this, true);
|
203
|
+
},
|
204
|
+
|
205
|
+
/**
|
206
|
+
* @private
|
207
|
+
* @method _handleMouseOver
|
208
|
+
* @description Handles the mouseover event
|
209
|
+
*/
|
210
|
+
_handleMouseOver: function(ev) {
|
211
|
+
var evType = 'keydown';
|
212
|
+
if (YAHOO.env.ua.gecko || YAHOO.env.ua.opera) {
|
213
|
+
evType = 'keypress';
|
214
|
+
}
|
215
|
+
if (!this._active) {
|
216
|
+
this._active = true;
|
217
|
+
if (this.get('useKeys')) {
|
218
|
+
Event.on(document, evType, this._handleKeyPress, this, true);
|
219
|
+
}
|
220
|
+
}
|
221
|
+
},
|
222
|
+
/**
|
223
|
+
* @private
|
224
|
+
* @method _handleMouseOut
|
225
|
+
* @description Handles the mouseout event
|
226
|
+
*/
|
227
|
+
_handleMouseOut: function(ev) {
|
228
|
+
var evType = 'keydown';
|
229
|
+
if (YAHOO.env.ua.gecko || YAHOO.env.ua.opera) {
|
230
|
+
evType = 'keypress';
|
231
|
+
}
|
232
|
+
this._active = false;
|
233
|
+
if (this.get('useKeys')) {
|
234
|
+
Event.removeListener(document, evType, this._handleKeyPress);
|
235
|
+
}
|
236
|
+
},
|
237
|
+
|
238
|
+
/**
|
239
|
+
* @private
|
240
|
+
* @method _moveEl
|
241
|
+
* @description Moves the resize element based on the arrow keys
|
242
|
+
*/
|
243
|
+
_moveEl: function(dir, inc) {
|
244
|
+
var t = 0, l = 0,
|
245
|
+
region = this._setConstraints(),
|
246
|
+
resize = true;
|
247
|
+
|
248
|
+
switch (dir) {
|
249
|
+
case 'down':
|
250
|
+
t = -(inc);
|
251
|
+
if ((region.bottom - inc) < 0) {
|
252
|
+
resize = false;
|
253
|
+
this._resizeEl.style.top = (region.top + region.bottom) + 'px';
|
254
|
+
}
|
255
|
+
break;
|
256
|
+
case 'up':
|
257
|
+
t = (inc);
|
258
|
+
if ((region.top - inc) < 0) {
|
259
|
+
resize = false;
|
260
|
+
this._resizeEl.style.top = '0px';
|
261
|
+
}
|
262
|
+
break;
|
263
|
+
case 'right':
|
264
|
+
l = -(inc);
|
265
|
+
if ((region.right - inc) < 0) {
|
266
|
+
resize = false;
|
267
|
+
this._resizeEl.style.left = (region.left + region.right) + 'px';
|
268
|
+
}
|
269
|
+
break;
|
270
|
+
case 'left':
|
271
|
+
l = inc;
|
272
|
+
if ((region.left - inc) < 0) {
|
273
|
+
resize = false;
|
274
|
+
this._resizeEl.style.left = '0px';
|
275
|
+
}
|
276
|
+
break;
|
277
|
+
}
|
278
|
+
|
279
|
+
if (resize) {
|
280
|
+
this._resizeEl.style.left = (parseInt(this._resizeEl.style.left, 10) - l) + 'px';
|
281
|
+
this._resizeEl.style.top = (parseInt(this._resizeEl.style.top, 10) - t) + 'px';
|
282
|
+
this.fireEvent('moveEvent', { target: 'keypress' });
|
283
|
+
} else {
|
284
|
+
this._setConstraints();
|
285
|
+
}
|
286
|
+
this._syncBackgroundPosition();
|
287
|
+
},
|
288
|
+
|
289
|
+
/**
|
290
|
+
* @private
|
291
|
+
* @method _handleKeyPress
|
292
|
+
* @description Handles the keypress event
|
293
|
+
*/
|
294
|
+
_handleKeyPress: function(ev) {
|
295
|
+
var kc = Event.getCharCode(ev),
|
296
|
+
stopEvent = false,
|
297
|
+
inc = ((ev.shiftKey) ? this.get('shiftKeyTick') : this.get('keyTick'));
|
298
|
+
|
299
|
+
switch (kc) {
|
300
|
+
case 0x25: // left
|
301
|
+
this._moveEl('left', inc);
|
302
|
+
stopEvent = true;
|
303
|
+
break;
|
304
|
+
case 0x26: // up
|
305
|
+
this._moveEl('up', inc);
|
306
|
+
stopEvent = true;
|
307
|
+
break;
|
308
|
+
case 0x27: // right
|
309
|
+
this._moveEl('right', inc);
|
310
|
+
stopEvent = true;
|
311
|
+
break;
|
312
|
+
case 0x28: // down
|
313
|
+
this._moveEl('down', inc);
|
314
|
+
stopEvent = true;
|
315
|
+
break;
|
316
|
+
default:
|
317
|
+
}
|
318
|
+
if (stopEvent) {
|
319
|
+
Event.preventDefault(ev);
|
320
|
+
}
|
321
|
+
},
|
322
|
+
|
323
|
+
/**
|
324
|
+
* @private
|
325
|
+
* @method _handleB4DragEvent
|
326
|
+
* @description Handles the DragDrop b4DragEvent event
|
327
|
+
*/
|
328
|
+
_handleB4DragEvent: function() {
|
329
|
+
this._setConstraints();
|
330
|
+
},
|
331
|
+
|
332
|
+
/**
|
333
|
+
* @private
|
334
|
+
* @method _handleDragEvent
|
335
|
+
* @description Handles the DragDrop DragEvent event
|
336
|
+
*/
|
337
|
+
_handleDragEvent: function() {
|
338
|
+
this._syncBackgroundPosition();
|
339
|
+
this.fireEvent('dragEvent', arguments);
|
340
|
+
this.fireEvent('moveEvent', { target: 'dragevent' });
|
341
|
+
},
|
342
|
+
|
343
|
+
/**
|
344
|
+
* @private
|
345
|
+
* @method _handleBeforeResizeEvent
|
346
|
+
* @description Handles the Resize Utilitys beforeResize event
|
347
|
+
*/
|
348
|
+
_handleBeforeResizeEvent: function(args) {
|
349
|
+
var region = Dom.getRegion(this.get('element')),
|
350
|
+
c = this._resize._cache,
|
351
|
+
ch = this._resize._currentHandle, h = 0, w = 0;
|
352
|
+
|
353
|
+
if (args.top && (args.top < region.top)) {
|
354
|
+
h = (c.height + c.top) - region.top;
|
355
|
+
Dom.setY(this._resize.getWrapEl(), region.top);
|
356
|
+
this._resize.getWrapEl().style.height = h + 'px';
|
357
|
+
this._resize._cache.height = h;
|
358
|
+
this._resize._cache.top = region.top;
|
359
|
+
this._syncBackgroundPosition();
|
360
|
+
return false;
|
361
|
+
}
|
362
|
+
if (args.left && (args.left < region.left)) {
|
363
|
+
w = (c.width + c.left) - region.left;
|
364
|
+
Dom.setX(this._resize.getWrapEl(), region.left);
|
365
|
+
this._resize._cache.left = region.left;
|
366
|
+
this._resize.getWrapEl().style.width = w + 'px';
|
367
|
+
this._resize._cache.width = w;
|
368
|
+
this._syncBackgroundPosition();
|
369
|
+
return false;
|
370
|
+
}
|
371
|
+
if (ch != 'tl' && ch != 'l' && ch != 'bl') {
|
372
|
+
if (c.left && args.width && ((c.left + args.width) > region.right)) {
|
373
|
+
w = (region.right - c.left);
|
374
|
+
Dom.setX(this._resize.getWrapEl(), (region.right - w));
|
375
|
+
this._resize.getWrapEl().style.width = w + 'px';
|
376
|
+
this._resize._cache.left = (region.right - w);
|
377
|
+
this._resize._cache.width = w;
|
378
|
+
this._syncBackgroundPosition();
|
379
|
+
return false;
|
380
|
+
}
|
381
|
+
}
|
382
|
+
if (ch != 't' && ch != 'tr' && ch != 'tl') {
|
383
|
+
if (c.top && args.height && ((c.top + args.height) > region.bottom)) {
|
384
|
+
h = (region.bottom - c.top);
|
385
|
+
Dom.setY(this._resize.getWrapEl(), (region.bottom - h));
|
386
|
+
this._resize.getWrapEl().style.height = h + 'px';
|
387
|
+
this._resize._cache.height = h;
|
388
|
+
this._resize._cache.top = (region.bottom - h);
|
389
|
+
this._syncBackgroundPosition();
|
390
|
+
return false;
|
391
|
+
}
|
392
|
+
}
|
393
|
+
},
|
394
|
+
/**
|
395
|
+
* @private
|
396
|
+
* @method _handleResizeMaskEl
|
397
|
+
* @description Resizes the inner mask element
|
398
|
+
*/
|
399
|
+
_handleResizeMaskEl: function() {
|
400
|
+
var a = this._resize._cache;
|
401
|
+
this._resizeMaskEl.style.height = Math.floor(a.height) + 'px';
|
402
|
+
this._resizeMaskEl.style.width = Math.floor(a.width) + 'px';
|
403
|
+
},
|
404
|
+
/**
|
405
|
+
* @private
|
406
|
+
* @method _handleResizeEvent
|
407
|
+
* @param Event ev The Resize Utilitys resize event.
|
408
|
+
* @description Handles the Resize Utilitys Resize event
|
409
|
+
*/
|
410
|
+
_handleResizeEvent: function(ev) {
|
411
|
+
this._setConstraints(true);
|
412
|
+
this._syncBackgroundPosition();
|
413
|
+
this.fireEvent('resizeEvent', arguments);
|
414
|
+
this.fireEvent('moveEvent', { target: 'resizeevent' });
|
415
|
+
},
|
416
|
+
|
417
|
+
/**
|
418
|
+
* @private
|
419
|
+
* @method _syncBackgroundPosition
|
420
|
+
* @description Syncs the packground position of the resize element with the resize elements top and left style position
|
421
|
+
*/
|
422
|
+
_syncBackgroundPosition: function() {
|
423
|
+
this._handleResizeMaskEl();
|
424
|
+
this._setBackgroundPosition(-(parseInt(this._resizeEl.style.left, 10)), -(parseInt(this._resizeEl.style.top, 10)));
|
425
|
+
},
|
426
|
+
|
427
|
+
/**
|
428
|
+
* @private
|
429
|
+
* @method _setBackgroundPosition
|
430
|
+
* @param Number l The left position
|
431
|
+
* @param Number t The top position
|
432
|
+
* @description Sets the background image position to the top and left position
|
433
|
+
*/
|
434
|
+
_setBackgroundPosition: function(l, t) {
|
435
|
+
var bl = parseInt(Dom.getStyle(this._resize.get('element'), 'borderLeftWidth'), 10);
|
436
|
+
var bt = parseInt(Dom.getStyle(this._resize.get('element'), 'borderTopWidth'), 10);
|
437
|
+
if (isNaN(bl)) {
|
438
|
+
bl = 0;
|
439
|
+
}
|
440
|
+
if (isNaN(bt)) {
|
441
|
+
bt = 0;
|
442
|
+
}
|
443
|
+
var mask = this._resize.getWrapEl().firstChild;
|
444
|
+
var pos = (l - bl) + 'px ' + (t - bt) + 'px';
|
445
|
+
this._resizeMaskEl.style.backgroundPosition = pos;
|
446
|
+
},
|
447
|
+
|
448
|
+
/**
|
449
|
+
* @private
|
450
|
+
* @method _setBackgroundImage
|
451
|
+
* @param String url The url of the image
|
452
|
+
* @description Sets the background image of the resize element
|
453
|
+
*/
|
454
|
+
_setBackgroundImage: function(url) {
|
455
|
+
var mask = this._resize.getWrapEl().firstChild;
|
456
|
+
this._image = url;
|
457
|
+
mask.style.backgroundImage = 'url(' + url + '#)';
|
458
|
+
},
|
459
|
+
|
460
|
+
/**
|
461
|
+
* @private
|
462
|
+
* @method _handleEndResizeEvent
|
463
|
+
* @description Handles the Resize Utilitys endResize event
|
464
|
+
*/
|
465
|
+
_handleEndResizeEvent: function() {
|
466
|
+
this._setConstraints(true);
|
467
|
+
},
|
468
|
+
/**
|
469
|
+
* @private
|
470
|
+
* @method _handleStartResizeEvent
|
471
|
+
* @description Handles the Resize Utilitys startResize event
|
472
|
+
*/
|
473
|
+
_handleStartResizeEvent: function() {
|
474
|
+
this._setConstraints(true);
|
475
|
+
|
476
|
+
var h = this._resize._cache.height,
|
477
|
+
w = this._resize._cache.width,
|
478
|
+
t = parseInt(this._resize.getWrapEl().style.top, 10),
|
479
|
+
l = parseInt(this._resize.getWrapEl().style.left, 10),
|
480
|
+
maxH = 0, maxW = 0;
|
481
|
+
|
482
|
+
switch (this._resize._currentHandle) {
|
483
|
+
case 'b':
|
484
|
+
maxH = (h + this._resize.dd.bottomConstraint);
|
485
|
+
break;
|
486
|
+
case 'l':
|
487
|
+
maxW = (w + this._resize.dd.leftConstraint);
|
488
|
+
break;
|
489
|
+
case 'r':
|
490
|
+
maxH = (h + t);
|
491
|
+
maxW = (w + this._resize.dd.rightConstraint);
|
492
|
+
break;
|
493
|
+
case 'br':
|
494
|
+
maxH = (h + this._resize.dd.bottomConstraint);
|
495
|
+
maxW = (w + this._resize.dd.rightConstraint);
|
496
|
+
break;
|
497
|
+
case 'tr':
|
498
|
+
maxH = (h + t);
|
499
|
+
maxW = (w + this._resize.dd.rightConstraint);
|
500
|
+
break;
|
501
|
+
|
502
|
+
}
|
503
|
+
|
504
|
+
if (maxH) {
|
505
|
+
//this._resize.set('maxHeight', maxH);
|
506
|
+
}
|
507
|
+
if (maxW) {
|
508
|
+
//this._resize.set('maxWidth', maxW);
|
509
|
+
}
|
510
|
+
|
511
|
+
this.fireEvent('startResizeEvent', arguments);
|
512
|
+
},
|
513
|
+
|
514
|
+
/**
|
515
|
+
* @private
|
516
|
+
* @method _setConstraints
|
517
|
+
* @param Boolean inside Used when called from inside a resize event, false by default (dragging)
|
518
|
+
* @description Set the DragDrop constraints to keep the element inside the crop area.
|
519
|
+
* @return {Object} Object containing Top, Right, Bottom and Left constraints
|
520
|
+
*/
|
521
|
+
_setConstraints: function(inside) {
|
522
|
+
var resize = this._resize;
|
523
|
+
resize.dd.resetConstraints();
|
524
|
+
var height = parseInt(resize.get('height'), 10),
|
525
|
+
width = parseInt(resize.get('width'), 10);
|
526
|
+
if (inside) {
|
527
|
+
//Called from inside the resize callback
|
528
|
+
height = resize._cache.height;
|
529
|
+
width = resize._cache.width;
|
530
|
+
}
|
531
|
+
|
532
|
+
//Get the top, right, bottom and left positions
|
533
|
+
var region = Dom.getRegion(this.get('element'));
|
534
|
+
//Get the element we are working on
|
535
|
+
var el = resize.getWrapEl();
|
536
|
+
|
537
|
+
//Get the xy position of it
|
538
|
+
var xy = Dom.getXY(el);
|
539
|
+
|
540
|
+
//Set left to x minus left
|
541
|
+
var left = xy[0] - region.left;
|
542
|
+
|
543
|
+
//Set right to right minus x minus width
|
544
|
+
var right = region.right - xy[0] - width;
|
545
|
+
|
546
|
+
//Set top to y minus top
|
547
|
+
var top = xy[1] - region.top;
|
548
|
+
|
549
|
+
//Set bottom to bottom minus y minus height
|
550
|
+
var bottom = region.bottom - xy[1] - height;
|
551
|
+
|
552
|
+
if (top < 0) {
|
553
|
+
top = 0;
|
554
|
+
}
|
555
|
+
|
556
|
+
resize.dd.setXConstraint(left, right);
|
557
|
+
resize.dd.setYConstraint(top, bottom);
|
558
|
+
|
559
|
+
return {
|
560
|
+
top: top,
|
561
|
+
right: right,
|
562
|
+
bottom: bottom,
|
563
|
+
left: left
|
564
|
+
};
|
565
|
+
|
566
|
+
|
567
|
+
|
568
|
+
},
|
569
|
+
/**
|
570
|
+
* @method getCropCoords
|
571
|
+
* @description Returns the coordinates needed to crop the image
|
572
|
+
* @return {Object} The top, left, height, width and image url of the image being cropped
|
573
|
+
*/
|
574
|
+
getCropCoords: function() {
|
575
|
+
var coords = {
|
576
|
+
top: parseInt(this._resize.getWrapEl().style.top, 10),
|
577
|
+
left: parseInt(this._resize.getWrapEl().style.left, 10),
|
578
|
+
height: this._resize._cache.height,
|
579
|
+
width: this._resize._cache.width,
|
580
|
+
image: this._image
|
581
|
+
};
|
582
|
+
return coords;
|
583
|
+
},
|
584
|
+
/**
|
585
|
+
* @method reset
|
586
|
+
* @description Resets the crop element back to it's original position
|
587
|
+
* @return {<a href="YAHOO.widget.ImageCropper.html">YAHOO.widget.ImageCropper</a>} The ImageCropper instance
|
588
|
+
*/
|
589
|
+
reset: function() {
|
590
|
+
this._resize.resize(null, this.get('initHeight'), this.get('initWidth'), 0, 0, true);
|
591
|
+
this._resizeEl.style.top = this.get('initialXY')[1] + 'px';
|
592
|
+
this._resizeEl.style.left = this.get('initialXY')[0] + 'px';
|
593
|
+
this._syncBackgroundPosition();
|
594
|
+
return this;
|
595
|
+
},
|
596
|
+
|
597
|
+
/**
|
598
|
+
* @method getEl
|
599
|
+
* @description Get the HTML reference for the image element.
|
600
|
+
* @return {HTMLElement} The image element
|
601
|
+
*/
|
602
|
+
getEl: function() {
|
603
|
+
return this.get('element');
|
604
|
+
},
|
605
|
+
/**
|
606
|
+
* @method getResizeEl
|
607
|
+
* @description Get the HTML reference for the resize element.
|
608
|
+
* @return {HTMLElement} The resize element
|
609
|
+
*/
|
610
|
+
getResizeEl: function() {
|
611
|
+
return this._resizeEl;
|
612
|
+
},
|
613
|
+
/**
|
614
|
+
* @method getWrapEl
|
615
|
+
* @description Get the HTML reference for the wrap element.
|
616
|
+
* @return {HTMLElement} The wrap element
|
617
|
+
*/
|
618
|
+
getWrapEl: function() {
|
619
|
+
return this._wrap;
|
620
|
+
},
|
621
|
+
|
622
|
+
/**
|
623
|
+
* @method getMaskEl
|
624
|
+
* @description Get the HTML reference for the mask element.
|
625
|
+
* @return {HTMLElement} The mask element
|
626
|
+
*/
|
627
|
+
getMaskEl: function() {
|
628
|
+
return this._mask;
|
629
|
+
},
|
630
|
+
|
631
|
+
/**
|
632
|
+
* @method getResizeMaskEl
|
633
|
+
* @description Get the HTML reference for the resizable object's mask element.
|
634
|
+
* @return {HTMLElement} The resize objects mask element.
|
635
|
+
*/
|
636
|
+
getResizeMaskEl: function() {
|
637
|
+
return this._resizeMaskEl;
|
638
|
+
},
|
639
|
+
|
640
|
+
/**
|
641
|
+
* @method getResizeObject
|
642
|
+
* @description Get the Resize Utility object.
|
643
|
+
* @return {<a href="YAHOO.util.Resize.html">YAHOO.util.Resize</a>} The Resize instance
|
644
|
+
*/
|
645
|
+
getResizeObject: function() {
|
646
|
+
return this._resize;
|
647
|
+
},
|
648
|
+
|
649
|
+
/**
|
650
|
+
* @private
|
651
|
+
* @method init
|
652
|
+
* @description The ImageCropper class's initialization method
|
653
|
+
*/
|
654
|
+
init: function(p_oElement, p_oAttributes) {
|
655
|
+
Crop.superclass.init.call(this, p_oElement, p_oAttributes);
|
656
|
+
|
657
|
+
var id = p_oElement;
|
658
|
+
|
659
|
+
if (!Lang.isString(id)) {
|
660
|
+
if (id.tagName && (id.tagName.toLowerCase() == 'img')) {
|
661
|
+
id = Dom.generateId(id);
|
662
|
+
} else {
|
663
|
+
return false;
|
664
|
+
}
|
665
|
+
} else {
|
666
|
+
var el = Dom.get(id);
|
667
|
+
if (el.tagName && el.tagName.toLowerCase() == 'img') {
|
668
|
+
//All good
|
669
|
+
} else {
|
670
|
+
return false;
|
671
|
+
}
|
672
|
+
}
|
673
|
+
|
674
|
+
|
675
|
+
|
676
|
+
Crop._instances[id] = this;
|
677
|
+
this._createWrap();
|
678
|
+
this._createMask();
|
679
|
+
this._createResize();
|
680
|
+
this._setConstraints();
|
681
|
+
|
682
|
+
},
|
683
|
+
/**
|
684
|
+
* @private
|
685
|
+
* @method initAttributes
|
686
|
+
* @description Initializes all of the configuration attributes used to create a croppable element.
|
687
|
+
* @param {Object} attr Object literal specifying a set of
|
688
|
+
* configuration attributes used to create the widget.
|
689
|
+
*/
|
690
|
+
|
691
|
+
initAttributes: function(attr) {
|
692
|
+
Crop.superclass.initAttributes.call(this, attr);
|
693
|
+
|
694
|
+
/**
|
695
|
+
* @attribute initialXY
|
696
|
+
* @description Array of the XY position that we need to set the crop element to when we build it. Defaults to [10, 10]
|
697
|
+
* @type Array
|
698
|
+
*/
|
699
|
+
this.setAttributeConfig('initialXY', {
|
700
|
+
writeOnce: true,
|
701
|
+
validator: YAHOO.lang.isArray,
|
702
|
+
value: attr.initialXY || [10, 10]
|
703
|
+
});
|
704
|
+
/**
|
705
|
+
* @attribute keyTick
|
706
|
+
* @description The pixel tick for the arrow keys, defaults to 1
|
707
|
+
* @type Number
|
708
|
+
*/
|
709
|
+
this.setAttributeConfig('keyTick', {
|
710
|
+
validator: YAHOO.lang.isNumber,
|
711
|
+
value: attr.keyTick || 1
|
712
|
+
});
|
713
|
+
|
714
|
+
/**
|
715
|
+
* @attribute shiftKeyTick
|
716
|
+
* @description The pixel tick for shift + the arrow keys, defaults to 10
|
717
|
+
* @type Number
|
718
|
+
*/
|
719
|
+
this.setAttributeConfig('shiftKeyTick', {
|
720
|
+
validator: YAHOO.lang.isNumber,
|
721
|
+
value: attr.shiftKeyTick || 10
|
722
|
+
});
|
723
|
+
|
724
|
+
/**
|
725
|
+
* @attribute useKeys
|
726
|
+
* @description Should we use the Arrow keys to position the crop element, defaults to true
|
727
|
+
* @type Boolean
|
728
|
+
*/
|
729
|
+
this.setAttributeConfig('useKeys', {
|
730
|
+
validator: YAHOO.lang.isBoolean,
|
731
|
+
value: ((attr.useKeys === false) ? false : true)
|
732
|
+
});
|
733
|
+
|
734
|
+
/**
|
735
|
+
* @attribute status
|
736
|
+
* @description Show the Resize Utility status, defaults to true
|
737
|
+
* @type Boolean
|
738
|
+
*/
|
739
|
+
this.setAttributeConfig('status', {
|
740
|
+
validator: YAHOO.lang.isBoolean,
|
741
|
+
value: ((attr.status === false) ? false : true),
|
742
|
+
method: function(status) {
|
743
|
+
if (this._resize) {
|
744
|
+
this._resize.set('status', status);
|
745
|
+
}
|
746
|
+
}
|
747
|
+
});
|
748
|
+
|
749
|
+
/**
|
750
|
+
* @attribute minHeight
|
751
|
+
* @description MinHeight of the crop area, default 50
|
752
|
+
* @type Number
|
753
|
+
*/
|
754
|
+
this.setAttributeConfig('minHeight', {
|
755
|
+
validator: YAHOO.lang.isNumber,
|
756
|
+
value: attr.minHeight || 50,
|
757
|
+
method: function(h) {
|
758
|
+
if (this._resize) {
|
759
|
+
this._resize.set('minHeight', h);
|
760
|
+
}
|
761
|
+
}
|
762
|
+
});
|
763
|
+
|
764
|
+
/**
|
765
|
+
* @attribute minWidth
|
766
|
+
* @description MinWidth of the crop area, default 50.
|
767
|
+
* @type Number
|
768
|
+
*/
|
769
|
+
this.setAttributeConfig('minWidth', {
|
770
|
+
validator: YAHOO.lang.isNumber,
|
771
|
+
value: attr.minWidth || 50,
|
772
|
+
method: function(w) {
|
773
|
+
if (this._resize) {
|
774
|
+
this._resize.set('minWidth', w);
|
775
|
+
}
|
776
|
+
}
|
777
|
+
});
|
778
|
+
|
779
|
+
/**
|
780
|
+
* @attribute ratio
|
781
|
+
* @description Set the ratio config option of the Resize Utlility, default false
|
782
|
+
* @type Boolean
|
783
|
+
*/
|
784
|
+
this.setAttributeConfig('ratio', {
|
785
|
+
validator: YAHOO.lang.isBoolean,
|
786
|
+
value: attr.ratio || false,
|
787
|
+
method: function(r) {
|
788
|
+
if (this._resize) {
|
789
|
+
this._resize.set('ratio', r);
|
790
|
+
}
|
791
|
+
}
|
792
|
+
});
|
793
|
+
|
794
|
+
/**
|
795
|
+
* @attribute ratio
|
796
|
+
* @description Set the autoRatio config option of the Resize Utlility, default true
|
797
|
+
* @type Boolean
|
798
|
+
*/
|
799
|
+
this.setAttributeConfig('autoRatio', {
|
800
|
+
validator: YAHOO.lang.isBoolean,
|
801
|
+
value: ((attr.autoRatio === false) ? false : true),
|
802
|
+
method: function(a) {
|
803
|
+
if (this._resize) {
|
804
|
+
this._resize.set('autoRatio', a);
|
805
|
+
}
|
806
|
+
}
|
807
|
+
});
|
808
|
+
|
809
|
+
/**
|
810
|
+
* @attribute initHeight
|
811
|
+
* @description Set the initlal height of the crop area, defaults to 1/4 of the image height
|
812
|
+
* @type Number
|
813
|
+
*/
|
814
|
+
this.setAttributeConfig('initHeight', {
|
815
|
+
writeOnce: true,
|
816
|
+
validator: YAHOO.lang.isNumber,
|
817
|
+
value: attr.initHeight || (this.get('element').height / 4)
|
818
|
+
});
|
819
|
+
|
820
|
+
/**
|
821
|
+
* @attribute initWidth
|
822
|
+
* @description Set the initlal width of the crop area, defaults to 1/4 of the image width
|
823
|
+
* @type Number
|
824
|
+
*/
|
825
|
+
this.setAttributeConfig('initWidth', {
|
826
|
+
validator: YAHOO.lang.isNumber,
|
827
|
+
writeOnce: true,
|
828
|
+
value: attr.initWidth || (this.get('element').width / 4)
|
829
|
+
});
|
830
|
+
|
831
|
+
},
|
832
|
+
/**
|
833
|
+
* @method destroy
|
834
|
+
* @description Destroys the ImageCropper object and all of it's elements & listeners.
|
835
|
+
*/
|
836
|
+
destroy: function() {
|
837
|
+
this._resize.destroy();
|
838
|
+
this._resizeEl.parentNode.removeChild(this._resizeEl);
|
839
|
+
this._mask.parentNode.removeChild(this._mask);
|
840
|
+
Event.purgeElement(this._wrap);
|
841
|
+
this._wrap.parentNode.replaceChild(this.get('element'), this._wrap);
|
842
|
+
|
843
|
+
//Brutal Object Destroy
|
844
|
+
for (var i in this) {
|
845
|
+
if (Lang.hasOwnProperty(this, i)) {
|
846
|
+
this[i] = null;
|
847
|
+
}
|
848
|
+
}
|
849
|
+
|
850
|
+
},
|
851
|
+
/**
|
852
|
+
* @method toString
|
853
|
+
* @description Returns a string representing the ImageCropper Object.
|
854
|
+
* @return {String}
|
855
|
+
*/
|
856
|
+
toString: function() {
|
857
|
+
if (this.get) {
|
858
|
+
return 'ImageCropper (#' + this.get('id') + ')';
|
859
|
+
}
|
860
|
+
return 'Image Cropper';
|
861
|
+
}
|
862
|
+
});
|
863
|
+
|
864
|
+
YAHOO.widget.ImageCropper = Crop;
|
865
|
+
|
866
|
+
/**
|
867
|
+
* @event dragEvent
|
868
|
+
* @description Fires when the DragDrop dragEvent
|
869
|
+
* @type YAHOO.util.CustomEvent
|
870
|
+
*/
|
871
|
+
/**
|
872
|
+
* @event startResizeEvent
|
873
|
+
* @description Fires when when a resize action is started.
|
874
|
+
* @type YAHOO.util.CustomEvent
|
875
|
+
*/
|
876
|
+
/**
|
877
|
+
* @event resizeEvent
|
878
|
+
* @description Fires on every element resize.
|
879
|
+
* @type YAHOO.util.CustomEvent
|
880
|
+
*/
|
881
|
+
/**
|
882
|
+
* @event moveEvent
|
883
|
+
* @description Fires on every element move. Inside these methods: _handleKeyPress, _handleDragEvent, _handleResizeEvent
|
884
|
+
* @type YAHOO.util.CustomEvent
|
885
|
+
*/
|
886
|
+
|
887
|
+
})();
|
888
|
+
|
889
|
+
YAHOO.register("imagecropper", YAHOO.widget.ImageCropper, {version: "2.8.1", build: "19"});
|